/* ============================================
   CART & CHECKOUT RESPONSIVE STYLES
============================================ */

/* Cart Icon in Header */
.cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.cart-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.cart-icon i {
    font-size: 20px;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #f5576c;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Cart Page Styles */
.cart-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.cart-header {
    text-align: center;
    margin-bottom: 40px;
}

.cart-header h2 {
    font-size: 36px;
    font-weight: 800;
    color: #1a1a2e;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cart-items {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 20px;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.cart-item-price {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.quantity-value {
    font-size: 16px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.remove-btn {
    padding: 10px 20px;
    background: #f8d7da;
    color: #721c24;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #dc3545;
    color: white;
}

/* Cart Summary */
.cart-summary {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 100px;
}

.summary-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.summary-row:last-child {
    border-bottom: none;
    padding-top: 20px;
    margin-top: 10px;
    border-top: 2px solid #667eea;
}

.summary-label {
    font-size: 16px;
    color: #6c757d;
}

.summary-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.summary-row:last-child .summary-label,
.summary-row:last-child .summary-value {
    font-size: 20px;
    font-weight: 800;
    color: #667eea;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.continue-shopping:hover {
    color: #764ba2;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 80px 20px;
}

.empty-cart-icon {
    font-size: 80px;
    color: #e9ecef;
    margin-bottom: 20px;
}

.empty-cart h3 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 15px;
}

.empty-cart p {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 30px;
}

/* ============================================
   RESPONSIVE DESIGN FOR CART
============================================ */

@media (max-width: 992px) {
    .cart-item {
        grid-template-columns: 100px 1fr;
        gap: 15px;
    }

    .cart-item-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-header h2 {
        font-size: 28px;
    }

    .cart-items {
        padding: 20px;
    }

    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 12px;
        padding: 15px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-title {
        font-size: 16px;
    }

    .cart-item-price {
        font-size: 18px;
    }

    .quantity-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .cart-summary {
        padding: 20px;
    }

    .summary-title {
        font-size: 20px;
    }

    .cart-icon {
        width: 40px;
        height: 40px;
    }

    .cart-icon i {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .cart-container {
        padding: 0 15px;
    }

    .cart-item {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cart-item-image {
        margin: 0 auto;
        width: 100%;
        height: 200px;
    }

    .cart-item-details {
        align-items: center;
    }

    .cart-item-quantity {
        justify-content: center;
    }

    .cart-item-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .remove-btn {
        width: 100%;
    }

    .summary-row {
        font-size: 14px;
    }

    .checkout-btn {
        padding: 14px;
        font-size: 14px;
    }
}

/* Loading State */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Message */
.success-message {
    position: fixed;
    top: 100px;
    right: 20px;
    background: #d4edda;
    color: #155724;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
