/* ==========================================================================
   FILE: css/explore.css
   DESCRIPTION: Specific styles for the Explore/Search Page
   UI/UX: Premium Dark Theme, Refined Search, 2-Column Mobile Grid
   ========================================================================== */

/* ==========================================================
   EXPLORE PAGE BASE
   ========================================================== */

.explore-page {
    background-color: var(--bg-base);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================
   EXPLORE HEADER
   ========================================================== */

.explore-header {
    padding: 140px 0 40px 0;
    text-align: center;
    position: relative;
    z-index: 10;
}

.explore-container {
    max-width: 800px;
    margin: 0 auto;
}

.explore-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    margin-bottom: 0.75rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-family: var(--font-heading);
}

.explore-subtitle {
    color: var(--text-muted);
    font-size: clamp(0.95rem, 1.2vw, 1.125rem);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ==========================================================
   MODERN SEARCH BOX
   ========================================================== */

.search-container {
    position: relative;
    width: 100%;
    max-width: 650px;
    margin: 0 auto 2rem auto;
    background: rgba(24, 24, 27, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    padding: 0.4rem;
    display: flex;
    align-items: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    transition: var(--transition-smooth);
}

.search-container:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
}

.search-icon {
    padding: 0 1.25rem;
    font-size: 1.1rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-container input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1.05rem;
    padding: 0.9rem 0;
    min-height: 52px;
    outline: none;
}

.search-container input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-weight: 400;
}

.clear-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0 1.25rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-btn:hover {
    color: var(--text-main);
}

.clear-btn.hidden {
    display: none !important;
}

/* ==========================================================
   FILTER PILLS
   ========================================================== */

.explore-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0.25rem;
}

.pill-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    min-height: 40px;
}

.pill-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.12);
}

.pill-btn:active {
    transform: translateY(0) scale(0.97);
}

.pill-btn.active {
    background: var(--bg-surface);
    color: var(--text-main);
    border-color: var(--primary-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 20px rgba(139, 92, 246, 0.05);
}

.pill-btn .text-orange {
    color: var(--accent-orange);
}

.pill-btn .text-purple {
    color: var(--primary-light);
}

.pill-btn .text-green {
    color: var(--accent-green);
}

.explore-filters .divider {
    width: 1px;
    height: 24px;
    background: var(--border-glass);
    margin: 0 0.25rem;
    flex-shrink: 0;
}

/* ==========================================================
   RESULTS SECTION
   ========================================================== */

.explore-results {
    flex-grow: 1;
    padding-bottom: 4rem;
}

.results-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.results-header h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    font-family: var(--font-body);
}

.results-header h3 strong {
    color: var(--text-main);
    font-weight: 600;
}

/* ==========================================================
   PRODUCT GRID
   ========================================================== */

.explore-grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* ==========================================================
   EMPTY STATE
   ========================================================== */

#explore-empty .empty-icon-wrapper {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* ==========================================================
   RESPONSIVE DESIGN
   ========================================================== */

