/* =========================================
   1. CSS Variables & Design Tokens
   ========================================= */
:root {
    /* Brand Colors */
    --color-primary: #1F4E4D;
    /* Deep Teal - Premium & Professional */
    --color-primary-light: #2A6B69;
    /* Lighter Teal for hovers */
    --color-secondary: #2C2C2C;
    /* Soft Black */
    --color-accent: #C5A065;
    /* Gold/Bronze accent for premium feel */
    --color-accent-border: rgba(197, 160, 101, 0.4);
    /* Border matching the accent color - Thicker & Slightly more opaque */
    /* Border matching the accent color */

    --color-white: #ffffff;
    --color-off-white: #F8F9FA;
    --color-light-gray: #E9ECEF;
    --color-dark-gray: #495057;
    --color-text: #343A40;

    --color-border: #DEE2E6;

    /* Fonts */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Roboto', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 5rem;
    /* Increased for breathing room */
    --spacing-xl: 8rem;

    /* Layout */
    --container-width: 1200px;
    --header-height: 80px;

    /* UI Elements */
    --border-radius: 2px;
    /* Sharper corners for modern tech feel */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    /* Softer, larger shadow */
    --transition-speed: 0.3s;
}

/* =========================================
   2. Reset & Base Styles
   ========================================= */
html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    /* Better readability */
    color: #ffffff;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('../assets/images/automotive-service-hero-background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Content sections with glassmorphism effect */
section {
    position: relative;
    margin: 1rem 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-speed);
}

ul {
    list-style: none;
}

/* =========================================
   3. Typography
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: #ffffff;
    font-weight: 800;
    /* Increased for better visibility */
    line-height: 1.25;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    /* Subtle definition */
}

h1 {
    font-size: 3.5rem;
    letter-spacing: -1px;
    color: #ffffff;
    /* Dark by default */
}

h2 {
    font-size: 2.5rem;
    color: #ffffff;
    position: relative;
    display: inline-block;
}

h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff !important;
    /* Force white for maximum visibility */
    margin-top: 0.5rem;
}

p {
    margin-bottom: var(--spacing-sm);
    color: #ffffff;
}

/* Shared top-of-page hero title block for internal pages */
.page-hero {
    padding: 2.25rem 0 1.5rem;
    text-align: center;
}

.page-title {
    margin: 0 auto;
    max-width: 980px;
    padding: 0 1rem;
    font-size: clamp(2.25rem, 5vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

/* Match the tuning hero heading size on selected internal pages */
.page-title.page-title-tuning-size {
    max-width: 1280px;
    font-size: clamp(2rem, 3.2vw, 2.6rem);
    text-wrap: initial;
}

.page-subtitle {
    margin: 0.85rem auto 0;
    max-width: 820px;
    padding: 0 1rem;
    font-size: clamp(1.05rem, 1.8vw, 1.6rem);
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.95);
}

/* =========================================
   4. Layout Utilities
   ========================================= */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Prevent Layout Shift on Header Load */
#header-placeholder {
    min-height: 145px;
    /* Desktop Header Height */
}

@media (max-width: 768px) {
    #header-placeholder {
        min-height: 120px;
        /* Mobile Header Height */
    }
}

.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.blog-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.text-center {
    text-align: center;
}

.section-padding {
    padding: var(--spacing-lg) 0;
}

.pt-0 {
    padding-top: 0 !important;
}

/* =========================================
   5. Components
   ========================================= */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
    border: 2px solid var(--color-primary);
    cursor: pointer;
}

.btn:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(197, 160, 101, 0.4);
}

.btn-outline {
    background-color: transparent;
    color: #ffffff;
    border: 2px solid var(--color-accent-border);
}

.btn-outline:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #000000;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--color-accent-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-speed);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--color-accent);
    box-shadow: 0 12px 40px rgba(197, 160, 101, 0.2);
}

.card-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.card-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Stock / tag badges used on car cards */
.stock-tag {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    border-radius: 6px;
    color: #ffffff;
    background: rgba(31, 78, 77, 0.9);
    border: 1px solid var(--color-accent-border);
    margin-right: 0.5rem;
    margin-bottom: 0.6rem;
}

