/* ============================================
   IMPORT MOTORING - GLOBAL STYLESHEET
   Only includes styles actually being used
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --color-primary: #E31A21;
    --color-secondary: #4C4C4C;
    --color-dark: #1a1a1a;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #ddd;
    --color-bg-light: #f8f8f8;
    --color-white: #fff;
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    --container-max: 1140px;
}

/* ============================================
   GLOBAL TEMPLATE SCOPING
   ============================================ */

body.im-template {
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    margin: 0;
    padding: 0;
}

body.im-template * {
    box-sizing: border-box;
}

body.im-template h1,
body.im-template h2,
body.im-template h3,
body.im-template h4,
body.im-template h5,
body.im-template h6 {
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 1rem 0;
    color: var(--color-dark);
}

body.im-template h1 { font-size: 48px; }
body.im-template h2 { font-size: 36px; }
body.im-template h3 { font-size: 28px; }
body.im-template h4 { font-size: 24px; }
body.im-template h5 { font-size: 20px; }

body.im-template p {
    margin: 0 0 1rem 0;
    font-weight: 400;
    line-height: 1.8;
}

body.im-template a:not(.btn) {
    color: var(--color-primary);
    transition: color 0.2s ease;
    text-decoration: none;
}

body.im-template a:not(.btn):hover {
    color: var(--color-secondary);
}

body.im-template-blog,
body.im-template-listing,
body.im-template-search {
    background: var(--color-bg-light);
}

/* ============================================
   LAYOUT
   ============================================ */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
}

/* New Layout System - Semantic Names */
.layout-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.layout-row.layout-center {
    justify-content: center;
}

.layout-row.layout-spaced {
    justify-content: space-between;
}

.layout-row.layout-even {
    justify-content: space-evenly;
}

.layout-half {
    flex: 0 0 50%;
    padding: 0 15px;
}

.layout-third {
    flex: 0 0 33.333%;
    padding: 0 15px;
}

.layout-twothirds {
    flex: 0 0 66.666%;
    padding: 0 15px;
}

.layout-quarter {
    flex: 0 0 25%;
    padding: 0 15px;
}

.layout-auto {
    flex: 1;
    padding: 0 15px;
    min-width: 0;
}

/* OLD DEPRECATED - DO NOT USE */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-6 {
    flex: 0 0 50%;
    padding: 0 15px;
    background: red !important;
}

.col-6::before {
    content: 'DO NOT USE .col-6 - Use .layout-half instead';
    display: block;
    color: white;
    font-weight: bold;
    padding: 10px;
}

/* ============================================
   UTILITIES - Only what's used
   ============================================ */

.mt-4 { margin-top: 2rem; }

.text-primary { color: var(--color-primary); }

.font-weight-bold { font-weight: 700; }

.rounded { border-radius: 8px; }

.shadow { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.hide-mobile { display: block; }

.show-mobile { display: none; }

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    font-size: 16px;
    line-height: 1.5;
    font-family: var(--font-main);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: #c11519;
    color: var(--color-white);
}

.btn-light {
    background: var(--color-white);
    color: var(--color-dark);
}

.btn-light:hover {
    background: var(--color-bg-light);
    color: var(--color-dark);
}

.hero-section .btn-light {
    background: var(--color-white);
    color: var(--color-dark);
    font-weight: 600;
}

.hero-section .btn-light:hover {
    background: rgba(255,255,255,0.9);
    color: var(--color-dark);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

/* ============================================
   FORM CONTROLS
   ============================================ */

input.form-control,
textarea.form-control,
select.form-control {
    width: 100%;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid var(--color-border);
    font-size: 16px;
    font-family: var(--font-main);
    background: transparent;
    transition: border-color 0.2s ease;
}

input.form-control:focus,
textarea.form-control:focus,
select.form-control:focus {
    outline: none;
    border-bottom-color: var(--color-primary);
}

input.form-control::placeholder,
textarea.form-control::placeholder {
    color: #999;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

label.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text);
}

.form-group {
    margin-bottom: 24px;
}

