/**
 * Cart drawer, toasts and notices.
 * --ce-accent and --ce-accent-soft come from the Customizer colour palette.
 */

:root {
	--ce-accent: #775a19;
	--ce-accent-soft: #fed488;
	--ce-ink: #1b1c1c;
	--ce-ink-soft: #5c5f60;
	--ce-line: #e4e2e2;
	--ce-surface: #fbf9f8;
	--ce-card: #ffffff;
	--ce-error: #ba1a1a;
	--ce-success: #2e6b3f;
	--ce-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--ce-font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--ce-font-display: 'Playfair Display', Georgia, serif;
}

.ce-icon {
	width: 1em;
	height: 1em;
	display: block;
	flex-shrink: 0;
}

/* Buttons
   ========================================================================== */

.ce-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 22px;
	border-radius: 999px;
	font-family: var(--ce-font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none !important;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
	cursor: pointer;
}

.ce-btn--primary,
.ce-btn--primary:visited {
	background: var(--ce-ink);
	border: 1px solid var(--ce-ink);
	color: #fff !important;
}

.ce-btn--primary:hover,
.ce-btn--primary:focus-visible {
	background: var(--ce-accent);
	border-color: var(--ce-accent);
}

.ce-btn--ghost,
.ce-btn--ghost:visited {
	background: transparent;
	border: 1px solid var(--ce-ink);
	color: var(--ce-ink) !important;
}

.ce-btn--ghost:hover,
.ce-btn--ghost:focus-visible {
	background: var(--ce-ink);
	color: #fff !important;
}

/* Cart drawer
   ========================================================================== */

.ce-drawer {
	position: fixed;
	inset: 0;
	z-index: 100200; /* above the header and Storefront's mobile bottom bar */
	visibility: hidden;
	pointer-events: none;
	transition: visibility 0s linear 0.35s;
}

.ce-drawer.is-open {
	visibility: visible;
	pointer-events: auto;
	transition: visibility 0s;
}

.ce-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 17, 0.38);
	opacity: 0;
	transition: opacity 0.3s ease;
}

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

.ce-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(440px, 100%);
	background: var(--ce-surface);
	box-shadow: -24px 0 60px rgba(0, 0, 0, 0.12);
	transform: translateX(100%);
	transition: transform 0.35s var(--ce-ease);
	outline: none;
	font-family: var(--ce-font-body);
	color: var(--ce-ink);
}

.ce-drawer.is-open .ce-drawer__panel {
	transform: translateX(0);
}

.ce-cart-drawer__content {
	height: 100%;
	display: flex;
	flex-direction: column;
}

.ce-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 24px 18px;
	border-bottom: 1px solid var(--ce-line);
}

.ce-drawer .ce-drawer__title {
	margin: 0;
	font-family: var(--ce-font-display) !important;
	font-size: 24px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	color: var(--ce-ink);
}

.ce-drawer__count {
	font-family: var(--ce-font-body);
	font-size: 14px;
	color: var(--ce-ink-soft);
	margin-left: 4px;
}

.ce-drawer .ce-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: -8px -10px -8px 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ce-ink);
	font-size: 22px;
	cursor: pointer;
	transition: background-color 0.2s;
}

.ce-drawer .ce-drawer__close:hover {
	background: rgba(0, 0, 0, 0.05);
}

/* "Added to your bag" confirmation: collapsed until an add opens the drawer. */
.ce-drawer__added {
	display: flex;
	align-items: center;
	gap: 10px;
	max-height: 0;
	overflow: hidden;
	padding: 0 24px;
	background: color-mix(in srgb, var(--ce-accent-soft) 45%, #fff);
	color: var(--ce-ink);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	transition: max-height 0.3s var(--ce-ease), padding 0.3s var(--ce-ease);
}

.ce-drawer.is-added .ce-drawer__added {
	max-height: 60px;
	padding: 12px 24px;
}

.ce-drawer__added-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	background: var(--ce-accent);
	color: #fff;
	font-size: 14px;
}

.ce-drawer__items {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
	margin: 0;
	padding: 8px 24px;
}

.ce-drawer__item {
	display: grid;
	grid-template-columns: 88px 1fr;
	gap: 16px;
	margin: 0;
	padding: 18px 0;
	border-bottom: 1px solid var(--ce-line);
	transition: opacity 0.2s, background-color 0.6s;
}

.ce-drawer__item:last-child {
	border-bottom: 0;
}

.ce-drawer__item.is-busy {
	opacity: 0.45;
	pointer-events: none;
}

.ce-drawer__item.is-new .ce-drawer__thumb {
	box-shadow: 0 0 0 2px var(--ce-surface), 0 0 0 3px var(--ce-accent);
}

.ce-drawer__thumb {
	display: block;
	width: 88px;
	height: 110px;
	border-radius: 12px;
	overflow: hidden;
	background: var(--ce-card);
	transition: box-shadow 0.3s;
}

.ce-drawer .ce-drawer__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
	border-radius: 0;
}