/* Ensure tags and title don't overlap images and wrap nicely */
.card-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

.stock-price {
    margin-top: 0.25rem;
    font-weight: 800;
    color: #ffffff;
}

/* When multiple tags exist, keep them in a single row but wrap if needed */
.card-content .tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

 .card-content a.btn,
 .card-content a.btn-outline {
     margin-top: auto;
 }

.card-content h3,
.car-card h3 {
    color: #ffffff !important;
    /* Force white */
    font-weight: 800;
}


/* Navbar */
.navbar-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    transition: transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.22s ease;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.top-bar {
    background-color: #232628;
    padding: 1.2rem 0;
}

.top-bar .container {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
}

.top-bar .logo {
    flex-shrink: 0;
    margin-right: 4rem;
    margin-left: 0;
}

.top-bar .logo a {
    color: #fff !important;
    display: flex;
    align-items: center;
}

.top-bar .nav-links {
    flex-shrink: 1;
    white-space: nowrap;
    margin-left: auto;
}

.logo img {
    height: 70px;
    width: auto;
    max-width: 200px;
}

/* Navigation styles - now in top bar */
.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
}

.nav-links li {
    height: 100%;
}

.nav-links a {
    display: block;
    padding: 1.2rem 1.2rem;
    color: #ffffff;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
    margin: 2px;
}

.nav-links a:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Active link - restored highlighting */
.nav-links li.active {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 4px;
    margin: 2px;
}

.nav-links li.active>a,
.nav-links li.dropdown-parent.active>a {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    font-weight: 800;
    border-radius: 4px;
    padding: 1.2rem 1.2rem;
    border: none;
    box-shadow: none;
}

/* Prevent hover from changing active link color */
.nav-links li.active>a:hover,
.nav-links li.dropdown-parent.active>a:hover {
    background-color: transparent !important;
    color: #ffffff !important;
}

/* Dropdown */
.dropdown-parent {
    position: relative;
}

.dropdown-parent>a {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-parent>a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 5px solid currentColor;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.dropdown-parent:hover>a::after {
    transform: rotate(180deg);
}


.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--color-accent-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    min-width: 250px;
    z-index: 1001;
    list-style: none;
    padding: 1rem 0;
    border-radius: 12px;
}

/* Show dropdown on Hover */
.dropdown-parent:hover .dropdown-menu {
    display: flex;
    flex-direction: column;
}

/* Ensure dropdown links are ALWAYS white, even when parent is active */
.nav-links li.active .dropdown-menu li a,
.dropdown-menu li a {
    display: block;
    width: 100%;
    background-color: transparent !important;
    white-space: nowrap;
    padding: 1rem 1.5rem;
    color: #ffffff !important;
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding-left: 2rem;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 1rem;
}

/* Mobile Menu */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ffffff;
}

/* =========================================
   6. Sections
   ========================================= */

/* Hero Section */
.hero {
    position: relative;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5)), url('../assets/images/automotive-service-hero-background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    /* Full screen to hide next section */
    min-height: 700px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 2rem 10rem;
    /* Space for navbar and bottom gap */
    color: white;
    text-align: center;
    margin: 0;
    border-radius: 0;
}


.hero h1 {
    font-size: 4rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 800;
    color: white;
    /* Keep white on dark hero images */
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
    /* Stronger shadow for image overlay */
}

.hero p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 1000px;
    margin: 0 auto 2.5rem;
}

