@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --accent: #38bdf8;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

/* Header */
header {
    background-color: var(--bg-card);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 8px 20px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 30px;
}

.logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    margin-left: 20px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Search Bar Section */
.search-bar-section {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 8px 20px;
    position: sticky;
    top: 58px;
    z-index: 40;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    margin: 0;
}

.search-bar-container {
    max-width: 1050px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 14px;
    transition: border-color 0.2s;
}

.search-input-wrap:focus-within {
    border-color: var(--primary);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-main);
}

.search-input::placeholder {
    color: #94a3b8;
}

.location-select {
    display: none;
    /* Hide the native select, we'll use it behind the scenes */
}

/* Custom Location Dropdown */
.custom-loc-dropdown {
    position: relative;
    min-width: 240px;
    font-size: 14px;
}

.custom-loc-dropdown.active {
    z-index: 105;
}

.custom-loc-trigger {
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 14px;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s;
    user-select: none;
}

.custom-loc-trigger:hover,
.custom-loc-dropdown.active .custom-loc-trigger {
    border-color: var(--primary);
}

.custom-loc-trigger svg {
    width: 14px;
    height: 14px;
    fill: #64748b;
    transition: transform 0.3s;
}

.custom-loc-dropdown.active .custom-loc-trigger svg {
    transform: rotate(180deg);
}

.custom-loc-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-height: 350px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    padding: 8px 0;
}

.custom-loc-dropdown.active .custom-loc-menu {
    display: block;
    animation: fadeInDown 0.2s ease-out;
}

.custom-loc-item {
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-main);
}

