/* ============================================
   CMC Auto Sales — Custom Styles
   Classic & Elegant | Burgundy + Blush
   ============================================ */

/* ---- Custom Properties ---- */
:root {
    --burgundy-700: #a11533;
    --burgundy-800: #83142f;
    --burgundy-950: #3d0714;
    --cream-50: #fefdfb;
    --cream-100: #fdf9f4;
    --cream-200: #faf0e4;
}

/* ---- Base Reset Enhancements ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

/* ---- Selection Color ---- */
::selection {
    background-color: rgba(161, 21, 51, 0.2);
    color: var(--burgundy-950);
}

/* ---- Smooth Focus Styles ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--burgundy-700);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---- Scroll Reveal Base (progressive enhancement) ---- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

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

/* Default state: always visible (JS enhancement adds animation) */
.reveal {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Navbar Transition ---- */
#navbar {
    background-color: transparent;
}

#navbar.scrolled {
    background-color: rgba(254, 253, 251, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(161, 21, 51, 0.1), 0 4px 20px rgba(61, 7, 20, 0.06);
}

#navbar.scrolled .nav-link {
    color: #3d0714;
}

#navbar.scrolled .nav-link:hover {
    color: #a11533;
}

#navbar.scrolled .font-serif.text-burgundy-950 {
    color: #3d0714;
}

/* ---- Mobile Menu ---- */
#mobile-menu {
    background-color: rgba(254, 253, 251, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#mobile-menu.open {
    transform: translateX(0);
}

/* ---- Button Hover Lift ---- */
button, a[href^="tel"], a[href^="#"] {
    cursor: pointer;
}

/* ---- Input Autofill Styling ---- */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #fefdfb inset !important;
    -webkit-text-fill-color: #3d0714 !important;
}

/* ---- Image Loading ---- */
img {
    display: block;
    max-width: 100%;
}

/* ---- Subtle Hover Transitions on Cards ---- */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* ---- Decorative Line Animations ---- */
.nav-link::after {
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---- Mobile Menu Link Transitions ---- */
.mobile-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

/* ---- Form Focus States ---- */
input:focus,
textarea:focus,
select:focus {
    border-color: #a11533 !important;
    box-shadow: 0 0 0 3px rgba(161, 21, 51, 0.1);
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fdf9f4;
}

::-webkit-scrollbar-thumb {
    background: #d4a0aa;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a11533;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ---- Print Styles ---- */
@media print {
    #navbar,
    #mobile-menu,
    .reveal,
    iframe {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
}