/* Hero Buttons - Uniform Premium Gold Design */
.hero .btn {
    border-color: var(--color-accent);
    background-color: var(--color-accent);
    color: #232628;
    /* Dark text as per image */
    min-width: 250px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hero .btn:hover {
    background-color: #d4af72;
    /* Slightly lighter/richer gold */
    border-color: #d4af72;
    color: #232222;
    transform: translateY(-3px) scale(1.02);
    /* Subtler "Popup" animation */
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

/* Remove separate hero overrides to keep design consistent */
.hero .btn-outline,
.hero .btn.btn-tuning {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #232628;
}

.hero .btn-outline:hover,
.hero .btn.btn-tuning:hover {
    background-color: #d4af72;
    color: #232222;
    transform: translateY(-3px) scale(1.02);
}

/* Footer */
footer {
    background-color: #232628;
    color: #ffffff;
    padding: 5rem 0 2rem;
    margin-top: 0;
}

footer h3 {
    color: #ffffff !important;
    /* Force white text */
    border-bottom: 3px solid #333;
    /* Visual separation */
    padding-bottom: 0.5rem;
    display: inline-block;
}

footer a,
footer a,
footer p {
    color: #cccccc;
}

footer a:hover {
    color: #ffffff;
    padding-left: 5px;
}

/* New Footer Layout */
.footer-wide-container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-split-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 4rem;
}

.footer-brand-col {
    flex: 0 0 250px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.footer-links-col {
    flex: 1;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-copyright {
    font-size: 0.85rem;
    color: #888;
    margin-top: auto;
    /* Push to bottom if needed */
}

/* Working hours rows: keep day/time compact and aligned */
footer .footer-section div[style*="grid-template-columns: 55px 1fr"] {
    display: grid !important;
    grid-template-columns: max-content max-content !important;
    column-gap: 0.35rem !important;
    row-gap: 0.06rem !important;
    width: max-content;
}

footer .footer-section div[style*="grid-template-columns: 55px 1fr"] strong,
footer .footer-section div[style*="grid-template-columns: 55px 1fr"] span {
    text-align: left;
}

@media (max-width: 992px) {
    .footer-split-layout {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-brand-col {
        width: 100%;
        align-items: center;
        text-align: center;
    }

    .footer-links-col {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .footer-links-col {
        grid-template-columns: 1fr;
    }
}

footer li {
    color: #ffffff;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    width: 100%;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

/* Stock Tags */
.stock-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--color-light-gray);
    color: var(--color-secondary);
    border-radius: 4px;
    /* Tech look */
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    margin-right: 0.5rem;
}

.stock-price {
    font-size: 1.5rem;
    color: #ffffff;
    font-weight: 700;
    margin-top: auto;
    /* Push to bottom of content area */
    padding-top: 1rem;
}

/* Form Styles */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #ffffff;
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--color-accent-border);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: var(--border-radius);
    transition: border-color var(--transition-speed);
    color: #fff;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(31, 78, 77, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .page-hero {
        padding: 1.5rem 0 1rem;
    }

    .page-title {
        font-size: clamp(1.9rem, 9vw, 2.8rem);
    }

    .page-subtitle {
        font-size: 1.05rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    /* Mobile Menu Touch Targets - now in top bar */
    .top-bar .container {
        flex-wrap: wrap;
    }

    .top-bar .nav-links {
        display: none;
        position: static;
        width: 100%;
        background: rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 2px solid var(--color-accent-border);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
        flex-direction: column;
        padding: 1rem 0;
        gap: 0;
        border-radius: 0 0 12px 12px;
        margin-top: 1rem;
        order: 3;
        white-space: normal;
        overflow-x: visible;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-links a {
        padding: 1rem 2rem;
        /* Larger touch target */
        width: 100%;
    }

    /* Mobile Text & Spacing */
    .hero {
        min-height: 400px;
        /* Reduce height on mobile */
        padding: 0 1rem;
        background-attachment: scroll;
        /* Better performance on mobile */
    }

    .hero h1 {
        font-size: 2rem;
        /* Smaller heading */
    }

    .hero p {
        font-size: 1.1rem;
    }

    .section-padding {
        padding: 2.5rem 0;
        /* Reduce vertical padding */
    }

    .grid-2,
    .grid-3,
    .blog-grid-2 {
        grid-template-columns: 1fr;
        /* Stack grids */
    }

    /* Make buttons full width on small screens */
    .btn,
    .btn-outline {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Improve footer spacing */
    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-section {
        width: 100%;
        text-align: center;
    }

    .menu-toggle {
        display: block;
        order: 2;
    }

    .nav-links.active {
        display: flex;
    }

    /* Mobile background performance */
    body {
        background-attachment: scroll;
    }

    /* Mobile Dropdown Specifics */
    .dropdown-parent .dropdown-menu {
        position: static;
        /* Flow in document */
        width: 100%;
        box-shadow: none;
        background-color: #f8f9fa;
        /* Slightly darker to distinguish */
        display: none;
        /* Hidden by default */
        padding: 0;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    /* Force display when active or hovered on mobile */
    .dropdown-parent.active .dropdown-menu,
    .dropdown-parent:hover .dropdown-menu {
        display: flex;
        animation: none;
        /* No weird transitions */
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }

    .dropdown-menu li a {
        padding-left: 2.5rem;
        /* Indent sub-items */
        font-size: 0.8rem;
    }
}

/* =========================================
   7. Carousel (New Arrivals)
   ========================================= */
.carousel-container {
    width: 100%;
    position: relative;
    padding: 2rem 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--color-accent-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin: 1rem 0;
}

.carousel-viewport {
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    align-items: stretch;
    gap: var(--spacing-md);
    width: max-content;
    /* Allows proper width calculation */
    will-change: transform;
}

.carousel-track .card {
    width: 350px;
    min-height: 420px;
    flex-shrink: 0;
    align-self: stretch;
}

.carousel-track .card .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.carousel-track .card .card-content h3 {
    min-height: 4rem;
    /* Ensures space for 2-line titles like Mercedes A-Class A180d */
    display: flex;
    align-items: flex-start;
}

.carousel-track .card .card-content a.btn {
    margin-top: auto;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--color-accent-border);
    background: rgba(31, 78, 77, 0.88);
    color: #ffffff;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.carousel-nav-prev {
    left: -3.4rem;
}

.carousel-nav-next {
    right: -3.4rem;
}

.carousel-nav-btn:hover {
    background: var(--color-primary-light);
    border-color: var(--color-accent);
    box-shadow: 0 10px 24px rgba(197, 160, 101, 0.3);
}

.carousel-nav-btn:active {
    background: var(--color-primary);
}

.carousel-nav-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(197, 160, 101, 0.45), 0 8px 20px rgba(0, 0, 0, 0.35);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-16.666%);
        /* Move by 1/6th width (since we have 6 identical sets) */
    }
}

/* =========================================
   8. User Friendly Enhancements
   ========================================= */

/* Floating Contact Button (e.g. WhatsApp style) */
.floating-contact {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    background-color: #25D366;
    /* WhatsApp Green */
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    font-weight: 600;
    transition: all 0.3s ease;
}

.floating-contact:hover {
    transform: scale(1.05);
    background-color: #20BA5C;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(31, 78, 77, 0.1);
    border-left-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Services Grid - Force 2 columns */
.services-grid {
    display: grid;
    gap: var(--spacing-md);
    grid-template-columns: 1fr 1fr;
    /* Force 2 columns always on desktop/tablet */
}

/* Services cards: cinematic grade inspired by dark automotive editorial shots */
.services .card {
    background: rgba(11, 11, 12, 0.78);
    border-color: rgba(197, 160, 101, 0.52);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
}

.services .card:hover {
    background: rgba(15, 15, 16, 0.85);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48);
}

.services .service-image-wrap {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.services .service-image-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(130% 95% at 50% 6%, rgba(0, 0, 0, 0) 36%, rgba(0, 0, 0, 0.44) 80%, rgba(0, 0, 0, 0.7) 100%),
        linear-gradient(180deg, rgba(27, 20, 12, 0.15) 0%, rgba(8, 8, 10, 0.5) 100%);
}

.services .card-image.service-card-image {
    height: 200px;
    display: block;
    filter: saturate(0.65) contrast(1.15) brightness(0.72) sepia(0.18);
    transform: scale(1.04);
    transition: transform var(--transition-speed), filter var(--transition-speed);
}

.services .card:hover .card-image.service-card-image {
    transform: scale(1.08);
    filter: saturate(0.7) contrast(1.18) brightness(0.76) sepia(0.16);
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .services .card-image.service-card-image {
        height: 180px;
    }
}

/* Floating Action Buttons Container */
.floating-actions-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1001;
    align-items: flex-end;
}

