.cart-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--c-highlight);
    color: #422006;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.cart-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-drawer-backdrop.open {
    opacity: 1;
}

.cart-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: white;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
}

.cart-drawer-backdrop.open .cart-drawer-panel {
    transform: translateX(0);
}

.cart-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.cart-drawer-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.cart-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.25rem;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
}

.cart-close-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #94a3b8;
    gap: 0.75rem;
}

.cart-empty-icon {
    font-size: 48px;
    color: #cbd5e1;
}

.cart-empty-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    color: #64748b;
}

.cart-empty-link {
    color: var(--c-primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.25rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.cart-item-image {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
    margin-bottom: 0.2rem;
    overflow-wrap: anywhere;
}

.cart-item-variant {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.35rem;
}

.cart-item-price {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    flex-wrap: wrap;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: #1e293b;
}

.cart-item-price del {
    color: #94a3b8;
    font-size: 0.78rem;
    text-decoration-thickness: 2px;
}

.cart-item-unavailable {
    opacity: 0.72;
}

.cart-reward-item {
    margin-top: 0.25rem;
    padding: 0.85rem;
    border: 1px solid rgba(250, 204, 21, 0.45);
    border-radius: 18px;
    background:
        radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.72), transparent 34%),
        linear-gradient(135deg, #fffbea, #fef3c7 56%, #fde68a);
}

.cart-reward-image {
    background: #fff7ed;
    border: 1px solid rgba(250, 204, 21, 0.4);
}

.cart-reward-image img {
    object-fit: cover;
}

.cart-reward-detail {
    color: #78350f;
    font-weight: 800;
    line-height: 1.35;
}

.cart-reward-price {
    color: #713f12;
}

.cart-item-warning {
    color: #b91c1c;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    flex-shrink: 0;
}

.cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.15rem 0.25rem;
}

.cart-qty-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    color: #475569;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.15s;
}

.cart-qty-btn:hover {
    background: #f1f5f9;
}

.cart-qty-btn:focus-visible,
.cart-remove-btn:focus-visible,
.cart-close-btn:focus-visible,
.cart-checkout-btn:focus-visible,
.cart-refund-agreement-input:focus-visible,
.cart-refund-agreement a:focus-visible,
.cart-empty-link:focus-visible {
    outline: 3px solid rgba(250, 204, 21, 0.7);
    outline-offset: 2px;
}

.cart-qty-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    min-width: 16px;
    text-align: center;
}

.cart-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #cbd5e1;
    padding: 0.2rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    display: flex;
}

.cart-remove-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

.cart-drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #fafbfc;
}

.cart-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.45rem;
}

.cart-subtotal-label {
    font-size: 0.9rem;
    color: #64748b;
}

.cart-subtotal-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e293b;
}

.cart-shipping-note {
    margin: 0 0 0.6rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
}

.cart-promo-note {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 14px;
    background: rgba(124, 58, 237, 0.08);
    color: #5b21b6;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.35;
}

.cart-promo-note .material-symbols-rounded {
    font-size: 1rem;
    flex: 0 0 auto;
}

.cart-newsletter-note {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(250, 204, 21, 0.55);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(254, 240, 138, 0.94), rgba(252, 211, 77, 0.92));
    color: #713f12;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.cart-newsletter-note:hover {
    filter: brightness(1.03);
}

.cart-newsletter-note .material-symbols-rounded {
    font-size: 1rem;
    flex: 0 0 auto;
}

.cart-refund-agreement {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0 0 1rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.4;
    cursor: pointer;
}

.cart-refund-agreement-input {
    width: 18px;
    height: 18px;
    margin: 0.05rem 0 0;
    flex: 0 0 auto;
    accent-color: var(--c-primary);
    cursor: pointer;
}

.cart-refund-agreement a {
    color: var(--c-primary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.cart-refund-agreement a:hover {
    color: var(--c-primary-dark);
}

.cart-checkout-btn {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    background: var(--c-primary);
    color: white;
    font-family: var(--font-display);
    transition: background 0.15s;
}

.cart-checkout-btn:hover {
    background: var(--c-primary-dark);
}

.cart-checkout-btn:disabled {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
}

.cart-newsletter-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.cart-newsletter-modal[hidden] {
    display: none;
}

.cart-newsletter-modal__scrim {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.56);
    cursor: pointer;
}

.cart-newsletter-modal__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 540px);
    padding: clamp(1rem, 3vw, 1.35rem);
    border: 1px solid #fde68a;
    border-radius: 28px;
    background:
        radial-gradient(circle at 10% 10%, rgba(250, 204, 21, 0.26), transparent 32%),
        radial-gradient(circle at 100% 0%, rgba(254, 240, 138, 0.58), transparent 38%),
        #ffffff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    outline: none;
}

.cart-newsletter-modal.is-open .cart-newsletter-modal__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.cart-newsletter-modal__close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    display: inline-flex;
    width: 2.4rem;
    height: 2.4rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #713f12;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.cart-newsletter-modal .footer-newsletter {
    width: 100%;
    margin-top: 0;
}

.cart-newsletter-modal .footer-newsletter h4 {
    margin: 0 0 0.5rem;
    padding-right: 2.8rem;
    color: #172033;
    font-size: clamp(1.55rem, 4vw, 2.1rem);
    line-height: 0.95;
}

.cart-newsletter-modal .newsletter-signup-intro {
    margin: 0 0 1rem;
    color: #713f12;
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.55;
}

.cart-newsletter-modal .footer-newsletter-shell {
    padding: 1.1rem;
    border: 1px solid rgba(250, 204, 21, 0.34);
    background: linear-gradient(135deg, rgba(254, 249, 195, 0.94), rgba(255, 255, 255, 0.95));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.cart-newsletter-modal .footer-newsletter-label {
    color: #422006;
}

.cart-newsletter-modal .footer-newsletter-input {
    border-color: rgba(250, 204, 21, 0.32);
}

.cart-newsletter-modal .footer-newsletter-privacy {
    color: #854d0e;
}

.cart-newsletter-modal .footer-newsletter-message-error {
    color: #7f1d1d;
    background: #fee2e2;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.cart-newsletter-modal .footer-newsletter-message-success {
    color: #14532d;
    background: #dcfce7;
    border: 1px solid rgba(74, 222, 128, 0.35);
}

html.cart-newsletter-modal-open,
html.cart-newsletter-modal-open body {
    overflow: hidden;
}

@media (max-width: 480px) {
    .cart-drawer-panel {
        max-width: 100%;
    }

    .cart-drawer-body,
    .cart-drawer-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .cart-newsletter-modal__panel {
        width: 100%;
        padding: 0.9rem;
        border-radius: 24px;
    }

    .cart-newsletter-modal .footer-newsletter-shell {
        padding: 0.95rem;
    }
}