.ce-drawer__info {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.ce-drawer__name-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.ce-drawer .ce-drawer__name {
	font-size: 14px;
	font-weight: 500;
	line-height: 1.4;
	color: var(--ce-ink);
	text-decoration: none;
}

.ce-drawer a.ce-drawer__name:hover {
	color: var(--ce-accent);
}

.ce-drawer__price {
	flex-shrink: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--ce-ink);
	white-space: nowrap;
}

/* Stock notes some plugins append to cart item names (e.g. "Only 1 left in stock"). */
.ce-drawer .ce-drawer__name .stock,
.ce-drawer .ce-drawer__name p {
	justify-content: flex-start !important;
	margin: 4px 0 0 !important;
	font-size: 12px;
	text-align: left !important;
}

.ce-drawer__meta {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--ce-ink-soft);
}

.ce-drawer__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 6px;
}

.ce-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--ce-line);
	border-radius: 999px;
	background: var(--ce-card);
}

.ce-drawer .ce-qty__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ce-ink);
	font-size: 16px;
	cursor: pointer;
}

.ce-drawer .ce-qty__btn:hover {
	background: rgba(0, 0, 0, 0.05);
}

.ce-drawer .ce-qty__btn:disabled {
	opacity: 0.3;
	cursor: default;
	background: transparent;
}

.ce-qty__value {
	min-width: 24px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
}

.ce-drawer__qty-fixed {
	font-size: 12px;
	color: var(--ce-ink-soft);
}

.ce-drawer .ce-drawer__remove {
	padding: 4px 0;
	border: 0;
	background: transparent;
	color: var(--ce-ink-soft);
	font-family: var(--ce-font-body);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: underline;
	text-underline-offset: 4px;
	cursor: pointer;
}

.ce-drawer .ce-drawer__remove:hover {
	color: var(--ce-error);
}

.ce-drawer__foot {
	padding: 20px 24px calc(20px + env(safe-area-inset-bottom));
	border-top: 1px solid var(--ce-line);
	background: var(--ce-card);
}

.ce-drawer__subtotal {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.ce-drawer__subtotal strong {
	font-size: 20px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

.ce-drawer__note {
	margin: 6px 0 16px;
	font-size: 12px;
	color: var(--ce-ink-soft);
}

.ce-drawer__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.ce-drawer__empty {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 40px 32px;
	text-align: center;
}

.ce-drawer__empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin-bottom: 8px;
	border-radius: 999px;
	background: var(--ce-card);
	color: var(--ce-accent);
	font-size: 32px;
}

.ce-drawer .ce-drawer__empty-title {
	margin: 0;
	font-family: var(--ce-font-display) !important;
	font-size: 22px;
	color: var(--ce-ink);
}

.ce-drawer__empty-text {
	margin: 0 0 16px;
	font-size: 14px;
	color: var(--ce-ink-soft);
}

html.ce-drawer-locked,
html.ce-drawer-locked body {
	overflow: hidden !important;
}

/* The drawer replaces WooCommerce's "View cart" link after quick-add buttons. */
.ce-notify-js .ce-has-cart-drawer a.added_to_cart.wc-forward {
	display: none !important;
}

/* Toasts
   ========================================================================== */

.ce-toasts {
	position: fixed;
	left: 50%;
	bottom: calc(88px + env(safe-area-inset-bottom)); /* above Storefront's mobile bottom bar */
	z-index: 100300;
	display: flex;
	flex-direction: column-reverse;
	gap: 10px;
	width: min(420px, calc(100vw - 32px));
	transform: translateX(-50%);
	pointer-events: none;
}

@media (min-width: 1024px) {
	.ce-toasts {
		left: auto;
		right: 24px;
		bottom: 24px;
		transform: none;
	}
}

.ce-toast {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 12px 14px 16px;
	border-radius: 14px;
	background: var(--ce-ink);
	color: #fff;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
	font-family: var(--ce-font-body);
	font-size: 14px;
	line-height: 1.45;
	pointer-events: auto;
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 0.25s ease, transform 0.35s var(--ce-ease);
}

.ce-toast.is-visible {
	opacity: 1;
	transform: none;
}

.ce-toast__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin-top: -1px;
	border-radius: 999px;
	background: var(--ce-accent);
	color: #fff;
	font-size: 14px;
	flex-shrink: 0;
}

.ce-toast--error .ce-toast__icon {
	background: var(--ce-error);
}

.ce-toast__text {
	flex: 1 1 auto;
	padding-top: 1px;
}

.ce-toast__text a {
	color: #fff !important;
	text-decoration: underline;
}

.ce-toast .ce-toast__action {
	flex-shrink: 0;
	padding: 2px 4px;
	border: 0;
	background: transparent;
	color: var(--ce-accent-soft) !important;
	font-family: var(--ce-font-body);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none !important;
	white-space: nowrap;
	cursor: pointer;
	align-self: center;
}

.ce-toast .ce-toast__action:hover {
	text-decoration: underline !important;
}

