/* ═══════════════════════════════════════════════════════════════
   Cart  (ca-)  — faithful translation of fr-cart.jsx
   ═══════════════════════════════════════════════════════════════ */

/* ── Nav override: dark green + sticky ── */
body:has(.ca-page) .nh-header,
body:has(.ca-loading) .nh-header {
    background: #0B3D2E !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 200 !important;
}
body:has(.ca-page) main,
body:has(.ca-loading) main { padding-top: 0 !important; }

/* ── Page wrapper ── */
.ca-page {
    background: #F8FAFC;
    min-height: 60vh;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    color: #0F172A;
    padding-bottom: 80px;
}
.ca-page, .ca-page * { box-sizing: border-box; }

/* ── Loading ── */
.ca-loading {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 15px;
    color: #64748B;
    background: #F8FAFC;
}

/* ── Title bar ── */
.ca-topbar {
    max-width: 1240px;
    margin: 0 auto;
    padding: 30px 40px 24px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
}
.ca-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.025em;
    margin: 0;
    color: #0F172A;
}
.ca-count {
    font-size: 20px;
    font-weight: 500;
    color: #64748B;
    letter-spacing: 0;
}
.ca-continue-link {
    font-size: 14px;
    font-weight: 600;
    color: #10B981;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.ca-continue-link:hover { color: #0B3D2E; }

/* ── Two-column layout ── */
.ca-layout {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: flex-start;
}

/* ── Items card ── */
.ca-items-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 4px 24px 16px;
}

/* ── Line item ── */
.ca-line {
    display: grid;
    grid-template-columns: 104px 1fr auto;
    gap: 18px;
    padding: 20px 0;
    border-bottom: 1px solid #E2E8F0;
}

/* Image */
.ca-line-img {
    width: 104px;
    height: 104px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #E2E8F0;
    flex-shrink: 0;
    background: #F8FAFC;
}
.ca-line-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ca-line-img-placeholder {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        rgba(16,185,129,.05) 0 9px,
        rgba(16,185,129,.10) 9px 18px
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Info */
.ca-line-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}
.ca-line-meta {
    display: flex;
    align-items: center;
    gap: 7px;
}
.ca-line-brand {
    font-size: 11.5px;
    color: #64748B;
    font-weight: 500;
}
.ca-line-oem {
    font-size: 11px;
    color: #64748B;
    opacity: .6;
    font-family: 'Geist Mono',ui-monospace,monospace;
    letter-spacing: .04em;
}
.ca-line-name {
    font-size: 16px;
    font-weight: 600;
    color: #0F172A;
    text-decoration: none;
    letter-spacing: -.01em;
    line-height: 1.3;
}
.ca-line-name:hover { color: #0B3D2E; }
.ca-line-sub {
    font-size: 12px;
    color: #64748B;
}
.ca-line-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    padding-top: 8px;
}

/* Qty stepper */
.ca-qty-ctrl {
    display: inline-flex;
    align-items: center;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.ca-qty-btn {
    width: 36px;
    height: 38px;
    border: none;
    background: transparent;
    font-size: 17px;
    color: #0F172A;
    cursor: pointer;
    font-family: inherit;
    transition: background .1s;
}
.ca-qty-btn:hover { background: #F8FAFC; }
.ca-qty-val {
    width: 34px;
    text-align: center;
    font-size: 14.5px;
    font-weight: 600;
    color: #0F172A;
}

/* Action buttons (Save / Remove) */
.ca-action-btn {
    border: none;
    background: none;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    color: #DC2626;
    font-weight: 500;
    transition: opacity .12s;
}
.ca-action-btn:hover { opacity: .75; }

/* Price column */
.ca-line-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}
.ca-line-total {
    font-size: 20px;
    font-weight: 700;
    color: #0B3D2E;
    letter-spacing: -.01em;
}
.ca-line-unit {
    font-size: 12px;
    color: #64748B;
}

/* Trust footer inside card */
.ca-items-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 18px;
    font-size: 13px;
    color: #64748B;
}

