@import url("//cdn.web-fonts.ge/fonts/bpg-web-001-caps/css/bpg-web-001-caps.min.css");

/* --- 1. RESET & BASICS --- */
:root {
    --primary-red: #C53030;
    --primary-black: #000000;
    --dark-bg: #242024;
    --text-color: #333333;
    --bg-gradient-start: #f8f9fa;
    --bg-gradient-end: #e9ecef;
}

* {
    box-sizing: border-box; /* CRITICAL FIX: Ensures padding doesn't add width */
}

body {
    margin: 0;
    padding: 0;
    font-family: "BPG WEB 001 Caps", sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden; /* CRITICAL FIX: Prevents horizontal scroll/white space */
    width: 100%;
}

h1, h2, h3, h4, h5, h6, p, a, button, input, select, option {
    font-family: "BPG WEB 001 Caps", sans-serif !important;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; padding: 0; margin: 0; }
iframe { max-width: 100%; } /* Prevents maps from breaking layout */

/* --- 2. RESPONSIVE CONTAINER --- */
.container {
    width: 100%;
    padding-right: 20px;
    padding-left: 20px;
    margin-right: auto;
    margin-left: auto;
}

/* Breakpoints */
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

/* --- 3. NAVIGATION --- */
.navbar {
    padding: 1.5rem 0;
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-black) !important;
    display: flex;
    align-items: center;
    z-index: 1001;
}