.ce-toast .ce-toast__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: -4px 0 -4px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: rgba(255, 255, 255, 0.7);
	font-size: 16px;
	cursor: pointer;
	flex-shrink: 0;
}

.ce-toast .ce-toast__close:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}

/* Success banners become toasts once the script runs; hide them so they don't flash first. */
.ce-notify-js .woocommerce-message {
	display: none !important;
}

/* Inline notices (info, errors, and success banners when scripts are off)
   ========================================================================== */

body .woocommerce-message,
body .woocommerce-info,
body .woocommerce-error,
body .woocommerce-noreviews,
body p.no-comments,
body .commerce-elegante-cart .woocommerce-message,
body .commerce-elegante-cart .woocommerce-info,
body .commerce-elegante-cart .woocommerce-error {
	position: relative;
	display: block;
	margin: 0 0 24px !important;
	padding: 14px 18px 14px 50px !important;
	border: 1px solid var(--ce-line) !important;
	border-left: 3px solid var(--ce-accent) !important;
	border-radius: 12px !important;
	background: var(--ce-card) !important;
	color: var(--ce-ink) !important;
	font-family: var(--ce-font-body) !important;
	font-size: 14px !important;
	line-height: 1.55 !important;
	list-style: none !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

body .woocommerce-error,
body .commerce-elegante-cart .woocommerce-error {
	border-left-color: var(--ce-error) !important;
}

body .woocommerce-message::before,
body .woocommerce-info::before,
body .woocommerce-error::before,
body .woocommerce-noreviews::before,
body p.no-comments::before {
	content: "" !important;
	position: absolute;
	top: 15px;
	left: 18px;
	width: 20px;
	height: 20px;
	background: var(--ce-accent);
	-webkit-mask: var(--ce-notice-icon) center / contain no-repeat;
	mask: var(--ce-notice-icon) center / contain no-repeat;
	--ce-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
}

body .woocommerce-message::before {
	--ce-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.7L16 9.8'/%3E%3C/svg%3E");
}

body .woocommerce-error::before {
	background: var(--ce-error);
	--ce-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E");
}

body .woocommerce-error li {
	margin: 0;
	list-style: none;
}

body .woocommerce-error li a:not(.button) {
	font-weight: 500;
}

body .woocommerce-error li + li {
	margin-top: 4px;
}

body .woocommerce-message a:not(.button),
body .woocommerce-info a:not(.button),
body .woocommerce-error a:not(.button) {
	color: var(--ce-ink) !important;
	font-weight: 600;
	text-decoration: underline !important;
	text-underline-offset: 3px;
}

body .woocommerce-message a.button,
body .woocommerce-info a.button,
body .woocommerce-error a.button,
body .commerce-elegante-cart .woocommerce-message a.button,
body .commerce-elegante-cart .woocommerce-info a.button,
body .commerce-elegante-cart .woocommerce-error a.button {
	float: right;
	margin: -2px 0 0 16px !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--ce-ink) !important;
	font-family: var(--ce-font-body) !important;
	font-size: 11px !important;
	font-weight: 700 !important;
	line-height: 24px !important;
	letter-spacing: 0.12em !important;
	text-transform: uppercase !important;
	text-decoration: underline !important;
	text-underline-offset: 4px;
	box-shadow: none !important;
}

body .woocommerce-message a.button:hover,
body .woocommerce-info a.button:hover,
body .woocommerce-error a.button:hover {
	color: var(--ce-accent) !important;
}

/* Block cart and checkout notices */
body .wc-block-components-notice-banner {
	gap: 12px;
	padding: 14px 18px !important;
	border: 1px solid var(--ce-line) !important;
	border-left: 3px solid var(--ce-accent) !important;
	border-radius: 12px !important;
	background: var(--ce-card) !important;
	color: var(--ce-ink) !important;
	font-family: var(--ce-font-body);
	font-size: 14px !important;
	line-height: 1.55;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

body .wc-block-components-notice-banner > svg {
	background-color: var(--ce-accent) !important;
	fill: #fff !important;
}

body .wc-block-components-notice-banner.is-error {
	border-left-color: var(--ce-error) !important;
}

body .wc-block-components-notice-banner.is-error > svg {
	background-color: var(--ce-error) !important;
}

body .wc-block-components-notice-banner a {
	color: var(--ce-ink) !important;
}

body .wc-block-components-notice-snackbar-list .wc-block-components-notice-banner {
	border: 0 !important;
	background: var(--ce-ink) !important;
	color: #fff !important;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

body .wc-block-components-notice-snackbar-list .wc-block-components-notice-banner a,
body .wc-block-components-notice-snackbar-list .wc-block-components-notice-banner .wc-block-components-button {
	color: #fff !important;
}

@media (prefers-reduced-motion: reduce) {
	.ce-drawer,
	.ce-drawer__overlay,
	.ce-drawer__panel,
	.ce-drawer__added,
	.ce-toast {
		transition: none !important;
	}
}