/* ── Sidebar (sticky) ── */
.ca-sidebar {
    position: sticky;
    top: calc(68px + 20px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Summary card */
.ca-summary-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 24px;
}
.ca-summary-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 18px;
    letter-spacing: -.01em;
    color: #0F172A;
}
.ca-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
}
.ca-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ca-summary-row span:first-child { color: #64748B; }
.ca-summary-row span:last-child  { font-weight: 600; color: #0F172A; }
.ca-free { color: #16A34A !important; }
.ca-shipping-nudge {
    font-size: 12px;
    color: #64748B;
    margin-top: -2px;
}

/* Total row */
.ca-summary-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid #E2E8F0;
    margin-top: 18px;
    padding-top: 18px;
}
.ca-total-label {
    font-size: 16px;
    font-weight: 600;
    color: #0F172A;
}
.ca-ttc {
    font-size: 12px;
    color: #64748B;
    font-weight: 400;
    margin-left: 4px;
}
.ca-total-amount {
    font-size: 28px;
    font-weight: 700;
    color: #0B3D2E;
    letter-spacing: -.02em;
}

/* Promo code */
.ca-promo-row {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}
.ca-promo-input {
    flex: 1;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 11px 13px;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 13.5px;
    color: #0F172A;
    outline: none;
    transition: border-color .12s;
}
.ca-promo-input:focus { border-color: #10B981; }
.ca-promo-btn {
    border: 1px solid #E2E8F0;
    background: #fff;
    border-radius: 12px;
    padding: 0 16px;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    color: #0F172A;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color .12s;
}
.ca-promo-btn:hover { border-color: #10B981; }
.ca-promo-success {
    font-size: 12px;
    color: #16A34A;
    font-weight: 600;
    margin-top: 8px;
}

/* Checkout button */
.ca-checkout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 18px;
    padding: 16px;
    background: linear-gradient(135deg, #10B981 0%, #047857 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Geist','Inter',system-ui,sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 12px 28px -12px rgba(16,185,129,.6);
    transition: opacity .15s;
}
.ca-checkout-btn:hover { opacity: .92; color: #fff; }

/* Payment logos */
.ca-payment-logos {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    opacity: .7;
}
.ca-payment-logo {
    font-size: 10px;
    font-weight: 700;
    color: #64748B;
    border: 1px solid #E2E8F0;
    border-radius: 5px;
    padding: 4px 7px;
    letter-spacing: .02em;
}

/* Trust list below summary */
.ca-trust-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ca-trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #64748B;
}

/* ── Empty state ── */
.ca-empty {
    max-width: 900px;
    margin: 40px auto 0;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 70px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}
.ca-empty-icon { opacity: .5; }
.ca-empty h3 {
    font-size: 20px;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
}
.ca-empty p {
    font-size: 14px;
    color: #64748B;
    margin: 0;
}
.ca-empty-btn {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 13px 22px;
    background: #0B3D2E;
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background .15s;
}
.ca-empty-btn:hover { background: #14532D; color: #fff; }

/* ── Suggestions ── */
.ca-suggestions {
    max-width: 1240px;
    margin: 56px auto 0;
    padding: 0 40px;
}
.ca-suggestions-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 20px;
    color: #0F172A;
}
.ca-suggestions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.ca-sugg-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: border-color .15s, box-shadow .15s;
}
.ca-sugg-card:hover { border-color: #10B981; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.ca-sugg-img {
    aspect-ratio: 4/3;
    overflow: hidden;
    border-bottom: 1px solid #E2E8F0;
    position: relative;
}
.ca-sugg-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.ca-sugg-card:hover .ca-sugg-img img { transform: scale(1.04); }
.ca-sugg-stripe {
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        rgba(16,185,129,.05) 0 9px,
        rgba(16,185,129,.10) 9px 18px
    );
    display: flex;
    align-items: center;
    justify-content: center;
}
.ca-sugg-body {
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.ca-sugg-brand { font-size: 11.5px; color: #64748B; }
.ca-sugg-name  {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #0F172A;
    line-height: 1.3;
    letter-spacing: -.01em;
}
.ca-sugg-price {
    font-size: 20px;
    font-weight: 700;
    color: #0B3D2E;
    letter-spacing: -.02em;
    margin-top: 4px;
}

/* ── Responsive ── */
@media (max-width: 1040px) {
    .ca-layout { grid-template-columns: 1fr; gap: 24px; }
    .ca-sidebar { position: static; }
    .ca-suggestions-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 768px) {
    .ca-topbar { padding: 20px 16px 18px; flex-wrap: wrap; gap: 10px; }
    .ca-title { font-size: 24px; }
    .ca-layout { padding: 0 16px; }
    .ca-suggestions { padding: 0 16px; margin-top: 32px; }
    .ca-suggestions-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
    .ca-empty { margin: 20px 16px 0; padding: 48px 20px; max-width: none; }
    .ca-line { grid-template-columns: 84px 1fr; }
    .ca-line-price { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
    .ca-line-info { grid-column: 2; }
    .ca-line-img { width: 84px; height: 84px; }
    .ca-total-amount { font-size: 24px; }
}
@media (max-width: 480px) {
    .ca-suggestions-grid { grid-template-columns: 1fr; }
    .ca-line-name { font-size: 14.5px; }
}
