/*
 * Cart drawer (inc/cart-drawer.php, js/cart-drawer.js), AG Skin's drawer in the header's language:
 * Montserrat, the slate ink, hairlines, soft grey tiles, the brand orange for accents, Phosphor glyphs.
 * One family with the header's other panels: it slides in from the right, where the bag is, with the
 * phone drawers' motion, top bar, 24px edges and section titles (css/mobile-menu.css); on wide screens
 * the page under it dims like under the header's panels (css/header.css). Everything sits on one left
 * and one right edge. No <p> in the markup: Elementor pages carry global rules for it.
 */

.ses-cart-drawer,
.ses-cart-empty--page {
	--ink: #212b36;
	--text: #4a5561;
	--muted: #7a838c;
	--pale: #a7aeb5;
	--accent: #f48511;
	--accent-dark: #c96a07;
	--line: #e3e6e9;
	--soft: #f4f6f7;
	--ease: cubic-bezier(0.22, 1, 0.36, 1);
	--dim: rgba(33, 43, 54, 0.28); /* the header panels' scrim */
	--pad: 24px;
	--bar: 68px;
}

.ses-cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 100000;
	color: var(--ink);
	font-family: Montserrat, sans-serif;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

.ses-cart-drawer[hidden] {
	display: none;
}

.ses-cart-drawer *,
.ses-cart-drawer *::before,
.ses-cart-drawer *::after {
	box-sizing: border-box;
}

/* Scroll lock; the html's reserved scrollbar gutter (css/header.css) keeps the page from shifting. */
body.ses-cart-open {
	overflow: hidden;
}

/* Buttons start bare: css/base.css paints every hovered or focused button pink. */
.ses-cart-drawer button {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	cursor: pointer;
}

.ses-cart-drawer button:hover,
.ses-cart-drawer button:focus {
	background: none;
	color: inherit;
	outline: 0;
}

.ses-cart-drawer button:focus-visible,
.ses-cart-drawer a:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

.ses-cart-drawer__overlay {
	position: absolute;
	inset: 0;
	background: var(--dim);
	opacity: 0;
	transition: opacity 0.4s;
}

.ses-cart-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(460px, 100%);
	background: #fff;
	box-shadow: -12px 0 40px rgba(33, 43, 54, 0.08);
	outline: 0;
	transform: translateX(100%);
	transition: transform 0.5s var(--ease);
}

.ses-cart-drawer.is-open .ses-cart-drawer__overlay {
	opacity: 1;
}

.ses-cart-drawer.is-open .ses-cart-drawer__panel {
	transform: none;
}

/* Top bar, as in the phone drawers: a hairline under it, the title in the menu's type in the middle, the
   24px cross in a 44px round target at the right, on the content's edge (its hover circle keeps clear
   of the panel's edge, which a scrollbar may cover). The bands under it (the count, the totals) have
   their hairlines across the whole panel too; only the lines between items stay on the content's edges. */

.ses-cart-drawer__top {
	display: grid;
	flex: 0 0 auto;
	grid-template-columns: 44px 1fr 44px;
	align-items: center;
	height: var(--bar);
	padding: 0 calc(var(--pad) - 10px);
	border-bottom: 1px solid var(--line);
}

.ses-cart-drawer .ses-cart-drawer__title {
	grid-column: 2;
	font-size: 13px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: 0.08em;
	text-align: center;
	text-transform: uppercase;
}

.ses-cart-drawer .ses-cart-drawer__close {
	display: grid;
	grid-column: 3;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	color: var(--ink);
	transition: background-color 0.2s;
}

.ses-cart-drawer .widget_shopping_cart_content {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	padding: 0 var(--pad) calc(var(--pad) + env(safe-area-inset-bottom, 0px));
}

/* Count and "Очистити", in the drawers' section titles ("Продукція", "Часто шукають"): a band across
   the panel, centred between its two hairlines. */

.ses-cart-panel__head {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	height: 52px;
	margin: 0 calc(-1 * var(--pad));
	padding: 0 var(--pad);
	border-bottom: 1px solid var(--line);
	color: var(--muted);
	font-size: 11px;
	line-height: 16px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.ses-cart-drawer .ses-cart-panel__clear {
	color: var(--muted);
	font-size: 12px;
	letter-spacing: 0;
	text-transform: none;
	text-decoration: underline;
	text-decoration-color: var(--line);
	text-underline-offset: 3px;
	transition: color 0.2s, text-decoration-color 0.2s;
}

/* Items */

.ses-cart-items {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
	scrollbar-width: thin;
}

.ses-cart-item {
	--thumb: 92px;
	display: grid;
	grid-template-columns: var(--thumb) minmax(0, 1fr);
	gap: 16px;
	margin: 0;
	padding: 20px 0;
	border-bottom: 1px solid var(--line);
	transition: opacity 0.2s;
}

.ses-cart-item:last-child {
	border-bottom: 0;
}

.ses-cart-item.is-removing {
	opacity: 0.4;
}

.ses-cart-item__thumb {
	display: block;
	width: var(--thumb);
	height: var(--thumb);
	overflow: hidden;
	border-radius: 8px;
	background: var(--soft);
}

.ses-cart-item__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

/* The body is as tall as the photo: the line and the name on its top edge, stepper and price on its bottom. */
.ses-cart-item__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: var(--thumb);
}