/* Base Floating Button */
.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    color: white;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    border: 2px solid var(--color-accent-border);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.floating-btn:hover {
    transform: translateY(-3px);
    border-color: var(--color-accent);
    box-shadow: 0 12px 30px rgba(197, 160, 101, 0.28);
}

.floating-btn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* Specific Buttons */
.btn-whatsapp {
    background: rgba(44, 44, 44, 0.78);
}

.btn-whatsapp:hover {
    background: rgba(44, 44, 44, 0.9);
}

.btn-phone {
    background: linear-gradient(145deg, var(--color-primary-light), var(--color-primary));
}

.btn-phone:hover {
    background: linear-gradient(145deg, var(--color-primary-light), var(--color-primary));
}

/* Tooltip/Label on hover (optional, or just icon) - requested "similar size button" */

/* =========================================
   FAQ Section
   ========================================= */
.faq-section {
    margin-top: 3rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--color-accent-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    border-radius: 12px;
}

.faq-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.faq-item {
    border-bottom: 1px solid #e9ecef;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 1.2rem 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s;
}

.faq-question:hover {
    color: #ffffff;
}

.faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-bottom: 1rem;
}

.faq-answer p {
    margin: 0;
    color: #ffffff;
    line-height: 1.6;
}

/* ==========================
   Mobile & Responsive Fixes
   ========================== */
