/* Rideway Auto Group - Premium Design System (Detour Orange) */

:root {
    /* Brand color - detour-sign orange #F5811F (CSS var name 'cq-red' kept for backwards compat) */
    --cq-red: #F5811F;
    --cq-red-hover: #D96A0F;
    --cq-brand: #F5811F;
    --cq-brand-hover: #D96A0F;
    --cq-brand-text: #FFFFFF; /* white text for contrast on orange */
    --cq-dark: #1A1A1A;
    --cq-charcoal: #2D2D2D;
    --transition-base: 0.3s ease;
    --transition-slow: 0.6s ease;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

::selection { background-color: var(--cq-red); color: #fff; }

/* ===== Custom Scrollbar - Red on Dark ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: var(--cq-red); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--cq-red-hover); }
* { scrollbar-width: thin; scrollbar-color: var(--cq-red) #111; }

/* ===== Safe area for notched devices ===== */
.safe-area-bottom { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ===== Hero Background Pattern ===== */
.hero-bg-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ===== Hero Film Grain ===== */
.hero-film-grain {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* ===== Hero Text Animation ===== */
@keyframes heroTextSlideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-text-animate {
    opacity: 0;
    animation: heroTextSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ===== Reveal on Scroll ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Parallax Background ===== */
.parallax-bg {
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* ===== Serv Parallax - car overflows right ===== */
#serv-parallax {
    overflow: hidden;
}
#serv-parallax-img {
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* ===== Form Inputs ===== */
.cq-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    background-color: #FAFAF8;
    transition: all 0.25s ease;
    color: var(--cq-charcoal);
    -webkit-appearance: none;
}
.cq-input:focus {
    outline: none;
    border-color: var(--cq-red);
    box-shadow: 0 0 0 3px rgba(245, 129, 31, 0.18);
    background-color: #fff;
}
.cq-input::placeholder { color: #c4c4c4; }

/* ===== Buttons ===== */
.cq-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--cq-red);
    color: #FFFFFF;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(245, 129, 31, 0.35);
}
.cq-btn-primary:hover {
    background-color: var(--cq-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(245, 129, 31, 0.45);
}
.cq-btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: #FAFAF8;
    color: var(--cq-charcoal);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 0.875rem;
    border: 1px solid #e5e7eb;
    transition: all 0.25s ease;
}
.cq-btn-secondary:hover {
    background-color: #f0eeec;
    border-color: #d1d5db;
}

/* ===== Header ===== */
#main-header.scrolled {
    box-shadow: 0 2px 30px rgba(0,0,0,0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ===== Swiper Custom ===== */
.swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: #d1d5db;
    opacity: 1;
    transition: all var(--transition-base);
    border-radius: 8px;
}
.swiper-pagination-bullet-active {
    background: var(--cq-red);
    width: 32px;
}

/* Brands swiper pagination */
.brands-pagination {
    margin-top: 2rem !important;
    position: relative !important;
}
.brands-pagination .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.2);
    width: 8px;
    height: 8px;
}
.brands-pagination .swiper-pagination-bullet-active {
    background: #fff;
    width: 8px;
}

/* ===== WhatsApp FAB ===== */
@keyframes wa-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70% { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
#whatsapp-fab { animation: wa-pulse 2s infinite; }
#whatsapp-fab:hover { animation: none; transform: scale(1.1); }

/* ===== Flash ===== */
@keyframes slideDown {
    from { transform: translate(-50%, -20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}
.animate-slide-down { animation: slideDown 0.4s ease-out; }

/* ===== FAQ ===== */
.faq-item.active { border-color: rgba(245, 129, 31, 0.3); }

/* ===== Form steps ===== */
.form-step { transition: opacity 0.3s ease; }

/* ===== Spinner ===== */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--cq-red);
    border-radius: 50%;
    width: 18px; height: 18px;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ===== Radio styled labels ===== */
label:has(input[type="radio"]:checked) {
    border-color: var(--cq-red) !important;
    background-color: rgba(245, 129, 31, 0.1) !important;
}

/* ===== MOBILE BOTTOM NAV ===== */
#mobile-bottom-nav {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

/* ===== MOBILE FULL-SCREEN MENU ===== */
#mobile-menu-panel { will-change: transform; }
#mobile-menu-backdrop { transition: background-color 0.5s ease; }

.submenu-panel {
    max-height: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.menu-item-anim {
    opacity: 0;
    transform: translateX(20px);
}

.bottom-nav-item {
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:active { transform: scale(0.9); }

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 1023px) {
    footer { padding-bottom: 100px; }
    body { overscroll-behavior-y: contain; }
    .overflow-y-auto { -webkit-overflow-scrolling: touch; }
    a, button { min-height: 44px; min-width: 44px; }

    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ===== Glassmorphism ===== */
.glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ===== iOS overscroll fix ===== */
@supports (-webkit-touch-callout: none) {
    #mobile-menu-panel { min-height: -webkit-fill-available; }
}

/* ===== Focus Styles ===== */
:focus-visible { outline: 2px solid var(--cq-red); outline-offset: 2px; }

/* ===== Page Enter ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.page-enter { animation: fadeIn 0.3s ease; }

/* ===== Detour Orange Brand Readability =====
   Orange #F5811F has great contrast with both white and black. */
.bg-cq-red {
    color: #fff;
}
.bg-cq-red i,
.bg-cq-red svg {
    filter: none;
}
/* Legacy utility kept for backwards compat; now no-op since orange works with white */
.text-on-yellow { color: #FFFFFF !important; }

