/*
 * Cart page (inc/cart-page.php, woocommerce/cart/*.php), ported from the Perfume Valley
 * theme's cart redesign. Two columns from 1000px (items ~65%, summary ~35%, sticky). Below
 * that one column with a fixed checkout bar. Item rows switch layout on the items card's own
 * width (container queries).
 */
.an-cart-page { --c-sticky-top: 140px; }
.an-cart-page.admin-bar { --c-sticky-top: 172px; }
.an-flow--cart { padding-block: 0 64px; }
.an-cart-progress { margin: 22px auto 22px; }
.an-cart__muted { color: var(--an-muted); font-weight: 400; }
.an-cart { display: grid; gap: 20px; align-items: start; }
@media (min-width: 1000px) { .an-cart { grid-template-columns: minmax(0, 1fr) minmax(330px, 380px); gap: 24px; } .an-cart__side { position: sticky; top: var(--c-sticky-top); } }
.an-cart__main { min-width: 0; }
.an-cart__card { padding: 22px; border: 1px solid var(--an-line); border-radius: 20px; background: var(--an-surface); container-type: inline-size; }
@media (max-width: 767px) { .an-cart__card { padding: 16px; } }

.an-cart__header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--an-line); }
.an-cart__title { margin: 0; font-size: clamp(22px, 2.4vw, 28px); }
.an-cart__count { font: 500 16px/1 var(--an-sans); color: var(--an-muted); }

/* Items */
.an-cart__items { margin: 0; padding: 0; list-style: none; }
.an-cart__item {
	display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; grid-template-areas: "thumb product product" "thumb qty line" "thumb remove remove";
	gap: 8px 14px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--an-line);
}
.an-cart__item:last-child { border-bottom: 0; }
.an-cart__thumb { grid-area: thumb; align-self: start; }
.an-cart__thumb a, .an-cart__thumb img { display: block; }
.an-cart__thumb img { width: 88px; height: 88px; object-fit: contain; border: 1px solid var(--an-line); border-radius: 14px; background: #fff; padding: 4px; }
.an-cart__product { grid-area: product; min-width: 0; }
.an-cart__name { margin: 0 0 4px; font: 600 15.5px/1.35 var(--an-sans); letter-spacing: 0; }
.an-cart__name a { color: var(--an-ink); text-decoration: none; }
.an-cart__name a:hover { text-decoration: underline; }
.an-cart__sub { margin: 0 0 6px; font-size: 13.5px; color: var(--an-muted); line-height: 1.4; }
.an-cart__unit { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0; font-size: 14.5px; font-weight: 700; }
.an-cart__unit del { color: var(--an-faint); font-weight: 400; font-size: 13px; }
.an-cart__quantity { grid-area: qty; }
.an-cart__line { grid-area: line; text-align: right; font-size: 17px; font-weight: 800; white-space: nowrap; }
.an-cart__remove-wrap { grid-area: remove; }
.an-cart__remove { display: inline-flex; align-items: center; gap: 6px; color: var(--an-muted) !important; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.an-cart__remove:hover { color: var(--an-err) !important; }
@container (min-width: 620px) {
	.an-cart__item { grid-template-columns: 104px minmax(0, 1fr) 132px 96px 40px; grid-template-areas: "thumb product qty line remove"; gap: 18px; }
	.an-cart__thumb img { width: 104px; height: 104px; }
	.an-cart__remove span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
	.an-cart__remove { justify-content: center; width: 40px; height: 40px; border-radius: 10px; }
	.an-cart__remove:hover { background: var(--an-err-soft); }
}

/* Coupon + update */
.an-cart__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--an-line); }
.an-cart__update { display: none !important; }
.an-cart__coupon { flex: 1; min-width: 0; }
.an-cart__coupon-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 0; border: 0; background: none; font: 700 15px/1.3 var(--an-sans); color: var(--an-ink); text-align: left; cursor: pointer; }
.an-cart__coupon-toggle span { text-decoration: underline; text-underline-offset: 3px; }
.an-cart__coupon-toggle .an-icon:last-child { margin-left: auto; color: var(--an-muted); transition: transform .2s; }
.an-cart__coupon.is-open .an-cart__coupon-toggle .an-icon:last-child { transform: rotate(180deg); }
.an-cart__coupon-panel { display: none; gap: 10px; padding-top: 10px; flex-wrap: wrap; }
.an-cart__coupon.is-open .an-cart__coupon-panel { display: flex; }
.an-cart__coupon-input { flex: 1 1 200px; height: 48px; padding: 0 14px; border: 1.5px solid var(--an-line-2); border-radius: var(--an-r-md); font: 600 16px/1 var(--an-sans); letter-spacing: .04em; text-transform: uppercase; }
.an-cart__coupon-input::placeholder { letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--an-faint); }
.an-cart__coupon-input:focus { outline: none; border-color: var(--an-brand); box-shadow: 0 0 0 4px rgba(242, 176, 30, .35); }
.an-cart__coupon-apply { height: 48px; padding: 0 22px; border: 0; border-radius: var(--an-r-btn); background: var(--an-brand); color: #fff; font: 700 14px/1 var(--an-sans); }
.an-cart__coupon .coupon-error-notice { flex-basis: 100%; margin: 4px 0 0; color: var(--an-err); font-size: 13.5px; }

/* Suggestions */
.an-cart__recs { margin-top: 28px; }
.an-cart__recs-title { font-size: clamp(20px, 2.2vw, 26px); }

/* Summary */
.an-cart__summary { padding: 22px; border: 1px solid var(--an-line); border-radius: 20px; background: var(--an-surface); }
.an-cart__summary-title { margin: 0 0 14px; font-size: 22px; }
.an-cart__summary .an-free { margin-bottom: 14px; }
.an-cart__totals { width: 100%; margin: 0; border: 0; font-size: 15px; }
.an-cart__totals th, .an-cart__totals td { padding: 8px 0; border: 0; vertical-align: top; }
.an-cart__totals th { text-align: left; font-weight: 500; color: var(--an-ink-2); }
.an-cart__totals td { text-align: right; font-weight: 700; }
.an-cart__save-row th, .an-cart__save-row td, .an-cart__totals .cart-discount td { color: var(--an-save); }
.an-cart__totals a.woocommerce-remove-coupon { margin-left: 4px; color: var(--an-muted); font-size: 13px; font-weight: 400; text-decoration: underline; }
.an-cart__totals .order-total th, .an-cart__totals .order-total td { padding-top: 14px; border-top: 1px solid var(--an-line); }
.an-cart__totals .order-total th { font: 800 19px/1.2 var(--an-display); color: var(--an-ink); }
.an-cart__incl { display: block; margin-top: 4px; font: 500 12.5px/1.2 var(--an-sans); color: var(--an-muted); }
.an-cart__total { font-size: 26px; font-weight: 800; }
.an-cart__total .includes_tax { display: block; font-size: 12px; font-weight: 400; color: var(--an-muted); }
.an-cart__cta { margin-top: 16px; }
.an-cart__cta .checkout-button { min-height: 56px; font-size: 17px; font-weight: 800; }
.an-cart__continue { display: block; margin-top: 12px; text-align: center; color: var(--an-ink); font-weight: 700; font-size: 14.5px; }
.an-cart__trust { display: grid; gap: 12px; margin: 14px 0 0; padding: 18px; border: 1px solid var(--an-line); border-radius: 20px; background: var(--an-surface); list-style: none; }
.an-cart__trust li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--an-muted); line-height: 1.35; }
.an-cart__trust li > .an-icon { color: var(--an-save); }
.an-cart__trust strong { display: block; color: var(--an-ink); font-size: 14px; }

