﻿:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --accent-color: #f43f5e;
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --border-radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px 0;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary-color);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.search-bar {
    display: flex;
    background: #f1f5f9;
    border-radius: 50px;
    padding: 5px 15px;
    width: 350px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-bar input {
    border: none;
    background: none;
    flex-grow: 1;
    padding: 8px;
    outline: none;
    font-family: inherit;
}

.search-bar button {
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
}

/* Hero Section */
.hero {
    margin-bottom: 40px;
}

.hero-carousel {
    position: relative;
    width: 100%;
    height: 260px;
    overflow: hidden;
    background: #f5f5f7;
}

.hero-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Layout */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-top: 20px;
    min-width: 0;
}

/* Sidebar */
.sidebar .filter-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--glass-shadow);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: sticky;
    top: 100px;
}

.filter-card h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-group select,
.filter-group input[type="range"] {
    width: 100%;
}

.filter-group select {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    outline: none;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Content */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge {
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

/* Stores List */
.stores-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 40px;
}

.store-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.3s;
}

.store-badge:hover {
    transform: translateY(-5px);
}

.store-badge img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Product Cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
    min-width: 0;
    width: 100%;
}

.product-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.product-image {
    position: relative;
    height: 200px;
    background: #f8fafc;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discount-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    z-index: 10;
}

.product-info {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.store-name {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.product-info h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    height: 3.2rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-wrapper {
    margin-top: auto;
    margin-bottom: 15px;
}

.old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 8px;
}

.current-price {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-main);
}

.btn-view {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    background: #f1f5f9;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-view:hover {
    background: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 991px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        align-items: center;
        margin-bottom: 25px;
    }
}

/* Carousel Specific Styles */
.featured-carousel-section .carousel-controls {
    display: flex;
    gap: 10px;
}

.carousel-controls button {
    background: white;
    border: 1px solid #e2e8f0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-main);
}

.carousel-controls button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.carousel-container {
    overflow: hidden;
    margin-bottom: 40px;
    padding: 10px 5px;
}

.carousel-track {
    display: flex;
    gap: 24px;
    transition: transform 0.5s ease-in-out;
}

.carousel-track .product-card {
    min-width: 250px;
    flex-shrink: 0;
}

/* Fix content column overflow */
.content {
    min-width: 0;
    overflow: hidden;
    width: 100%;
}

.products-section {
    min-width: 0;
    overflow: hidden;
}

.featured-carousel-section {
    min-width: 0;
}

/* Category Pills */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.cat-pill {
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-main);
    font-family: inherit;
}

.cat-pill:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.cat-pill.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.cat-count {
    opacity: 0.75;
    font-weight: 400;
}

@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
    }
    .search-bar {
        width: 100%;
    }
    .hero-carousel {
        height: 120px;
    }
}

/* Filter Accordion (mobile) */
.filter-toggle {
    display: none;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.filter-chevron {
    transition: transform 0.3s ease;
}

.filter-toggle[aria-expanded='true'] .filter-chevron {
    transform: rotate(180deg);
}

.filter-body {
    /* always visible on desktop */
}

@media (max-width: 991px) {
    .filter-toggle {
        display: flex;
    }
    .filter-card h3 {
        display: none;
    }
    .filter-body {
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows 0.3s ease;
        overflow: hidden;
    }
    .filter-body > * {
        min-height: 0;
        overflow: hidden;
    }
    .filter-body.open {
        grid-template-rows: 1fr;
    }
}

/* Fix accordion - override with max-height approach */
@media (max-width: 991px) {
    .filter-body {
        display: block !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
        grid-template-rows: unset !important;
    }
    .filter-body.open {
        max-height: 800px;
        grid-template-rows: unset !important;
    }
}
