/**
 * Slide-out cart panel (Your Cart) — theme primary accent.
 */
.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.cart-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.cart-drawer {
    position: fixed;
    top: 0;
    inset-inline-end: 0;
    z-index: 1041;
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 100dvh;
    background: #fff;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    transform: translateX(calc(100% + 1px));
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    border-radius: 20px 0 0 20px;
    overflow: hidden;
}

[dir="rtl"] .cart-drawer {
    transform: translateX(calc(-100% - 1px));
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.12);
    border-radius: 0 20px 20px 0;
}

.cart-drawer.is-open {
    transform: translateX(0);
}

body.cart-drawer-open {
    overflow: hidden;
    touch-action: none;
}

.cart-drawer__panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    width: 100%;
    height: 100%;
    background: #fff;
}

.cart-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    flex-shrink: 0;
}

.cart-drawer__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
}

.cart-drawer__close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #f3f3f3;
    color: #333;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.cart-drawer__close:hover {
    background: #e8e8e8;
}

.cart-drawer__divider {
    height: 1px;
    background: #e8e8e8;
    margin: 0 20px;
    flex-shrink: 0;
}

.cart-drawer__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px 20px 20px;
    -webkit-overflow-scrolling: touch;
}

/* Mini cart inside drawer: scroll line items; keep summary + Continue visible */
.cart-drawer__body .cart-drawer-mini--drawer {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
}

.cart-drawer-mini__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-right: 2px;
    margin-right: -2px;
}

.cart-drawer-mini__foot {
    flex-shrink: 0;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid #ececec;
    background: #fff;
}

/* ——— Partial: mini cart ——— */
.cart-drawer-mini {
    color: #111;
}

.cart-drawer-mini__promo {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.35;
}