/* Fixed checkout bar (phones and tablets) */
.an-cart-bar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 150; display: flex; align-items: center; gap: 14px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--an-line); background: rgba(255, 255, 255, .98); box-shadow: 0 -8px 24px rgba(29, 43, 36, .08); transform: translateY(110%); visibility: hidden; transition: transform .22s var(--an-ease), visibility 0s linear .22s; }
.an-cart-bar.is-on { transform: none; visibility: visible; transition: transform .22s var(--an-ease), visibility 0s; }
.an-cart-bar__amount { display: flex; flex-direction: column; line-height: 1.15; }
.an-cart-bar__label { font-size: 12px; color: var(--an-muted); font-weight: 600; }
.an-cart-bar__total { font-size: 20px; font-weight: 800; }
.an-cart-bar__total .includes_tax { display: none; }
.an-cart-bar__btn { flex: 1; min-height: 52px; font-size: 16px; }
@media (min-width: 1000px) { .an-cart-bar { display: none; } }

/* Empty cart */
.an-cart-empty__box { text-align: center; padding-block: 40px; }
.an-cart-empty__ico { display: inline-flex; align-items: center; justify-content: center; width: 84px; height: 84px; margin-bottom: 12px; border-radius: 50%; background: var(--an-accent-soft); }
.an-cart-empty__title { margin: 0 0 8px; font-size: clamp(24px, 3vw, 32px); }
.an-cart-empty__text { margin: 0 auto 20px; max-width: 42ch; color: var(--an-muted); }
.an-cart-empty .return-to-shop { margin: 0; }
.an-cart-page .woocommerce-notices-wrapper:not(:empty) { margin-bottom: 16px; }
