/* ==========================================================================
   Hospital PP — Public site stylesheet
   Token-driven, accessible, mobile-friendly.
   ========================================================================== */

/* ===== Design Tokens ===== */
:root {
    /* Brand */
    --hpp-primary: #0d6efd;
    --hpp-primary-rgb: 13, 110, 253;
    --hpp-secondary: #64748b;     /* aligned with slate palette */

    /* Neutral palette (slate) */
    --hpp-dark: #0f172a;
    --hpp-muted: #64748b;
    --hpp-light: #f8fafc;
    --hpp-surface: #ffffff;
    --hpp-surface-alt: #f1f5f9;
    --hpp-border: #e2e8f0;
    --hpp-border-strong: #cbd5e1;

    /* Status colors */
    --hpp-success: #10b981;
    --hpp-warning: #f59e0b;
    --hpp-danger: #ef4444;
    --hpp-info: #06b6d4;
    --hpp-whatsapp: #25d366;

    /* Spacing scale (4px base) */
    --space-1: .25rem;
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4.5rem;

    /* Radius scale */
    --radius-sm: .375rem;
    --radius-md: .5rem;
    --radius-lg: .75rem;
    --radius-xl: 1rem;
    --radius-pill: 2rem;

    /* Elevation */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 6px 16px rgba(15, 23, 42, .08), 0 2px 4px rgba(15, 23, 42, .04);
    --shadow-lg: 0 14px 28px rgba(15, 23, 42, .10), 0 4px 8px rgba(15, 23, 42, .05);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, .14), 0 8px 16px rgba(15, 23, 42, .06);

    /* Motion */
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --t-fast: 150ms;
    --t-base: 220ms;
    --t-slow: 320ms;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    color: var(--hpp-dark);
    font-family: 'Segoe UI', 'Hind Siliguri', 'Noto Sans Bengali', system-ui, -apple-system, Tahoma, Roboto, Arial, sans-serif;
    line-height: 1.6;
    background: var(--hpp-surface);
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(var(--hpp-primary-rgb), .18); color: var(--hpp-dark); }

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

/* Accessible focus rings */
:focus-visible {
    outline: 3px solid rgba(var(--hpp-primary-rgb), .35);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
    box-shadow: 0 0 0 .25rem rgba(var(--hpp-primary-rgb), .25) !important;
    outline: none;
}

/* Honor reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== Theme primary override ===== */
.btn-primary {
    --bs-btn-bg: var(--hpp-primary);
    --bs-btn-border-color: var(--hpp-primary);
    --bs-btn-hover-bg: var(--hpp-primary);
    --bs-btn-hover-border-color: var(--hpp-primary);
    --bs-btn-active-bg: var(--hpp-primary);
    --bs-btn-active-border-color: var(--hpp-primary);
}
.btn { transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-base) var(--ease-out), background-color var(--t-fast), color var(--t-fast); }
.btn-primary { box-shadow: 0 4px 12px rgba(var(--hpp-primary-rgb), .25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(var(--hpp-primary-rgb), .32); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); }
.btn-outline-primary { color: var(--hpp-primary); border-color: var(--hpp-primary); }
.btn-outline-primary:hover { background: var(--hpp-primary); border-color: var(--hpp-primary); }
.text-primary { color: var(--hpp-primary) !important; }
.bg-primary { background-color: var(--hpp-primary) !important; }
.border-primary { border-color: var(--hpp-primary) !important; }
a { color: var(--hpp-primary); transition: color var(--t-fast); }
a:hover { color: var(--hpp-primary); filter: brightness(.85); }

/* ===== Notice Bar ===== */
.notice-bar {
    padding: 8px 16px;
    text-align: center;
    font-size: .875rem;
    font-weight: 500;
    letter-spacing: .01em;
}
.notice-bar a { text-decoration: none; }
.notice-bar a:hover { text-decoration: underline; }