.contact-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ============================================
   HEADER
   ============================================ */

.header-main {
    background: var(--color-white);
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
    position: relative;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-transparent {
    background: transparent;
    border-bottom: none;
    padding: 30px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-transparent.scrolled {
    background: var(--color-white);
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
}

.header-transparent .nav-link {
    color: var(--color-white);
}

.header-transparent .nav-link:hover {
    color: rgba(255,255,255,0.8);
}

.header-transparent.scrolled .nav-link {
    color: var(--color-dark);
}

.header-transparent.scrolled .nav-link:hover {
    color: var(--color-dark);
}

.header-transparent .menu-toggle {
    color: var(--color-white);
}

.header-transparent.scrolled .menu-toggle {
    color: var(--color-dark);
}

.header-transparent.scrolled .nav-main li {
    border-right-color: rgba(0,0,0,0.2);
}

.header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    max-width: 100%;
    margin: 0;
    padding: 0 20px;
}

.header-logo {
    flex: 0 0 auto;
    max-width: 400px;
}

.header-logo img {
    max-width: 100%;
    height: auto;
    transition: all 0.3s ease;
}

.header-transparent .header-logo {
    flex: 1;
    max-width: 60%;
}

.header-transparent .header-logo img {
    max-width: 100%;
}

.header-transparent.scrolled .header-logo {
    flex: 0 0 auto;
    max-width: 400px;
}

.header-transparent.scrolled .header-logo img {
    max-width: 100%;
}

.nav-main {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-main li {
    position: relative;
    padding: 0 20px;
    border-right: 1px solid rgba(0,0,0,0.2);
}

.header-transparent .nav-main li {
    border-right-color: rgba(255,255,255,0.3);
}

.nav-main li:last-child {
    border-right: none;
    padding-right: 0;
}

.nav-main li:first-child {
    padding-left: 0;
}

.nav-link {
    color: var(--color-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.2s ease;
    display: block;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--color-dark);
}

.header-main .nav-link {
    color: var(--color-dark);
}

.header-main .nav-link:hover {
    color: var(--color-dark);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    min-width: 200px;
    padding: 8px 0;
    margin-top: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 400;
    transition: background 0.2s ease;
}

.nav-dropdown-menu a:hover {
    background: var(--color-bg-light);
    color: var(--color-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    font-size: 24px;
    color: var(--color-dark);
    z-index: 1001;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    position: relative;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    color: var(--color-white);
    max-width: 600px;
}

.hero-title {
    font-size: 48px;
    font-weight: bold;
    color: var(--color-white) !important;
    line-height: 1.2;
    margin-bottom: 30px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */

.content-section {
    background: #fff;
    padding: 60px 0;
}

.content-section h1 {
    color: var(--color-dark);
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 30px;
    line-height: 1.2;
}

.content-section h2 {
    font-size: 36px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.content-section ul {
    line-height: 1.8;
    margin-bottom: 30px;
}

.content-section p {
    margin-bottom: 1rem;
}

.content-section img {
    width: 100%;
    height: auto;
}

.content-section {
    padding: 60px 0;
}

.section-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--color-dark);
}

.section-subtitle {
    font-size: 18px;
    color: var(--color-text-light);
    margin-bottom: 30px;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    background: #f5f5f5;
    padding: 60px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 60px;
}

.footer .row {
    display: flex;
    gap: 40px;
    flex-wrap: nowrap;
}

.footer .col {
    flex: 1;
    min-width: 0;
    padding: 0 30px;
}

.footer .col:first-child {
    text-align: center;
}

.footer .col:nth-child(2) {
    flex: 0 0 auto;
    text-align: center;
}

.footer .logo {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.footer .text {
    color: var(--color-text);
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: center;
}

.footer .credit-cards {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.footer .menu {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

.footer .menu-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--color-dark);
}

.footer .menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer .menu-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.footer .menu-list li:last-child {
    border-bottom: none;
}

.footer .menu-list a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s;
}

.footer .menu-list a:hover {
    color: var(--color-primary);
}

.footer .map {
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.footer .map:hover {
    opacity: 0.9;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    body.im-template h1 { font-size: 32px; }
    body.im-template h2 { font-size: 28px; }
    body.im-template h3 { font-size: 24px; }

    .hero-title {
        font-size: 32px;
        white-space: normal;
    }

    /* New layout system - stack on mobile */
    .layout-half,
    .layout-third,
    .layout-twothirds,
    .layout-quarter {
        flex: 0 0 100%;
    }

    /* OLD DEPRECATED */
    .col-6 { flex: 0 0 100%; }

    .header-inner {
        flex-wrap: wrap;
        padding: 0 15px;
    }

    .header-logo {
        flex: 1;
        max-width: 70%;
    }

    .header-logo img {
        max-width: 100%;
    }

    .header-transparent .header-logo img {
        max-width: 100%;
    }

    .nav-main {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        margin-top: 20px;
    }

    body.menu-open .nav-main { display: flex; }

    .nav-main li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-link { padding: 12px 0; }

    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: var(--color-bg-light);
    }

    .nav-dropdown.open .nav-dropdown-menu { display: block; }

    .menu-toggle { display: block; }

    .hero-section { min-height: 60vh; }

    .footer .row {
        flex-direction: column;
        gap: 30px;
        align-items: center;
    }

    .footer .col {
        flex: 0 0 100%;
        width: 100%;
        text-align: center;
    }

    .footer .col:first-child {
        padding: 0 15px;
    }

    .footer .col:nth-child(2) {
        flex: 1;
    }

    .footer .menu-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 20px;
    }

    .footer .menu-list li {
        padding: 0;
        border-bottom: none;
        flex: 0 0 auto;
    }

    .footer .menu-list a {
        display: inline-block;
        padding: 8px 12px;
    }

    .footer .map {
        max-width: 100%;
        margin: 0 auto;
    }

    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
}

/* CSS-only Hamburger Menu */
.menu-toggle-wrapper {
    position: relative;
    display: none;
}

.menu-toggle-checkbox {
    display: none;
}

.menu-toggle {
    cursor: pointer;
    font-size: 24px;
    color: var(--color-text);
    padding: 10px;
    transition: color 0.3s ease;
}

.header-transparent .menu-toggle {
    color: white;
}

.header-transparent.scrolled .menu-toggle {
    color: var(--color-text);
}

.menu-toggle:hover {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .menu-toggle-wrapper {
        display: block;
    }

    /* Show nav when checkbox is checked */
    .menu-toggle-checkbox:checked ~ .header-inner .nav-main {
        display: flex !important;
    }

    /* Alternative: Show nav on hover of wrapper */
    .menu-toggle-wrapper:hover + .header-inner .nav-main,
    .header-inner .nav-main:hover {
        display: flex !important;
    }

    /* Dropdown hover for mobile */
    .nav-dropdown:hover .nav-dropdown-menu {
        display: block !important;
    }
}

/* CSS-only Hamburger Menu */
.menu-toggle-checkbox {
    display: none;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--color-text);
    padding: 10px;
    transition: color 0.3s ease;
}

.header-transparent .menu-toggle {
    color: white;
}

.header-transparent.scrolled .menu-toggle {
    color: var(--color-text);
}

.menu-toggle:hover {
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    /* Show nav when checkbox is checked */
    .menu-toggle-checkbox:checked ~ .nav-main {
        display: flex !important;
    }

    /* Dropdown hover for mobile */
    .nav-dropdown:hover > .nav-dropdown-menu {
        display: block !important;
    }
}

/* Mobile Menu Fixes */
@media (max-width: 768px) {
    .nav-main {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        z-index: 1000;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        padding: 0;
        margin: 0;
    }

    .header-transparent .nav-main {
        background: white;
    }

    .nav-main li {
        padding-left: 20px;
        padding-right: 20px;
    }

    .nav-main li:first-child {
        padding-left: 20px;
    }

    .nav-link {
        color: var(--color-text) !important;
    }

    .nav-dropdown-menu a {
        color: var(--color-text) !important;
        padding-left: 40px;
    }
}
