/* ============================================
   Carrollton Regional 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 {
    background: #0d4f4f;
    color: #f0fdfa;
}

/* --- Hero Animations --- */
.hero-eyebrow {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-headline {
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.hero-subheadline {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 0.6s;
}

.hero-ctas {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

.hero-strip {
    opacity: 0;
    transform: translateY(15px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 1s;
}

.hero-img-main {
    opacity: 0;
    transform: translateX(40px);
    animation: heroSlideRight 1s ease forwards;
    animation-delay: 0.5s;
}

.hero-float-card {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 0.8s ease forwards;
    animation-delay: 1.2s;
}

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroSlideRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Navigation --- */
#navbar {
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    transition: all duration-500;
}

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: #0d4f4f;
    transition: width 0.3s ease;
}

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

/* Mobile Menu */
.menu-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    background: #334155;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-line.top { top: 36%; }
.menu-line.middle { top: 50%; }
.menu-line.bottom { top: 64%; }

body.menu-open .menu-line.top {
    top: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

body.menu-open .menu-line.middle {
    opacity: 0;
}

body.menu-open .menu-line.bottom {
    top: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.mobile-link {
    opacity: 0;
    transform: translateY(15px);
}

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

body.menu-open .mobile-link:nth-child(1) { transition-delay: 0.05s; }
body.menu-open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
body.menu-open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
body.menu-open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
body.menu-open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* --- Section Headers --- */
.section-eyebrow {
    opacity: 0;
    transform: translateY(15px);
}

.section-title {
    opacity: 0;
    transform: translateY(20px);
}

.section-subtitle {
    opacity: 0;
    transform: translateY(15px);
}

/* --- Service Cards --- */
.service-card {
    opacity: 0;
    transform: translateY(25px);
}

/* --- About Section --- */
.about-images {
    opacity: 0;
    transform: translateX(-30px);
}

.about-text-col {
    opacity: 0;
    transform: translateX(30px);
}

/* --- Community --- */
.community-img {
    opacity: 0;
    transform: scale(0.95);
}

/* --- Contact --- */
.contact-item {
    opacity: 0;
    transform: translateY(15px);
}

.hours-card {
    opacity: 0;
    transform: translateY(20px);
}

.map-card {
    opacity: 0;
    transform: translateY(20px);
}

/* --- Scroll Reveal (below-fold only, progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
    .reveal-active .section-eyebrow {
        animation: revealUp 0.7s ease forwards;
    }
    .reveal-active .section-title {
        animation: revealUp 0.7s ease forwards;
        animation-delay: 0.1s;
    }
    .reveal-active .section-subtitle {
        animation: revealUp 0.7s ease forwards;
        animation-delay: 0.2s;
    }
    .reveal-active .service-card {
        animation: revealUp 0.7s ease forwards;
    }
    .reveal-active .service-card:nth-child(1) { animation-delay: 0s; }
    .reveal-active .service-card:nth-child(2) { animation-delay: 0.08s; }
    .reveal-active .service-card:nth-child(3) { animation-delay: 0.16s; }
    .reveal-active .service-card:nth-child(4) { animation-delay: 0.24s; }
    .reveal-active .service-card:nth-child(5) { animation-delay: 0.32s; }
    .reveal-active .service-card:nth-child(6) { animation-delay: 0.4s; }
    .reveal-active .about-images {
        animation: revealLeft 0.8s ease forwards;
    }
    .reveal-active .about-text-col {
        animation: revealRight 0.8s ease forwards;
    }
    .reveal-active .community-img {
        animation: revealScale 0.7s ease forwards;
    }
    .reveal-active .community-img:nth-child(1) { animation-delay: 0s; }
    .reveal-active .community-img:nth-child(2) { animation-delay: 0.1s; }
    .reveal-active .community-img:nth-child(3) { animation-delay: 0.2s; }
    .reveal-active .community-img:nth-child(4) { animation-delay: 0.3s; }
    .reveal-active .contact-item {
        animation: revealUp 0.6s ease forwards;
    }
    .reveal-active .contact-item:nth-child(1) { animation-delay: 0s; }
    .reveal-active .contact-item:nth-child(2) { animation-delay: 0.1s; }
    .reveal-active .contact-item:nth-child(3) { animation-delay: 0.2s; }
    .reveal-active .hours-card {
        animation: revealUp 0.7s ease forwards;
    }
    .reveal-active .map-card {
        animation: revealUp 0.7s ease forwards;
        animation-delay: 0.15s;
    }
}

@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes revealScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- CTA Buttons --- */
.cta-primary {
    position: relative;
    overflow: hidden;
}

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

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

/* --- Image Hover Effects --- */
.community-img img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Smooth image loading --- */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* --- Responsive --- */
@media (max-width: 1023px) {
    .hero-headline {
        font-size: 3.5rem;
    }
    .hero-headline span {
        font-size: 2.25rem;
    }
}

@media (max-width: 767px) {
    .hero-headline {
        font-size: 2.75rem;
    }
    .hero-headline span {
        font-size: 1.75rem;
    }
    .hero-img-main {
        height: 400px !important;
    }
    .hero-float-card {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 1rem;
    }
}
