/* ===== Custom Cart Shortcode — cart.css v1.3 ===== */

/* ── Font assignments ── */
.ccs-wrap h1, .ccs-wrap h2, .ccs-wrap h3, .ccs-wrap h4,
.ccs-wrap .ccs-summary-title,
.ccs-wrap .ccs-header span,
.ccs-wrap .ccs-name,
.ccs-wrap .ccs-checkout-btn {
    font-family: 'Brice', 'Georgia', serif !important;
}
.ccs-wrap,
.ccs-wrap p, .ccs-wrap span, .ccs-wrap input,
.ccs-wrap button, .ccs-wrap a, .ccs-wrap strong, .ccs-wrap label {
    font-family: 'Galano Grotesque', 'Galano', 'Nunito Sans', sans-serif !important;
}

/* ── Reset ── */
.ccs-wrap *, .ccs-wrap *::before, .ccs-wrap *::after { box-sizing: border-box; }

/* ══════════════════════════════
   LAYOUT — desktop two-column
══════════════════════════════ */
.ccs-wrap {
    display: grid;
    grid-template-columns: 1fr 340px;
    grid-template-areas: "table sidebar";
    gap: 24px;
    align-items: start;
    padding: 20px 0;
    width: 100%;
}

/* ══════════════════════════════
   RESPONSIVE — single column
══════════════════════════════ */
@media (max-width: 960px) {
    .ccs-wrap {
        grid-template-columns: 1fr;
        grid-template-areas:
            "table"
            "sidebar";
        gap: 16px;
    }
    .ccs-sidebar {
        position: static !important; /* remove sticky on mobile */
        width: 100%;
    }
    /* Stack header columns nicely on tablet */
    .ccs-header {
        display: none !important; /* hide header row on small screens */
    }
    .ccs-item {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        gap: 8px !important;
        padding: 14px 0 !important;
    }
    .ccs-product  { grid-column: 1 / -1; }
    .ccs-price-col { grid-column: 1; }
    .ccs-qty-ctrl  { grid-column: 2; justify-self: end; }
    .ccs-subtotal-col { grid-column: 1; }
    .ccs-del       { grid-column: 2; justify-self: end; align-self: center; }
}

@media (max-width: 480px) {
    .ccs-table  { padding: 14px !important; }
    .ccs-summary-card { padding: 16px !important; }
    .ccs-item {
        grid-template-columns: 1fr auto !important;
    }
    .ccs-img-wrap,
    .ccs-img-wrap img { width: 60px !important; height: 50px !important; }
}

/* ══════════════════════════════
   LEFT PANEL
══════════════════════════════ */
.ccs-table {
    grid-area: table;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    overflow-x: auto; /* safety scroll on tiny screens */
    min-width: 0;
}

.ccs-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 1fr 44px;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e8e8e8;
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
}

