/* =========================================================
   CART PAGE
========================================================= */

.cart-page-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 70px;
}

/* Header */
.cart-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
}

.cart-page-header span {
    display: block;
    margin-bottom: 5px;
    color: #315efb;
    font-size: 13px;
    font-weight: 600;
}

.cart-page-header h1 {
    margin: 0;
    color: #0f172a;
    font-size: 34px;
    line-height: 1.2;
}

.continue-shopping-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.continue-shopping-btn:hover {
    border-color: #315efb;
    color: #315efb;
}

/* Alerts */
.cart-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 22px;
    padding: 13px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.cart-alert-success {
    border: 1px solid #bbf7d0;
    background: #ecfdf3;
    color: #15803d;
}

.cart-alert-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #dc2626;
}

/* Main Layout */
.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    align-items: start;
    gap: 28px;
}

/* Cart Items */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-item {
    display: grid;
    grid-template-columns: 110px minmax(180px, 1fr) 170px 120px 46px;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

/* Product Image */
.cart-item-image {
    width: 110px;
    height: 110px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #94a3b8;
    font-size: 30px;
}

/* Product Info */
.cart-item-info h3 {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.4;
}

.cart-item-info h3 a {
    color: #0f172a;
    text-decoration: none;
}

.cart-item-info h3 a:hover {
    color: #315efb;
}

.cart-item-price {
    margin: 0;
    color: #315efb;
    font-size: 17px;
    font-weight: 700;
}

/* Quantity */
.cart-item-quantity form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.cart-item-quantity label {
    color: #64748b;
    font-size: 11px;
    font-weight: 600;
}

.quantity-box {
    display: grid;
    grid-template-columns: 34px 50px 34px;
    height: 36px;
    overflow: hidden;
    border: 1px solid #ccd7e6;
    border-radius: 8px;
}

.quantity-box button {
    border: none;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
}

.quantity-box button:hover {
    background: #315efb;
    color: #ffffff;
}

.quantity-box input {
    width: 100%;
    border: none;
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    outline: none;
    text-align: center;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
}

.quantity-box input::-webkit-inner-spin-button,
.quantity-box input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}

.cart-update-btn:hover {
    background: #315efb;
    color: #ffffff;
}

/* Subtotal */
.cart-item-subtotal {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: right;
}

.cart-item-subtotal span {
    color: #64748b;
    font-size: 11px;
}

.cart-item-subtotal strong {
    color: #0f172a;
    font-size: 16px;
}

/* Remove */
.cart-item-remove {
    display: flex;
    justify-content: flex-end;
}

.cart-item-remove form {
    margin: 0;
}

.cart-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid #fecaca;
    border-radius: 9px;
    background: #fff5f5;
    color: #ef4444;
    cursor: pointer;
}

.cart-remove-btn:hover {
    border-color: #ef4444;
    background: #ef4444;
    color: #ffffff;
}

/* =========================================================
   ORDER SUMMARY
========================================================= */

.cart-summary {
    position: sticky;
    top: 105px;
    padding: 22px;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.cart-summary h2 {
    margin: 0 0 20px;
    color: #0f172a;
    font-size: 21px;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 11px 0;
    border-bottom: 1px solid #edf2f7;
    color: #64748b;
    font-size: 13px;
}

.cart-summary-row strong {
    color: #0f172a;
}

.cart-summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 0;
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
}

.cart-summary-total strong {
    color: #315efb;
    font-size: 22px;
}

.cart-checkout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    border: 1px solid #315efb;
    border-radius: 10px;
    background: #315efb;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.cart-checkout-btn:hover {
    background: #2449d8;
}

.cart-clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 40px;
    margin-top: 10px;
    border: none;
    background: transparent;
    color: #ef4444;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.cart-clear-btn:hover {
    text-decoration: underline;
}

/* =========================================================
   EMPTY CART
========================================================= */

.empty-cart {
    padding: 70px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #ffffff;
    text-align: center;
}

.empty-cart-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #eef4ff;
    color: #315efb;
    font-size: 30px;
}

.empty-cart h2 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 25px;
}

.empty-cart p {
    margin: 0 0 22px;
    color: #64748b;
    font-size: 14px;
}

.empty-cart-shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 10px;
    background: #315efb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns: 90px minmax(160px, 1fr) 150px 110px 40px;
        gap: 12px;
    }

    .cart-item-image {
        width: 90px;
        height: 90px;
    }
}

@media (max-width: 760px) {
    .cart-page-container {
        width: min(100% - 20px, 1180px);
        padding-top: 24px;
    }

    .cart-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .cart-item {
        grid-template-columns: 90px 1fr;
        align-items: start;
    }

    .cart-item-image {
        grid-row: span 2;
    }

    .cart-item-quantity,
    .cart-item-subtotal,
    .cart-item-remove {
        grid-column: 2;
    }

    .cart-item-subtotal {
        text-align: left;
    }

    .cart-item-remove {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .cart-item {
        grid-template-columns: 1fr;
    }

    .cart-item-image {
        grid-row: auto;
        width: 100%;
        height: 220px;
    }

    .cart-item-info,
    .cart-item-quantity,
    .cart-item-subtotal,
    .cart-item-remove {
        grid-column: 1;
    }
}
.cart-item-variant {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.cart-item-variant span {
    padding: 4px 8px;
    border: 1px solid #d6e4f2;
    border-radius: 7px;
    background: #f3f8ff;
    color: #526980;
    font-size: 11px;
}

.cart-item-variant strong {
    color: #17395d;
}
