/**
 * Buy buttons and the basket.
 *
 * The panel is fixed to the bottom-right so it stays reachable while someone
 * scrolls a gallery of two hundred photos, and it sits above Envira's lightbox
 * z-index so it is never buried.
 */

.sgp-buy {
	position: absolute;
	right: 8px;
	bottom: 8px;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 10px;
	border: 0;
	border-radius: 999px;
	background: rgba( 0, 0, 0, 0.66 );
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s ease, background 0.15s ease;
}

.envira-gallery-item:hover .sgp-buy,
.sgp-buy:focus,
.sgp-buy.is-in {
	opacity: 1;
}

/* Touch screens have no hover, so the price is simply always there. */
@media ( hover: none ) {
	.sgp-buy {
		opacity: 1;
	}
}

.sgp-buy:hover {
	background: rgba( 0, 0, 0, 0.85 );
}

.sgp-buy.is-in {
	background: #1a7f37;
}

.sgp-buy.is-in .sgp-buy-plus {
	transform: rotate( 45deg );
}

.sgp-buy-plus {
	display: inline-block;
	font-size: 15px;
	transition: transform 0.15s ease;
}

.sgp-buy-all {
	display: inline-block;
	margin: 0 0 14px;
	padding: 10px 18px;
	border: 0;
	border-radius: 6px;
	background: #1d2327;
	color: #fff;
	font-size: 15px;
	cursor: pointer;
}

.sgp-buy-all.is-in {
	background: #1a7f37;
}

/* ---- the basket ---- */

.sgp-cart {
	position: fixed;
	right: 18px;
	bottom: 18px;
	z-index: 988030;
	font-size: 15px;
	text-align: left;
}

.sgp-cart.is-empty .sgp-cart-count {
	display: none;
}

.sgp-cart-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 18px;
	border: 0;
	border-radius: 999px;
	background: #1d2327;
	color: #fff;
	font-size: 15px;
	cursor: pointer;
	box-shadow: 0 3px 14px rgba( 0, 0, 0, 0.28 );
}

.sgp-cart-count {
	min-width: 22px;
	padding: 2px 6px;
	border-radius: 999px;
	background: #1a7f37;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}

.sgp-cart-body {
	position: absolute;
	right: 0;
	bottom: 54px;
	width: min( 340px, calc( 100vw - 36px ) );
	max-height: min( 60vh, 460px );
	overflow-y: auto;
	padding: 14px;
	border-radius: 10px;
	background: #fff;
	color: #1d2327;
	box-shadow: 0 6px 28px rgba( 0, 0, 0, 0.24 );
}

.sgp-cart-list {
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
}

.sgp-cart-list li {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 4px 8px;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f1;
	font-size: 14px;
}

.sgp-cart-name {
	overflow: hidden;
	text-overflow: ellipsis;
}

.sgp-cart-note {
	grid-column: 1 / -1;
	color: #646970;
	font-size: 12px;
}

.sgp-cart-price {
	font-weight: 600;
}

.sgp-cart-remove {
	border: 0;
	background: none;
	color: #646970;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.sgp-cart-empty,
.sgp-cart-loading {
	padding: 10px 0;
	color: #646970;
	font-size: 14px;
	border: 0 !important;
	display: block !important;
}

.sgp-cart-total {
	display: flex;
	justify-content: space-between;
	margin: 0 0 10px;
	font-size: 15px;
}

.sgp-cart-checkout {
	width: 100%;
	padding: 11px;
	border: 0;
	border-radius: 6px;
	background: #1a7f37;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.sgp-cart-msg {
	margin: 10px 0 0;
	font-size: 13px;
	color: #646970;
}

.sgp-cart-msg.is-error {
	color: #b32d2e;
}

/* ---- discount code ---- */

.sgp-cart-coupon {
	display: flex;
	gap: 6px;
	margin: 0 0 8px;
}

.sgp-cart-code {
	flex: 1 1 auto;
	min-width: 0;
	padding: 7px 9px;
	border: 1px solid #dcdcde;
	border-radius: 5px;
	font-size: 14px;
	text-transform: uppercase;
}

.sgp-cart-apply {
	flex: 0 0 auto;
	padding: 7px 12px;
	border: 1px solid #dcdcde;
	border-radius: 5px;
	background: #f6f7f7;
	font-size: 14px;
	cursor: pointer;
}

.sgp-cart-coupon-msg {
	margin: 0 0 8px;
	font-size: 13px;
}

.sgp-cart-coupon-msg.is-ok {
	color: #1a7f37;
}

.sgp-cart-coupon-msg.is-error {
	color: #b32d2e;
}

.sgp-cart-saved {
	margin: 0 0 6px;
	color: #1a7f37;
	font-size: 13px;
	font-weight: 600;
}

/* ---- where free photos go ---- */

.sgp-cart-email {
	margin: 0 0 10px;
	padding: 10px;
	border: 1px solid #dcdcde;
	border-radius: 6px;
	background: #f6f7f7;
}

.sgp-cart-email-label {
	display: block;
	margin: 0 0 5px;
	font-size: 13px;
	font-weight: 600;
}

/*
 * The 16px is not a style choice. iOS zooms the whole page in the moment a
 * field smaller than that is tapped, and it does not zoom back out.
 */
.sgp-cart-email-field {
	display: block;
	box-sizing: border-box;
	width: 100%;
	padding: 8px 9px;
	border: 1px solid #dcdcde;
	border-radius: 5px;
	background: #fff;
	font-size: 16px;
}

.sgp-cart-email-field:focus {
	border-color: #1a7f37;
	outline: 2px solid rgba( 26, 127, 55, 0.25 );
	outline-offset: 0;
}

.sgp-cart-email-why {
	margin: 6px 0 0;
	font-size: 12px;
	color: #646970;
}
