/* ============================================
   ORDER SUMMARY PAGE STYLES
   SAGA - Your Cart
   ============================================ */

/* Cart Header */
.cart-header {
    background: linear-gradient(135deg, #81C408 0%, #6aa106 100%);
    padding: 3rem 0;
    margin-bottom: 0;
}

.cart-header h1 {
    color: white;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cart-header .cart-count {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

/* Cart Container */
.cart-container {
    background: #f8f9fa;
    min-height: 60vh;
    padding: 2rem 0;
}

/* ============================================
   CART ITEM CARD
   ============================================ */
.cart-item-card {
    background: white;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid #eee;
    position: relative; /* anchor for absolutely-positioned children on mobile */
}

.cart-item-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Product Image */
.product-image-wrapper {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.product-image-wrapper img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* Product Info */
.product-info {
    flex: 1;
    min-width: 0;
}

.product-category {
    font-size: 0.75rem;
    color: #81C408;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.product-size {
    font-size: 0.85rem;
    color: #666;
}

/* Store Badge */
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    margin-top: 8px;
}

.store-badge img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.store-badge span {
    font-size: 0.8rem;
    font-weight: 500;
    color: #555;
    text-transform: capitalize;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    background: white;
}

.action-btn-info {
    border-color: #81c408;
    color: #81c408;
}

.action-btn-info:hover {
    background: #81c408;
    color: white;
    transform: scale(1.1);
}

.action-btn-refresh {
    border-color: #81c408;
    color: #81c408;
}

.action-btn-refresh:hover {
    background: #81c408;
    color: white;
    transform: scale(1.1);
}

.action-btn-search {
    border-color: #81c408;
    color: #81c408;
}

.action-btn-search:hover {
    background: #81c408;
    color: white;
    transform: scale(1.1);
}

.action-btn-delete {
    border-color: #dc3545;
    color: #dc3545;
}

.action-btn-delete:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
}

/* ── Product feedback (Like / Dislike) — sit beneath the price on the
   right side of the card on desktop, anchored top-right on mobile. The
   color schemes intentionally match other action buttons:
     • Like    → same green as Why?/Regenerate/Browse (.action-btn-info)
     • Dislike → same red   as Remove                  (.action-btn-delete)
   ──────────────────────────────────────────────────────────────────── */
.feedback-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.feedback-actions .action-btn {
    /* Slightly smaller than the bottom action row so the right-side stack
       doesn't dominate the price block. */
    width: 32px;
    height: 32px;
    font-size: 0.78rem;
}
.action-btn-like {
    border-color: #81c408;
    color: #81c408;
}
.action-btn-like:hover,
.action-btn-like.is-active {
    background: #81c408;
    color: #fff;
    transform: scale(1.08);
}
.action-btn-dislike {
    border-color: #dc3545;
    color: #dc3545;
}
.action-btn-dislike:hover,
.action-btn-dislike.is-active {
    background: #dc3545;
    color: #fff;
    transform: scale(1.08);
}

/* ── Alternatives strip (horizontal scroller of swap candidates) ───
   Themed to match the page's green palette so it blends with the rest
   of the cart UI instead of standing out as warm-toned. */
.alt-strip {
    margin-top: 14px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #f4faec 0%, #eaf5d8 100%);
    border: 1px solid #d4e8b6;
    border-radius: 12px;
}
.alt-strip[hidden] { display: none !important; }
.alt-strip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.alt-strip-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #4a7c0a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.alt-strip-title i { color: #81c408; }
.alt-strip-close {
    border: none;
    background: transparent;
    color: #4a7c0a;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.15s ease;
}
.alt-strip-close:hover { background: rgba(129, 196, 8, 0.15); }
.alt-strip-scroller {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: #b8d98c transparent;
}
.alt-strip-scroller::-webkit-scrollbar { height: 6px; }
.alt-strip-scroller::-webkit-scrollbar-thumb {
    background: #b8d98c;
    border-radius: 3px;
}
.alt-strip-empty {
    color: #4a7c0a;
    font-size: 0.8rem;
    padding: 14px;
    width: 100%;
    text-align: center;
}

/* Individual alternative product card */
.alt-card {
    flex: 0 0 240px;
    min-height: 138px;
    background: #fff;
    border: 1px solid #d4e8b6;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    gap: 8px;
    scroll-snap-align: start;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}
.alt-card:hover {
    border-color: #81c408;
    box-shadow: 0 2px 10px rgba(129, 196, 8, 0.22);
}
.alt-card-img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    background: #f4faec center/cover no-repeat;
}
.alt-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.alt-card-name {
    font-size: 0.72rem;
    color: #1f2937;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 2px 0;
}
.alt-card-size {
    font-size: 0.66rem;
    color: #6b7280;
    margin-bottom: 2px;
}
.alt-card-price {
    font-size: 0.82rem;
    font-weight: 700;
    color: #4a7c0a;
}
.alt-card-platform {
    font-size: 0.6rem;
    color: #64748b;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.alt-card-add {
    margin-top: 6px;
    width: 100%;
    padding: 4px 6px;
    background: #81c408;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.alt-card-add:hover { background: #6ba506; transform: translateY(-1px); }
.alt-card-add:disabled { background: #b5d471; cursor: progress; }
.alt-card.is-adding { opacity: 0.7; pointer-events: none; }

/* Action Labels (tooltips) */
.action-with-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.action-label {
    font-size: 0.65rem;
    color: #81c408;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.action-with-label:has(.action-btn-delete) .action-label {
    color: #dc3545;
}

/* ============================================
   QUANTITY CONTROLS
   ============================================ */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 25px;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: white;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.qty-btn:hover {
    background: #81C408;
    color: white;
}

.qty-value {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
}

/* ============================================
   PRICE DISPLAY
   ============================================ */
.item-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

.item-total {
    font-size: 0.85rem;
    color: #666;
}

.savings-badge {
    background: linear-gradient(135deg, #81C408 0%, #6aa106 100%);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* ============================================
   CART SUMMARY CARD
   ============================================ */
.cart-summary-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    position: sticky;
    top: 170px;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.summary-title i {
    color: #81C408;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-of-type {
    border-bottom: none;
}

.summary-row.total {
    border-top: 2px solid #81C408;
    margin-top: 1rem;
    padding-top: 1rem;
}

.summary-label {
    color: #666;
    font-size: 0.95rem;
}

.summary-value {
    font-weight: 600;
    color: #333;
}

.summary-total-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

.summary-total-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #81C408;
}

.discount-row {
    color: #388e3c;
}

.discount-row .summary-value {
    color: #388e3c;
}

/* ============================================
   CHECKOUT BUTTON
   ============================================ */
.checkout-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #81C408 0%, #6aa106 100%);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 1.5rem;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(129, 196, 8, 0.4);
    color: white;
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ============================================
   COUNTDOWN TIMER
   ============================================ */
.countdown-section {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cd 100%);
    border-radius: 16px;
    padding: 1.25rem;
    margin-top: 1.5rem;
    border: 1px solid #FFB524;
}

.countdown-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.countdown-timer {
    font-size: 2rem;
    font-weight: 700;
    color: #FFB524;
    font-family: 'Courier New', monospace;
}

.delivery-day {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    margin-top: 4px;
}

/* ============================================
   REPLACEMENT PREFERENCE
   ============================================ */
.replacement-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
}

.replacement-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
}

.replacement-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
}

