/* Cart/checkout summary card + hero + coupon + actions. Adopts user_area vocabulary.
   Selectors target both :is(#my-cart-wrapper, #my-checkout-wrapper) and #my-checkout-wrapper via :is() so the
   summary card design is shared between cart.php and checkout.php. */

/* Shadow comes from the template's .shadow class (matches user_area outer card). */
:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-card {
    width: 100%;
    min-width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    padding: 22px 24px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--chip-active-bg, #2020B3) 8%, #fff) 0%,
        #fff 100%);
    border: 1px solid color-mix(in srgb, var(--chip-active-bg, #2020B3) 15%, transparent);
    border-radius: 16px;
    box-sizing: border-box;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero-label {
    font-size: 13px;
    font-weight: 600;
    color: #6B7280;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin: 0;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero-amount {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--chip-active-bg, #2020B3);
    font-variant-numeric: tabular-nums;
    flex-wrap: wrap;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero-amount .amount {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.5px;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero-amount .currency {
    font-size: 20px;
    font-weight: 700;
    opacity: 0.75;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero-amount .amount-sep {
    font-size: 22px;
    font-weight: 600;
    opacity: 0.55;
    margin: 0 2px;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    width: 100%;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-section .drawer-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--chip-active-bg, #2020B3);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-align: start;
    margin: 0;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-form {
    margin: 0;
    width: 100%;
}

/* Tighter than the shared .input-container default — coupon is a small inline field. */
:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-input-container {
    padding: 4px 0 0 0;
    gap: 6px;
}

/* Override .input-container's centered flex label so the drawer-label sits flat. */
:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-input-container > label {
    display: block;
    justify-content: flex-start;
}

/* 3px inset padding nests the button visually inside the pill. */
:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-input-row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    height: 44px;
    padding: 3px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--chip-active-bg, #2020B3) 30%, #e5e7eb);
    border-radius: 999px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* :focus-within lifts the focus ring from the inner input onto the wrapper pill. */
:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-input-row:focus-within {
    border-color: var(--chip-active-bg, #2020B3);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--chip-active-bg, #2020B3) 12%, transparent);
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-input {
    flex: 1;
    min-width: 0;
    color: #0B0427;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-align: right;
    background: transparent;
    border: none;
    outline: none;
    padding: 0 14px;
    direction: rtl;
    box-sizing: border-box;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-input::placeholder {
    color: #46494F;
    opacity: 0.5;
    font-size: 14px;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-button {
    min-width: 64px;
    padding: 0 18px;
    background-color: var(--chip-active-bg, #2020B3);
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-button:hover {
    opacity: 0.9;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-error {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff3f3;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-error.is-visible,
:is(#my-cart-wrapper, #my-checkout-wrapper) .invalidCouponCode[style*="display: block"] {
    display: block;
}

/* Same recipe as .code-box in user_area orders drawer. */
:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-success-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--chip-active-bg, #2020B3) 20%, #e5e7eb);
    border-radius: 999px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #0B0427;
    letter-spacing: 0.5px;
    direction: ltr;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-success-pill .cart-remove-coupon {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    opacity: 0.7;
    color: #6B7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s ease, color 0.2s ease;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-success-pill .cart-remove-coupon:hover {
    opacity: 1;
    color: var(--chip-active-bg, #2020B3);
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-success-pill .cart-remove-coupon svg {
    width: 18px;
    height: 18px;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-checkout-button {
    gap: 8px;
    background: var(--chip-active-bg, #2020B3);
    text-decoration: none;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-checkout-button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-checkout-button span {
    line-height: 1;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-checkout-button:hover {
    text-decoration: none;
    color: #fff;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-continue-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 50px;
    padding: 12px 16px;
    background: #f9fafb;
    color: #46494F;
    /* border:0 — egged forces border-color on all <a>, so any non-zero width shows. */
    border: 0;
    border-radius: 6px;
    outline: none;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-continue-button:hover {
    background: var(--chip-active-bg, #2020B3);
    color: #fff;
    text-decoration: none;
}

/* Keyboard-only focus ring — suppresses the persistent ring after a mouse click. */
:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-continue-button:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--chip-active-bg, #2020B3) 25%, transparent);
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-empty {
    text-align: center;
    padding: 60px 20px;
    max-width: 480px;
    margin: 0 auto;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #0B0427;
    margin: 0 0 6px 0;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-empty-subtitle {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 20px 0;
}

:is(#my-cart-wrapper, #my-checkout-wrapper) .cart-empty .cart-actions {
    max-width: 320px;
    margin: 0 auto;
    padding-top: 0;
    border-top: none;
}


@media (max-width: 768px) {
    :is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-card {
        padding: 16px;
        gap: 16px;
    }

    :is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero {
        padding: 18px 18px;
        border-radius: 12px;
    }

    :is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero-amount .amount {
        font-size: 36px;
    }

    :is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero-amount .currency {
        font-size: 17px;
    }

    :is(#my-cart-wrapper, #my-checkout-wrapper) .cart-summary-hero-amount .amount-sep {
        font-size: 18px;
    }

    :is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-input-row {
        height: 40px;
    }

    :is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-input {
        font-size: 15px;
    }

    :is(#my-cart-wrapper, #my-checkout-wrapper) .cart-coupon-button {
        font-size: 14px;
        min-width: 56px;
        padding: 0 14px;
    }
}