/* ===== Topbar (above main header) ===== */
.topbar {
    background: var(--hpp-dark);
    color: #cbd5e1;
    padding: 8px 0;
    font-size: .85rem;
}
.topbar a { color: #cbd5e1; text-decoration: none; transition: color var(--t-fast); }
.topbar a:hover { color: #fff; }
.topbar .topbar-info { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.topbar .topbar-info > span { display: inline-flex; align-items: center; gap: .35rem; }
.topbar .topbar-social a {
    margin-left: .5rem;
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    transition: background var(--t-fast), transform var(--t-fast);
}
.topbar .topbar-social a:hover { background: rgba(var(--hpp-primary-rgb), .8); color: #fff; transform: translateY(-1px); }

/* ===== Main Header / Navbar ===== */
.main-header {
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--hpp-border);
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--shadow-sm);
}
.main-header .navbar-brand { gap: .65rem !important; }
.main-header .navbar-brand img { max-height: 50px; }
a.navbar-brand { white-space: normal; text-align: left; }

/* Scroll-to-top floating button */
.scroll-top-btn {
    position: fixed;
    bottom: 90px; left: 20px;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1040;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out), visibility var(--t-base);
}
.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.main-header .navbar-brand .brand-text {
    font-weight: 700;
    color: var(--hpp-dark);
    font-size: 1.15rem;
    letter-spacing: -.01em;
}
.main-header .navbar-nav { gap: .12rem; }
.main-header .navbar-nav .nav-link {
    color: var(--hpp-dark);
    font-weight: 500;
    font-size: .95rem;
    padding: .5rem .95rem !important;
    border-radius: 999px;
    position: relative;
    transition: color var(--t-fast), background-color var(--t-fast);
}
.main-header .navbar-nav .nav-link:hover {
    color: var(--hpp-primary);
    background-color: rgba(var(--hpp-primary-rgb), .08);
}
.main-header .navbar-nav .nav-link.active {
    color: var(--hpp-primary);
    background-color: rgba(var(--hpp-primary-rgb), .12);
    font-weight: 600;
}
.main-header .header-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: nowrap; }
.main-header .header-actions .btn { white-space: nowrap; }
/* keep the centered menu from crowding the action buttons */
@media (min-width: 992px) {
    .main-header .navbar-nav { column-gap: .05rem; }
    .main-header .navbar-nav .nav-link { padding: .5rem .75rem !important; }
}
.main-header .navbar-toggler {
    border: 1px solid var(--hpp-border);
    padding: .35rem .55rem;
}
.main-header .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(var(--hpp-primary-rgb), .18); }

/* Stack actions below nav on smaller screens for breathing room */
@media (max-width: 991.98px) {
    .main-header .navbar-nav { padding-top: .5rem; gap: .15rem; }
    .main-header .navbar-nav .nav-link {
        border-radius: .5rem;
        padding: .65rem .85rem !important;
        border-left: 3px solid transparent;
    }
    .main-header .navbar-nav .nav-link.active {
        border-left-color: var(--hpp-primary);
    }
    .main-header .header-actions {
        padding-top: .75rem;
        margin-top: .5rem;
        border-top: 1px solid var(--hpp-border);
    }
}