@media (max-width: 900px) {
    :root {
        --header-height: 56px;
    }

    /* Use simpler background on mobile for performance */
    body {
        background-attachment: scroll;
        background-position: center top;
    }

    /* Show hamburger button and hide desktop nav by default */
    .menu-toggle {
        display: block;
        background: transparent;
        border: none;
        color: #ffffff;
        font-size: 1.95rem;
        cursor: pointer;
        width: 52px;
        height: 52px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    .menu-toggle span {
        display: block;
        line-height: 1;
    }

    .top-bar {
        padding: 0.42rem 0;
    }

    .top-bar .container {
        align-items: center;
        flex-wrap: nowrap;
    }

    .top-bar .logo {
        margin-right: 0;
    }

    .logo img {
        height: 44px;
        max-width: 145px;
    }

    .top-bar .nav-links,
    .nav-links {
        display: none;
        position: fixed;
        top: calc(var(--mobile-header-offset, var(--header-height, 56px)) + env(safe-area-inset-top, 0px));
        left: 0;
        width: 100%;
        background: rgba(35, 38, 40, 0.98);
        border-top: 1px solid rgba(197, 160, 101, 0.5);
        border-bottom: 2px solid rgba(197, 160, 101, 0.5);
        flex-direction: column;
        gap: 0;
        padding: 0.4rem 0;
        max-height: calc(100dvh - var(--mobile-header-offset, var(--header-height, 56px)) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        white-space: normal;
        order: initial;
        z-index: 1200;
    }

    .nav-links.active {
        display: flex;
    }

    @supports not (height: 100dvh) {
        .nav-links {
            max-height: calc(100vh - var(--mobile-header-offset, var(--header-height, 56px)));
        }
    }

    .nav-links a {
        padding: 0.9rem 1rem;
        font-size: 1rem;
    }

    /* On mobile hide dropdown submenus so parent link navigates directly */
    .nav-links .dropdown-menu {
        display: none !important;
        position: static;
        background: transparent;
        padding-left: 0;
    }

    /* Make parent links full-width and clearly clickable on mobile */
    .nav-links > li > a {
        display: block;
        width: 100%;
    }

    .floating-btn {
        width: 52px;
        height: 52px;
    }
    /* Remove dropdown arrow on mobile to avoid suggesting expandable submenu */
    .dropdown-parent > a::after {
        display: none !important;
    }

    .navbar-wrapper.header-hidden {
        transform: translate3d(0, calc(-100% - 6px), 0);
        opacity: 0.01;
        pointer-events: none;
    }

    .navbar-wrapper.menu-open,
    .navbar-wrapper.menu-open.header-hidden {
        transform: translate3d(0, 0, 0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    body.mobile-nav-open {
        overflow: hidden;
    }

    footer .footer-section div[style*="grid-template-columns: 55px 1fr"] {
        margin: 0 auto;
        column-gap: 0.28rem !important;
        row-gap: 0.04rem !important;
        font-size: 0.88rem !important;
    }

    /* Force readable form colors on mobile across the whole site */
    form label {
        color: #ffffff !important;
    }

    form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    form select,
    form textarea {
        background: #3f444c !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        border-color: rgba(197, 160, 101, 0.72) !important;
    }

    form input:not([type="checkbox"]):not([type="radio"])::placeholder,
    form textarea::placeholder {
        color: rgba(255, 255, 255, 0.86) !important;
        opacity: 1 !important;
    }

    form input:-webkit-autofill,
    form select:-webkit-autofill,
    form textarea:-webkit-autofill {
        -webkit-text-fill-color: #ffffff !important;
        -webkit-box-shadow: 0 0 0 1000px #3f444c inset !important;
        box-shadow: 0 0 0 1000px #3f444c inset !important;
    }

    form select option {
        background: #3f444c !important;
        color: #ffffff !important;
    }

    /* Force readable booking form colors on mobile (iOS/Safari safe) */
    #service-booking-funnel,
    .booking-funnel-card {
        background: rgba(14, 16, 20, 0.96) !important;
        color: #ffffff !important;
    }

    .booking-funnel-card .booking-funnel-title,
    .booking-funnel-card .booking-funnel-sub,
    .booking-funnel-card label,
    .booking-funnel-card .booking-note,
    .booking-funnel-card .booking-review,
    .booking-funnel-card .booking-review strong {
        color: #ffffff !important;
    }

    .booking-funnel-card .booking-field input,
    .booking-funnel-card .booking-field select,
    .booking-funnel-card .booking-field textarea,
    .booking-funnel-card .booking-picker-shell {
        background: #3f444c !important;
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        border-color: rgba(197, 160, 101, 0.72) !important;
    }

    .booking-funnel-card .booking-field input::placeholder,
    .booking-funnel-card .booking-field textarea::placeholder {
        color: rgba(255, 255, 255, 0.86) !important;
        opacity: 1 !important;
    }

    .booking-funnel-card .booking-field input:-webkit-autofill,
    .booking-funnel-card .booking-field select:-webkit-autofill,
    .booking-funnel-card .booking-field textarea:-webkit-autofill {
        -webkit-text-fill-color: #ffffff !important;
        -webkit-box-shadow: 0 0 0 1000px #3f444c inset !important;
        box-shadow: 0 0 0 1000px #3f444c inset !important;
    }

    .booking-funnel-card .booking-field select option,
    .booking-funnel-card .booking-picker-select option {
        background: #3f444c !important;
        color: #ffffff !important;
    }

    /* Make hero text more compact and readable */
    h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-bottom p {
        font-size: 1rem;
    }

    /* Cards stack and use smaller images */
    .grid-3, .grid-2 {
        grid-template-columns: 1fr;
    }

    .card-image {
        height: 160px;
    }

    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }

    /* Carousel: horizontal scroll on small screens */
    .carousel-viewport {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .carousel-track {
        display: flex;
        gap: 1rem;
        padding: 1rem 0;
    }

    .carousel-track .card {
        min-width: 260px;
        flex: 0 0 auto;
    }

    .carousel-track .card .card-content {
        background: rgba(16, 18, 23, 0.95);
    }

    .carousel-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .carousel-container {
        padding-left: 0;
        padding-right: 0;
    }

    .carousel-nav-prev {
        left: -2.4rem;
    }

    .carousel-nav-next {
        right: -2.4rem;
    }

    /* Floating actions spacing for small screens */
    .floating-actions-container {
        right: 0.75rem;
        bottom: 1.5rem;
        gap: 0.5rem;
    }
}

@media (min-width: 901px) {
    /* Desktop: ensure hamburger is hidden */
    .menu-toggle {
        display: none;
    }
}
