/* ============================================
   Hubbard's Country Store — Custom Styles
   ============================================ */

/* Base & Smooth Scrolling */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

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

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

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

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

/* Selection */
::selection {
    background: #ffc945;
    color: #2d1520;
}

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

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

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

@keyframes scrollLine {
    0% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }
    50% {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
    100% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-scroll-line {
    animation: scrollLine 2s ease-in-out infinite;
}

/* ============================================
   Scroll Reveal
   ============================================ */

.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);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ============================================
   Navigation
   ============================================ */

.nav-text {
    transition: color 0.3s ease;
}

.nav-subtext {
    transition: color 0.3s ease;
}

/* Hero nav state */
nav:not(.scrolled) .nav-text {
    color: #4e2a3a;
}

nav:not(.scrolled) .nav-subtext {
    color: #8c4765;
}

nav.scrolled {
    background: rgba(250, 245, 247, 0.95);
    backdrop-blur-lg;
    box-shadow: 0 1px 20px rgba(45, 21, 32, 0.08);
}

nav.scrolled .nav-text {
    color: #4e2a3a;
}

nav.scrolled .nav-subtext {
    color: #8c4765;
}

/* ============================================
   Product Cards
   ============================================ */

.product-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(45, 21, 32, 0.12);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

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

.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffc945;
    transition: width 0.3s ease;
}

.mobile-link:hover::after {
    width: 100%;
}

/* ============================================
   Typography refinements
   ============================================ */

.font-serif {
    text-rendering: optimizeLegibility;
}

/* ============================================
   Responsive adjustments
   ============================================ */

@media (max-width: 768px) {
    .reveal {
        transform: translateY(20px);
    }
}

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

/* ============================================
   Image placeholder fallback
   ============================================ */

img {
    image-rendering: auto;
}

/* ============================================
   Print styles
   ============================================ */

@media print {
    nav, .animate-scroll-line {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}