.ses-cart-item__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.ses-cart-item__sub {
	margin-bottom: 4px;
	color: var(--accent-dark);
	font-size: 10px;
	font-weight: 600;
	line-height: 14px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.ses-cart-item__name {
	display: -webkit-box;
	overflow: hidden;
	font-size: 13px;
	line-height: 18px;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.ses-cart-drawer .ses-cart-item__name a {
	color: var(--ink);
	text-decoration: none;
	transition: color 0.2s;
}

/* Labels other plugins append to the name (gifts) */
.ses-cart-item__name > div {
	margin-top: 4px;
	color: var(--accent-dark);
	font-size: 12px;
}

/* 32px round target; the 16px cross ends on the price's right edge. */
.ses-cart-drawer .ses-cart-item__remove {
	display: grid;
	flex: 0 0 32px;
	place-items: center;
	width: 32px;
	height: 32px;
	margin: -7px -8px 0 0;
	border-radius: 50%;
	color: var(--pale);
	transition: color 0.2s, background-color 0.2s;
}

.ses-cart-item__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 12px;
}

.ses-cart-item__qty {
	color: var(--text);
	font-size: 13px;
}

.ses-cart-item__price {
	font-size: 15px;
	font-weight: 600;
	line-height: 20px;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.ses-cart-item__price del {
	margin-right: 6px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 400;
}

.ses-cart-item__price ins {
	text-decoration: none;
}

/* Quantity stepper */

.ses-cart-stepper {
	display: inline-grid;
	grid-template-columns: 32px 28px 32px;
	height: 34px;
	border: 1px solid var(--line);
	border-radius: 999px;
}

.ses-cart-drawer .ses-cart-stepper button {
	display: grid;
	place-items: center;
	color: var(--ink);
	transition: color 0.2s;
}

.ses-cart-drawer .ses-cart-stepper button:disabled {
	color: var(--line);
	cursor: default;
}

.ses-cart-stepper__value {
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.is-loading .ses-cart-items,
.is-loading .ses-cart-panel__bottom {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s;
}

/* Bottom: subtotal, checkout */

.ses-cart-panel__bottom {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	margin: 0 calc(-1 * var(--pad));
	padding: 0 var(--pad);
	border-top: 1px solid var(--line);
}

.ses-cart-panel__subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 0;
	color: var(--text);
	font-size: 12px;
	font-weight: 500;
	line-height: 20px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.ses-cart-panel__subtotal span:last-child {
	color: var(--ink);
	font-size: 20px;
	font-weight: 600;
	letter-spacing: 0;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.ses-cart-panel__note {
	margin-top: 10px;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.4;
	text-align: center;
}

.ses-cart-button,
.ses-cart-button:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 15px 20px;
	border: 0;
	border-radius: 0;
	background: var(--ink);
	color: #fff;
	font-family: Montserrat, sans-serif;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.12em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s;
}

.ses-cart-button:focus-visible {
	background: var(--accent);
	color: #fff;
}

/* Empty cart (drawer and the cart page) */

.ses-cart-empty {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 0;
	font-family: Montserrat, sans-serif;
	text-align: center;
}

.ses-cart-empty .ses-icon {
	margin-bottom: 16px;
	color: var(--pale);
}

.ses-cart-empty .ses-cart-empty__title {
	margin: 0;
	color: var(--ink);
	font-size: 18px;
	font-weight: 500;
	line-height: 26px;
}

.ses-cart-empty .ses-cart-empty__text {
	max-width: 300px;
	margin: 8px 0 28px;
	color: var(--muted);
	font-size: 14px;
	line-height: 22px;
}

.ses-cart-empty .ses-cart-button {
	width: auto;
	min-width: 260px;
}

/* The cart page with an empty cart: the same block on a grey tile; the page's own link is not needed. */
.ses-cart-empty--page {
	margin: 8px 0 64px;
	padding: 72px 40px;
	background: var(--soft);
}

.woocommerce-cart .return-to-shop {
	display: none;
}

/* Cards: WooCommerce's "Переглянути кошик" after adding — the drawer opens instead. */
.woocommerce .ses-card-actions a.added_to_cart {
	display: none;
}

/* Hover only where there is a pointer: on phones a tap leaves :hover stuck. */

@media (hover: hover) {
	.ses-cart-drawer .ses-cart-drawer__close:hover {
		background: var(--soft);
	}

	.ses-cart-drawer .ses-cart-panel__clear:hover {
		color: var(--ink);
		text-decoration-color: currentColor;
	}

	.ses-cart-drawer .ses-cart-item__name a:hover {
		color: var(--accent-dark);
	}

	.ses-cart-drawer .ses-cart-item__remove:hover {
		background: var(--soft);
		color: var(--ink);
	}

	.ses-cart-drawer .ses-cart-stepper button:hover:not(:disabled) {
		color: var(--accent-dark);
	}

	.ses-cart-button:hover {
		background: var(--accent);
		color: #fff;
	}
}

/* Tablets and phones: the phone drawers' 64px top bar with the cross mirroring the menu's, their darker dim. */
@media (max-width: 1024px) {
	.ses-cart-drawer {
		--bar: 64px;
		--dim: rgba(33, 43, 54, 0.4);
	}

	.ses-cart-drawer__top {
		padding: 0 2px 0 12px;
	}
}

@media (max-width: 767px) {
	.ses-cart-item {
		--thumb: 80px;
		gap: 14px;
		padding: 16px 0;
	}

	/* Bigger touch targets: 40px for the cross and the stepper buttons. */
	.ses-cart-drawer .ses-cart-item__remove {
		flex-basis: 40px;
		width: 40px;
		height: 40px;
		margin: -11px -12px -8px 0;
	}

	.ses-cart-stepper {
		grid-template-columns: 40px 28px 40px;
		height: 40px;
	}

	.ses-cart-empty--page {
		margin: 0 0 40px;
		padding: 48px 20px;
	}

	.ses-cart-empty .ses-cart-button {
		width: 100%;
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ses-cart-drawer__overlay,
	.ses-cart-drawer__panel {
		transition: none;
	}
}
