/* ==========================================
   Jersey Carpet Outlet — Custom Styles
   ========================================== */

/* Base & Reset */
*, *::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(196, 98, 45, 0.3);
    color: #E8D5B7;
}

/* ==========================================
   Animations
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.animate-fade-in {
    animation-name: fadeIn;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: forwards;
}

.animate-fade-in-up {
    animation-name: fadeInUp;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: forwards;
}

/* Scroll Reveal (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), 
                    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback: always visible if JS disabled */
.no-js .scroll-reveal,
.scroll-reveal {
    opacity: 1;
    transform: none;
}

/* ==========================================
   Navbar
   ========================================== */

#navbar {
    background: transparent;
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
    background: rgba(13, 13, 13, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(201, 168, 76, 0.1);
}

/* ==========================================
   Mobile Menu
   ========================================== */

#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    transition: color 0.3s ease, transform 0.3s ease;
}

.mobile-link:hover {
    color: #C9A84C;
    transform: scale(1.05);
}

/* Menu button animation */
.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#menu-btn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ==========================================
   Custom Scrollbar
   ========================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0D0D0D;
}

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

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

/* ==========================================
   Focus Styles
   ========================================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #C9A84C;
    outline-offset: 2px;
}

/* ==========================================
   Image Optimization
   ========================================== */

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

/* ==========================================
   Responsive Adjustments
   ========================================== */

@media (max-width: 768px) {
    .font-display {
        line-height: 1.15;
    }
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
    #navbar,
    #mobile-menu,
    .scroll-reveal {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
}