.cart-drawer-mini__promo--progress {
    background: color-mix(in srgb, #4f46e5 14%, #ffffff);
    color: #4338ca;
    border: 1px solid color-mix(in srgb, #4f46e5 24%, #ffffff);
}

.cart-drawer-mini__promo--success {
    background: color-mix(in srgb, #22c55e 14%, #ffffff);
    color: #15803d;
    border: 1px solid color-mix(in srgb, #22c55e 22%, #ffffff);
}

.cart-drawer-mini a {
    color: inherit;
    text-decoration: none;
}

.cart-drawer-mini a:hover {
    color: var(--cart-drawer-accent, var(--theme-primary, #ff6a00));
}

.cart-drawer-mini__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.cart-drawer-mini__count {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111;
}

.cart-drawer-mini__clear {
    padding: 0;
    border: none;
    background: none;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--cart-drawer-accent, var(--theme-primary, #ff6a00));
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cart-drawer-mini__clear:hover {
    opacity: 0.85;
}

.cart-drawer-mini__list {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
}

.cart-drawer-mini__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 42px 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-drawer-mini__item:first-child {
    padding-top: 0;
}

.cart-drawer-mini__thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f5f5;
}

.cart-drawer-mini__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-drawer-mini__info {
    flex: 0 0 47%;
    min-width: 0;
    padding-top: 2px;
    max-width: none;
}

.cart-drawer-mini__name {
    margin: 0 0 4px;
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.35;
    color: #111;
}

.cart-drawer-mini__unit-calc {
    display: inline;
    font-weight: 500;
    color: #555;
    line-height: 1.2;
    font-size: 0.6rem;
    white-space: nowrap;
}

.cart-drawer-mini__line-total {
    display: inline;
    font-weight: 700;
    color: #111;
    margin-top: 0;
    line-height: 1.2;
    font-size: 0.65rem;
    white-space: nowrap;
}

.cart-drawer-mini__meta {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.cart-drawer-mini__meta em {
    font-style: normal;
    font-weight: 500;
}

.cart-drawer-mini__qty {
    flex: 0 0 auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: #f3f3f3;
    border-radius: 999px;
    padding: 3px;
    margin-top: 0;
    transform: scale(0.72);
    transform-origin: left center;
    flex-shrink: 0;
    margin-left: 0;
}

.cart-drawer-mini__qty-col {
    margin-left: auto;
    margin-right: 42px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    flex-shrink: 0;
}

.cart-drawer-mini__qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
    transition: transform 0.1s ease;
}

.cart-drawer-mini__qty-btn:active {
    transform: scale(0.94);
}

.cart-drawer-mini__qty-minus {
    background: #e8e8e8;
    color: #333;
}

.cart-drawer-mini__qty-plus {
    background: var(--cart-drawer-accent, var(--theme-primary, #ff6a00));
    color: #fff;
}

.cart-drawer-mini__qty-val {
    min-width: 28px;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 700;
    border: none;
    background: transparent;
    color: #111;
    padding: 0 4px;
}

.cart-drawer-mini__qty-val:disabled {
    opacity: 1;
    -webkit-text-fill-color: #111;
}

.cart-drawer-mini__qty--static {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 2px 0;
    color: #555;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 0;
}

.cart-drawer-mini__amount {
    margin-left: 0;
    margin-right: 0;
    flex: 0 0 auto;
    min-width: 0;
    text-align: left;
    flex-shrink: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    white-space: nowrap;
}

.cart-drawer-mini__item > .js-cart-drawer-remove,
.cart-drawer-mini__item > .js-cart-page-remove {
    flex: 0 0 auto;
    margin-left: 2px;
}

@media (max-width: 991.98px) {
    .cart-drawer-mini__info {
        flex: 0 0 50%;
    }

    .cart-drawer-mini__qty-col {
        margin-left: auto;
        margin-right: 42px;
    }
}

/* Form wraps remove button — participates in cart row flex alignment */
.cart-drawer-mini__item > .js-cart-drawer-remove,
.cart-drawer-mini__item > .js-cart-page-remove {
    position: absolute;
    right: 0;
    top: 16px;
    transform: none;
    align-self: auto;
    display: inline-flex !important;
    align-items: center;
    margin: 0 !important;
    line-height: 0;
    vertical-align: middle;
    z-index: 3;
}

.cart-page--full .cart-drawer-mini__item > .js-cart-page-remove {
    align-self: center;
}

/* Remove line item — clear tap target, matches qty pill polish */
.cart-drawer-mini__remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #737373;
    cursor: pointer;
    line-height: 1;
    box-shadow: none;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.cart-drawer-mini__remove i {
    display: block;
    font-size: 1rem;
    line-height: 1;
}

.cart-drawer-mini__remove-icon {
    display: block;
    font-size: 18px;
    line-height: 1;
    font-weight: 500;
}

.cart-drawer-mini__remove:hover {
    background: transparent;
    border-color: transparent;
    color: #c62828;
    box-shadow: none;
}

.cart-drawer-mini__remove:active {
    transform: scale(0.94);
}

.cart-drawer-mini__remove:focus {
    outline: none;
}

.cart-drawer-mini__remove:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--cart-drawer-accent, var(--theme-primary, #ff6a00)) 45%, transparent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .cart-drawer-mini__remove:active {
        transform: none;
    }
}

.cart-drawer-mini__summary-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 14px;
    color: #111;
}

.cart-drawer-mini__coupon {
    display: flex;
    align-items: stretch;
    background: #f5f5f5;
    border-radius: 999px;
    padding: 4px 4px 4px 16px;
    margin-bottom: 20px;
    gap: 8px;
}

.cart-drawer-mini__coupon input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.875rem;
    outline: none;
}

.cart-drawer-mini__coupon input::placeholder {
    color: #999;
}

.cart-drawer-mini__coupon-btn {
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    background: #111;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.cart-drawer-mini__coupon-btn:hover {
    background: #333;
}

.cart-drawer-mini__rows {
    margin-bottom: 12px;
}

.cart-drawer-mini__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9375rem;
    margin-bottom: 10px;
    color: #333;
}

.cart-drawer-mini__row--total {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e8e8e8;
    font-weight: 700;
    font-size: 1rem;
    color: #111;
    margin-bottom: 0;
}

.cart-drawer-mini__continue {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 16px 20px;
    border: none;
    border-radius: 999px;
    background: var(--cart-drawer-accent, var(--theme-primary, #ff6a00));
    color: #fff !important;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.1s ease;
}

.cart-drawer-mini__continue:hover {
    filter: brightness(1.05);
    color: #fff !important;
}

.cart-drawer-mini__continue:active {
    transform: scale(0.99);
}

.cart-drawer-mini__footer-links {
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.cart-drawer-mini__footer-links a {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #666;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cart-drawer-mini__empty {
    text-align: center;
    padding: 48px 16px;
    color: #888;
    font-size: 0.9375rem;
}

/* Header: no hover dropdown for cart */
.site-header .topbar .header-toolbar-cart-item {
    position: relative;
}

.site-header .topbar .header-toolbar-cart-item > a.js-open-cart-drawer {
    cursor: pointer;
}

/* Fixed edge cart pill: opens same drawer as header cart (all breakpoints) */
.floating-cart-widget {
    position: fixed;
    top: 50%;
    inset-inline-end: 0;
    transform: translateY(-50%);
    z-index: 1035;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 64px;
    min-height: 120px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 14px 0 0 14px;
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    overflow: hidden;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

[dir="rtl"] .floating-cart-widget {
    border-radius: 0 14px 14px 0;
    box-shadow: 4px 4px 20px rgba(0, 0, 0, 0.12);
}

.floating-cart-widget:focus {
    outline: 2px solid color-mix(in srgb, var(--theme-primary, #ff6a00) 55%, transparent);
    outline-offset: 2px;
}

.floating-cart-widget__top {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 6px 10px;
    background: var(--cart-drawer-accent, var(--theme-primary, #ff6a00));
    color: #fff;
}

.floating-cart-widget__icon {
    font-size: 22px;
    line-height: 1;
    opacity: 0.95;
}

.floating-cart-widget__items {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    word-break: break-word;
}

.floating-cart-widget__bottom {
    flex-shrink: 0;
    padding: 10px 6px 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.floating-cart-widget__total {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    color: var(--cart-drawer-accent, var(--theme-primary, #ff6a00));
    word-break: break-word;
}

.floating-cart-widget.is-empty .floating-cart-widget__total {
    font-size: 10px;
    opacity: 0.85;
}

/* Add-to-cart feedback (does not conflict with translateY on desktop) */
@keyframes floating-cart-shake {
    0%,
    100% {
        margin-inline-end: 0;
    }
    12% {
        margin-inline-end: 14px;
    }
    24% {
        margin-inline-end: -10px;
    }
    36% {
        margin-inline-end: 10px;
    }
    48% {
        margin-inline-end: -6px;
    }
    60% {
        margin-inline-end: 4px;
    }
    72% {
        margin-inline-end: 0;
    }
}

.floating-cart-widget--shake {
    animation: floating-cart-shake 0.65s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .floating-cart-widget--shake {
        animation: none;
    }
}

/* Mobile / tablet: keep pill on screen edge, clear of bottom tab bar */
@media (max-width: 991.98px) {
    .floating-cart-widget {
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        width: 52px;
        min-height: 104px;
        border-radius: 12px 0 0 12px;
        box-shadow: -3px 3px 16px rgba(0, 0, 0, 0.14);
    }

    #floating_cart_widget {
        margin-top: 0;
    }

    .floating-cart-widget.js-open-cart-drawer {
        margin-top: 0;
    }

    [dir="rtl"] .floating-cart-widget {
        border-radius: 0 12px 12px 0;
        box-shadow: 3px 3px 16px rgba(0, 0, 0, 0.14);
    }
}

/* ——— Full cart page (/cart) ——— */
.cart-page--full {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px 40px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.cart-page__title {
    margin: 0 0 16px;
    font-size: 1.75rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
}

.cart-page--full .cart-drawer-mini__toolbar {
    margin-bottom: 4px;
}

.cart-page--full .cart-drawer-mini__item {
    padding: 18px 0;
    align-items: center;
}


.cart-page--full .cart-drawer-mini__thumb {
    width: 72px;
    height: 72px;
}

.cart-page--empty-shell {
    padding: 48px 24px 56px;
}

.cart-page--empty-shell .cart-page__title {
    margin-bottom: 12px;
}

.cart-drawer-mini__coupon-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
}

.cart-drawer-mini__coupon-remove {
    border: none;
    background: none;
    color: #c62828;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
}

.cart-drawer-mini__coupon-remove:hover {
    color: #b71c1c;
}

@media (max-width: 575.98px) {
    .cart-page--full {
        padding: 20px 16px 32px;
        border-radius: 0;
        box-shadow: none;
    }

    .cart-page__title {
        font-size: 1.5rem;
    }

    .cart-page--full .cart-drawer-mini__item {
        flex-wrap: wrap;
    }

    .cart-page--full .cart-drawer-mini__qty,
    .cart-page--full .cart-drawer-mini__qty--static {
        margin-top: 8px;
        margin-inline-start: auto;
    }
}
