/* ==========================================================================
   SHRI MADHUBAN CHAKKI MASALE - COMMON PRODUCT STYLES
   ========================================================================== */

/* CSS Variables */
:root {
    --spice-orange: #ff6b35;
    --spice-red: #e74c3c;
    --spice-yellow: #ffc107;
    --spice-green: #28a745;
    --spice-dark: #2c3e50;
    --spice-brown: #8b4513;
    --primary-color: var(--spice-orange);
    --secondary-color: var(--spice-red);
    --success-color: var(--spice-green);
    --warning-color: var(--spice-yellow);
    --dark-color: var(--spice-dark);
    --gray-color: #6c757d;
}

/* ==========================================================================
   HERO SECTION STYLES
   ========================================================================== */

.products-hero {
    position: relative;
    height: 60vh;
    overflow: hidden;
    background: linear-gradient(145deg, #2c3e50 0%, #34495e 15%, #e74c3c 40%, #c0392b 65%, #8e44ad 85%, #2c3e50 100%);
    background-size: 400% 400%;
    animation: heroGradient 15s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.products-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at top left, rgba(255,193,7,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at top right, rgba(230,126,34,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at bottom left, rgba(211,84,0,0.1) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(192,57,43,0.08) 0%, transparent 50%);
    z-index: 1;
}

@keyframes heroGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* ==========================================================================
   SPICE PARTICLES ANIMATION
   ========================================================================== */

.spice-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.spice-particle {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.7;
    animation: floatSpice 15s infinite linear;
    color: rgba(255, 255, 255, 0.6);
}

@keyframes floatSpice {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* ==========================================================================
   LOADING OVERLAY
   ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--spice-orange), var(--spice-red));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   PRODUCT CARDS STYLES
   ========================================================================== */

.products-section {
    padding: 100px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f1f3f4 100%);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 3rem;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    height: 100%;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 50px rgba(231, 76, 60, 0.2);
}

.product-image {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 3rem;
}

/* ==========================================================================
   PRODUCT OVERLAY & ACTIONS
   ========================================================================== */

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.product-action-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    color: var(--spice-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
    cursor: pointer;
}

.product-card:hover .product-action-btn {
    transform: translateY(0);
    opacity: 1;
}

.product-action-btn:nth-child(1) { transition-delay: 0.1s; }
.product-action-btn:nth-child(2) { transition-delay: 0.2s; }
.product-action-btn:nth-child(3) { transition-delay: 0.3s; }

.product-action-btn:hover {
    background: var(--spice-orange);
    color: white;
    transform: scale(1.1) translateY(0);
}

/* ==========================================================================
   PRODUCT BADGES
   ========================================================================== */

.product-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--spice-orange), var(--spice-red));
    color: white;
    padding: 8px 15px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: pulse 2s infinite;
}

.product-badge.sale {
    background: linear-gradient(135deg, var(--spice-green), #27ae60);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   PRODUCT DETAILS
   ========================================================================== */

.product-details {
    padding: 2rem;
}

.product-category {
    color: var(--gray-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--spice-dark);
    margin-bottom: 1rem;
    font-family: "Noto Sans Devanagari", sans-serif;
    line-height: 1.4;
}

.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.stars {
    color: #ffc107;
    margin-right: 0.5rem;
}

.rating-text,
.rating-count {
    color: var(--gray-color);
    font-size: 0.9rem;
}

.product-price {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-current,
.current-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--spice-orange);
}

.price-original,
.original-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 0.5rem;
}

/* ==========================================================================
   STOCK INFORMATION
   ========================================================================== */

.stock-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.stock-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stock-available {
    background: rgba(40,167,69,0.1);
    color: var(--spice-green);
}

.stock-limited {
    background: rgba(255,193,7,0.1);
    color: var(--spice-yellow);
}

.stock-out {
    background: rgba(220,53,69,0.1);
    color: #dc3545;
}

.quantity-info {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* ==========================================================================
   STATS BANNER
   ========================================================================== */

.stats-banner {
    background: linear-gradient(135deg, var(--spice-orange), var(--spice-red));
    color: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.stats-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.1"><circle cx="15" cy="15" r="2"/><circle cx="45" cy="15" r="2"/><circle cx="30" cy="30" r="3"/><circle cx="15" cy="45" r="2"/><circle cx="45" cy="45" r="2"/></g></g></svg>');
    opacity: 0.1;
}

.stats-content {
    position: relative;
    z-index: 2;
}

.stats-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   FILTER SIDEBAR (for products.php)
   ========================================================================== */

.filter-sidebar {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group h5 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    padding: 0.3rem 0;
}

.filter-option input[type="checkbox"] {
    margin-right: 0.7rem;
    transform: scale(1.2);
    accent-color: var(--spice-orange);
}

.filter-option label {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--dark-color);
}

/* ==========================================================================
   SORT CONTROLS
   ========================================================================== */

.sort-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.sort-controls .form-select {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.sort-controls .form-select:focus {
    border-color: var(--spice-orange);
    box-shadow: 0 0 0 0.2rem rgba(255, 107, 53, 0.25);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    justify-content: center;
    margin-top: 3rem;
}

.pagination .page-link {
    border-radius: 8px;
    margin: 0 0.2rem;
    border: none;
    color: var(--dark-color);
    padding: 0.7rem 1rem;
    transition: all 0.3s ease;
}

.pagination .page-link:hover,
.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    font-family: 'Noto Sans Devanagari', sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-notification.success {
    background: var(--spice-green);
    color: white;
}

.toast-notification.error {
    background: #dc3545;
    color: white;
}

.toast-notification.info {
    background: #17a2b8;
    color: white;
}

.toast-notification.show {
    transform: translateX(0);
}

/* ==========================================================================
   FLOATING ICON ANIMATION
   ========================================================================== */

@keyframes float-icon {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.float-icon {
    animation: float-icon 3s ease-in-out infinite;
}

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .products-hero {
        height: 50vh;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 2rem;
    }
    
    .product-card {
        margin: 0 10px;
    }
    
    .filter-sidebar {
        padding: 1.5rem;
    }
    
    .sort-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-number {
        font-size: 2.5rem;
    }
    
    .product-details {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .product-image {
        height: 220px;
    }
    
    .product-action-btn {
        width: 40px;
        height: 40px;
    }
    
    .stats-number {
        font-size: 2rem;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.text-spice-orange { color: var(--spice-orange); }
.text-spice-red { color: var(--spice-red); }
.text-spice-green { color: var(--spice-green); }
.text-spice-dark { color: var(--spice-dark); }

.bg-spice-orange { background-color: var(--spice-orange); }
.bg-spice-red { background-color: var(--spice-red); }
.bg-spice-green { background-color: var(--spice-green); }

.shadow-spice {
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.15);
}

.border-spice {
    border-color: var(--spice-orange);
}
