/* Emergency Fixes CSS for MidasBeauty Live Site */
/* Ensures proper styling for all emergency fix components */

/* ===== CART SIDEBAR FIXES ===== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.cart-header h3 {
    margin: 0;
    color: #d4af37;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-cart {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.close-cart:hover {
    background: rgba(255, 255, 255, 0.1);
}

.cart-items {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 2rem;
    font-style: italic;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 1rem;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.cart-item-price {
    color: #d4af37;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.cart-item-quantity {
    font-size: 0.85rem;
    color: #666;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.cart-total span:last-child {
    color: #d4af37;
}

#checkout-btn {
    width: 100%;
    background: linear-gradient(135deg, #d4af37, #f4e4a6);
    color: #1a1a1a;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

#checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* ===== CART COUNT BADGE ===== */
.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cartBounce 0.5s ease;
    z-index: 1;
}

@keyframes cartBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

/* ===== PRODUCT GRID FIXES ===== */
.featured-products-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.product-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #d4af37, #f4e4a6);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.product-card:hover::before {
    transform: scaleX(1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.05);
}

.product-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    line-height: 1.3;
}

.product-card .description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.product-price-rating {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #d4af37;
}

.product-price .sale-price {
    color: #d4af37;
}

.product-price .original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.product-rating {
    color: #f39c12;
    font-size: 0.9rem;
}

.add-to-cart {
    width: 100%;
    background: linear-gradient(135deg, #d4af37, #f4e4a6);
    color: #1a1a1a;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.add-to-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.add-to-cart:hover::before {
    left: 100%;
}

.add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.add-to-cart:active {
    transform: translateY(0);
}

/* ===== NOTIFICATION SYSTEM ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-weight: 500;
    max-width: 300px;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    background: #28a745;
    color: white;
}

.notification.error {
    background: #dc3545;
    color: white;
}

.notification.info {
    background: #007bff;
    color: white;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== SEARCH RESULTS ===== */
.search-results-message {
    text-align: center;
    color: #666;
    grid-column: 1 / -1;
    padding: 2rem;
    font-style: italic;
}

.search-results-count {
    text-align: center;
    color: #d4af37;
    grid-column: 1 / -1;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* ===== USER INDICATOR ===== */
.user-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.user-indicator img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #d4af37;
}

.user-indicator span {
    color: #d4af37;
    font-weight: 500;
    font-size: 0.9rem;
}

/* ===== LOADING STATES ===== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.loading-content {
    text-align: center;
    color: #1a1a1a;
}

.loading-content .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    margin-bottom: 1rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 1rem 0;
    }
    
    .product-card {
        padding: 1rem;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .user-indicator {
        margin-right: 0.5rem;
        padding: 0.25rem 0.75rem;
    }
    
    .user-indicator span {
        display: none;
    }
}

@media (max-width: 480px) {
    .cart-header {
        padding: 1rem;
    }
    
    .cart-items {
        padding: 0.5rem;
    }
    
    .cart-footer {
        padding: 1rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .featured-products-section {
        padding: 2rem 0;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
.high-contrast .cart-sidebar {
    background: #000000;
    color: #ffffff;
    border-left: 3px solid #ffff00;
}

.high-contrast .product-card {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffff00;
}

.high-contrast .add-to-cart {
    background: #ffff00;
    color: #000000;
}

/* ===== PRINT STYLES ===== */
@media print {
    .cart-sidebar,
    .notification,
    .loading-overlay {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
