/* Cart Page Styles */
.cart-section {
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 60vh;
}

.cart-section h1 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.cart-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    max-width: 100%;
    width: 100%;
}

/* Cart Items */
.cart-items {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    max-width: 100%;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr minmax(110px, auto);
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    max-width: 100%;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    word-break: break-word;
}

.cart-item-size {
    font-size: 0.9rem;
    color: var(--light-text);
}

.cart-item-size strong {
    color: var(--text-color);
}

.cart-item-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 0.3rem;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: white;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: var(--primary-color);
    color: white;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-display {
    min-width: 40px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
}

.remove-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s;
}

.remove-btn:hover {
    color: #c0392b;
}

/* Cart Summary */
.cart-summary {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
    max-width: 100%;
}

.cart-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #eee;
    font-size: 1rem;
}

.summary-row.total {
    border-top: 2px solid #ddd;
    border-bottom: none;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-top: 0.5rem;
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.checkout-btn:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.continue-shopping {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.continue-shopping:hover {
    color: #3a7bc8;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.empty-cart i {
    font-size: 4rem;
    color: #bdc3c7;
    margin-bottom: 1rem;
}

.empty-cart h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.empty-cart p {
    color: var(--light-text);
    margin-bottom: 1.5rem;
}

.empty-cart a {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s;
}

.empty-cart a:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 992px) {
    .cart-container {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-section h1 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 0.8rem;
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
    }
    
    .cart-item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 0.8rem;
    }

    .quantity-controls { gap: 0.3rem; padding: 0.2rem; }
    .qty-btn { width: 26px; height: 26px; font-size: 0.9rem; }
    .qty-display { min-width: 32px; font-size: 0.95rem; }
    .line-total { min-width: 90px !important; text-align: left !important; }
    
    .cart-item-name {
        font-size: 1rem;
    }
    
    .cart-item-price {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .cart-section {
        padding: 1rem 0.5rem;
    }
    
    .cart-items,
    .cart-summary {
        padding: 1rem;
    }
    
    .cart-item {
        padding: 0.8rem;
    }
    
    .summary-row {
        font-size: 0.9rem;
    }
    
    .summary-row.total {
        font-size: 1.1rem;
    }

    /* Empty Cart: mobile sizing */
    .empty-cart {
        padding: 2rem 1rem;
    }
    .empty-cart i {
        font-size: 2.6rem;
        margin-bottom: 0.6rem;
    }
    .empty-cart h2 {
        font-size: 1.2rem;
        margin-bottom: 0.4rem;
    }
    .empty-cart p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    .empty-cart a {
        padding: 0.6rem 1.2rem 0.4rem;
        font-size: 0.9rem;
        border-radius: 3px;
    }
    .empty-cart a i {
        font-size: 0.9rem;
    }
}

/* Address Modal Styles */
.address-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.address-modal-content {
    background: white;
    max-width: 550px;
    margin: 1rem auto;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.address-modal-content h2 {
    margin: 0 0 0.3rem 0;
    color: var(--text-color);
    font-size: 1.4rem;
}

.modal-subtitle {
    color: var(--light-text);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #333;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 0.8rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.85rem;
}

.form-group label i {
    color: var(--primary-color);
    margin-right: 0.3rem;
    font-size: 0.8rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.order-summary-modal {
    background: #f8f9fa;
    padding: 0.8rem;
    border-radius: 4px;
    margin: 1rem 0 0.8rem;
}

.order-summary-modal h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 0.95rem;
}

.summary-details p {
    display: flex;
    justify-content: space-between;
    margin: 0.3rem 0;
    font-size: 0.85rem;
}

.summary-details span {
    font-weight: 600;
    color: var(--primary-color);
}

.submit-order-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.submit-order-btn:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Responsive for Address Modal */
@media (max-width: 768px) {
    .address-modal-content {
        padding: 1.2rem;
        margin: 0.5rem auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .address-modal-content h2 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .address-modal {
        padding: 10px;
    }
    
    .address-modal-content {
        padding: 1rem;
        margin: 0.5rem auto;
    }
    
    .form-group {
        margin-bottom: 0.6rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    
    .submit-order-btn {
        padding: 0.7rem;
        font-size: 0.95rem;
    }
}

/* Success Modal Styles */
.success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.success-modal-content {
    background: white;
    max-width: 450px;
    width: 90%;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: successPop 0.5s ease;
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    margin-bottom: 1.5rem;
}

.success-icon i {
    font-size: 5rem;
    color: #4CAF50;
    animation: checkBounce 0.6s ease;
}

@keyframes checkBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.success-modal-content h2 {
    color: var(--text-color);
    font-size: 1.8rem;
    margin: 0 0 1rem 0;
}

.success-message {
    color: var(--light-text);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.order-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.order-info p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

.order-info strong {
    color: var(--text-color);
}

.order-info span {
    color: var(--primary-color);
    font-weight: 600;
}

.success-buttons {
    display: flex;
    gap: 0.8rem;
    width: 100%;
}

.view-orders-btn,
.continue-btn {
    flex: 1;
    padding: 1rem;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.view-orders-btn {
    background: #4CAF50;
}

.view-orders-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.continue-btn {
    background: var(--primary-color);
}

.continue-btn:hover {
    background: #3a7bc8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

/* Responsive for Success Modal */
@media (max-width: 480px) {
    .success-modal-content {
        padding: 2rem 1.5rem;
    }
    
    .success-icon i {
        font-size: 4rem;
    }
    
    .success-modal-content h2 {
        font-size: 1.5rem;
    }
    
    .success-message {
        font-size: 0.9rem;
    }
    
    .success-buttons {
        flex-direction: column;
    }
    
    .view-orders-btn,
    .continue-btn {
        font-size: 0.95rem;
        padding: 0.9rem;
    }
}
