/* AddToCart Page Styles */

body {
    background: linear-gradient(180deg, #f8fafc 0%, #f3f5f8 180px, #eef1f5 100%);
}

.cart-container {
    max-width: 1440px;
    margin: 32px auto 48px;
    padding: 0 24px;
    min-height: 60vh;
}

.cart-header {
    background: linear-gradient(135deg, #07142a 0%, #172236 100%);
    border: 1px solid rgba(255, 193, 7, 0.28);
    border-radius: 8px;
    padding: 22px 28px;
    margin-bottom: 24px;
    box-shadow: 0 18px 40px rgba(7, 20, 42, 0.16);
}

.cart-header h1 {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 5px;
}

.cart-count-text {
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.95rem;
    margin: 0;
}

#cartItemCount {
    color: #ffc107;
    font-weight: 800;
}

/* Empty Cart */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 28px;
    text-align: center;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(7, 20, 42, 0.08);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.empty-cart i {
    font-size: 80px;
    color: rgba(7, 20, 42, 0.16);
    margin-bottom: 20px;
}

.empty-cart h2 {
    font-size: 1.5rem;
    color: #07142a;
    margin-bottom: 10px;
}

.empty-cart p {
    color: #56657a;
    margin-bottom: 25px;
}

.btn-continue-shopping {
    display: inline-block;
    padding: 14px 30px;
    background: #07142a;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid rgba(255, 193, 7, 0.45);
    box-shadow: 0 10px 22px rgba(7, 20, 42, 0.14);
    transition: background 0.3s, color 0.3s, transform 0.3s;
}

.btn-continue-shopping:hover {
    background: #ffc107;
    color: #07142a;
    transform: translateY(-1px);
}

/* Cart Content - Two Column Layout */
.cart-content {
    grid-template-columns: minmax(0, 1.65fr) minmax(380px, 0.9fr);
    gap: 24px;
    align-items: start;
}

/* Left Side: Cart Items Section */
.cart-items-section {
    background: rgba(255, 255, 255, 0.98);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid rgba(7, 20, 42, 0.08);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.cart-items-section h2 {
    font-size: 1.3rem;
    color: #07142a;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e7ebf2;
}

/* Right Side: Checkout Section */
.checkout-section {
    background: rgba(255, 255, 255, 0.98);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid rgba(7, 20, 42, 0.08);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.checkout-section h2 {
    font-size: 1.3rem;
    color: #07142a;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e7ebf2;
}

/* Checkout Form Styles */
.checkout-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-section {
    padding-bottom: 20px;
    border-bottom: 1px solid #e7ebf2;
}

.form-section h3 {
    font-size: 1rem;
    color: #07142a;
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.checkout-form .form-group {
    margin-bottom: 15px;
}

.checkout-form .form-group label {
    display: block;
    font-size: 0.9rem;
    color: #1f2d44;
    margin-bottom: 6px;
    font-weight: 500;
}

.checkout-form .form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #d8dee9;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.checkout-form .form-group input:focus {
    outline: none;
    border-color: #07142a;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.18);
}

/* Payment Options */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 2px solid #d8dee9;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: #07142a;
}

.payment-option input[type="radio"]:checked + .payment-icon {
    color: #ffc107;
}

.payment-option:has(input:checked) {
    border-color: #07142a;
    background: #f8fafc;
}

.payment-icon {
    font-size: 1.2rem;
    color: #56657a;
}

.payment-option span:last-child {
    font-weight: 500;
    color: #1f2d44;
}

/* Order Summary in Checkout */
.order-summary {
    margin-top: 4px;
    padding: 18px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #dce2ec;
}

.order-summary h3 {
    font-size: 1rem;
    color: #07142a;
    margin-bottom: 14px;
}


.cart-summary-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 16px;
    padding-bottom: 14px;
    border-bottom: 1px dashed rgba(7, 20, 42, 0.18);
}

.cart-summary-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
    color: #1f2d44;
}

.cart-summary-item-main {
    min-width: 0;
}

.cart-summary-item-name {
    display: block;
    overflow: hidden;
    color: #07142a;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-summary-item-sku {
    display: block;
    margin-top: 2px;
    color: #6b778c;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.76rem;
    line-height: 1.2;
}

.cart-summary-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    white-space: nowrap;
}

.cart-summary-item-qty {
    color: #6b778c;
    font-size: 0.76rem;
    font-weight: 700;
}

.cart-summary-item-price {
    color: #07142a;
    font-size: 0.86rem;
    font-weight: 800;
}

.cart-summary-empty {
    color: #6b778c;
    font-size: 0.86rem;
}

.order-summary .summary-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    color: #56657a;
}

.order-summary .summary-row span:last-child {
    text-align: right;
}

.cart-shipping-note {
    margin: -4px 0 12px;
    color: #6b778c;
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: right;
}

.order-summary .summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #07142a;
    padding-top: 15px;
    border-top: 2px solid #e7ebf2;
    margin-top: 15px;
}