/* ===== Hero / Slider ===== */
.hero-slider .carousel-item {
    height: clamp(420px, 56vh, 640px);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
}
.hero-slider .carousel-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15,23,42,.75) 0%, rgba(15,23,42,.45) 55%, rgba(15,23,42,.15) 100%);
}
.hero-slider .hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    color: #fff;
    z-index: 2;
}
.hero-slider .hero-content h1 {
    font-size: clamp(1.65rem, 2.5vw + 1rem, 2.75rem);
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.2;
}
.hero-slider .hero-content .lead {
    font-size: clamp(.95rem, .6vw + .85rem, 1.2rem);
    opacity: .95;
}
.hero-slider .carousel-indicators [data-bs-target] {
    width: 28px; height: 4px; border-radius: 2px;
    background: rgba(255, 255, 255, .55);
    border: none;
}
.hero-slider .carousel-indicators .active { background: #fff; }
.hero-slider .carousel-control-prev,
.hero-slider .carousel-control-next { width: 7%; opacity: .8; }

@media (max-width: 768px) {
    .hero-slider .carousel-item { height: clamp(380px, 70vh, 520px); }
}

/* When the quick-appointment widget is rendered without the hero slider above it,
   skip the negative margin overlap so it doesn't crash into the header. */
.quick-appointment.no-hero-overlap { margin-top: 2rem !important; }

/* ===== Section ===== */
.section { padding: 70px 0; }
.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-title h2 {
    font-size: clamp(1.5rem, 1vw + 1.25rem, 2.15rem);
    font-weight: 700;
    color: var(--hpp-dark);
    margin: 0;
    letter-spacing: -.01em;
}
.section-title .small-title {
    color: var(--hpp-primary);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: .35rem;
    display: inline-block;
}
.section-title .small-title::before,
.section-title .small-title::after {
    content: '';
    display: inline-block;
    width: 18px; height: 2px; vertical-align: middle;
    background: currentColor;
    opacity: .5;
}
.section-title .small-title::before { margin-right: .5rem; }
.section-title .small-title::after { margin-left: .5rem; }
.section-title .subtitle { color: var(--hpp-muted); margin-top: .5rem; max-width: 640px; margin-left: auto; margin-right: auto; }
.bg-light-gray { background: var(--hpp-light); }

/* ===== Cards (departments, services, doctors, packages) ===== */
.card-soft {
    border: 1px solid var(--hpp-border);
    border-radius: var(--radius-lg);
    background: var(--hpp-surface);
    box-shadow: var(--shadow-xs);
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out), border-color var(--t-base);
    overflow: hidden;
}
.card-soft:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--hpp-primary-rgb), .25);
}

.dept-card { padding: 1.75rem 1.5rem; text-align: center; }
.dept-card .dept-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--hpp-primary-rgb), .18), rgba(var(--hpp-primary-rgb), .06));
    color: var(--hpp-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    transition: transform var(--t-base) var(--ease-out);
}
.dept-card:hover .dept-icon { transform: scale(1.08) rotate(-3deg); }
.dept-card h5 { font-weight: 600; margin-bottom: .5rem; }
.dept-card p { color: var(--hpp-muted); margin-bottom: 1rem; }

.service-card { display: flex; gap: 1rem; padding: 1.25rem; }
.service-card .service-icon {
    width: 50px; height: 50px; flex-shrink: 0;
    border-radius: var(--radius-md);
    background: rgba(var(--hpp-primary-rgb), .1);
    color: var(--hpp-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
}

.doctor-card .doctor-photo {
    aspect-ratio: 1; overflow: hidden;
    background: var(--hpp-surface-alt);
}
.doctor-card .doctor-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow) var(--ease-out);
}
.doctor-card:hover .doctor-photo img { transform: scale(1.07); }
.doctor-card .doctor-body { padding: 1rem 1.25rem 1.25rem; text-align: center; }
.doctor-card h5 { margin-bottom: .25rem; font-weight: 600; }
.doctor-card .designation { color: var(--hpp-muted); font-size: .9rem; margin-bottom: .5rem; }
.doctor-card .dept {
    display: inline-block;
    padding: .2rem .65rem;
    background: rgba(var(--hpp-primary-rgb), .1);
    color: var(--hpp-primary);
    border-radius: var(--radius-pill);
    font-size: .75rem;
    font-weight: 500;
}