@media (max-width: 1024px) {
    .explore-header {
        padding: 130px 0 30px 0;
    }
    
    .explore-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .explore-header {
        padding: 115px 0 20px 0;
    }

    .explore-title {
        font-size: 2.2rem;
    }

    .explore-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.75rem;
        padding: 0 0.5rem;
    }

    .search-container {
        padding: 0.25rem;
        border-radius: var(--radius-md);
        max-width: 100%;
        margin: 0 0.5rem 1.5rem 0.5rem;
    }

    .search-container input {
        font-size: 0.95rem;
        padding: 0.7rem 0;
        min-height: 44px;
    }

    .search-icon {
        padding: 0 0.75rem;
        font-size: 0.95rem;
    }

    .clear-btn {
        padding: 0 0.75rem;
        font-size: 0.95rem;
        min-height: 38px;
        min-width: 38px;
    }

    .explore-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 0.5rem 0.75rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }

    .explore-filters::-webkit-scrollbar {
        display: none;
    }

    .pill-btn {
        font-size: 0.78rem;
        padding: 0.4rem 1rem;
        white-space: nowrap;
        min-height: 36px;
        flex-shrink: 0;
    }

    .explore-filters .divider {
        display: none;
    }

    /* 🔴 MAIN FIX: 2 CARDS PER ROW ON MOBILE */
    .explore-grid-layout {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    
    .explore-grid-layout .product-card {
        min-width: 100% !important;
        max-width: 100% !important;
        transform: none !important;
        border-radius: var(--radius-sm) !important;
    }
    
    .explore-grid-layout .product-card:hover {
        transform: translateY(-3px) !important;
    }

    .explore-grid-layout .product-content {
        padding: 0.6rem !important;
    }

    .explore-grid-layout .product-title {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.2rem !important;
        -webkit-line-clamp: 2;
        min-height: 1.6rem;
    }

    .explore-grid-layout .product-category {
        font-size: 0.55rem !important;
        letter-spacing: 0.5px;
        margin-bottom: 0.2rem !important;
    }
    
    .explore-grid-layout .product-desc {
        display: none !important;
    }

    .explore-grid-layout .product-footer {
        padding-top: 0.5rem !important;
        gap: 0.3rem !important;
    }

    .explore-grid-layout .product-price {
        font-size: 0.85rem !important;
    }
    
    .explore-grid-layout .product-price .original {
        font-size: 0.65rem !important;
    }

    .explore-grid-layout .btn {
        padding: 0.4rem 0 !important;
        font-size: 0.6rem !important;
        border-radius: 6px !important;
        min-height: 32px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        letter-spacing: 0.3px;
    }

    .explore-grid-layout .badge-overlay {
        font-size: 0.5rem !important;
        padding: 0.15rem 0.4rem !important;
        top: 0.4rem !important;
        left: 0.4rem !important;
        border-radius: 4px !important;
    }
    
    .explore-grid-layout .product-image-wrapper {
        aspect-ratio: 1/1 !important;
    }

    .results-header {
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }
    
    .results-header h3 {
        font-size: 0.95rem;
    }

    #explore-empty .empty-icon-wrapper {
        font-size: 2.5rem;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .explore-header {
        padding: 105px 0 15px 0;
    }
    
    .explore-title {
        font-size: 1.8rem;
    }
    
    .explore-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.25rem;
    }
    
    .search-container {
        margin: 0 0.25rem 1rem 0.25rem;
        border-radius: var(--radius-sm);
    }
    
    .search-container input {
        font-size: 0.85rem;
        min-height: 38px;
        padding: 0.5rem 0;
    }
    
    .search-icon {
        padding: 0 0.5rem;
        font-size: 0.8rem;
    }
    
    .clear-btn {
        padding: 0 0.5rem;
        font-size: 0.8rem;
        min-height: 34px;
        min-width: 34px;
    }
    
    .pill-btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.75rem;
        min-height: 32px;
    }
    
    .explore-grid-layout {
        gap: 0.5rem !important;
    }
    
    .explore-grid-layout .product-content {
        padding: 0.4rem !important;
    }
    
    .explore-grid-layout .product-title {
        font-size: 0.65rem !important;
        min-height: 1.4rem;
    }
    
    .explore-grid-layout .product-price {
        font-size: 0.75rem !important;
    }
    
    .explore-grid-layout .btn {
        font-size: 0.5rem !important;
        padding: 0.3rem 0 !important;
        min-height: 28px !important;
        border-radius: 4px !important;
    }
    
    .explore-grid-layout .badge-overlay {
        font-size: 0.4rem !important;
        padding: 0.1rem 0.3rem !important;
        top: 0.3rem !important;
        left: 0.3rem !important;
    }
    
    .results-header h3 {
        font-size: 0.85rem;
    }
    
    .results-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
}

/* Large screens */
@media (min-width: 1400px) {
    .explore-grid-layout {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2.5rem;
    }
}

/* ==========================================================
   REDUCED MOTION SUPPORT
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    .explore-grid-layout .product-card {
        animation: none !important;
        opacity: 1 !important;
    }
    
    .explore-grid-layout .product-card:hover {
        transform: none !important;
    }
    
    .search-container {
        transition: none !important;
    }
    
    .pill-btn {
        transition: none !important;
    }
    
    .pill-btn:hover {
        transform: none !important;
    }
    
    .explore-grid-layout .product-image {
        transition: none !important;
    }
    
    .product-card:hover .product-image {
        transform: none !important;
    }
}