/* =========================================================
   PharmaDeko CMS — Custom Styles
   CDN-based Tailwind CSS is primary; this file adds polish
   that Tailwind inline classes can't express.
   ========================================================= */

/* ── Fonts ────────────────────────────────────────────────── */
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
.font-display { font-family: 'Playfair Display', Georgia, serif; }

/* ── Smooth scroll ────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Scroll progress bar ──────────────────────────────────── */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary-600, #16a34a), var(--color-primary-400, #4ade80));
    z-index: 9999;
    width: 0%;
    transition: width .1s linear;
}

/* ── Nav utilities ────────────────────────────────────────── */
.nav-link {
    position: relative;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: .875rem;
    font-weight: 500;
    color: #374151;
    transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--color-primary-600, #16a34a); background: color-mix(in srgb, var(--color-primary-600, #16a34a) 7%, transparent); }
.mobile-nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: .9rem;
    font-weight: 500;
    color: #374151;
    transition: background .2s, color .2s;
}
.dark .nav-link { color: #cbd5e1; }
.dark .mobile-nav-link { color: #cbd5e1; }
.mobile-nav-link:hover, .dark .mobile-nav-link:hover { background: color-mix(in srgb, var(--color-primary-600, #16a34a) 10%, transparent); color: var(--color-primary-600, #16a34a); }

/* ── Header shrink on scroll ──────────────────────────────── */
header#main-header { transition: box-shadow .3s, backdrop-filter .3s; }
header#main-header.shrunk { box-shadow: 0 2px 24px rgba(0,0,0,.08); }

/* ── Gradient text ────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--color-primary-600, #16a34a) 0%, var(--color-primary-400, #4ade80) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.gradient-text-blue {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Glass card ───────────────────────────────────────────── */
.glass {
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.5);
}
.dark .glass {
    background: rgba(15,23,42,.65);
    border-color: rgba(255,255,255,.08);
}

/* ── Swiper bullets ───────────────────────────────────────── */
.swiper-pagination-bullet {
    background: rgba(255,255,255,.45);
    opacity: 1;
    transition: width .3s, background .3s;
}
.swiper-pagination-bullet-active {
    background: #fff;
    width: 28px;
    border-radius: 4px;
}
.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    width: 56px !important;
    height: 56px !important;
    border-radius: 9999px !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.24), rgba(255,255,255,0.12)) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.24);
    transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}
.hero-swiper .swiper-button-next:hover,
.hero-swiper .swiper-button-prev:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.32), rgba(255,255,255,0.18)) !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.3);
}
.hero-swiper .swiper-button-next::after,
.hero-swiper .swiper-button-prev::after {
    font-size: 1.05rem !important;
    font-weight: 800;
}

/* ── Hero slide animation ─────────────────────────────────── */
@keyframes heroFadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
.swiper-slide-active [data-slide-content] > * {
    animation: heroFadeUp .7s cubic-bezier(.22,1,.36,1) forwards;
}
.swiper-slide-active [data-slide-content] > *:nth-child(1) { animation-delay: .1s; opacity: 0; }
.swiper-slide-active [data-slide-content] > *:nth-child(2) { animation-delay: .25s; opacity: 0; }
.swiper-slide-active [data-slide-content] > *:nth-child(3) { animation-delay: .4s; opacity: 0; }
.swiper-slide-active [data-slide-content] > *:nth-child(4) { animation-delay: .55s; opacity: 0; }

/* ── Scroll-bounce arrow ──────────────────────────────────── */
@keyframes bounce-slow {
    0%, 100% { transform: translateY(0) translateX(-50%); }
    50%       { transform: translateY(8px) translateX(-50%); }
}
.scroll-arrow { animation: bounce-slow 2s ease-in-out infinite; }

/* ── Section wave divider ─────────────────────────────────── */
.wave-divider { display: block; width: 100%; overflow: hidden; line-height: 0; }
.wave-divider svg { display: block; }

/* ── Counter animation ────────────────────────────────────── */
@keyframes countUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.counter { display: inline-block; }

/* ── Card hover lift ──────────────────────────────────────── */
.card-lift {
    transition: box-shadow .35s cubic-bezier(.22,1,.36,1), transform .35s cubic-bezier(.22,1,.36,1);
}
.card-lift:hover {
    box-shadow: 0 20px 60px rgba(0,0,0,.12);
    transform: translateY(-6px);
}
.dark .card-lift:hover { box-shadow: 0 20px 60px rgba(0,0,0,.35); }

/* ── Service card icon animation ──────────────────────────── */
.service-card .service-icon {
    transition: background .35s, color .35s, transform .35s;
}
.service-card:hover .service-icon {
    transform: scale(1.1) rotate(-4deg);
}