.package-card .package-image { aspect-ratio: 16/10; background: var(--hpp-surface-alt); overflow: hidden; }
.package-card .package-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--t-slow) var(--ease-out);
}
.package-card:hover .package-image img { transform: scale(1.05); }
.package-card .package-body { padding: 1.25rem; }
.package-card .price { font-size: 1.5rem; font-weight: 700; color: var(--hpp-primary); }
.package-card .price-old { text-decoration: line-through; color: var(--hpp-muted); margin-left: .5rem; font-size: .9rem; font-weight: 400; }

.blog-card .blog-image { aspect-ratio: 16/9; background: var(--hpp-surface-alt); overflow: hidden; }
.blog-card .blog-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--t-slow) var(--ease-out);
}
.blog-card:hover .blog-image img { transform: scale(1.06); }
.blog-card .blog-body { padding: 1.25rem; }
.blog-card .blog-meta { color: var(--hpp-muted); font-size: .8rem; margin-bottom: .5rem; display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.blog-card h5 { font-weight: 600; line-height: 1.35; }
.blog-card h5 a { color: var(--hpp-dark); text-decoration: none; }
.blog-card h5 a:hover { color: var(--hpp-primary); }

/* ===== Stats / Counters ===== */
.stats-section {
    background: linear-gradient(135deg, var(--hpp-primary) 0%, color-mix(in srgb, var(--hpp-primary) 70%, #000) 100%);
    color: #fff;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}
.stats-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 10%, rgba(255,255,255,.15) 0%, transparent 45%),
                      radial-gradient(circle at 80% 90%, rgba(255,255,255,.10) 0%, transparent 50%);
    pointer-events: none;
}
.stats-section .container { position: relative; z-index: 1; }
.stats-section .stat-item { text-align: center; }
.stats-section .stat-icon { font-size: 2.5rem; opacity: .9; margin-bottom: .5rem; }
.stats-section .stat-value { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.stats-section .stat-label { opacity: .9; font-size: 1rem; }

/* ===== Testimonial ===== */
.testimonial-card {
    background: var(--hpp-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--hpp-border);
    text-align: center;
    box-shadow: var(--shadow-xs);
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.testimonial-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.testimonial-card .quote {
    color: var(--hpp-muted);
    font-style: italic;
    margin-bottom: 1rem;
    position: relative;
    padding-top: 1rem;
}
.testimonial-card .quote::before {
    content: '\201C';
    position: absolute; top: -.5rem; left: 50%; transform: translateX(-50%);
    font-size: 3rem; line-height: 1;
    color: rgba(var(--hpp-primary-rgb), .25);
    font-family: Georgia, serif;
}
.testimonial-card img.t-photo {
    width: 64px; height: 64px; border-radius: 50%;
    object-fit: cover; margin-bottom: .5rem;
    border: 3px solid var(--hpp-surface);
    box-shadow: 0 0 0 2px rgba(var(--hpp-primary-rgb), .25);
}
.testimonial-card .t-rating { color: var(--hpp-warning); margin-bottom: .35rem; }

/* ===== Emergency strip (above footer) ===== */
.emergency-strip {
    background: linear-gradient(90deg, #b91c1c 0%, #ef4444 50%, #b91c1c 100%);
    color: #fff;
    padding: .65rem 0;
    text-align: center;
    font-size: .9rem;
    letter-spacing: .01em;
}
.emergency-strip-link {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    background: rgba(255,255,255,.18);
    padding: .15rem .65rem;
    border-radius: 999px;
    transition: background var(--t-fast);
}
.emergency-strip-link:hover { background: rgba(255,255,255,.32); color: #fff; }

/* ===== Footer ===== */
.main-footer {
    background: var(--hpp-dark);
    color: #cbd5e1;
    padding: 60px 0 0;
    position: relative;
}
.main-footer::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--hpp-primary), color-mix(in srgb, var(--hpp-primary) 60%, #fff));
}
.main-footer::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 80px;
    background: radial-gradient(ellipse at center top, rgba(var(--hpp-primary-rgb), .08) 0%, transparent 70%);
    pointer-events: none;
}
.main-footer > .container { position: relative; z-index: 1; }
.main-footer h6 { color: #fff; margin-bottom: 1rem; font-weight: 600; letter-spacing: .01em; }
.main-footer a { color: #cbd5e1; text-decoration: none; transition: color var(--t-fast), padding-left var(--t-fast); }
.main-footer .footer-links a:hover { color: #fff; padding-left: 4px; }
.main-footer a:hover { color: #fff; }
.main-footer .footer-links li { padding: 5px 0; }
.main-footer .text-light-emphasis { color: #94a3b8 !important; }
.main-footer .footer-bottom {
    border-top: 1px solid #334155;
    margin-top: 40px;
    padding: 20px 0;
    font-size: .875rem;
    color: #94a3b8;
}
.main-footer .social-links a {
    display: inline-flex;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
    align-items: center; justify-content: center;
    margin-right: .35rem;
    transition: background var(--t-fast), transform var(--t-fast), color var(--t-fast);
}
.main-footer .social-links a:hover { background: var(--hpp-primary); color: #fff; transform: translateY(-2px); }

/* ===== Floating Buttons ===== */
.floating-buttons {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 1040;
    display: flex; flex-direction: column; gap: 10px;
}
.floating-buttons a {
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
    transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-base);
    position: relative;
}
.floating-buttons a:hover { transform: scale(1.08); color: #fff; box-shadow: var(--shadow-lg); }
.fab-whatsapp { background: var(--hpp-whatsapp); }
.fab-emergency { background: var(--hpp-danger); }
/* Pulse ring on emergency button to nudge attention */
.fab-emergency::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .55);
    animation: fab-pulse 2.4s infinite;
}
@keyframes fab-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); }
    70% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ===== Page hero (sub-pages) ===== */
.page-hero {
    background: linear-gradient(135deg, var(--hpp-primary) 0%, color-mix(in srgb, var(--hpp-primary) 60%, #000) 100%);
    color: #fff;
    padding: 70px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 15% 20%, rgba(255,255,255,.18) 0%, transparent 45%),
                      radial-gradient(circle at 85% 80%, rgba(255,255,255,.12) 0%, transparent 50%);
    pointer-events: none;
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 {
    font-size: clamp(1.6rem, 1.5vw + 1.1rem, 2.5rem);
    font-weight: 700;
    margin-bottom: .5rem;
    letter-spacing: -.01em;
}
.page-hero .breadcrumb { background: transparent; justify-content: center; padding: 0; margin: 0; }
.page-hero .breadcrumb a { color: rgba(255,255,255,.85); text-decoration: none; }
.page-hero .breadcrumb a:hover { color: #fff; text-decoration: underline; }
.page-hero .breadcrumb-item.active { color: #fff; }
.page-hero .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.6); }

/* ===== Doctor profile, Department detail, etc. ===== */
.profile-photo {
    width: 100%; max-width: 280px;
    aspect-ratio: 1;
    margin: 0 auto;
    background: var(--hpp-surface-alt);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-info dl { margin-bottom: 0; }
.profile-info dt { color: var(--hpp-muted); font-weight: 500; font-size: .85rem; }
.profile-info dd { font-weight: 500; margin-bottom: .65rem; }

/* ===== Appointment & contact form ===== */
.contact-info-card {
    background: var(--hpp-surface);
    border: 1px solid var(--hpp-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xs);
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.contact-info-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.contact-info-card .icon-wrap {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(var(--hpp-primary-rgb), .1);
    color: var(--hpp-primary);
    display: flex; align-items: center; justify-content: center;
}

/* Form polish */
.form-control, .form-select {
    border-color: var(--hpp-border);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control:focus, .form-select:focus {
    border-color: var(--hpp-primary);
}
.form-label { font-weight: 500; margin-bottom: .35rem; }

/* ===== Star rating display ===== */
.star-rating { color: var(--hpp-warning); }
.star-rating .star-empty { color: var(--hpp-border-strong); }

/* ===== Pagination ===== */
.pagination { gap: .25rem; }
.page-link {
    color: var(--hpp-primary);
    border-color: var(--hpp-border);
    border-radius: var(--radius-md) !important;
    transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.page-link:hover { background: rgba(var(--hpp-primary-rgb), .08); transform: translateY(-1px); }
.page-item.active .page-link {
    background: var(--hpp-primary);
    border-color: var(--hpp-primary);
    box-shadow: 0 4px 10px rgba(var(--hpp-primary-rgb), .25);
}

/* ===== Gallery grid ===== */
.gallery-item {
    aspect-ratio: 1;
    background: var(--hpp-surface-alt);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}
.gallery-item img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--t-slow) var(--ease-out);
}
.gallery-item:hover img { transform: scale(1.08); }
.gallery-item::after {
    content: '\F4F1'; /* bi-zoom-in */
    font-family: 'bootstrap-icons';
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.5rem;
    background: linear-gradient(135deg, rgba(15,23,42,.45), rgba(15,23,42,.15));
    opacity: 0;
    transition: opacity var(--t-base);
}
.gallery-item:hover::after { opacity: 1; }

/* ===== TinyMCE rendered content ===== */
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4 { color: var(--hpp-dark); margin-top: 1.5rem; line-height: 1.3; }
.rich-content img { max-width: 100%; height: auto; border-radius: var(--radius-md); }
.rich-content table { width: 100%; margin-bottom: 1rem; overflow-x: auto; display: block; }
.rich-content p { margin-bottom: 1rem; }
.rich-content blockquote {
    border-left: 4px solid var(--hpp-primary);
    background: var(--hpp-light);
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--hpp-dark);
}
.rich-content ul, .rich-content ol { padding-left: 1.5rem; }

/* ===== Responsive (desktop-first refinements) ===== */
@media (max-width: 991.98px) {
    .section { padding: 50px 0; }
    .page-hero { padding: 50px 0 40px; }
    body.has-mobile-cta { padding-bottom: 68px; }
    .floating-buttons { bottom: 84px; right: 14px; gap: 8px; }
    .floating-buttons a { width: 46px; height: 46px; font-size: 1.1rem; }
    .topbar .topbar-info { justify-content: center; gap: .9rem; }
}

@media (max-width: 575.98px) {
    .section { padding: 38px 0; }
    .hero-slider .carousel-item { height: 320px; }
    .hero-slider .btn-lg { padding: .5rem 1rem; font-size: .9rem; }
    .stats-section { padding: 40px 0; }
    .stats-section .stat-value { font-size: 1.75rem; }
    .stats-section .stat-icon { font-size: 2rem; }
    .testimonial-card { padding: 1.25rem; }
    .doctor-card .doctor-body { padding: .75rem 1rem 1rem; }
    .dept-card { padding: 1.25rem; }
    .topbar { padding: 6px 0; font-size: .75rem; }
    .package-card .price { font-size: 1.25rem; }
    .section-title { margin-bottom: 1.75rem; }
    .main-header .navbar-brand .brand-text { font-size: 1rem; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .main-header .navbar-brand img { max-height: 40px; }
}

/* Mobile table polish */
.table-responsive { -webkit-overflow-scrolling: touch; }
@media (max-width: 575.98px) {
    .table thead th, .table tbody td { font-size: .85rem; padding: .5rem; }
    .card-soft .card-body { padding: 1rem; }
    .card-soft .card-header { padding: .75rem 1rem; }
}

/* ===== Mobile sticky bottom CTA bar ===== */
.mobile-cta-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-top: 1px solid var(--hpp-border);
    box-shadow: 0 -2px 14px rgba(15, 23, 42, .08);
    z-index: 1035;
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}
.mobile-cta-bar .row { margin: 0; }
.mobile-cta-bar .cta-btn {
    display: flex; align-items: center; justify-content: center; gap: .35rem;
    padding: .65rem;
    border-radius: var(--radius-md);
    font-size: .85rem; font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: transform var(--t-fast) var(--ease-out), filter var(--t-fast);
}
.mobile-cta-bar .cta-btn:active { transform: scale(.96); }
.mobile-cta-bar .cta-call { background: rgba(239,68,68,.1); color: #dc2626; }
.mobile-cta-bar .cta-book { background: var(--hpp-primary); color: #fff !important; box-shadow: 0 4px 10px rgba(var(--hpp-primary-rgb), .25); }
.mobile-cta-bar .cta-whatsapp { background: rgba(37,211,102,.1); color: #128c4f; }

@media (max-width: 991.98px) { .mobile-cta-bar { display: block; } }

/* ===== Trust Signals (Smart Landing) ===== */
.trust-signal-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--hpp-surface);
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.trust-signal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.trust-signal-card .ts-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--hpp-primary-rgb), .18), rgba(var(--hpp-primary-rgb), .06));
    color: var(--hpp-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.75rem; margin-bottom: 1rem;
}
.trust-signal-card h6 { font-weight: 600; margin-bottom: .35rem; }
.trust-signal-card p { color: var(--hpp-muted); font-size: .85rem; margin: 0; }

/* ===== Inline appointment widget (Smart Landing) ===== */
.quick-appointment {
    background: linear-gradient(135deg, var(--hpp-primary) 0%, color-mix(in srgb, var(--hpp-primary) 65%, #000) 100%);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin: -3rem auto 0;
    max-width: 1100px;
    position: relative;
    z-index: 5;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}
.quick-appointment::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(circle at 90% 10%, rgba(255,255,255,.15) 0%, transparent 45%);
    pointer-events: none;
}
.quick-appointment > * { position: relative; z-index: 1; }
.quick-appointment h3 { font-weight: 700; margin-bottom: .25rem; }
.quick-appointment p { opacity: .9; margin-bottom: 1rem; }
.quick-appointment .form-control,
.quick-appointment .form-select {
    background: rgba(255,255,255,.95);
    border: 1px solid rgba(255,255,255,.3);
    color: var(--hpp-dark);
}
.quick-appointment .form-control:focus,
.quick-appointment .form-select:focus {
    background: #fff;
    border-color: #fff;
    box-shadow: 0 0 0 .2rem rgba(255,255,255,.25);
}
.quick-appointment .btn-light { color: var(--hpp-primary); font-weight: 600; }

@media (max-width: 991.98px) {
    .quick-appointment { padding: 1.5rem; margin-top: -2rem; border-radius: var(--radius-lg); }
    .quick-appointment h3 { font-size: 1.25rem; }
}

/* ===== OPD timing + map block ===== */
.opd-card {
    background: linear-gradient(135deg, #fff 0%, var(--hpp-light) 100%);
    border: 1px solid var(--hpp-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-xs);
}
.opd-card h5 { color: var(--hpp-primary); margin-bottom: 1rem; }
.opd-card .opd-row {
    display: flex; justify-content: space-between;
    padding: .5rem 0;
    border-bottom: 1px dashed var(--hpp-border);
}
.opd-card .opd-row:last-child { border-bottom: none; }
.opd-card .day { font-weight: 500; color: var(--hpp-dark); }
.opd-card .time { color: var(--hpp-muted); font-size: .9rem; }
.opd-card .closed { color: var(--hpp-danger); }

/* ===== Service grid (improved) ===== */
.service-grid-card {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: var(--radius-lg);
    background: var(--hpp-surface);
    border: 1px solid var(--hpp-border);
    transition: transform var(--t-base) var(--ease-out), border-color var(--t-base), box-shadow var(--t-base);
    cursor: pointer;
    height: 100%;
}
.service-grid-card:hover {
    transform: translateY(-6px);
    border-color: var(--hpp-primary);
    box-shadow: 0 14px 28px rgba(var(--hpp-primary-rgb), .15);
}
.service-grid-card:hover .sg-icon { background: var(--hpp-primary); color: #fff; }
.service-grid-card .sg-icon {
    width: 72px; height: 72px;
    border-radius: var(--radius-xl);
    background: rgba(var(--hpp-primary-rgb), .1);
    color: var(--hpp-primary);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 2rem; margin-bottom: 1rem;
    transition: all var(--t-base) var(--ease-out);
}
.service-grid-card h6 { font-weight: 600; color: var(--hpp-dark); margin-bottom: .5rem; }
.service-grid-card p { color: var(--hpp-muted); font-size: .85rem; margin: 0; }

/* ===== Counter / reveal animation ===== */
.counter[data-counter] { transition: opacity var(--t-slow); }

[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
}
[data-reveal].revealed { opacity: 1; transform: translateY(0); }
[data-reveal-delay="100"] { transition-delay: .08s; }
[data-reveal-delay="200"] { transition-delay: .16s; }
[data-reveal-delay="300"] { transition-delay: .24s; }
[data-reveal-delay="400"] { transition-delay: .32s; }

/* ===== Hero CTA badges ===== */
.hero-slider .hero-content .hero-badges {
    display: flex; gap: .5rem; flex-wrap: wrap;
    margin-bottom: 1rem;
}
.hero-slider .hero-content .hero-badges .badge {
    background: rgba(255,255,255,.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    padding: .35rem .75rem;
    font-weight: 500;
    font-size: .75rem;
    border-radius: var(--radius-pill);
}

/* ===== Utility helpers ===== */
.text-balance { text-wrap: balance; }
.btn-pill { border-radius: var(--radius-pill); }
.shadow-soft { box-shadow: var(--shadow-md) !important; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--hpp-muted);
}
.empty-state .empty-icon {
    font-size: 3rem;
    color: var(--hpp-border-strong);
    margin-bottom: .75rem;
}

/* Skeleton (for async loaders if needed) */
.skeleton {
    background: linear-gradient(90deg, var(--hpp-surface-alt) 25%, #e2e8f0 50%, var(--hpp-surface-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.4s infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Print */
@media print {
    .topbar, .main-header, .main-footer, .floating-buttons, .mobile-cta-bar, .notice-bar,
    .scroll-top-btn, .emergency-strip, .share-buttons, .form-actions-bar,
    .d-print-none, [data-newsletter-form], form[data-submit-spinner] { display: none !important; }
    body { color: #000; background: #fff !important; }
    a { color: #000 !important; text-decoration: none !important; }
    .page-hero {
        background: #fff !important;
        color: #000 !important;
        border-bottom: 1px solid #000;
        padding: 1rem 0 !important;
    }
    .page-hero::before { display: none !important; }
    .page-hero h1, .page-hero .breadcrumb,
    .page-hero .breadcrumb a, .page-hero .breadcrumb-item.active { color: #000 !important; }
    .card-soft, .app-card { box-shadow: none !important; border: 1px solid #ccc !important; }
    .sticky-top { position: static !important; }

    /* Compact spacing so content fits on a single page */
    @page { margin: 12mm; }
    .section { padding: 0 !important; }
    .page-hero { padding: .5rem 0 !important; border-bottom: 1px solid #ccc; }
    .page-hero .breadcrumb { display: none !important; }
    .card-soft, .app-card { padding: 1rem !important; }
    .card-soft.p-4, .card-soft.p-md-5 { padding: 1rem !important; }

    /* Appointment confirmation: tighten the success block */
    .appt-confirm-icon { width: 52px !important; height: 52px !important; margin-bottom: .5rem !important; }
    .appt-confirm-icon i { font-size: 1.5rem !important; }
}
