:root {
    --primary-yellow: #FFC107;
    --text-dark: #333;
    --text-medium: #666;
    --text-light: #999;
    --bg-light: #fafafa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1400px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px 40px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.logo img {
    height: 40px;
}

.main-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 500;
}

.nav-link.active, .nav-link:hover {
    color: var(--primary-yellow);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right a {
    display: block;
    text-decoration: none;
}

.lang-selector {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-light);
}

.lang.active {
    color: var(--primary-yellow);
    font-weight: 700;
}

.cart-container {
    position: relative;
    cursor: pointer;
}

.cart-container i {
    font-size: 20px;
    color: var(--text-medium);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 50%;
    font-weight: bold;
}

.user-avatar img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0e0e0;
}

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    padding-top: 40px;
}

.left-section {
    flex: 1;
    padding-right: 40px;
}

.search-area {
    margin-bottom: 60px;
}

.filters {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: var(--text-light);
    gap: 5px;
}

.filter-val {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
}

.search-bar {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 30px;
    padding: 10px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: 60px;
}

.plus-icon {
    font-size: 24px;
    color: var(--text-medium);
    margin-right: 15px;
    font-weight: 300;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
}

.search-input::placeholder {
    color: #ccc;
    letter-spacing: 2px;
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-actions i {
    color: var(--text-light);
    cursor: pointer;
}

.ai-btn {
    background: white;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hero-text h1 {
    font-size: 48px;
    font-weight: 700;
    color: #999;
    line-height: 1.1;
    letter-spacing: 1px;
}

.hero-text .highlight {
    color: var(--text-dark);
    font-size: 56px;
}

.hero-text p {
    font-size: 20px;
    color: var(--text-dark);
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.flag {
    height: 20px;
    border: 1px solid #ddd;
}

/* Right Section - Grid */
.right-section {
    position: relative;
    width: 500px;
    height: 500px;
}

.grid-backdrop {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100%;
    height: 100%;
    background: var(--primary-yellow);
    z-index: 1;
}

.brands-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 5px;
    width: 100%;
    height: 100%;
    background: transparent;
}

.grid-item {
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.grid-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.grid-item i {
    font-size: 24px;
    color: #4da6ff;
}

/* Pages shared styles */
.footer-text {
    text-align: center;
    padding: 20px;
    color: var(--text-medium);
    font-size: 12px;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Fallback text style */
.grid-item:not(:has(img:not([style*="none"]))) {
    font-size: 10px;
    color: #555;
    font-weight: 500;
    line-height: 1.2;
}


/* Specific styling for category icons to match image roughly */
.grid-item.category:nth-child(16) i { color: #5dade2; } /* Car */
.grid-item.category:nth-child(17) i { color: #5dade2; } /* Clipboard */
.grid-item.category:nth-child(18) i { color: #5dade2; } /* Wiper */
.grid-item.category:nth-child(19) i { color: #5dade2; } /* Spark Plug */


.grid-item.empty {
    border: 1px solid #ddd;
    background-color: #fff; /* Keep white but empty */
}

/* Responsive Scaling Logic */
/*
   Since scrolling is forbidden, we must scale content down on smaller screens.
   We can use media queries to adjust sizes.
*/

@media (max-width: 1200px) {
    .container { padding: 0 30px; }
    .hero-text-section h1 { font-size: 36px; }
    .brand-grid { width: 90%; }
}

@media (max-width: 992px) {
    .left-section { padding-right: 30px; }
    .right-section { width: 40%; }
    .nav-container { gap: 15px; }
    nav { gap: 15px; }
    .search-bar-container { height: 50px; }
    .plus-btn { font-size: 24px; }
}

@media (max-width: 768px) {
    /* Tablet/Mobile Layout */
    .container { padding: 10px 15px; }

    header {
        height: auto;
        min-height: 120px; /* Force minimum height */
        flex-direction: column;
        gap: 10px;
        padding-bottom: 10px;
        margin-bottom: 10px; /* Add margin to push main down */
    }

    .nav-container {
        width: 100%;
        flex-direction: column; /* Stack vertically */
        align-items: center;
        gap: 10px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 10px;
        margin-bottom: 5px;
    }

    .nav-link {
        font-size: 11px; /* Even smaller font */
    }

    .lang-selector {
        margin-bottom: 5px;
    }

    /* Fix overlap by aligning top instead of center */
    main {
        align-items: flex-start;
        padding-top: 10px;
    }

    .content-wrapper {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 0;
        overflow: hidden;
    }

    .left-section {
        width: 100%;
        padding-right: 0;
        align-items: center;
        text-align: center;
        flex: 0 0 auto;
        gap: 20px;
    }

    .search-area {
        align-items: center;
        gap: 15px;
    }

    .filter-row {
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px; /* Tighter gap */
        margin-bottom: 10px;
    }

    .filter-group {
        align-items: center;
        font-size: 10px;
    }

    .filter-value { font-size: 12px; }

    .hero-text-section h1 { font-size: 24px; margin-bottom: 5px; }
    .hero-text-section { margin-top: 0; }
    .specialist-text { font-size: 14px; margin-bottom: 10px; }

    .right-section {
        width: 100%;
        height: auto;
        flex: 1;
        max-width: 320px; /* Constrain width */
        margin-top: 10px;
        align-items: flex-start;
        overflow: hidden;
    }

    .brand-grid {
        width: 90%;
        max-width: 300px;
        margin: 0 auto;
        gap: 3px;
    }

    .grid-background {
        top: 10px;
        left: 10px;
        width: 100%;
        height: 100%;
    }
}

@media (max-height: 700px) {
    /* Short screens */
    header { padding: 10px 0; height: 60px; }
    .logo img { height: 30px; }
    .left-section { gap: 15px; }
    .hero-text-section h1 { font-size: 28px; }
    .grid-item { padding: 2px; }
}