/* ── Image zoom ───────────────────────────────────────────── */
.img-zoom { overflow: hidden; }
.img-zoom img { transition: transform .7s cubic-bezier(.22,1,.36,1); }
.img-zoom:hover img { transform: scale(1.07); }

/* ── Skeleton loaders ─────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position:  800px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
}
.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 800px 100%;
}

/* ── Lazy-image fade ──────────────────────────────────────── */
img.lazy { opacity: 0; transition: opacity .4s ease; }
img.lazy.loaded { opacity: 1; }

/* ── Dark-mode color transitions ──────────────────────────── */
body, header, footer, section, div, a, p, h1, h2, h3, h4, h5, span, button, input, textarea, select {
    transition: background-color .25s ease, border-color .25s ease, color .2s ease;
}
/* Don't animate transforms (causes jitter on enter animations) */
.swiper-slide, [data-aos], [x-show] { transition-property: opacity, background-color, border-color, color !important; }

/* ── Scroll-to-top ────────────────────────────────────────── */
#scroll-top {
    transition: opacity .3s, transform .3s;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}
#scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Cookie consent ───────────────────────────────────────── */
#cookie-consent { z-index: 9999; }

/* ── WhatsApp float ───────────────────────────────────────── */
a[href*="wa.me"] {
    transition: transform .2s, box-shadow .2s;
}
a[href*="wa.me"]:hover {
    transform: scale(1.12);
    box-shadow: 0 8px 24px rgba(37,211,102,.4);
}

/* ── AOS ──────────────────────────────────────────────────── */
[data-aos] { pointer-events: none; }
[data-aos].aos-animate { pointer-events: auto; }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline-item:not(:last-child) > .timeline-dot::after {
    content: '';
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    width: 2px; height: 100%;
    background: #e5e7eb;
}
.dark .timeline-item:not(:last-child) > .timeline-dot::after { background: #1e293b; }

/* ── Product thumbs ───────────────────────────────────────── */
.thumb-swiper .swiper-slide { cursor: pointer; opacity: .5; }
.thumb-swiper .swiper-slide-thumb-active { opacity: 1; border: 2px solid var(--color-primary-600, #16a34a); border-radius: 8px; }

/* ── Gallery lightbox ─────────────────────────────────────── */
#lightbox { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ── Search highlight ─────────────────────────────────────── */
mark.search-hl { background: #fef9c3; color: inherit; border-radius: 2px; padding: 0 2px; }
.dark mark.search-hl { background: #713f12; }

/* ── Form focus ring ──────────────────────────────────────── */
input:focus, textarea:focus, select:focus { outline: none; }

/* ── Prose dark mode ──────────────────────────────────────── */
.dark .prose { color: #d1d5db; }
.dark .prose h1,.dark .prose h2,.dark .prose h3 { color: #f9fafb; }
.dark .prose a { color: #4ade80; }
.dark .prose strong { color: #f3f4f6; }
.dark .prose code  { background: #1e293b; color: #d1fae5; }
.dark .prose blockquote { border-left-color: #1e293b; color: #9ca3af; }

/* ── Masonry gallery ──────────────────────────────────────── */
.masonry { columns: 2; gap: 16px; }
@media (min-width: 640px)  { .masonry { columns: 3; } }
@media (min-width: 1024px) { .masonry { columns: 4; } }
.masonry-item { break-inside: avoid; margin-bottom: 16px; }

/* ── FAQ accordion ────────────────────────────────────────── */
.faq-answer { overflow: hidden; }

/* ── Testimonial card quote mark ──────────────────────────── */
.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: -8px; left: 24px;
    font-size: 5rem;
    line-height: 1;
    color: var(--color-primary-600, #16a34a);
    opacity: .12;
    font-family: Georgia, serif;
    pointer-events: none;
}

/* ── Stats count suffix ───────────────────────────────────── */
.counter-wrap { position: relative; display: inline-flex; align-items: baseline; }

/* ── Section label tag ────────────────────────────────────── */
.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--color-primary-600, #16a34a);
    padding: 4px 12px;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--color-primary-600, #16a34a) 9%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-primary-600, #16a34a) 18%, transparent);
}
.dark .section-tag { background: color-mix(in srgb, var(--color-primary-600, #16a34a) 12%, transparent); border-color: color-mix(in srgb, var(--color-primary-600, #16a34a) 22%, transparent); }

/* ── Print ────────────────────────────────────────────────── */
@media print {
    header, footer, #cookie-consent, #scroll-top, a[href*="wa.me"] { display: none !important; }
}
