/* ---- Cart Page ---- */
.cart-page {
    font-family: Open Sans, Verdana, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #f5f6f8;
    min-height: 60vh;
    color: #111827;
    font-size: 14px;
    line-height: 1.5;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 40px;
}

/* Header */
.cart-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
}

.cart-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.2;
}

.cart-count-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 600;
}

/* Empty state */
.cart-empty {
    text-align: center;
    padding: 48px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.cart-empty svg {
    display: block;
    margin: 0 auto 12px;
}

.cart-empty p {
    color: #6b7280;
    font-size: 15px;
    margin: 0 0 16px;
}

.btn-continue {
    display: inline-block;
    padding: 10px 24px;
    background: #f29900;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    border-radius: 6px;
    text-decoration: none;
    transition: background .15s;
}

.btn-continue:hover {
    background: #e08a00;
}

/* Layout */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

/* Table */
.cart-items-col {
    min-width: 0;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.cart-table thead {
    background: #fafbfc;
    border-bottom: 1px solid #e5e7eb;
}

.cart-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    padding: 9px 12px;
    white-space: nowrap;
}

.th-price,
.th-qty,
.th-subtotal { text-align: right; }
.th-qty { text-align: center; }
.th-remove { width: 36px; }

.cart-table tbody tr {
    border-bottom: 1px solid #f0f2f5;
}

.cart-table tbody tr:last-child {
    border-bottom: 0;
}

.cart-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

/* Product cell */
.td-product {
    width: 45%;
}

.cart-item-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.cart-item-link:hover .cart-item-name {
    color: #e98b12;
}

.cart-thumb {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #f0f2f5;
    border-radius: 6px;
    flex-shrink: 0;
}

.cart-thumb-empty {
    display: block;
    width: 56px;
    height: 56px;
    background: #f5f6f8;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    flex-shrink: 0;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.cart-item-brand {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #9ca3af;
    line-height: 1.3;
}

.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    transition: color .15s;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cart-item-variant {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.3;
    margin-top: 1px;
}

/* Price cell */
.td-price {
    text-align: right;
    white-space: nowrap;
}

.price-now {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    display: block;
}

.price-was {
    font-size: 11px;
    color: #9ca3af;
    text-decoration: line-through;
    display: block;
}

/* Qty cell */
.td-qty {
    text-align: center;
}

.qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    overflow: hidden;
    height: 30px;
}

.qty-btn {
    width: 28px;
    height: 30px;
    border: 0;
    background: #fafbfc;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s;
    line-height: 1;
    padding: 0;
}

.qty-btn:hover {
    background: #f0f2f5;
}

.qty-input {
    width: 34px;
    height: 30px;
    border: 0;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    background: #fff;
    -moz-appearance: textfield;
    padding: 0;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Subtotal cell */
.td-subtotal {
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
}

/* Remove cell */
.td-remove {
    text-align: center;
}

.remove-btn {
    background: none;
    border: 0;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color .15s, background .15s;
}

.remove-btn:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* Summary sidebar */
.cart-summary-col {
    position: sticky;
    top: 100px;
}

.cart-summary {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 18px 16px;
}

.cart-summary h2 {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #374151;
    padding: 4px 0;
}

.shipping-free {
    color: #16a34a;
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.summary-total {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    padding: 4px 0 2px;
}

.vat-note {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-bottom: 14px;
}

.btn-checkout {
    display: block;
    width: 100%;
    padding: 12px;
    background: #f29900;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
    text-align: center;
}

.btn-checkout:hover {
    background: #e08a00;
}

.link-continue {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 600;
    transition: color .15s;
}

.link-continue:hover {
    color: #e98b12;
}

.summary-usps {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    border-top: 1px solid #f0f2f5;
    padding-top: 12px;
}

.summary-usps li {
    font-size: 12px;
    color: #374151;
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.summary-usps li::before {
    content: "\2713";
    color: #16a34a;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ---- Mobile responsive ---- */
@media (max-width: 899px) {
    .cart-container {
        padding: 14px 14px 32px;
    }

    .cart-header h1 {
        font-size: 19px;
    }

    .cart-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cart-summary-col {
        position: static;
        order: 2;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td {
        display: block;
        width: 100%;
    }

    .cart-table tbody tr {
        padding: 10px 10px;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "product remove"
            "price qty";
        gap: 4px 8px;
        align-items: center;
    }

    .td-product {
        grid-area: product;
        width: auto;
        padding: 0 0 4px;
        padding-right: 6px;
    }

    .td-price {
        grid-area: price;
        text-align: left;
        padding: 0;
    }

    .td-qty {
        grid-area: qty;
        text-align: center;
        padding: 0;
    }

    .cart-table .td-subtotal {
        display: none;
    }

    .td-remove {
        grid-area: remove;
        align-self: start;
        justify-self: end;
        padding: 0;
        text-align: right;
    }

    .cart-thumb {
        width: 48px;
        height: 48px;
    }

    .cart-thumb-empty {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 479px) {
    .cart-item-name {
        font-size: 12px;
    }

    .cart-item-brand {
        font-size: 10px;
    }
}

/* ---- Cart added toast ---- */
.cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: #111827;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    animation: cartToastIn .25s ease-out;
    max-width: calc(100vw - 48px);
}

.cart-toast.is-hiding {
    animation: cartToastOut .2s ease-in forwards;
}

.cart-toast a {
    color: #f29900;
    text-decoration: none;
    font-weight: 700;
    margin-left: 4px;
    white-space: nowrap;
}

.cart-toast a:hover {
    text-decoration: underline;
}

@keyframes cartToastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes cartToastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(12px); }
}

/* ---- Header badge ---- */
.cart-badge {
    position: absolute;
    top: -2px;
    right: 0;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #f29900;
    border-radius: 99px;
    padding: 0 4px;
    pointer-events: none;
}
