/* ===========================================
   PRODUSE NOI - GRID LAYOUT
   =========================================== */

.products-new-section {
    background: none;
    padding: 0 0 50px;
    margin-top: 0;
}

/* 🔥 SPAȚIU ÎNTRE BRANDURI ȘI PRODUSE POPULARE */
#popular-products {
    margin-top: 50px; /* Spațiu între branduri de încredere și produse populare */
}

/* 🔥 STIL SPECIFIC PENTRU TITLURILE MAJORULUI */
#new-products .products-title,
#popular-products .products-title,
#recently-viewed-products .products-title {
    color: #2034AD !important;
    font-size: 30px !important;
    font-weight: 600 !important;
    font-family: 'Poppins', sans-serif !important;
    margin: 0 !important;
    display: block !important;
    visibility: visible !important;
}

/* 👁️ SPAȚIU ȘI STIL PENTRU PRODUSE VIZUALIZATE RECENT */
#recently-viewed-products {
    margin-top: 50px; /* Spațiu între produse populare și produse vizualizate recent */
}

/* 👁️ STILIZARE SUBTILĂ PENTRU BADGE-URI VIZUALIZATE RECENT */
#recently-viewed-products .badge-vazut {
    filter: hue-rotate(30deg); /* Ușoară modificare de culoare pentru badge */
    opacity: 0.9;
}

#recently-viewed-products .products-title {
    color: #1f2937 !important;
}

/* Header with title and navigation */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.products-title {
    font-size: 30px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: #2034AD;
    margin: 0;
}

.products-headline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.products-headline .section-subtitle {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #4b5563;
    max-width: 640px;
}

.products-nav {
    display: flex;
    gap: 10px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #2034AD;
    background: white;
    color: #2034AD;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(32, 52, 173, 0.15);
}

.nav-btn:hover {
    background: #2034AD;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(32, 52, 173, 0.25);
}

.nav-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(32, 52, 173, 0.2);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: #f5f5f5;
    border-color: #ddd;
    color: #999;
}

