/* Cart Page Styles */

.cart-page {
    padding: 120px 0 40px 0;
    background: #f8fafc;
    min-height: 100vh;
}

/* Scope container to only cart page content, not header/footer */
.cart-page .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.cart-header {
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 10px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 14px;
}

.breadcrumb a {
    color: #3b82f6;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #1d4ed8;
}

.breadcrumb .separator {
    color: #94a3b8;
}

.breadcrumb .current {
    color: #64748b;
    font-weight: 500;
}

.cart-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start; /* Keep content at top, don’t stretch columns */
}

/* Cart Items Section */
.cart-items-section h2 {
    font-size: 24px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 20px;
}

.cart-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 80px 1fr auto auto auto;
    gap: 20px;
    align-items: center;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 24px;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.cart-item-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.cart-item-specs {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
    line-height: 1.4;
}

.cart-item-price {
    font-size: 18px;
    font-weight: 700;
    color: #10b981;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
}

.quantity-btn {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.quantity-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.quantity-input {
    width: 40px;
    border: none;
    background: none;
    text-align: center;
    font-weight: 600;
    color: #374151;
}

.quantity-input:focus {
    outline: none;
}

.cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.cart-item-remove:hover {
    background: #fef2f2;
}

/* Empty Cart – content starts at top of section */
.empty-cart {
    text-align: center;
    padding: 40px 24px 60px;
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-top: 0;
}

.empty-cart-content {
    max-width: 360px;
    margin: 0 auto;
}

.empty-cart-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-cart-icon i {
    font-size: 36px;
    color: #0ea5e9;
}

.empty-cart-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 8px;
}

.empty-cart-content p {
    font-size: 15px;
    color: #64748b;
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Empty cart primary CTA – more prominent */
.empty-cart-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.empty-cart-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    color: white;
}

.empty-cart-cta:active {
    transform: translateY(0);
}

/* Order Summary */
.order-summary-section {
    position: sticky;
    top: 100px;
}

.order-summary {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.order-summary h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-size: 18px;
    padding: 20px 0 0 0;
    border-top: 2px solid #1e3a8a;
    margin-top: 10px;
}

.checkout-actions {
    margin: 30px 0 20px 0;
}

.checkout-actions .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #1e3a8a;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: #1e3a8a;
    border: 2px solid #1e3a8a;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #1e3a8a;
    color: white;
}

.continue-shopping {
    text-align: center;
    margin-bottom: 20px;
}

.trust-badges {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}

.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 14px;
}

.trust-badge i {
    font-size: 24px;
    color: #10b981;
}

/* When cart is empty: empty state appears first (top of page) */
.cart-content.cart-is-empty .cart-items-section {
    order: 0;
}
.cart-content.cart-is-empty .order-summary-section {
    order: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .order-summary-section {
        position: static;
        order: -1;
    }

    /* Empty cart: show empty message at top, then summary below */
    .cart-content.cart-is-empty .cart-items-section {
        order: 0;
    }
    .cart-content.cart-is-empty .order-summary-section {
        order: 1;
    }

    .cart-item {
        grid-template-columns: 60px 1fr;
        gap: 15px;
        position: relative;
    }

    .cart-item-image {
        width: 60px;
        height: 60px;
    }

    .cart-item-details {
        grid-column: 2;
        grid-row: 1;
    }

    .cart-item-price {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 16px;
    }

    .cart-item-quantity {
        position: absolute;
        bottom: 20px;
        right: 60px;
    }

    .cart-item-remove {
        position: absolute;
        bottom: 20px;
        right: 20px;
    }

    .page-title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .cart-page .container {
        padding: 0 15px;
    }

    .cart-item {
        padding: 15px;
        gap: 10px;
    }

    .order-summary {
        padding: 20px;
    }

    .trust-badges {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
