/* ============================================================
   CART PAGE — modern redesign (scoped to .cart-v2)
============================================================ */
.cart-v2 {
    --c-brand: #2A4A11;
    --c-brand-dark: #1d3310;
    --c-ink: #253D4E;
    --c-muted: #7E7E7E;
    --c-line: #eceff2;
    --c-bg-soft: #f7f8f9;
}

.cart-v2 .cart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}
.cart-v2 .cart-head__title {
    margin: 0 0 4px;
    font-size: 30px;
    font-weight: 800;
    color: var(--c-ink);
}
.cart-v2 .cart-head__count {
    margin: 0;
    font-size: 14px;
    color: var(--c-muted);
}
.cart-v2 .cart-head__count .text-brand { color: var(--c-brand); font-weight: 700; }
.cart-v2 .cart-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-muted);
    transition: color .2s ease;
}
.cart-v2 .cart-clear:hover { color: #e74c3c; }

/* ---- Items card + table ---- */
.cart-v2 .cart-items {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(37, 61, 78, .05);
    overflow: hidden;
}
.cart-v2 .table-responsive { margin: 0; }
.cart-v2 table.cart-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}
.cart-v2 .cart-table thead th {
    padding: 16px 20px;
    background: var(--c-bg-soft);
    border: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--c-muted);
    white-space: nowrap;
}
.cart-v2 .cart-table tbody td {
    padding: 20px;
    border: 0;
    border-top: 1px solid var(--c-line);
    vertical-align: middle;
}
.cart-v2 .cart-table tbody tr:first-child td { border-top: 0; }

/* Product cell */
.cart-v2 .cart-product {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 260px;
}
.cart-v2 .cart-product__thumb {
    flex-shrink: 0;
    width: 84px;
    height: 84px;
    border-radius: 12px;
    border: 1px solid var(--c-line);
    background: var(--c-bg-soft);
    overflow: hidden;
}
.cart-v2 .cart-product__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cart-v2 .cart-product__info { min-width: 0; }
.cart-v2 .cart-product__name {
    display: block;
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--c-ink);
    transition: color .2s ease;
}
.cart-v2 .cart-product__name:hover { color: var(--c-brand); }

.cart-v2 .cart-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}
.cart-v2 .cart-rating .font-small { font-size: 12px; }

/* Variant badges */
.cart-v2 .variant-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.cart-v2 .variant-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--c-bg-soft);
    color: #4f5d77;
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 6px;
    font-weight: 600;
    border: 1px solid var(--c-line);
}
.cart-v2 .variant-type-label {
    color: var(--c-brand);
    font-weight: 700;
    margin-inline-end: 4px;
}

/* Price + subtotal */
.cart-v2 .cart-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--c-ink);
    white-space: nowrap;
}
.cart-v2 .cart-subtotal-cell {
    font-size: 16px;
    font-weight: 800;
    color: var(--c-brand);
    white-space: nowrap;
}

/* Quantity stepper */
.cart-v2 .qty-stepper {
    display: inline-flex;
    align-items: center;
    height: 44px;
    background: #fff;
    border: 1.5px solid var(--c-line);
    border-radius: 10px;
    overflow: hidden;
}
.cart-v2 .qty-stepper > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 100%;
    color: var(--c-brand);
    font-size: 15px;
    transition: background .2s ease, color .2s ease;
}
.cart-v2 .qty-stepper > a:hover { background: var(--c-bg-soft); }
.cart-v2 .qty-stepper > a i { line-height: 1; }
.cart-v2 .qty-stepper .qty-val {
    width: 42px;
    height: 100%;
    border: 0;
    border-inline: 1.5px solid var(--c-line);
    border-radius: 0;
    padding: 0 !important;
    background: none;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--c-ink);
    box-shadow: none;
    box-sizing: border-box;
    -moz-appearance: textfield;
}
.cart-v2 .qty-stepper .qty-val:focus { outline: none; }
.cart-v2 .qty-stepper .qty-val::-webkit-outer-spin-button,
.cart-v2 .qty-stepper .qty-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Remove button */
.cart-v2 .cart-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--c-line);
    color: var(--c-muted);
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.cart-v2 .cart-remove:hover {
    background: #fde0e9;
    border-color: #fbccd9;
    color: #e74c3c;
}

/* Empty state */
.cart-v2 .cart-empty {
    padding: 60px 20px;
    text-align: center;
}
.cart-v2 .cart-empty i { font-size: 48px; color: #cfd6dc; }
.cart-v2 .cart-empty h4 { margin: 16px 0 20px; font-size: 20px; color: var(--c-ink); }

/* ---- Footer actions ---- */
.cart-v2 .cart-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}
.cart-v2 .cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.cart-v2 .cart-btn--ghost {
    background: #fff;
    border: 1.5px solid var(--c-line);
    color: var(--c-ink);
}
.cart-v2 .cart-btn--ghost:hover { border-color: var(--c-brand); color: var(--c-brand); }

