/* ═══════════════════════════════════════════════════════════════
   SupplySolution — Cart Page
   Clean, professional B2B cart
   ═══════════════════════════════════════════════════════════════ */

/* ── Page title ───────────────────────────────────────────────── */
.checkout-cart-index .page-title-wrapper { display: none; }

/* ── Cart form wrapper ────────────────────────────────────────── */
.ss-cart-form { max-width: 100%; }

/* ── Header ───────────────────────────────────────────────────── */
.ss-cart-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 0 16px;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 0;
}
.ss-cart-title {
    font-family: var(--ss-font);
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ss-cart-title svg { color: var(--ss-blue); }
.ss-cart-count {
    font-family: var(--ss-mono);
    font-size: 1.2rem;
    font-weight: 600;
    color: #6b7280;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 999px;
}

/* ── Column labels ────────────────────────────────────────────── */
.ss-cart-cols-label {
    display: grid;
    grid-template-columns: 1fr 140px 110px 140px 48px;
    gap: 16px;
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--ss-border);
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--ss-ink-3);
}
.ss-cart-col-label--price,
.ss-cart-col-label--qty,
.ss-cart-col-label--subtotal { text-align: center; }
@media (max-width: 768px) { .ss-cart-cols-label { display: none; } }

/* ── Items container ──────────────────────────────────────────── */
.ss-cart-items {
    border: 1px solid var(--ss-border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: var(--ss-white);
}

/* ── Single item row ──────────────────────────────────────────── */
.ss-cart-item {
    display: grid;
    grid-template-columns: 88px 1fr 140px 110px 140px 48px;
    gap: 16px;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}
.ss-cart-item:last-child { border-bottom: none; }
.ss-cart-item:hover { background: #fafbfc; }
@media (max-width: 900px) {
    .ss-cart-item {
        grid-template-columns: 72px 1fr 80px;
        grid-template-rows: auto auto auto;
        gap: 10px;
    }
    .ss-cart-item__price,
    .ss-cart-item__qty,
    .ss-cart-item__subtotal { grid-column: 2; }
    .ss-cart-item__remove-wrap { grid-column: 3; grid-row: 1; justify-self: end; }
}

/* ── Product image ────────────────────────────────────────────── */
.ss-cart-item__img-wrap {
    width: 88px;
    height: 88px;
    border-radius: 8px;
    border: 1px solid var(--ss-border);
    overflow: hidden;
    background: #f8fafc;
    flex-shrink: 0;
}
.ss-cart-item__img-link { display: block; width: 100%; height: 100%; }
.ss-cart-item__img-wrap img,
.ss-cart-item__img-wrap .product-image-container,
.ss-cart-item__img-wrap .product-image-wrapper {
    width: 100%;
    height: 100%;
    padding: 0;
    object-fit: contain;
}
.ss-cart-item__img-wrap img { padding: 8px; }
@media (max-width: 900px) {
    .ss-cart-item__img-wrap { width: 72px; height: 72px; grid-row: 1 / span 2; }
}

/* ── Item info ────────────────────────────────────────────────── */
.ss-cart-item__sku {
    font-family: var(--ss-mono);
    font-size: 1rem;
    color: var(--ss-ink-3);
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.ss-cart-item__name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ss-cart-item__name-link,
.ss-cart-item__name-link:visited { color: #0f172a; text-decoration: none; }
.ss-cart-item__name-link:hover { color: var(--ss-blue); }

.ss-cart-item__options {
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
    margin: 6px 0 0;
    font-size: 1.1rem;
    color: #6b7280;
}
.ss-cart-item__options dt { font-weight: 600; }
.ss-cart-item__options dt::after { content: ':'; margin-right: 3px; }

.ss-cart-item__msg {
    font-size: 1.1rem;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 6px;
}
.ss-cart-item__msg--error   { background: #fee2e2; color: #991b1b; }
.ss-cart-item__msg--notice  { background: #fef3c7; color: #92400e; }
.ss-cart-item__msg--success { background: #d1fae5; color: #065f46; }

/* ── Prices ───────────────────────────────────────────────────── */
.ss-cart-item__price,
.ss-cart-item__subtotal {
    text-align: center;
}
.ss-cart-item__price .price,
.ss-cart-item__subtotal .price {
    font-family: var(--ss-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
}
.ss-cart-item__subtotal .price { color: var(--ss-blue); }
.ss-cart-item__price .price-label,
.ss-cart-item__subtotal .price-label { display: none; }

/* ── Qty input ────────────────────────────────────────────────── */
.ss-cart-item__qty { display: flex; justify-content: center; }
.ss-cart-item__qty-input {
    width: 68px;
    padding: 7px 8px;
    text-align: center;
    border: 1.5px solid var(--ss-border);
    border-radius: 8px;
    font-family: var(--ss-mono);
    font-size: 1.3rem;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    transition: border-color .15s;
    -moz-appearance: textfield;
}
.ss-cart-item__qty-input:focus { border-color: var(--ss-blue); box-shadow: 0 0 0 3px rgba(0,102,204,.1); }
.ss-cart-item__qty-input::-webkit-inner-spin-button,
.ss-cart-item__qty-input::-webkit-outer-spin-button { opacity: 1; }

/* ── Icon buttons (remove / edit) ────────────────────────────── */
.ss-cart-item__remove-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Suppress any remaining raw action links (wishlist, etc.) */
.ss-cart-item__remove-wrap .action.towishlist,
.ss-cart-item__remove-wrap .action-towishlist,
.ss-cart-item__remove-wrap span:not([class]),
.ss-cart-item__remove-wrap .actions-toolbar { display: none !important; }
/* Remove — trash icon (extends shared base) */
.ss-cart-item__remove,
a.ss-cart-item__remove {
    text-indent: -9999px;
    white-space: nowrap;
    overflow: hidden;
}
.ss-cart-item__remove::before,
a.ss-cart-item__remove::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 15px;
    height: 15px;
    background: var(--ss-ink-3);
    transition: background .15s;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3C/svg%3E") center/contain no-repeat;
}
/* Remove needs the base box styles since it doesn't extend .ss-cart-item__icon-btn */
.ss-cart-item__remove,
a.ss-cart-item__remove {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid var(--ss-border);
    background: var(--ss-white);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    flex-shrink: 0;
}
.ss-cart-item__remove:hover::before,
a.ss-cart-item__remove:hover::before { background: var(--ss-red); }
.ss-cart-item__remove:hover,
a.ss-cart-item__remove:hover { background: #fee2e2; border-color: #fca5a5; }

/* ── Icon buttons shared base ─────────────────────────────────── */
.ss-cart-item__icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1.5px solid var(--ss-border);
    background: var(--ss-white);
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s;
    overflow: hidden;
    flex-shrink: 0;
    /* Push any text content off-screen */
    text-indent: -9999px;
    white-space: nowrap;
}
/* Pseudo-element carries the SVG icon */
.ss-cart-item__icon-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 15px;
    height: 15px;
    background: var(--ss-ink-3);
    transition: background .15s;
    flex-shrink: 0;
}

/* Edit — pencil icon */
.ss-cart-item__icon-btn--edit::before {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.ss-cart-item__icon-btn--edit:hover { background: #e8f0fe; border-color: #93c5fd; }
.ss-cart-item__icon-btn--edit:hover::before { background: var(--ss-blue); }

/* ── Cart footer actions ──────────────────────────────────────── */
.ss-cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 0;
}
.ss-cart-actions__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.ss-cart-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--ss-font);
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.ss-cart-btn--ghost {
    background: #f8fafc;
    color: #374151;
    border: 1.5px solid var(--ss-border);
}
.ss-cart-btn--ghost:hover { background: #f1f5f9; border-color: #cbd5e1; color: #0f172a; }

.ss-cart-btn--update {
    background: #f0fdf4;
    color: #166534;
    border: 1.5px solid #86efac;
}
.ss-cart-btn--update:hover { background: #dcfce7; border-color: #4ade80; }

.ss-cart-btn--danger {
    background: var(--ss-white);
    color: var(--ss-ink-3);
    border: 1.5px solid var(--ss-border);
    font-size: 1.2rem;
}
.ss-cart-btn--danger:hover { background: #fee2e2; color: var(--ss-red); border-color: #fca5a5; }

/* ── Totals sidebar ───────────────────────────────────────────── */
.cart-summary {
    background: var(--ss-white);
    border: 1px solid var(--ss-border);
    border-radius: 12px;
    padding: 24px;
    position: sticky;
    top: 20px;
}
.cart-summary > .title {
    font-family: var(--ss-font);
    font-size: 1.4rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7280;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 16px;
    display: block;
}

/* Totals rows (KO rendered) */
.cart-totals .table-caption { display: none; }
.cart-totals .totals th,
.cart-totals .totals td {
    font-size: 1.3rem;
    padding: 6px 0;
    color: #374151;
    border: none;
    background: transparent;
}
.cart-totals .totals th { font-weight: 600; color: #6b7280; }
.cart-totals .totals td { text-align: right; }
.cart-totals .totals td .price {
    font-family: var(--ss-mono);
    font-weight: 700;
    color: #0f172a;
}
.cart-totals .grand .mark,
.cart-totals .grand .amount {
    border-top: 2px solid #0f172a;
    padding-top: 12px;
    margin-top: 6px;
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
}
.cart-totals .grand .amount .price {
    font-size: 1.8rem;
    color: var(--ss-blue);
}

/* Checkout button */
.checkout-methods-items { padding: 0; margin: 16px 0 0; list-style: none; }
.checkout-methods-items .action.primary.checkout,
.checkout-methods-items .action.checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--ss-blue);
    color: var(--ss-white);
    border: none;
    border-radius: 8px;
    font-family: var(--ss-font);
    font-size: 16px;
    font-weight: 800;
    line-height: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
    letter-spacing: -.2px;
}
.checkout-methods-items .action.primary.checkout:hover,
.checkout-methods-items .action.checkout:hover { background: var(--ss-blue-dk); }
.checkout-methods-items .action.primary.checkout::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}

/* Coupon block */
.block.discount { margin-top: 20px; }
.block.discount .title {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 0;
    border-top: 1px solid #f1f5f9;
}
.block.discount .title strong {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.block.discount .content { padding-top: 12px; }
.block.discount input[type="text"] {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--ss-border);
    border-radius: 8px;
    font-size: 1.3rem;
    outline: none;
    font-family: var(--ss-font);
    transition: border-color .15s;
    box-sizing: border-box;
}
.block.discount input[type="text"]:focus { border-color: var(--ss-blue); }
.block.discount .action.apply,
.block.discount .action.cancel {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 9px 16px;
    margin-top: 8px;
    background: #f1f5f9;
    color: #374151;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: var(--ss-font);
    cursor: pointer;
    justify-content: center;
    transition: background .15s;
}
.block.discount .action.apply:hover { background: #e0f2fe; border-color: #7dd3fc; color: #0369a1; }
.block.discount .action.cancel:hover { background: #fee2e2; border-color: #fca5a5; color: var(--ss-red); }

/* ── Empty cart ───────────────────────────────────────────────── */
.cart-empty {
    text-align: center;
    padding: 80px 24px;
}
.cart-empty p {
    font-size: 1.5rem;
    color: #6b7280;
}
.cart-empty .action.continue {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--ss-blue);
    color: var(--ss-white);
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.4rem;
    text-decoration: none;
    margin-top: 16px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ss-cart-title  { font-size: 1.8rem; }
    .ss-cart-actions { flex-direction: column; align-items: stretch; }
    .ss-cart-actions__right { flex-direction: column; }
    .ss-cart-btn { justify-content: center; }
    .cart-summary {
        position: static;
        top: auto;
        margin-top: 24px;
    }
}

/* ── Overrides ────────────────────────────────────────────────── */
.column.main .cart-summary .block > .title strong { font-size: 1.6rem; }