.replacement-option input[type="radio"] {
    accent-color: #81C408;
    width: 18px;
    height: 18px;
}

.replacement-option label {
    font-size: 0.9rem;
    color: #555;
    cursor: pointer;
    margin-bottom: 0;
}

/* ============================================
   CLEAR CART BUTTON
   ============================================ */
.clear-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 2px solid #dc3545;
    color: #dc3545;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
}

.clear-cart-btn:hover {
    background: #dc3545;
    color: white;
}

/* ============================================
   EMPTY CART STATE
   ============================================ */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-cart-icon {
    font-size: 5rem;
    color: #ddd;
    margin-bottom: 1.5rem;
}

.empty-cart h3 {
    color: #666;
    margin-bottom: 1rem;
}

.empty-cart p {
    color: #999;
    margin-bottom: 1.5rem;
}

.shop-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #81C408 0%, #6aa106 100%);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

.shop-now-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(129, 196, 8, 0.4);
    color: white;
    text-decoration: none;
}

/* ============================================
   REASON POPOVER
   ============================================ */
.reason-popover {
    max-width: 300px;
}

/* ============================================
   MODAL STYLES
   ============================================ */
.regen-modal .modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
}

.regen-modal .modal-header {
    background: linear-gradient(135deg, #81C408 0%, #6aa106 100%);
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
}

.regen-modal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.regen-modal .modal-body {
    padding: 1.5rem;
}

/* ── Friendlier regenerate modal — intro copy + quick-suggestion chips ── */
.regen-intro {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.1rem;
}
.regen-label {
    color: #1f2937;
    margin-bottom: 0.5rem;
}
.regen-label i { color: #81c408; }
.regen-input.form-control {
    border: 1.5px solid #d4e8b6;
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.regen-input.form-control:focus {
    border-color: #81c408;
    box-shadow: 0 0 0 0.2rem rgba(129, 196, 8, 0.15);
    outline: none;
}
.regen-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0.9rem;
}
.regen-chip {
    background: #f4faec;
    border: 1px solid #d4e8b6;
    color: #4a7c0a;
    padding: 6px 13px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.regen-chip:hover,
.regen-chip:focus-visible {
    background: #81c408;
    color: #fff;
    border-color: #81c408;
    transform: translateY(-1px);
    outline: none;
}
.regen-hint {
    color: #4b5563;
    font-size: 0.83rem;
    margin: 1rem 0 0;
    padding: 9px 12px;
    background: #f4faec;
    border-left: 3px solid #81c408;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.regen-hint i { color: #81c408; }

/* Legacy store-picker styles kept for back-compat (no longer rendered) */
.store-checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 1rem;
}

.store-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.store-checkbox-item:hover {
    background: #e8f5e9;
}

.store-checkbox-item input {
    accent-color: #81C408;
    width: 18px;
    height: 18px;
}

.regen-modal .modal-footer {
    border: none;
    padding: 1rem 1.5rem 1.5rem;
}

.modal-submit-btn {
    background: linear-gradient(135deg, #81C408 0%, #6aa106 100%);
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    color: white;
    font-weight: 600;
}

.modal-submit-btn:hover {
    transform: scale(1.02);
    color: white;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 991px) {
    .cart-summary-card {
        position: relative;
        top: 0;
        margin-top: 2rem;
    }
    
    .cart-item-card {
        padding: 1rem;
    }
    
    .product-image-wrapper {
        width: 80px;
        height: 80px;
    }
}

/* ============================================
   MOBILE CART ITEM CARD REDESIGN  (≤576px)
   --------------------------------------------
   Goals:
     1. The action row (Why? / Regenerate / Browse / Remove + quantity)
        must start flush with the LEFT edge of the card content area —
        not at the inset created by the product image column.
     2. The Like / Dislike controls must sit *underneath* the price in
        the normal document flow, never overlapping it.
     3. Keep the image-left / details-right top row that users are used
        to, but tighten spacing so the card reads well on narrow screens.

   How it works:
     • A CSS custom property `--mobile-img-size` is used by both the
       image wrapper and the negative-margin math on the action row, so
       the two stay in sync if the image size is ever tuned.
     • The action row breaks out of its `.product-info` parent using a
       negative `margin-left` plus a matching `width` extension, so its
       `border-top` becomes a full-width divider across the card.
     • The feedback buttons are reverted to static positioning — they
       were previously absolutely positioned to the top-right corner of
       the card, which caused them to float over the price block.
   ============================================ */
@media (max-width: 576px) {
    .cart-item-card {
        /* Single source of truth for the image-column width on mobile.
           The action row's negative-margin math below references this
           value, so changes here flow through automatically. */
        --mobile-img-size: 72px;
        --mobile-img-gap: 0.85rem;
        --mobile-card-pad: 0.9rem;
        padding: var(--mobile-card-pad);
    }

    /* Slightly smaller image keeps the title block readable without
       forcing it to wrap aggressively. */
    .product-image-wrapper {
        width: var(--mobile-img-size);
        height: var(--mobile-img-size);
        border-radius: 10px;
    }
    .subscription-icon-wrapper {
        width: var(--mobile-img-size);
        height: var(--mobile-img-size);
    }
    .subscription-icon-container {
        width: var(--mobile-img-size);
        height: var(--mobile-img-size);
        font-size: 2.2rem;
    }

    /* Tighten the flex gap between image and details column to recover
       horizontal room for the title/price row. */
    .cart-item-card > .d-flex.gap-3 {
        gap: var(--mobile-img-gap) !important;
    }

    .cart-item-actions {
        flex-wrap: wrap;
        gap: 8px !important;
    }

    /* ── TOP HEADER ROW → 3-row CSS grid (mobile only)
       -------------------------------------------------
       Layout target on phones:
           [category — full width, clamped to 2 lines     ]
           [product name — full width, never truncated   ]
           [size] [store-badge]  …space…  [price + feedback]

       Implementation notes:
         • The HTML has an unnamed `<div>` wrapping category / name /
           size / store-badge, with `.price-feedback-col` as its sibling.
           We avoid touching the template by applying `display: contents`
           to that wrapper on mobile, which flattens its four children
           into direct grid items of the outer flex container (now a
           grid). That lets us co-place the size/store with the price
           block on a single row.
         • Scoped with `:not(.subscription-cart-item)` so the
           subscription card (different markup) keeps its existing
           layout untouched.
         • Auto-placement gracefully handles missing fields: if the
           category isn't rendered (`{% if ... %}`), the name simply
           moves up to row 1, and the meta row shifts to row 2. */
    .cart-item-card:not(.subscription-cart-item)
        .product-info > .d-flex.justify-content-between.align-items-start {
        display: grid !important;
        grid-template-columns: auto auto minmax(0, 1fr);
        column-gap: 8px;
        row-gap: 6px;
        align-items: center;
        justify-items: start;
    }
    .cart-item-card:not(.subscription-cart-item)
        .product-info
        > .d-flex.justify-content-between.align-items-start
        > div:first-child {
        display: contents;
    }

    /* Row 1: category — spans full width, capped at 2 lines so a long
       category label doesn't push the rest of the card down. */
    .cart-item-card:not(.subscription-cart-item) .product-category {
        grid-column: 1 / -1;
        font-size: 0.62rem;
        line-height: 1.3;
        letter-spacing: 0.4px;
        margin-bottom: 0;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Row 2: product name — spans full width, no truncation. The
       previous mobile rule clamped this to 2 lines, which is the
       behaviour we are explicitly reversing. */
    .cart-item-card:not(.subscription-cart-item) .product-name {
        grid-column: 1 / -1;
        font-size: 0.85rem;
        line-height: 1.3;
        margin-bottom: 0;
        display: block;
        overflow: visible;
        -webkit-line-clamp: unset;
        white-space: normal;
        word-break: break-word;
    }

    /* Row 3 col 1: product size */
    .cart-item-card:not(.subscription-cart-item) .product-size {
        grid-column: 1;
        font-size: 0.78rem;
        margin-right: 0 !important; /* defeat Bootstrap's `me-3` here */
        align-self: center;
    }

    /* Row 3 col 2: store badge, scaled down so it shares the row
       comfortably with size + price. */
    .cart-item-card:not(.subscription-cart-item) .store-badge {
        grid-column: 2;
        margin-top: 0;
        padding: 3px 8px;
        gap: 4px;
        align-self: center;
    }
    .cart-item-card:not(.subscription-cart-item) .store-badge img {
        width: 22px;
        height: 22px;
    }

    /* Row 3 col 3: price block (price + savings + like/dislike),
       right-aligned and stacked. Converted to a flex column so each
       element gets its own line independent of the surrounding text
       flow that the desktop layout relies on. */
    .cart-item-card:not(.subscription-cart-item) .price-feedback-col {
        grid-column: 3;
        justify-self: end;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
        padding-top: 0;
        white-space: nowrap;
    }

    .item-price {
        font-size: 1.1rem;
        line-height: 1.1;
    }

    /* ── Like / Dislike: back to natural flow inside the price column.
       The base `.feedback-actions` rule already gives them inline-flex
       layout; we just need to defeat the previous absolute-positioning
       override that used to float them over the price. */
    .feedback-actions {
        position: static;
        top: auto;
        right: auto;
        z-index: auto;
        margin-top: 4px;
    }
    .feedback-actions .action-btn {
        width: 30px;
        height: 30px;
        font-size: 0.72rem;
    }

    /* ── Action row breaks out of `.product-info` and spans the full
       card content width, so the buttons + quantity controls start at
       the same left edge as the product image. The negative left
       margin pulls the row back to the image's left edge; the matching
       width extension re-fills to the right edge. */
    .cart-item-actions-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        margin-left: calc(-1 * (var(--mobile-img-size) + var(--mobile-img-gap)));
        width: calc(100% + var(--mobile-img-size) + var(--mobile-img-gap));
        /* The Bootstrap `pt-3 border-top` utilities on this element now
           render a clean full-width divider across the card. */
    }

    .cart-item-actions-row .cart-item-actions {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        /* Distribute the four icon buttons evenly across the full row
           so they don't bunch at the left and waste right-side space. */
        justify-content: space-between !important;
        width: 100%;
    }

    .cart-item-actions-row .action-with-label {
        flex-direction: row !important;
        gap: 0 !important;
        align-items: center !important;
        border-radius: 50% !important;
        padding: 0 !important;
        width: auto !important;
        justify-content: center !important;
    }

    .cart-item-actions-row .action-btn {
        flex-shrink: 0;
    }

    .cart-item-actions-row .action-label {
        display: none !important;
    }

    .cart-item-actions-row .quantity-controls {
        justify-content: center !important;
        width: 100%;
        border-radius: 25px;
        padding: 8px 16px;
    }

    /* Alternatives strip is a sibling of the .d-flex inside .cart-item-card,
       so it naturally takes the full card width on every viewport. Just trim
       the padding a touch on mobile so cards keep their air. */
    .alt-strip {
        padding: 10px 10px;
    }
    .alt-card {
        flex: 0 0 220px;
    }
}

/* ============================================
   SUBSCRIPTION CART ITEM
   ============================================ */
.subscription-cart-item {
    background: linear-gradient(135deg, rgba(129, 196, 8, 0.05) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 2px solid #81c408;
}

.subscription-icon-wrapper {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.subscription-icon-container {
    width: 130px;
    height: 130px;
    background: linear-gradient(135deg, #ffc107 0%, #ffca28 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.subscription-cart-item .billing-cycle-badge {
    display: inline-flex;
    align-items: center;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: #495057;
    font-weight: 500;
}

.subscription-cart-item .monthly-equivalent {
    margin-top: 2px;
}

.subscription-features-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.subscription-features-mini .feature-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.subscription-features-mini .feature-tag i {
    font-size: 0.6rem;
}

/* Subscription row in summary */
.summary-row.subscription-row {
    background: rgba(129, 196, 8, 0.05);
    margin: 0 -1rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.summary-row.subscription-row .summary-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-row.subscription-row .summary-label small {
    font-size: 0.7rem;
}