/* ---- Totals summary ---- */
.cart-v2 .cart-summary {
    background: #fff;
    border: 1px solid var(--c-line);
    border-radius: 16px;
    box-shadow: 0 6px 24px rgba(37, 61, 78, .05);
    padding: 24px;
    position: sticky;
    top: 20px;
}
.cart-v2 .cart-summary__title {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 800;
    color: var(--c-ink);
}
.cart-v2 .cart-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
}
.cart-v2 .cart-summary__row .lbl { font-size: 14px; color: var(--c-muted); }
.cart-v2 .cart-summary__row .val { font-size: 15px; font-weight: 700; color: var(--c-ink); }
.cart-v2 .cart-summary__divider { height: 1px; background: var(--c-line); margin: 6px 0; }
.cart-v2 .cart-summary__row--total { padding-top: 14px; }
.cart-v2 .cart-summary__row--total .lbl { font-size: 16px; font-weight: 700; color: var(--c-ink); }
.cart-v2 .cart-summary__row--total .val { font-size: 22px; font-weight: 800; color: var(--c-brand); }
.cart-v2 .cart-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    margin-top: 20px;
    border-radius: 12px;
    background: var(--c-brand);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(42, 74, 17, .18);
    transition: background .2s ease, box-shadow .2s ease;
}
.cart-v2 .cart-checkout:hover { background: var(--c-brand-dark); color: #fff; box-shadow: 0 8px 22px rgba(42, 74, 17, .26); }

/* ============================================================
   MOBILE — stacked card rows (max-width: 767px)
============================================================ */
@media (max-width: 767px) {
    .cart-v2 .cart-head { margin-bottom: 18px; }
    .cart-v2 .cart-head__title { font-size: 22px; }
    .cart-v2 .cart-head__count { font-size: 13px; }
    .cart-v2 .cart-clear { font-size: 13px; }
    .cart-v2 .cart-items { border-radius: 14px; }

    .cart-v2 .cart-table thead { display: none; }
    .cart-v2 .cart-table,
    .cart-v2 .cart-table tbody,
    .cart-v2 .cart-table tr,
    .cart-v2 .cart-table td { display: block; width: 100%; }
    .cart-v2 .cart-table tbody td {
        padding: 0;
        border: 0;
    }
    .cart-v2 .cart-table tbody tr {
        padding: 16px;
        border-top: 1px solid var(--c-line);
    }
    .cart-v2 .cart-table tbody tr:first-child { border-top: 0; }

    /* Product block */
    .cart-v2 .cart-product {
        min-width: 0;
        gap: 12px;
        align-items: flex-start;
    }
    .cart-v2 .cart-product__thumb { width: 68px; height: 68px; }
    .cart-v2 .cart-product__name { font-size: 14px; margin-bottom: 4px; }
    .cart-v2 .variant-badge { font-size: 10px; padding: 2px 7px; }
    .cart-v2 .cart-rating { margin-top: 4px; }

    /* Labeled meta rows */
    .cart-v2 .cart-cell-price,
    .cart-v2 .cart-cell-qty,
    .cart-v2 .cart-cell-subtotal {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed var(--c-line);
    }
    .cart-v2 .cart-cell-price { margin-top: 14px; }
    .cart-v2 .cart-cell-price::before,
    .cart-v2 .cart-cell-qty::before,
    .cart-v2 .cart-cell-subtotal::before {
        content: attr(data-label);
        font-size: 13px;
        font-weight: 600;
        color: var(--c-muted);
    }
    .cart-v2 .cart-price { font-size: 14px; }
    .cart-v2 .cart-subtotal-cell { font-size: 15px; }
    .cart-v2 .qty-stepper { height: 40px; }
    .cart-v2 .qty-stepper > a { width: 34px; }
    .cart-v2 .qty-stepper .qty-val { width: 38px; }

    /* Remove — full-width action below, no overlap */
    .cart-v2 .cart-cell-remove {
        display: block !important;
        text-align: center;
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--c-line);
    }
    .cart-v2 .cart-remove {
        width: 100%;
        height: 40px;
        gap: 8px;
    }
    .cart-v2 .cart-remove::after {
        content: attr(data-label);
        font-size: 13px;
        font-weight: 600;
    }

    .cart-v2 .cart-summary { position: static; margin-top: 24px; padding: 20px; }
    .cart-v2 .cart-actions { margin-top: 16px; }
    .cart-v2 .cart-actions .cart-btn { flex: 1; }
}
