/* ===================================
   Perry Pharmacy — 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: #7f2222;
    color: #fff;
}

/* Navbar Scroll State */
.nav-scrolled {
    background-color: rgba(255, 255, 255, 0.97) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 20px rgba(0, 0, 0, 0.04);
}

.nav-scrolled .font-display {
    color: #7f2222 !important;
}

.nav-scrolled a:not([class*="bg-"]) {
    color: #44403c !important;
}

.nav-scrolled a:not([class*="bg-"]):hover {
    color: #7f2222 !important;
}

/* Mobile Menu */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.mobile-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Service Cards */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7f2222, #dc4c4c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover::after {
    transform: scaleX(1);
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

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

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

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

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

/* Focus Styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #7f2222;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Hero Image Float Animation (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
    @keyframes float {
        0%, 100% { transform: translateY(0px); }
        50% { transform: translateY(-10px); }
    }
    
    .hero-float {
        animation: float 6s ease-in-out infinite;
    }
    
    .hero-float-delay {
        animation: float 6s ease-in-out 2s infinite;
    }
}

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 400ms; }

.stagger-children.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* Counter Animation */
.counter {
    display: inline-block;
}