.nav-btn:disabled:hover {
    background: #f5f5f5;
    color: #999;
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-btn i {
    font-size: 16px;
    font-weight: bold;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Product Card - Force minimum width */
.product-card {
    background: white;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease, opacity 0.4s ease, transform 0.4s ease;
    position: relative;
    display: flex !important;
    flex-direction: column;
    min-width: 250px !important;
    min-height: 420px !important;
    padding: 12px !important;
}

.product-card:hover {
    border-color: #D0D0D0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-image {
    padding: 15px 15px 15px 15px;
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff !important;
    margin-bottom: 2px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-details {
    padding: 0 10px 65px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-name {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
    margin: 75px 0 10px 0;
    min-height: 50px;
}

.product-name a {
    color: #333;
    text-decoration: none;
    display: block;
    overflow: visible;
    word-wrap: break-word;
}

.product-name a:hover {
    color: #2034AD;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: #FF0000;
    margin: 0 0 8px;
    text-align: center;
}

.price-old {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    font-weight: 400;
    display: block;
}

@media (min-width: 769px) {
    .btn-add-to-cart {
        width: calc(100% - 90px);
        position: absolute;
        bottom: -20px;
        left: 10px;
    }
}

@media (max-width: 768px) {
    .btn-add-to-cart {
        width: 100%;
        position: static;
        bottom: auto;
        left: auto;
        margin-top: 20px;
        border-radius: 5px;
    background-color: #2034ad;
    height: 32px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-sizing: border-box;
    gap: 5px;
    text-align: center;
    font-size: 12px !important;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    border: none;
    cursor: pointer;
        transition: background-color 0.2s ease;
        line-height: 1;
    }
}

.btn-add-to-cart:hover {
    background-color: #1a2b8f;
}

.btn-add-to-cart .btn-text {
    position: relative;
    letter-spacing: 0.1px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-align: center;
    line-height: 1;
    margin: 0;
    padding: 0;
    font-size: 12px !important;
}

.btn-add-to-cart .btn-icon {
    width: 14px;
    position: relative;
    height: 14px;
    object-fit: cover;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Product Badges */
.product-badges {
    position: absolute !important;
    bottom: -35px !important;
    left: calc(100% - 55px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 50px !important;
    height: 32px !important;
    z-index: 10 !important;
}

/* Eye icon for in-stock products */
.badge-vazut {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain !important;
    opacity: 1 !important;
    display: block !important;
}

.product-details .badge-vazut:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* Wishlist button moved to image */
.btn-wishlist-image {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    z-index: 2;
}

.btn-wishlist-image:hover {
    color: #FF0000;
    background: white;
    transform: scale(1.1);
}

.btn-wishlist {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.btn-wishlist:hover {
    color: #FF0000;
}

/* Hidden state for pagination */
.product-card.js-hidden {
    display: none !important;
}

/* Visible state for smooth transitions */
.product-card.js-visible {
    display: flex !important;
}

/* Paginated cards animation */
.product-card.js-paginated {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card.js-paginated.js-hidden {
    display: none !important;
}

.product-card.js-paginated.js-visible {
    display: flex !important;
    animation: fadeInUp 0.4s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design - RESPONSIVE AUTO-FILL SYSTEM */

/* Extra large screens (1600px+) - auto-fill with 250px minimum */
@media (min-width: 1600px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

/* Large screens (1400px-1599px) - auto-fill with 250px minimum */  
@media (min-width: 1400px) and (max-width: 1599px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 18px;
    }
}

/* Medium-large screens (1300px-1399px) - auto-fill with 250px minimum */
@media (min-width: 1300px) and (max-width: 1399px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}

/* Medium screens (1100px-1299px) - auto-fill with 250px minimum */
@media (min-width: 1100px) and (max-width: 1299px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}

/* Small-medium screens (900px-1099px) - auto-fill with 250px minimum */
@media (min-width: 900px) and (max-width: 1099px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 14px;
    }
    
    .product-card {
        font-size: 12px;
    }
    
    .products-title {
        font-size: 26px;
    }
}

/* Small screens (768px-899px) - auto-fill with 250px minimum */
@media (min-width: 768px) and (max-width: 899px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 12px;
    }
    
    .product-card {
        font-size: 12px;
    }
    
    .products-title {
        font-size: 24px;
    }
    
    .product-image {
        height: 160px;
    }
}

/* Very small screens (576px-767px) - 2 columns as requested */
@media (min-width: 576px) and (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .product-name {
        font-size: 12px;
        min-height: 45px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .products-title {
        font-size: 22px;
    }
}

/* Extra small screens (<576px) - single column only */
@media (max-width: 575px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .products-header {
        margin-bottom: 20px;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .products-title {
        font-size: 20px;
        text-align: center;
    }
    
    .nav-btn {
        width: 32px;
        height: 32px;
    }
    
    .product-image {
        height: 140px;
        padding: 8px;
    }
    
    .product-details {
        padding: 8px;
    }
    
    .product-name {
        font-size: 11px;
        min-height: 40px;
    }
    
    .product-price {
        font-size: 14px;
    }
    
    .btn-add-to-cart {
        height: 30px;
        font-size: 11px !important;
    }
}

/* Override category-premium.css with higher specificity */
.container .products-grid,
.container section.products-new-section .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
}

@media (min-width: 1600px) {
    .container .products-grid,
    .container section.products-new-section .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
}

@media (min-width: 1400px) and (max-width: 1599px) {
    .container .products-grid,
    .container section.products-new-section .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
}

@media (min-width: 1100px) and (max-width: 1399px) {
    .container .products-grid,
    .container section.products-new-section .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
}

@media (min-width: 768px) and (max-width: 1099px) {
    .container .products-grid,
    .container section.products-new-section .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
    }
}

@media (max-width: 767px) {
    .container .products-grid,
    .container section.products-new-section .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ===========================================
   DESIGN MODERN PREMIUM - PAGINILE DE CATEGORII
   =========================================== */

/* Container principal cu background gradient subtil */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%) !important;
    min-height: 100vh;
}

/* FORȚEZ APLICAREA DESIGN-ULUI PREMIUM PE PAGINILE DE CATEGORII */
.container section.products-new-section div.product-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%) !important;
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15) !important;
    backdrop-filter: blur(4px) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    overflow: hidden !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 420px !important;
}

/* Hover effect spectaculos pentru cards */
.container section.products-new-section div.product-card:hover {
    transform: translateY(-12px) !important;
    box-shadow: 0 20px 60px rgba(31, 38, 135, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

/* Imagine produs cu efecte moderne */
.container section.products-new-section div.product-card div.product-image {
    background: #ffffff !important;
    border-radius: 0 !important;
    margin: 0 0 2px 0 !important;
    position: relative !important;
    overflow: hidden !important;
    height: 240px !important;
    padding: 15px 15px 15px 15px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.container section.products-new-section div.product-card div.product-image::before {
    display: none !important;
}

/* Imaginea în sine cu efect de zoom */
.container section.products-new-section div.product-card div.product-image img {
    transition: transform 0.4s ease !important;
    position: relative;
    z-index: 2;
}

.container section.products-new-section div.product-card:hover div.product-image img {
    transform: scale(1.1) !important;
}

/* Detalii produs cu spacing îmbunătățit */
.container section.products-new-section div.product-card div.product-details {
    padding: 0 10px 20px 10px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Titlu produs modern */
.container section.products-new-section div.product-card h3.product-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    margin: 75px 0 10px 0 !important;
    padding-top: 0 !important;
    min-height: 50px !important;
    color: #2d3748 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

.container section.products-new-section div.product-card h3.product-name a {
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.container section.products-new-section div.product-card:hover h3.product-name a {
    color: #667eea !important;
}

/* Preț cu design premium */
.container section.products-new-section div.product-card div.product-price {
    font-size: 22px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    margin: 0 0 8px !important;
    text-align: center !important;
    text-shadow: none !important;
}

/* Buton modern cu gradienți */
.container section.products-new-section div.product-card button.btn-add-to-cart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: white !important;
    width: calc(100% - 90px) !important;
    position: absolute !important;
    bottom: -20px !important;
    left: 10px !important;
    height: 32px !important;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

.container section.products-new-section div.product-card button.btn-add-to-cart:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%) !important;
}

/* Sidebar filtre modern cu glassmorphism */
.filters-sidebar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 20px !important;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    padding: 25px !important;
}

/* Headers pentru filtre cu accent line */
.filters-sidebar h3 {
    color: #2d3748 !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    margin-bottom: 15px !important;
    position: relative !important;
}

.filters-sidebar h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Checkboxes moderne cu gradient states */
.filters-sidebar input[type="checkbox"] {
    appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 4px !important;
    background: white !important;
    position: relative !important;
    transition: all 0.3s ease !important;
}

.filters-sidebar input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-color: #667eea !important;
}

.filters-sidebar input[type="checkbox"]:checked::before {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* Price slider modern cu glassmorphism */
#priceProgress {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.price-control {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: 3px solid white !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

/* Responsive grid cu gap-uri reduse pentru categorii */
@media (min-width: 1600px) {
    .container .products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px !important;
    }
}

@media (min-width: 1400px) and (max-width: 1599px) {
    .container .products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px !important;
    }
}

@media (min-width: 1300px) and (max-width: 1399px) {
    .container .products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
    }
}

@media (min-width: 1100px) and (max-width: 1299px) {
    .container .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }
}

@media (min-width: 900px) and (max-width: 1099px) {
    .container .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }
}

