/* ================================================================
   WOOCOMMERCE CUSTOM CART — cart-style.css
   Font: Playfair Display (headings) + DM Sans (body)
   Primary: #c0392b  |  Dark: #1a1a1a  |  Muted: #777
   ================================================================ */

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --red:        #c0392b;
    --red-light:  #fdf2f1;
    --red-dark:   #96281b;
    --dark:       #1a1a1a;
    --mid:        #444;
    --muted:      #888;
    --border:     #e8e8e8;
    --bg:         #f4f4f2;
    --white:      #ffffff;
    --radius:     12px;
    --radius-sm:  8px;
    --shadow-sm:  0 2px 12px rgba(0,0,0,.06);
    --shadow-md:  0 4px 24px rgba(0,0,0,.09);
    --transition: 0.22s cubic-bezier(.4,0,.2,1);
    --font-body:  'DM Sans', 'Helvetica Neue', sans-serif;
    --font-head:  'Playfair Display', Georgia, serif;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ---- STEPS BAR ---- */
.cart-steps-bar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0;
}

.steps-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    gap: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: #999;
    transition: var(--transition);
    font-family: var(--font-body);
}

.step.active .step-circle {
    background: var(--red);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(192,57,43,.35);
}

.step-label {
    font-size: 11px;
    font-weight: 500;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: .06em;
    white-space: nowrap;
}

.step.active .step-label {
    color: var(--red);
    font-weight: 600;
}

.step-line {
    flex: 1;
    height: 1px;
    background: var(--border);
    margin: 0 12px;
    margin-bottom: 22px; /* offset for label gap */
    max-width: 120px;
}

/* ---- CONTAINER ---- */
.wc-cart-page {
    min-height: 100vh;
}

.cart-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 32px 80px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
}

/* ---- CART LEFT ---- */
.cart-left {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- CART HEADING ---- */
.cart-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.heading-accent {
    width: 4px;
    height: 52px;
    background: var(--red);
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 4px;
}

.cart-title {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--dark);
    line-height: 1.1;
    text-transform: uppercase;
}

.cart-subtitle {
    font-size: 13.5px;
    color: var(--muted);
    font-weight: 400;
    margin-top: 5px;
}

/* ---- CART ITEMS CARD ---- */
.cart-items-list {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* ---- INDIVIDUAL CART ITEM ---- */
.cart-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    padding: 24px 24px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: background var(--transition);
    position: relative;
}

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

.cart-item:hover { background: #fafafa; }

/* Item removing animation */
.cart-item.removing {
    animation: itemRemove 0.38s ease forwards;
}

@keyframes itemRemove {
    0%   { opacity: 1; transform: translateX(0) scaleY(1); max-height: 200px; }
    40%  { opacity: 0; transform: translateX(24px) scaleY(.98); }
    100% { opacity: 0; transform: translateX(24px) scaleY(0); max-height: 0; padding: 0; border: 0; }
}

/* Image */
.item-image-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    display: block;
    border: 1px solid var(--border);
}

.item-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: var(--red);
    color: var(--white);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    padding: 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Details */
.item-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 8px;
}

.item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    letter-spacing: -.01em;
    line-height: 1.3;
}

.item-meta {
    font-size: 12.5px;
    color: var(--muted);
    font-weight: 400;
}

.item-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.price-current {
    font-size: 17px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -.01em;
}

.price-old {
    font-size: 13px;
    color: #bbb;
    text-decoration: line-through;
    font-weight: 400;
}

.price-savings {
    font-size: 11px;
    color: var(--red);
    background: var(--red-light);
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 600;
}

/* Actions */
.item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* Quantity Control */
.qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--mid);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
    font-family: var(--font-body);
    line-height: 1;
}