.ccs-empty { padding: 32px 0; color: #888; font-size: 15px; }
.ccs-empty a { color: #1a3a8f; font-weight: 600; margin-left: 8px; text-decoration: none; }

/* Cart row */
.ccs-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 1fr 44px;
    gap: 12px;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: opacity 0.3s;
    min-width: 0;
}
.ccs-item:last-child { border-bottom: none; }
.ccs-item.ccs-loading { opacity: 0.4; pointer-events: none; }

/* Product cell */
.ccs-product { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ccs-img-wrap {
    width: 80px; height: 64px;
    border-radius: 10px; overflow: hidden;
    flex-shrink: 0; background: #f5f5f5;
}
.ccs-img-wrap img.ccs-thumb,
.ccs-img-wrap img {
    width: 80px; height: 64px;
    object-fit: cover; display: block;
}
.ccs-name {
    font-weight: 700; font-size: 14px;
    color: #1a1a2e; line-height: 1.4;
    word-break: break-word;
}

/* Price / subtotal */
.ccs-price-col, .ccs-subtotal-col { display: flex; flex-direction: column; gap: 2px; }
.ccs-price-current, .ccs-sub-current { color: #1a3a8f; font-weight: 700; font-size: 15px; }
.ccs-price-old, .ccs-sub-old { color: #aaa; text-decoration: line-through; font-size: 13px; }

/* Qty control */
.ccs-qty-ctrl {
    display: inline-flex; align-items: center;
    border: 1.5px solid #e0e0e8; border-radius: 8px;
    overflow: hidden; background: #fff;
    flex-shrink: 0;
}
.ccs-qty-btn {
    width: 32px; height: 34px; border: none;
    background: #fff; color: #1a3a8f;
    font-size: 20px; font-weight: 700; line-height: 1;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: background 0.15s; padding: 0;
}
.ccs-qty-btn:hover { background: #f0f4ff; }
.ccs-qty-val {
    width: 48px; height: 34px; text-align: center;
    border: none;
    border-left: 1.5px solid #e0e0e8;
    border-right: 1.5px solid #e0e0e8;
    font-size: 14px; font-weight: 600; color: #1a1a2e;
    background: #fff; -moz-appearance: textfield; outline: none;
}
.ccs-qty-val::-webkit-inner-spin-button,
.ccs-qty-val::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* Delete */
.ccs-del {
    width: 36px; height: 36px;
    border: 1.5px solid #e0e0e8; border-radius: 8px;
    background: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #888; padding: 0;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.ccs-del:hover { border-color: #e24b4a; color: #e24b4a; background: #fff5f5; }

/* ══════════════════════════════
   RIGHT SIDEBAR
══════════════════════════════ */
.ccs-sidebar {
    grid-area: sidebar;
    display: flex; flex-direction: column; gap: 16px;
    position: sticky; top: 20px;
    min-width: 0;
}

.ccs-summary-card {
    background: #fff; border-radius: 16px;
    padding: 22px; box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.ccs-summary-title {
    font-size: 16px !important; font-weight: 800 !important;
    color: #1a3a8f !important; text-align: center;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin: 0 0 16px 0 !important; padding: 0 !important; border: none !important;
}

/* Promo */
.ccs-promo-row { display: flex; gap: 8px; margin-bottom: 6px; }
.ccs-promo-input {
    flex: 1; min-width: 0;
    border: 1.5px solid #e0e0e8 !important;
    border-radius: 8px !important; padding: 9px 12px !important;
    font-size: 14px !important; outline: none !important;
    box-shadow: none !important; transition: border-color 0.15s;
    background: #fff !important; color: #333 !important;
}
.ccs-promo-input:focus { border-color: #1a3a8f !important; }
.ccs-apply-btn {
    background: #fff !important; border: 2px solid #1a3a8f !important;
    color: #1a3a8f !important; font-weight: 700 !important;
    font-size: 14px !important; border-radius: 8px !important;
    padding: 9px 16px !important; cursor: pointer; white-space: nowrap;
    transition: background 0.15s, color 0.15s; flex-shrink: 0;
}
.ccs-apply-btn:hover,
.ccs-apply-btn:disabled { background: #1a3a8f !important; color: #fff !important; }

.ccs-promo-msg { font-size: 13px; min-height: 18px; margin: 0 0 8px 0 !important; }
.ccs-msg-err   { color: #e24b4a; }
.ccs-msg-ok    { color: #1a9e5a; font-weight: 600; }
.ccs-coupon-ok { color: #1a9e5a; font-size: 13px; margin-bottom: 8px; }

/* Summary rows */
.ccs-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; font-size: 14px; color: #444;
    border-bottom: 1px solid #f5f5f5;
}
.ccs-row:last-of-type { border-bottom: none; }
.ccs-row-total {
    font-size: 15px !important; color: #1a1a2e !important;
    padding-top: 12px !important; margin-top: 6px;
    border-top: 2px solid #f0f0f0 !important; border-bottom: none !important;
}
.ccs-save { color: #e24b4a; font-weight: 700; }

/* Checkout button */
.ccs-checkout-btn {
    display: flex !important; align-items: center !important;
    justify-content: center !important; gap: 8px;
    width: 100% !important; background: #e85d1a !important;
    border: none !important; color: #fff !important;
    font-size: 17px !important; font-weight: 700 !important;
    border-radius: 10px !important; padding: 14px !important;
    cursor: pointer; text-decoration: none !important;
    margin-top: 14px; transition: background 0.15s;
    letter-spacing: 0.02em;
}
.ccs-checkout-btn:hover { background: #c94b10 !important; color: #fff !important; }

/* Elementor block */
.ccs-elementor-block { width: 100%; min-width: 0; }
.ccs-elementor-block > .elementor:first-child { margin-top: 0 !important; padding-top: 0 !important; }
