/* Cart Page Styles */
.cart-section {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.page-title {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-required {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.auth-required i {
    font-size: 4rem;
    color: var(--warning-color);
    margin-bottom: 20px;
}

.auth-required h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
}

.cart-items-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    font-size: 1.4rem;
    color: var(--dark-color);
}

.btn-clear-cart {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-clear-cart:hover {
    background: var(--danger-color);
    color: white;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: box-shadow 0.3s;
}

.cart-item:hover {
    box-shadow: var(--shadow);
}

.cart-item-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-color);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-brand {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.cart-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 5px 0;
    color: var(--dark-color);
}

.cart-item-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.cart-current-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.cart-original-price {
    font-size: 1rem;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.cart-discount {
    color: var(--success-color);
    font-size: 0.9rem;
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    background: var(--light-color);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
}

.quantity-input {
    width: 50px;
    text-align: center;
    border: none;
    font-weight: 600;
    font-size: 1rem;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    padding: 8px;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.remove-btn:hover {
    transform: scale(1.2);
}

.cart-item-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.item-total-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.item-total-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.empty-cart {
    text-align: center;
    padding: 80px 20px;
}

.empty-cart i {
    font-size: 5rem;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-cart h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.empty-cart p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* Order Summary */
.order-summary-section {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.order-summary {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.order-summary h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    color: var(--text-color);
}

.summary-row span:last-child {
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 15px 0;
}

.total-row {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.success-text {
    color: var(--success-color) !important;
}

.savings-badge {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    margin: 15px 0;
    font-size: 0.95rem;
}

.delivery-info {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.delivery-info h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.delivery-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.btn-edit-address {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 6px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-edit-address:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.bill-modal {
    max-width: 800px;
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    color: var(--dark-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Bill Styles */
.bill-container {
    font-family: 'Inter', sans-serif;
}

.bill-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--dark-color);
}

.bill-logo {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.bill-title {
    font-size: 1.8rem;
    margin: 10px 0;
    color: var(--dark-color);
}

.bill-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.bill-section h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.bill-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 3px 0;
}

.bill-items {
    margin-bottom: 30px;
}

.bill-table {
    width: 100%;
    border-collapse: collapse;
}

.bill-table th {
    background: var(--light-color);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.bill-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.bill-table .text-right {
    text-align: right;
}

.bill-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.bill-summary-row {
    display: flex;
    justify-content: space-between;
    min-width: 300px;
    padding: 8px 0;
}

.bill-total {
    font-size: 1.3rem;
    font-weight: 700;
    padding-top: 10px;
    border-top: 2px solid var(--dark-color);
    color: var(--primary-color);
}

.bill-footer {
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .order-summary-section {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 15px;
    }

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

    .cart-item-total {
        grid-column: 2;
        align-items: flex-start;
        margin-top: 10px;
    }

    .bill-info {
        grid-template-columns: 1fr;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }
}