.qty-btn:hover { background: #f0f0f0; color: var(--dark); }
.qty-btn:active { background: #e8e8e8; }

.qty-input {
    width: 40px;
    height: 36px;
    border: none;
    border-left: 1.5px solid var(--border);
    border-right: 1.5px solid var(--border);
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    font-family: var(--font-body);
    -moz-appearance: textfield;
    background: var(--white);
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* Item subtotal */
.item-subtotal {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -.01em;
    transition: color .2s;
}

.item-subtotal.updating {
    color: var(--muted);
}

/* Remove button */
.remove-item {
    background: none;
    border: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    border-radius: 50%;
    transition: background var(--transition), color var(--transition), transform .15s;
    padding: 0;
}

.remove-item svg { width: 17px; height: 17px; }

.remove-item:hover {
    background: var(--red-light);
    color: var(--red);
    transform: scale(1.1);
}

/* ---- EMPTY CART ---- */
.cart-empty {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    padding: 60px 24px;
}

.empty-icon svg {
    width: 60px;
    height: 60px;
    color: #ccc;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 17px;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 20px;
}

.btn-continue {
    display: inline-block;
    padding: 12px 28px;
    background: var(--dark);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: background var(--transition);
}

.btn-continue:hover { background: #333; }

/* ---- COUPON ROW ---- */
.coupon-row {
    margin-top: 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.coupon-toggle {
    width: 100%;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--mid);
    font-family: var(--font-body);
    transition: color var(--transition);
}

.coupon-toggle:hover { color: var(--dark); }

.coupon-arrow {
    margin-left: auto;
    font-size: 18px;
    transition: transform var(--transition);
    line-height: 1;
}

.coupon-toggle.open .coupon-arrow { transform: rotate(90deg); }

.coupon-form {
    display: none;
    padding: 0 20px 16px;
    gap: 10px;
    align-items: center;
}

.coupon-form.open { display: flex; }

.coupon-input {
    flex: 1;
    height: 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    font-size: 13.5px;
    font-family: var(--font-body);
    color: var(--dark);
    outline: none;
    transition: border-color var(--transition);
}

.coupon-input:focus { border-color: var(--dark); }

.coupon-apply {
    height: 42px;
    padding: 0 20px;
    background: var(--dark);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background var(--transition);
    white-space: nowrap;
}

.coupon-apply:hover { background: #333; }

.coupon-msg {
    padding: 0 20px;
    font-size: 12.5px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.coupon-msg.success { color: #2e7d32; }
.coupon-msg.error   { color: var(--red); }

/* ---- ORDER SUMMARY CARD ---- */
.cart-right { position: relative; }

.order-summary-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 28px;
}

.summary-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 22px;
}

.summary-title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
}

.summary-count {
    font-size: 12px;
    color: var(--muted);
    background: #f0f0f0;
    padding: 3px 9px;
    border-radius: 20px;
}

/* Line items */
.summary-lines {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.line-label {
    font-size: 13.5px;
    color: var(--muted);
    font-weight: 400;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.line-hint {
    font-size: 11px;
    color: #bbb;
    font-weight: 400;
}

.line-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
    transition: color .2s;
}

.discount-line .line-value { color: #2e7d32; }

.summary-divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0;
}

/* Total row */
.summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.total-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
}

.total-value {
    font-family: var(--font-head);
    font-size: 26px;
    font-weight: 800;
    color: var(--red);
    letter-spacing: -.02em;
    transition: color .2s;
}

/* Savings callout */
.savings-callout {
    background: #f0faf1;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    font-size: 12px;
    font-weight: 500;
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 20px;
}

/* CTA Button */
.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: var(--dark);
    color: var(--white);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius-sm);
    letter-spacing: .01em;
    transition: background var(--transition), transform .15s, box-shadow .15s;
    cursor: pointer;
    border: none;
    font-family: var(--font-body);
    position: relative;
    overflow: hidden;
}

.btn-checkout::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.1) 0%, transparent 60%);
    pointer-events: none;
}

.btn-checkout:hover {
    background: #2a2a2a;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
}

.btn-checkout:active { transform: translateY(0); box-shadow: none; }

/* Payment icons */
.payment-icons {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 14px 0 10px;
    flex-wrap: wrap;
}

.pay-icon {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1.5px solid var(--border);
    color: var(--muted);
    background: #fafafa;
}

.pay-icon.visa  { color: #1a1f71; border-color: #c0c4d8; }
.pay-icon.mc    { color: #eb001b; border-color: #f0b8bb; }
.pay-icon.upi   { color: #5a0a9e; border-color: #d4b8f0; }

/* Security note */
.security-note {
    font-size: 11.5px;
    color: var(--muted);
    text-align: center;
    padding: 11px 10px;
    background: #f8f8f8;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* Return note */
.return-note {
    font-size: 11.5px;
    color: var(--muted);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* ---- TOAST NOTIFICATION ---- */
.wc-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--dark);
    color: var(--white);
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 8px 28px rgba(0,0,0,.22);
    z-index: 9999;
    transform: translateY(20px);
    opacity: 0;
    transition: transform .3s ease, opacity .3s ease;
    max-width: 300px;
}

.wc-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ---- LOADING SPINNER on qty update ---- */
.qty-updating .qty-input {
    color: transparent;
    position: relative;
}

/* ================================================================
   RESPONSIVE STYLES
   ================================================================ */

/* Tablet (≤960px) */
@media (max-width: 960px) {
    .cart-container {
        grid-template-columns: 1fr 300px;
        gap: 20px;
        padding: 28px 24px 60px;
    }

    .cart-title { font-size: 24px; }
    .item-image-wrap { width: 86px; height: 86px; }
    .cart-item { gap: 14px; padding: 18px; }
}

/* Mobile (≤680px) */
@media (max-width: 680px) {
    .cart-container {
        grid-template-columns: 1fr;
        padding: 20px 16px 60px;
    }

    .cart-right { order: 2; }
    .cart-left  { order: 1; }

    .order-summary-card {
        position: static;
        margin-top: 0;
    }

    .cart-item {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        padding: 16px;
    }

    .item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    .remove-item {
        position: static;
        margin-left: auto;
    }

    .item-image-wrap { width: 80px; height: 80px; }
    .cart-title { font-size: 22px; }
    .steps-inner { padding: 16px; }
    .step-line { max-width: 60px; }
}

/* Very small (≤380px) */
@media (max-width: 380px) {
    .item-actions { flex-wrap: wrap; gap: 10px; }
    .item-name { font-size: 14px; }
    .price-current { font-size: 15px; }
}