.custom-loc-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.custom-loc-group-title {
    padding: 8px 16px;
    font-weight: 600;
    color: var(--text-muted);
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.custom-loc-group-title:hover {
    background: #f1f5f9;
}

.custom-loc-group-title .arrow {
    font-size: 10px;
    transition: transform 0.3s;
}

.custom-loc-group.open .custom-loc-group-title .arrow {
    transform: rotate(180deg);
}

.custom-loc-group-content {
    display: none;
    border-left: 2px solid #e2e8f0;
    margin-left: 16px;
}

.custom-loc-group.open .custom-loc-group-content {
    display: block;
}

.custom-loc-sub-item {
    padding: 6px 16px 6px 12px;
    font-size: 13.5px;
    color: #475569;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Slider Container (1200px max-width, 4:1 ratio) */
.hero-slider-container {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto 30px;
    aspect-ratio: 4 / 1;
    position: relative;
    overflow: hidden;
    background: #e2e8f0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.banner-empty-gray {
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-single-static {
    width: 100%;
    height: 100%;
}

.banner-single-static img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-slider-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slider-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: #ffffff;
    width: 24px;
    border-radius: 10px;
}

/* Fallback Hero Section */
.hero {
    max-width: 1200px;
    width: 100%;
    margin: 20px auto 30px;
    background: linear-gradient(135deg, var(--secondary) 0%, #1e293b 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
    border-radius: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    aspect-ratio: 4 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(to right, #60a5fa, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 18px;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
}

/* Filters */
.filters-section {
    max-width: 1200px;
    margin: 40px auto 20px;
    padding: 0 20px;
    scroll-margin-top: 130px;
}

.header-filters-container {
    padding: 10px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.brand-filters {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
}

.filter-btn {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-filter-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    object-fit: contain;
    border-radius: 50%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: #ffde59;
    /* Yellow background */
    border-color: #facc15;
}

.all-text-logo {
    width: 36px;
    height: 36px;
    background: #393185;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
}



/* Products Grid */
.products-grid {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border);
    position: relative;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
}

.product-img-wrapper {
    aspect-ratio: 2 / 1;
    width: 100%;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform 0.5s;
}

.placeholder-img {
    background-color: #e2e8f0;
    width: 100%;
    height: 100%;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-weight: 600;
    text-align: center;
    padding: 16px;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.out {
    background: var(--danger);
}

.product-bottom-area {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    background: #fff;
    flex: 1;
}

.product-info-section {
    display: flex;
    gap: 12px;
    flex-grow: 1;
    align-items: center;
}

.product-brand-large {
    flex: 0 0 75px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-brand-large img {
    width: 100%;
    max-height: 52px;
    object-fit: contain;
    transform: scale(1.2);
}

.product-details-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}

.product-title {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    margin: 0;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-specs-bar {
    display: flex;
    gap: 4px;
    font-size: 12px;
    line-height: 1.2;
    color: #64748b;
}

.product-specs-bar span {
    background: #f1f5f9;
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-seller {
    font-size: 12px;
    line-height: 1.2;
    color: #64748b;
    margin: 3px 0 0 0;
}

.product-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 6px;
    margin-top: 10px;
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.footer-tag {
    background: #f1f5f9;
    border-radius: 4px;
    padding: 4px 2px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
    flex: 1;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-tag:hover {
    background: #e2e8f0;
}

/* Black styling for Price and View Details buttons */
.price-tag,
.view-tag {
    background: #111827 !important;
    /* Premium Black */
    color: #ffffff !important;
    border: none;
}

.price-tag:hover,
.view-tag:hover {
    background: #000000 !important;
    /* Pure Black on hover */
}

/* Pagination Styling */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 20px;
}

.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.page-btn {
    padding: 6px 12px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: none;
}

.page-btn:hover {
    background: transparent;
    color: var(--primary);
    border: none;
}

.page-btn.active {
    background: transparent;
    color: var(--primary);
    border: none;
    font-weight: 800;
    font-size: 16px;
    text-decoration: underline;
    text-underline-offset: 6px;
}

.page-btn.prev-btn,
.page-btn.next-btn {
    color: var(--text-main);
    font-weight: 600;
    padding: 6px 12px;
}

.page-btn.prev-btn:hover,
.page-btn.next-btn:hover {
    color: var(--primary);
}

/* Product Details Page */
.details-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.details-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    background: #f8fafc;
    padding: 30px;
}

.details-info h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.details-price {
    font-size: 36px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 30px;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.spec-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
}

.spec-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.spec-value {
    font-weight: 600;
    font-size: 16px;
}

.description {
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Footer */
footer {
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-top: auto;
}

/* Responsive Design - Tablets & iPads */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .details-container {
        gap: 30px;
        padding: 30px;
    }

    .hero h1 {
        font-size: 40px;
    }
}

/* Responsive Design - Mobile Phones & Tablets */
@media (max-width: 768px) {
    header {
        position: relative;
        width: 100%;
    }

    .nav-container {
        flex-direction: column;
        align-items: center;
        padding: 6px 12px;
        gap: 4px;
        width: 100%;
    }

    .logo {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-left: 0;
    }

    .logo img {
        width: 300px !important;
        height: auto !important;
        max-width: 90%;
    }

    .brand-filters {
        display: flex;
        width: 100%;
        max-width: 480px;
        margin: 0 auto;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }

    .filter-btn {
        width: 50px;
        height: 50px;
    }

    .brand-filter-icon {
        width: 42px;
        height: 42px;
    }

    .all-text-logo {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .nav-links {
        display: none !important;
    }

    /* Fix Search Bar on Mobile */
    .search-bar-section {
        position: static;
        padding: 6px 15px 10px;
        width: 100%;
        box-shadow: none;
        border-bottom: 1px solid var(--border);
        margin-top: 0;
    }

    .search-bar-container {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .search-input-wrap {
        width: 100%;
        order: 1;
    }

    .custom-loc-dropdown {
        width: 100%;
        min-width: 0 !important;
        order: 2;
    }

    #customBrandDropdown {
        order: 3;
    }

    .hero {
        width: 100%;
        margin: 15px auto 20px;
        border-radius: 0;
        padding: 24px 15px;
        text-align: center;
        aspect-ratio: auto;
        min-height: 110px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 14px;
    }

    .products-grid {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 20px;
        width: 100%;
    }

    .details-container {
        grid-template-columns: 1fr;
        padding: 15px;
        margin: 15px auto;
        width: 100%;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }

    .details-price {
        font-size: 26px;
    }

    .details-info h1 {
        font-size: 22px;
    }
}

/* Responsive Design - Small Mobile */
@media (max-width: 480px) {
    .nav-container {
        padding: 10px;
        gap: 10px;
    }

    .logo img {
        width: 260px !important;
        height: auto !important;
        max-width: 90%;
    }

    .brand-filters {
        width: 100%;
        justify-content: space-between;
    }

    .filter-btn {
        width: 45px;
        height: 45px;
    }

    .brand-filter-icon {
        width: 38px;
        height: 38px;
    }

    .all-text-logo {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .products-grid {
        padding: 10px;
        gap: 16px;
    }

    .product-footer-row {
        gap: 6px;
    }

    .footer-tag {
        font-size: 12px;
        padding: 6px 10px;
    }
}


/* Responsive Design - Ultra-Compact Mobile (320px - 360px) */
@media (max-width: 360px) {
    .nav-container {
        padding: 8px;
        gap: 8px;
    }

    .logo img {
        width: 200px !important;
        height: auto !important;
        max-width: 95%;
    }

    .brand-filters {
        width: 100%;
        justify-content: space-between;
    }

    .filter-btn {
        width: 38px;
        height: 38px;
    }

    .brand-filter-icon {
        width: 32px;
        height: 32px;
    }

    .all-text-logo {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .footer-tag {
        font-size: 11px;
        padding: 4px 6px;
    }
}

/* Dropdown styles */
.nav-links {
    display: flex;
    align-items: center;
    margin-right: 30px;
}
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown .dropbtn {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    margin-left: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.dropdown .arrow {
    font-size: 10px;
}
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-card);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 100;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 0;
    border: 1px solid var(--border);
}
.dropdown-content a {
    padding: 12px 16px;
    display: block;
    margin-left: 0 !important;
    font-weight: 400 !important;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
}
.dropdown-content a:last-child {
    border-bottom: none;
}
.dropdown-content a:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}
.dropdown:hover .dropdown-content {
    display: block;
}