.logo i {
    color: var(--primary-red);
    margin-right: 0.5rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav a {
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav a:hover {
    color: var(--primary-red);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: width 0.3s ease;
}

.nav a:hover::after { width: 100%; }

/* Nav Search */
.navsearch {
    background-color: #EAEAEA !important;
    border: none;
    border-radius: 25px;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    color: #333;
    width: 200px;
    transition: all 0.3s ease;
}

.navsearch:focus {
    width: 250px;
    outline: 2px solid var(--primary-red);
    background-color: #fff !important;
}

/* Burger Menu */
.nav-burger {
    display: none;
    cursor: pointer;
    z-index: 1002;
    padding: 10px; /* Bigger touch target */
}

.menu-btn {
    width: 30px;
    height: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-btn__line {
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s;
}

/* --- 4. HERO SECTION --- */
.hero-section {
    padding: 4rem 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.inside-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
}

.welcome-content {
    flex: 1;
    min-width: 300px;
}

.welcome-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.welcome-img {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

.welcome-button {
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    color: #fff;
    background: var(--primary-red);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* Search Box Area */
.selection-search {
    flex: 1;
    background: #fff;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-width: 300px;
    width: 100%; /* Ensures it fills container on mobile */
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.myform {
    width: 100% !important; /* CRITICAL: Override fixed widths */
    height: 3.5rem;
    padding: 0 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    max-width: 100%;
}

.search-btn button {
    width: 100%;
    height: 3.5rem;
    background-color: #FF3B30;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.search-btn button:hover { background-color: #d63026; }

/* Socials */
.socials {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}
.social {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

/* --- 5. GRIDS (Brands, Models, etc) --- */
/* FIXED: Increased gap and ensured items stretch */
.brands-grid, .models-grid, .years-grid, .parts-grid, .related-grid {
    display: grid;
    /* Responsive logic: Cards shrink to 220px before stacking */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem; /* Vertical and horizontal gap */
    width: 100%;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
}

/* Cards */
.brand-card, .model-card, .year-card, .part-card, .related-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 2rem 1.5rem; /* Increased vertical padding */
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px; /* FIXED: Ensures cards aren't too short */
}

.brand-card:hover, .model-card:hover, .year-card:hover, .part-card:hover, .related-card:hover {
    border-color: var(--primary-red);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(197, 48, 48, 0.15);
}

.part-image, .related-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* --- 6. PRODUCT PAGE --- */
.product-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: white;
    padding: 3rem;
    border-radius: 20px;
    margin: 2rem 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.product-gallery img.main-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s;
    text-align: center;
}
.btn-whts{
    border: solid 1px #33CC33;
    color: #33CC33;
}
.btn-secondary{
    color: #fff;
    background-color: #999999;
    border: none;
}

.btn-primary { background: var(--primary-red); color: white; border: none; font-weight: 100;}
.btn-primary:hover { background: #a02626; color: white; }
.btn-whts:hover{
    color: #fff;
    background-color: #33CC33;
}

/* --- 7. FOOTER (FIXED) --- */
footer {
    background-color: var(--dark-bg);
    color: white;
    padding: 4rem 0 2rem 0;
    margin-top: auto;
    width: 100%;
    overflow: hidden; /* Prevents overflow from children */
}

.footer-conteiner {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    justify-content: space-between;
}

.footer-one, .footer-two, .footer-three {

    min-width: 280px; /* Stacks on mobile */
    max-width: 100%; /* Ensures no overflow */
}

/* Footer Inputs Fix */
.helpform {
    width: 100%;
}

.helpform .inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap; /* Allows inputs to stack if needed */
}

.fixed-input {
    width: 100%; /* Makes inputs responsive */
    height: 44px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid #636363;
    border-radius: 5px;
    color: white;
    box-sizing: border-box; /* Important for width calculation */
}

/* Specific fix for the email input to sit next to message if space permits, or stack */
@media (min-width: 768px){
    .big-input { flex: 2; min-width: 150px; }
.small-input { flex: 1; min-width: 150px; }
}

#helpmessage {
    width: 100%;
    height: 44px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* Footer Map Fix */
.iframe-container {
    width: 100%;
    overflow: hidden; /* Cuts off any overflow */
    border-radius: 10px;
}

.iframe-container iframe {
    width: 100% !important; /* Force fit */
    max-width: 100% !important;
    border: 0;
    display: block;
}
.fas,.fab{
    margin-right: 0.3rem;
}

/* --- 8. MOBILE RESPONSIVENESS --- */

/* Tablet (Max 992px) */
@media (max-width: 992px) {
    .breadcrumb{
        padding-top: 7rem !important;
    }
    .car-years{
        padding: 5rem 0;
    }
    #mainNav{
        padding: 7rem 0;
    }
    .hero-section{
        padding: 7rem 0;
    }
    .nav-burger { display: flex; align-items: center; }
    .navbar{
        position: fixed;
        width: 100%;
    }
    
    .navbar .nav {
        position: fixed;
        top: 0;
        left: -100%; /* Hidden left */
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: #fff;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 5rem;
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
        transition: left 0.3s ease-in-out;
        z-index: 999;
    }

    .navbar .nav.active {
        left: 0;
    }

    .product-page {
        grid-template-columns: 1fr;
        padding: 2rem;
    }
}

/* Mobile (Max 768px) */
@media (max-width: 768px) {
    .searching{
        padding: 10rem 0;
    }
    .inside-container {
        flex-direction: column;
        gap: 5rem;
    }

    .selection-search {
        padding: 1.5rem;
    }

    /* Stack footer items completely */
    .footer-one, .footer-two, .footer-three {
        min-width: 100%;
    }

    /* Stack inputs on small screens */
    .helpform .inputs {
        flex-direction: column;
    }
    
    .big-input, .small-input {
        width: 100%;
    }

    /* Grid Adjustments for Mobile */
    .brands-grid, .models-grid, .parts-grid {
        gap: 1.5rem;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Smaller cards allowed */
    }
    .btn-primary{
        font-size: 0.8rem;
    }
}

/* Very Small Mobile (Max 480px) */
@media (max-width: 480px) {
    .brands-grid, .models-grid, .parts-grid {
        grid-template-columns: 1fr; /* Single column */
    }

    .navsearch {
        width: 100%; /* Full width search */
    }
    
    .navsearch:focus {
        width: 100%;
    }
    
    .welcome-content h1 {
        font-size: 2rem;
    }
    
    .btn {
        width: 100%;
    }
}

.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }