/* Products Page Styles */
/* Ensure this file loads after style.css to use CSS variables */

/* Force CSS to load - Test */
body.products-page {
    /* This ensures CSS is loaded */
}

/* Hero Section */
.products-hero {
    padding: 140px 0 100px;
    position: relative;
    overflow: hidden;
    margin-top: 0;
    z-index: 1;
    width: 100%;
}

/* Animated background will be applied via .animated-hero-background class */
.products-hero.animated-hero-background {
    background: 
        linear-gradient(135deg, #1a5f3f 0%, #28a745 25%, #20c997 50%, #17a2b8 75%, #1a5f3f 100%),
        url('data:image/svg+xml,<svg width="60" height="60" xmlns="http://www.w3.org/2000/svg"><circle cx="30" cy="30" r="2" fill="rgba(255,255,255,0.2)"/></svg>'),
        url('data:image/svg+xml,<svg width="80" height="80" xmlns="http://www.w3.org/2000/svg"><circle cx="40" cy="40" r="1.5" fill="rgba(255,255,255,0.15)"/></svg>'),
        url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 400% 400%, 60px 60px, 80px 80px, 100px 100px;
    background-position: 0% 50%, 0 0, 30px 30px, 50px 50px;
    animation: 
        gradient-shift 15s ease infinite,
        particle-float 20s linear infinite;
}

/* Remove old pseudo-elements - animated background handles this */
.products-hero.animated-hero-background::before,
.products-hero.animated-hero-background::after {
    /* Handled by .animated-hero-background styles */
}

.products-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 20px 0;
}

.products-hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    letter-spacing: -0.5px;
}

.products-hero p {
    font-size: 1.25rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease;
    animation-delay: 0.2s;
    animation-fill-mode: both;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Products Container */
.products-container {
    padding: 80px 0 100px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    min-height: calc(100vh - 400px);
    position: relative;
    z-index: 1;
}

/* Modern Filter Sidebar */
.filter-sidebar {
    background: white;
    border-radius: 24px;
    padding: 35px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06),
                0 2px 8px rgba(40, 167, 69, 0.08);
    position: sticky;
    top: 100px;
    animation: slideInLeft 0.6s ease;
    border: 1px solid rgba(40, 167, 69, 0.1);
    transition: all 0.3s ease;
}

.filter-sidebar:hover {
    box-shadow: 0 12px 48px rgba(0,0,0,0.1),
                0 4px 12px rgba(40, 167, 69, 0.12);
    transform: translateY(-2px);
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 2px solid rgba(40, 167, 69, 0.15);
}

.filter-header h3 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: #2c3e50;
    letter-spacing: -0.3px;
}

.filter-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-green);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
}

.filter-sidebar:hover .filter-icon {
    transform: rotate(15deg) scale(1.05);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.filter-group {
    margin-bottom: 25px;
}

.filter-label {
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    letter-spacing: -0.2px;
}

.filter-label i {
    color: var(--primary-green);
    font-size: 1.1rem;
}

.filter-input {
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 14px 18px;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 0.95rem;
    background: #fafafa;
    color: #495057;
}

.filter-input:hover {
    border-color: rgba(40, 167, 69, 0.3);
    background: white;
}

.filter-input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
    outline: none;
    background: white;
    transform: translateY(-1px);
}

.filter-btn {
    background: var(--gradient-green);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.filter-btn:active {
    transform: translateY(-1px);
}

.filter-clear {
    background: transparent;
    color: #6c757d;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    text-align: center;
}

.filter-clear:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

/* Products Header */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 50px;
    padding-bottom: 25px;
    border-bottom: 2px solid rgba(40, 167, 69, 0.1);
    animation: fadeInDown 0.6s ease;
}

.products-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: #2c3e50;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}

.products-count {
    color: #6c757d;
    font-size: 1.05rem;
    margin-top: 0;
    font-weight: 500;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sort-select {
    border: 2px solid #e9ecef;
    border-radius: 14px;
    padding: 12px 24px;
    font-weight: 600;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    color: #495057;
    min-width: 180px;
}

.sort-select:hover {
    border-color: rgba(40, 167, 69, 0.3);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
}

.sort-select:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 4px rgba(40, 167, 69, 0.1);
    outline: none;
}

/* Modern Product Grid */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 35px !important;
    animation: fadeIn 0.8s ease;
}

@media (min-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.product-card-new {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08),
                0 1px 3px rgba(0,0,0,0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    border: 1px solid rgba(40, 167, 69, 0.08);
    width: 100%;
    min-width: 0;
}

.product-card-new.animated {
    opacity: 1;
    transform: translateY(0);
}

.product-card-new:nth-child(1) { animation-delay: 0.1s; }
.product-card-new:nth-child(2) { animation-delay: 0.2s; }
.product-card-new:nth-child(3) { animation-delay: 0.3s; }
.product-card-new:nth-child(4) { animation-delay: 0.4s; }
.product-card-new:nth-child(5) { animation-delay: 0.5s; }
.product-card-new:nth-child(6) { animation-delay: 0.6s; }
.product-card-new:nth-child(7) { animation-delay: 0.7s; }
.product-card-new:nth-child(8) { animation-delay: 0.8s; }

.product-card-new:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 25px 70px rgba(40, 167, 69, 0.3),
                0 8px 20px rgba(0,0,0,0.1);
    border-color: rgba(40, 167, 69, 0.2);
}

.product-image-container {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image-new {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card-new:hover .product-image-new {
    transform: scale(1.15) rotate(2deg);
}

.product-badge-new {
    position: absolute;
    top: 18px;
    right: 18px;
    background: var(--gradient-green);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4),
                0 2px 5px rgba(0,0,0,0.1);
    z-index: 2;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.product-overlay-new {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.95) 0%, rgba(32, 201, 151, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.product-card-new:hover .product-overlay-new {
    opacity: 1;
}

.product-quick-view {
    background: white;
    color: var(--primary-green);
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transform: translateY(20px);
    transition: transform 0.4s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.product-card-new:hover .product-quick-view {
    transform: translateY(0);
}

.product-info-new {
    padding: 28px;
}

.product-name-new {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 14px;
    line-height: 1.5;
    min-height: 52px;
    letter-spacing: -0.2px;
}

.product-price-new {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-green);
    margin-bottom: 16px;
    letter-spacing: -0.3px;
}

.product-stock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 22px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 18px;
    transition: all 0.3s ease;
}

.product-stock.in-stock {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, rgba(32, 201, 151, 0.15) 100%);
    color: var(--primary-green);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.product-stock.out-stock {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

.product-card-new:hover .product-stock {
    transform: scale(1.05);
}

.product-view-btn {
    width: 100%;
    background: var(--gradient-green);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 14px 20px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.product-view-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.5);
    color: white;
}

.product-view-btn i {
    transition: transform 0.3s ease;
}

.product-view-btn:hover i {
    transform: translateX(4px);
}

.no-products {
    text-align: center;
    padding: 100px 40px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    border: 1px solid rgba(40, 167, 69, 0.1);
}

.no-products-icon {
    font-size: 5rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.no-products h3 {
    color: #6c757d;
    margin-bottom: 10px;
}

.no-products p {
    color: #adb5bd;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes float {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
}

/* Responsive */
@media (max-width: 992px) {
    .filter-sidebar {
        position: static;
        margin-bottom: 30px;
    }

    .products-hero h1 {
        font-size: 2.5rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .products-hero {
        padding: 100px 0 50px;
    }

    .products-hero h1 {
        font-size: 2rem;
    }

    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .products-container {
        padding: 40px 0 60px;
    }
}

