/* Cart Page Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 50px;
}

.error-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #721c24;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.error-close:hover {
    opacity: 1;
}

.cart-page {
    padding: 40px 0 40px 0;
}

/* Cart Hidden Override */
.cart-content.cart-hidden {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.cart-content.cart-hidden .cart-summary {
    display: none !important;
}

.cart-content.cart-hidden .cart-items {
    display: none !important;
}

.cart-header {
    margin-top: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.cart-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin: 0;
    font-weight: 700;
}

.cart-count {
    background: var(--tsgreen);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Loading State */
.cart-loading {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--tsgreen);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cart-loading p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 40px 20px;
}

.error-state p {
    font-size: 1.1rem;
    color: #dc3545;
    margin: 0 0 20px 0;
}

.error-state button {
    background: var(--tsgreen);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.error-state button:hover {
    background: #2a8f5a;
}

.cart-page .cart-content {
    display: grid !important;
    grid-template-columns: 2fr 1fr !important;
    gap: 40px;
    align-items: start;
    min-height: 400px;
    width: 100%;
}

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

.cart-item {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.item-info {
    flex: 1;
}

.item-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.item-description {
    color: #666;
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.item-type {
    color: var(--tsgreen);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.item-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tsgreen);
    min-width: 80px;
    text-align: right;
}

.remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #dc3545;
    color: white;
}

.cart-summary {
    position: sticky;
    top: 20px;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.promo-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.promo-section h3 {
    font-size: 1.3rem;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.promo-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.promo-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.promo-input:focus {
    outline: none;
    border-color: var(--tsgreen);
}

.apply-promo-btn {
    background: var(--tsgreen);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.apply-promo-btn:hover {
    background: #2a8f5a;
    transform: translateY(-1px);
}

.apply-promo-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.promo-message {
    font-size: 0.9rem;
    padding: 8px 0;
    min-height: 20px;
}

.promo-message.success {
    color: var(--tsgreen);
    font-weight: 600;
}

.promo-message.error {
    color: #dc3545;
}

.order-summary h3 {
    font-size: 1.3rem;
    color: #333;
    margin: 0 0 20px 0;
    font-weight: 600;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1rem;
}

.summary-row.discount {
    color: var(--tsgreen);
    font-weight: 600;
}

.summary-row.total {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    padding-top: 15px;
    border-top: 2px solid #e0e0e0;
    margin-top: 15px;
}

.checkout-btn {
    width: 100%;
    background: var(--tsgreen);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 25px;
}

.checkout-btn:hover {
    background: #2a8f5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.checkout-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Empty Cart Styles */
.empty-cart {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: 40px;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-cart h2 {
    font-size: 2rem;
    color: #333;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.empty-cart p {
    color: #666;
    font-size: 1.1rem;
    margin: 0 0 30px 0;
    line-height: 1.5;
}

.continue-shopping-btn {
    display: inline-block;
    background: var(--tsgreen);
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.continue-shopping-btn:hover {
    background: #2a8f5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid var(--tsgreen);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cart-page .cart-content {
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .cart-page .cart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .cart-page .cart-header h1 {
        font-size: 2rem;
    }
    
    .cart-page .cart-content {
        grid-template-columns: 1.5fr 1fr !important;
        gap: 25px;
    }
}

@media (max-width: 600px) {
    .cart-page .cart-content {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 20px;
    }
    
    .item-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .item-price {
        font-size: 1.3rem;
        text-align: left;
    }
    
    .cart-summary {
        position: static;
        padding: 25px;
    }
    
    .promo-input-group {
        flex-direction: column;
    }
    
    .apply-promo-btn {
        width: 100%;
    }
    
    .item-price {
        order: 2;
        text-align: left;
    }
    
    .remove-btn {
        order: 3;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .cart-page {
        padding: 20px 0;
    }
    
    .cart-header h1 {
        font-size: 1.8rem;
    }
    
    .cart-item {
        padding: 15px;
    }
    
    .item-title {
        font-size: 1.2rem;
    }
    
    .cart-summary {
        padding: 20px;
    }
    
    .checkout-btn {
        padding: 14px 20px;
        font-size: 1.1rem;
    }
}
