/* Shared drawer layout. Storefront branding is supplied through custom properties. */
html.rwc-cart-open { overflow: hidden; }
.rwc-cart { --rwc-ink: #202522; --rwc-muted: #737873; --rwc-line: #e7e8e4; --rwc-accent: #202823; box-sizing: border-box; position: fixed; inset: 0 0 0 auto; width: min(440px, 100%); height: 100dvh; max-width: 100%; max-height: 100dvh; margin: 0; padding: 0; border: 0; background: #fff; color: var(--rwc-ink); font: 400 14px/1.5 var(--rwc-font, system-ui, sans-serif); box-shadow: -12px 0 48px #00000012; overflow: hidden; }
.rwc-cart[open] { display: flex; flex-direction: column; animation: rwc-cart-enter 220ms cubic-bezier(.23,1,.32,1); }
.rwc-cart::backdrop { background: #0006; animation: rwc-backdrop-enter 180ms ease; }
.rwc-cart *, .rwc-cart *::before, .rwc-cart *::after { box-sizing: border-box; }
.rwc-cart [hidden] { display: none !important; }
.rwc-cart a { color: inherit; text-decoration: none; }
.rwc-cart button, .rwc-cart input { font: inherit; color: inherit; }
.rwc-cart button { cursor: pointer; }
.rwc-cart button:disabled, .rwc-cart input:disabled { opacity: .45; cursor: default; }
.rwc-cart[aria-busy="true"] button:disabled, .rwc-cart[aria-busy="true"] input:disabled { cursor: wait; }
.rwc-cart :is(button,a,input,summary):focus-visible { outline: 2px solid #365943; outline-offset: 3px; }
.rwc-cart-header { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--rwc-line); flex-shrink: 0; }
.rwc-cart-header h2 { display: flex; gap: 10px; align-items: center; margin: 0; font: 600 18px/1.3 var(--rwc-font, system-ui, sans-serif); letter-spacing: -.3px; }
.rwc-cart-header [data-cart-count] { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 30px; background: var(--rwc-accent); color: #fff; font-size: 12px; }
.rwc-icon { display: inline-block; flex-shrink: 0; width: 18px; height: 18px; background: currentColor; mask: var(--rwc-icon) center/contain no-repeat; -webkit-mask: var(--rwc-icon) center/contain no-repeat; }
.rwc-icon-close { --rwc-icon: url(icons/x.svg); }
.rwc-icon-plus { --rwc-icon: url(icons/plus.svg); }
.rwc-icon-minus { --rwc-icon: url(icons/minus.svg); }
.rwc-icon-arrow { --rwc-icon: url(icons/arrow-right.svg); }
.rwc-icon-caret { --rwc-icon: url(icons/caret-down.svg); width: 16px; height: 16px; transition: transform 180ms ease; }
.rwc-cart .rwc-icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; background: transparent; border: 0; border-radius: 6px; }
.rwc-cart .rwc-icon-button:hover { background: #f5f6f3; }
.rwc-cart-banner { background: #f5f6f3; padding: 14px 24px; margin: 0; font-size: 13px; }
.rwc-cart-status { margin: 0; padding: 0 24px; color: #a42b26; font-size: 13px; }
.rwc-cart-status:not(:empty) { padding-block: 12px; }
.rwc-cart-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px; }
.rwc-cart-items { display: flex; flex-direction: column; gap: 20px; margin: 0; padding: 0; list-style: none; }
.rwc-cart-item { display: grid; grid-template-columns: 80px minmax(0,1fr) 24px; gap: 12px; margin: 0; padding: 0 0 20px; border-bottom: 1px solid var(--rwc-line); }
.rwc-cart-item:last-child { border-bottom: 0; padding-bottom: 0; }
.rwc-cart-image { width: 80px; height: 80px; background: #f5f6f3; border-radius: 7px; overflow: hidden; }
.rwc-cart-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.rwc-cart-name { display: block; font-weight: 600; line-height: 1.4; }
.rwc-cart-name:hover { text-decoration: underline; }
.rwc-cart-variants { font-size: 12px; color: var(--rwc-muted); margin: 5px 0 0; }
.rwc-cart-variants:empty { display: none; }
.rwc-cart-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-top: 14px; }
.rwc-cart-quantity { display: flex; align-items: center; border: 1px solid #d9ddd6; border-radius: 6px; }
.rwc-cart-quantity button { display: grid; place-items: center; width: 30px; height: 34px; background: transparent; border: 0; padding: 0; }
.rwc-cart-quantity .rwc-icon { width: 12px; height: 12px; }
.rwc-cart-quantity input { appearance: textfield; -moz-appearance: textfield; width: 32px; height: 34px; border: 0; padding: 0; background: transparent; text-align: center; font-size: 13px; }
.rwc-cart-quantity input::-webkit-inner-spin-button, .rwc-cart-quantity input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rwc-cart-price { font-size: 13px; white-space: nowrap; }
.rwc-cart .rwc-cart-remove { width: 24px; height: 28px; color: var(--rwc-muted); }
.rwc-cart .rwc-cart-remove .rwc-icon { width: 14px; height: 14px; }
.rwc-cart-footer { flex-shrink: 0; max-height: 55dvh; overflow-y: auto; padding: 0 24px max(18px, env(safe-area-inset-bottom)); border-top: 1px solid var(--rwc-line); background: #f5f6f3; }
.rwc-cart-coupon { border-bottom: 1px solid var(--rwc-line); }
.rwc-cart-coupon summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; padding: 17px 0; font-size: 13px; }
.rwc-cart-coupon summary::-webkit-details-marker { display: none; }
.rwc-cart-coupon[open] .rwc-icon-caret { transform: rotate(180deg); }
.rwc-cart-coupon form { display: flex; gap: 8px; margin: 0 0 16px; }
.rwc-cart-coupon input { min-width: 0; flex: 1; height: 44px; padding: 11px 12px; border: 1px solid #cccfc9; border-radius: 6px; background: #fff; font-size: 16px; line-height: 20px; }
.rwc-cart-coupon form button { padding: 10px 14px; border: 1px solid #d4d7cf; border-radius: 6px; background: #e8ebe4; font-size: 13px; }
.rwc-cart-coupons:empty { display: none; }
.rwc-cart-coupons { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; }
.rwc-cart-coupon-tag { padding: 5px 9px; border: 0; border-radius: 4px; background: #f0f3ed; font-size: 12px; }
.rwc-cart-total { display: flex; justify-content: space-between; margin: 18px 0; font-size: 17px; font-weight: 600; }
.rwc-cart-note { margin: 8px 0 18px; font-size: 11px; color: var(--rwc-muted); }
.rwc-cart .rwc-cart-primary { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 12px 20px; background: var(--rwc-accent); color: #fff; border-radius: 6px; font-weight: 600; }
.rwc-cart .rwc-cart-primary:hover { background: #365943; }
.rwc-cart .rwc-cart-primary[aria-disabled=true] { opacity: .55; cursor: wait; }
.rwc-cart .rwc-cart-continue { display: block; width: 100%; border: 0; background: transparent; padding: 14px 0 0; font-size: 12px; }
.rwc-cart-empty { padding-top: 45px; text-align: center; }
.rwc-cart-empty h3 { font: 600 18px/1.4 var(--rwc-font, system-ui, sans-serif); }
.rwc-cart-empty p { color: var(--rwc-muted); margin-bottom: 24px; }
@keyframes rwc-cart-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes rwc-backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 380px) { .rwc-cart-header, .rwc-cart-body { padding-inline: 18px; } .rwc-cart-footer { padding-inline: 18px; } .rwc-cart-item { grid-template-columns: 64px minmax(0,1fr) 24px; gap: 10px; } .rwc-cart-image { width: 64px; height: 64px; } }
@media (prefers-reduced-motion: reduce) { .rwc-cart[open], .rwc-cart::backdrop { animation: none; } .rwc-icon-caret { transition: none; } }

/* Compact recommendations share the scroll area with the products. */
.rwc-cart-upsells { margin: -2px 0 24px; padding-bottom: 22px; border-bottom: 1px solid var(--rwc-line); }
.rwc-cart-upsells h3 { margin: 0 0 12px; font: 600 13px/1.4 var(--rwc-font, system-ui, sans-serif); }
.rwc-cart-upsell-list { display: grid; gap: 8px; }
.rwc-cart-upsell { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; gap: 10px; align-items: center; background: #f5f6f3; border: 1px solid #eceee8; border-radius: 8px; padding: 12px; }
.rwc-cart-upsell img { width: 48px; height: 48px; object-fit: contain; border-radius: 5px; }
.rwc-cart-upsell div { display: grid; gap: 4px; }
.rwc-cart-upsell div a { font-weight: 600; font-size: 12px; line-height: 1.4; }
.rwc-cart-upsell div span { font-size: 12px; color: var(--rwc-muted); }
.rwc-cart .rwc-upsell-add { padding: 8px 10px; border: 1px solid #d4d7cf; border-radius: 5px; color: var(--rwc-ink); background: #fff; font-size: 11px; font-weight: 600; }
.rwc-cart .rwc-upsell-add:hover { border-color: #365943; }

.rwc-cart-benefits { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; list-style: none; margin: 0 -24px; padding: 14px 18px; border-bottom: 1px solid #e1e3dc; color: #6c716d; }
.rwc-cart-benefits li { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 11px; font-weight: 600; line-height: 1.5; }
.rwc-cart-benefits .rwc-icon { width: 15px; height: 15px; }
.rwc-icon-download { --rwc-icon: url(icons/download-simple.svg); }
.rwc-icon-lock { --rwc-icon: url(icons/lock-simple.svg); }
@media (max-width: 380px) { .rwc-cart-benefits { margin-inline: -18px; gap: 10px 16px; } }
.rwc-gift { display: flex; align-items: center; gap: 12px; padding: 16px 24px; background: #f3f7f1; border-bottom: 1px solid #e1e9dc; flex-shrink: 0; }
.rwc-gift > div { flex: 1; min-width: 0; }
.rwc-gift p { margin: 0 0 8px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.rwc-gift small { display: block; color: #737873; font-size: 9px; margin-top: 5px; }
.rwc-gift progress { display: block; appearance: none; width: 100%; height: 5px; border: 0; border-radius: 10px; overflow: hidden; background: #dce6d7; color: #54845c; }
.rwc-gift progress::-webkit-progress-bar { background: #dce6d7; }
.rwc-gift progress::-webkit-progress-value { background: #54845c; }
.rwc-gift progress::-moz-progress-bar { background: #54845c; }
.rwc-icon-gift { --rwc-icon: url(icons/gift.svg); width: 24px; height: 24px; color: #875c00; }
.rwc-cart-item-gift .rwc-cart-price { color: #365943; }

.rwc-gift-image { width: 48px; height: 48px; flex: 0 0 48px; object-fit: contain; border-radius: 6px; background: #fff; }
.rwc-gift-track { display: flex; align-items: center; gap: 0; min-height: 26px; }
.rwc-gift-track progress { flex: 1; min-width: 0; border-radius: 10px 0 0 10px; }
.rwc-gift-marker { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 26px; border: 1px solid #b4c8ad; border-radius: 50%; background: #f8fbf6; color: #54845c; }
.rwc-gift-marker .rwc-icon { width: 15px; height: 15px; color: inherit; }
.rwc-gift.is-earned .rwc-gift-marker { background: #54845c; border-color: #54845c; color: #fff; }
.rwc-icon-check { --rwc-icon: url(icons/check.svg); }

/* Animate only the painted fill; retain native progress semantics. */
.rwc-gift-rail { position: relative; flex: 1; min-width: 0; height: 5px; overflow: hidden; border-radius: 10px 0 0 10px; background: #dce6d7; }
.rwc-gift-rail progress { position: absolute; width: 100%; height: 100%; margin: 0; opacity: 0; }
.rwc-gift-fill { display: block; width: 100%; height: 100%; background: #54845c; transform-origin: left center; transition: transform 250ms cubic-bezier(.23,1,.32,1); }
@media (prefers-reduced-motion: reduce) { .rwc-gift-fill { transition: none; } }

/* Recommendations sit at the bottom of the scroll area, above totals. */
.rwc-cart-body { display: flex; flex-direction: column; }
.rwc-cart-upsells { order: 2; flex-shrink: 0; margin: auto 0 0; padding: 24px 0 0; border: 0; }
.rwc-upsell-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.rwc-cart-upsells h3 { margin: 0; color: #426d49; font-size: 14px; }
.rwc-upsell-nav { display: flex; gap: 2px; }
.rwc-upsell-nav .rwc-icon-button { width: 30px; height: 30px; color: #54785a; }
.rwc-upsell-nav [data-upsell-prev] .rwc-icon { transform: rotate(180deg); }
.rwc-cart-upsell { padding: 14px; border-radius: 10px; }

/* Quiet recommendation row, separated from cart contents by one rule. */
.rwc-cart-upsells { padding-top: 18px; border-top: 1px solid var(--rwc-line); }
.rwc-cart-upsell { background: #fff; border: 0; border-radius: 0; padding: 4px 0 0; grid-template-columns: 56px minmax(0,1fr) auto; gap: 12px; }
.rwc-cart-upsell img { width: 56px; height: 56px; }
.rwc-cart-upsells h3 { color: var(--rwc-ink); font-size: 13px; }
.rwc-cart-body { row-gap: 24px; }
.rwc-cart-upsells h3,
.rwc-upsell-nav .rwc-icon-button { color: #000; }

.rwc-cart.is-closing::backdrop { animation: rwc-backdrop-exit 180ms ease forwards; }
@keyframes rwc-backdrop-exit { from { opacity: 1; } to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rwc-cart.is-closing::backdrop { animation: none; } }

/* Keep native wheel and touch scrolling inside the modal, independent of page smoothing. */
.rwc-cart-body { touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.rwc-cart-body > * { flex-shrink: 0; }

/* Recommendations stay with the totals while the product list scrolls. */
.rwc-cart-footer > .rwc-cart-upsells { margin: 0 -24px 14px; padding: 16px 24px; background: #fff; border-bottom: 1px solid var(--rwc-line); }
@media(max-width:380px) { .rwc-cart-footer > .rwc-cart-upsells { margin-inline: -18px; padding-inline: 18px; } }