.cart-table-header {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 140px;
    gap: 18px;
    align-items: center;
    padding: 10px 0 14px;
    border-bottom: 2px solid #e7ebf2;
    font-weight: 600;
    color: #1f2d44;
    font-size: 0.9rem;
}

.cart-table-header .col-price,
.cart-table-header .col-quantity,
.cart-table-header .col-subtotal {
    display: none;
}

.cart-table-header .col-product {
    min-width: 0;
}

.cart-table-header .col-action {
    justify-content: flex-end;
}

#cartItemsContainer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 14px;
}

.cart-item {
    display: grid;
    grid-template-columns: 40px 112px minmax(0, 1fr) minmax(140px, auto);
    gap: 18px;
    padding: 28px 26px;
    border: 1px solid rgba(7, 20, 42, 0.08);
    align-items: center;
    background: #ffffff;
    border-radius: 8px;
    min-height: 190px;
}

.col-select {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.col-select input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #ffc107;
    cursor: pointer;
}

.cart-item-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image img {
    width: 104px;
    height: 104px;
    object-fit: contain;
    border-radius: 8px;
}

.cart-item-details {
    min-width: 0;
}

.cart-item-details h4 {
    font-size: 1.08rem;
    color: #07142a;
    margin: 0 0 8px;
    line-height: 1.25;
}

.cart-item-details p {
    font-size: 0.92rem;
    color: #66758a;
    margin: 0 0 12px;
    line-height: 1.5;
}

.col-price {
    font-weight: 800;
    color: #07142a;
    white-space: nowrap;
    text-align: right;
    font-size: 1.02rem;
}

.col-quantity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.col-quantity input {
    width: 50px;
    padding: 8px;
    text-align: center;
    border: 2px solid #d8dee9;
    border-radius: 6px;
    font-size: 0.95rem;
}

.col-quantity input:focus {
    outline: none;
    border-color: #07142a;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.16);
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: 2px solid #d8dee9;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    color: #07142a;
    transition: all 0.3s;
}

.qty-btn:hover {
    border-color: #07142a;
    background: #07142a;
    color: #ffffff;
}

.qty-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.qty-btn:disabled:hover {
    background: #ffffff;
    border-color: #d8dee9;
    color: #07142a;
}

.cart-item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    align-self: center;
}

.col-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cart-wishlist,
.btn-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.3s;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-cart-wishlist {
    color: #1f2d44;
    border: 1px solid rgba(7, 20, 42, 0.16);
    background: #fff;
}

.btn-cart-wishlist.is-active {
    color: #e11d48;
    border-color: rgba(225, 29, 72, 0.24);
    background: #fff1f2;
}

.btn-remove {
    color: #dc2626;
}

.btn-cart-wishlist:hover,
.btn-remove:hover {
    transform: scale(1.1);
}

/* Cart Summary */
.cart-summary {
    width: 350px;
    background: #ffffff;
    padding: 30px;
    border: 1px solid rgba(7, 20, 42, 0.08);
    border-radius: 8px;
    height: fit-content;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.cart-summary h2 {
    font-size: 1.3rem;
    color: #07142a;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e7ebf2;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    color: #56657a;
}

.summary-row.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #07142a;
    padding-top: 15px;
    border-top: 2px solid #e7ebf2;
    margin-top: 15px;
}

.btn-checkout {
    width: 100%;
    padding: 16px;
    background: #07142a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 18px;
    border: 1px solid rgba(255, 193, 7, 0.38);
    transition: background 0.3s, color 0.3s, transform 0.3s;
}

.btn-checkout:hover {
    background: #ffc107;
    color: #07142a;
    transform: translateY(-1px);
}

.btn-continue-shopping-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: #1f2d44;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-continue-shopping-link:hover {
    color: #b88700;
}

/* Login Required Modal */
.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-primary {
    padding: 12px 30px;
    background: #07142a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 193, 7, 0.4);
    transition: background 0.3s, color 0.3s;
}

.btn-primary:hover {
    background: #ffc107;
    color: #07142a;
}

.btn-secondary {
    padding: 12px 30px;
    background: #ffffff;
    color: #07142a;
    border: 1px solid #d8dee9;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #f1f5f9;
}

/* Responsive */
@media (max-width: 900px) {
    .cart-content {
        grid-template-columns: 55% 45% !important;
    }
}

@media (max-width: 768px) {
    .cart-container {
        margin: 24px auto 36px;
    }

    .cart-content {
        grid-template-columns: 1fr !important;
    }

    .cart-items-section {
        order: 1;
    }
    
    .checkout-section {
        order: 2;
    }

    .cart-table-header {
        display: none;
    }

    .cart-item {
        grid-template-columns: 34px 84px minmax(0, 1fr);
        gap: 12px;
        padding: 18px;
        min-height: 0;
    }

    .cart-item-image img {
        width: 82px;
        height: 82px;
    }

    .cart-item-side {
        grid-column: 3;
        align-items: flex-start;
        gap: 12px;
    }

    .col-price {
        text-align: left;
    }

    .col-action {
        justify-content: flex-start;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}