@media (min-width: 768px) and (max-width: 899px) {
    .container .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}

@media (max-width: 767px) {
    /* Reduce container padding for full width cards */
    .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .container .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }

    /* Ensure products are visible on mobile */
    .container .product-card {
        display: flex !important;
        min-width: 0 !important;
        min-height: 360px !important;
        padding: 8px !important;
    }

    .container .product-image {
        height: 160px !important;
        padding: 10px !important;
    }

    .container .product-details {
        padding: 8px 5px 20px 5px !important;
    }

    .container .product-name {
        font-size: 12px !important;
        line-height: 1.3 !important;
        margin: 8px 0 !important;
        min-height: 40px !important;
    }

    .container .product-price {
        font-size: 16px !important;
    }
}

/* Product name spacing */
.container section.products-new-section div.product-card div.product-details h3.product-name {
    margin: 75px 0 10px 0 !important;
    padding-top: 0 !important;
    min-height: 50px !important;
    line-height: 1.3 !important;
}

/* Preț cu design premium */
.container section.products-new-section div.product-card div.product-price {
    font-size: 22px !important;
    font-weight: 800 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    margin: 0 0 8px !important;
    text-align: center !important;
    text-shadow: none !important;
}

/* 🎯 RECENTLY VIEWED PRODUCTS - Specific pagination styles */
#recently-viewed-products .products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* Always 4 columns for pagination */
    gap: 20px !important;
    margin-top: 30px !important;
}

/* Ensure product cards are visible when shown with inline styles */
#recently-viewed-products .product-card {
    /* Will be controlled by JavaScript inline styles */
}

/* Remove any interfering classes */
#recently-viewed-products .product-card.js-visible,
#recently-viewed-products .product-card.js-hidden {
    /* Override any conflicting styles */
}

/* Responsive columns for recently viewed - keep 4 items per page */
@media (max-width: 1200px) {
    #recently-viewed-products .products-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 15px !important;
    }
    
    #recently-viewed-products .product-card {
        min-width: 0 !important;
    }
}

@media (max-width: 992px) {
    #recently-viewed-products .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    #recently-viewed-products .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    #recently-viewed-products .products-grid {
        grid-template-columns: 1fr !important;
    }
} 

@media (max-width: 767px) {
    .products-new-section {
        padding: 0 0 20px !important;
    }

    .products-new-section .products-grid,
    #new-products .products-grid,
    #popular-products .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    .products-new-section .product-card {
        min-width: 0 !important;
        min-height: 360px !important;
        padding: 8px !important;
    }

    .products-new-section .product-image {
        height: 160px !important;
        padding: 10px !important;
    }

    .products-new-section .product-name {
        font-size: 12px !important;
        margin: 8px 0 !important;
    }

    .products-new-section .product-price {
        font-size: 16px !important;
    }
}

@media (max-width: 575px) {
    .products-new-section .products-grid,
    #new-products .products-grid,
    #popular-products .products-grid {
        grid-template-columns: 1fr !important;
    }
}
