/**
 * DoctorBookly — hospital public profile responsive polish
 * Loaded after inline hospital-profile.php styles.
 */

/* Hero stats — Beds / Doctors / Ambulance / ICU: 3 per row (not stacked one-by-one) */
body.page-hospital-profile .hero-badges-key.hp-hero-stat-grid,
body.page-hospital-profile .hp-hero-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-top: 12px !important;
    align-items: stretch !important;
    flex-wrap: unset !important;
    max-width: 100% !important;
}

body.page-hospital-profile .hp-hero-stat-grid .hero-badge {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    min-height: 48px !important;
    padding: 10px 12px !important;
    width: auto !important;
    max-width: 100% !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06) !important;
    box-sizing: border-box !important;
}

body.page-hospital-profile .hp-hero-stat-grid .hero-badge i {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
    background: rgba(255, 255, 255, 0.65) !important;
    box-shadow: none !important;
}

@media (max-width: 520px) {
    body.page-hospital-profile .hp-hero-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    body.page-hospital-profile .hp-hero-stat-grid .hero-badge {
        font-size: 10px !important;
        padding: 6px 7px !important;
        min-height: 40px !important;
        white-space: normal !important;
        gap: 5px !important;
    }

    body.page-hospital-profile .hp-hero-stat-grid .hero-badge i {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        font-size: 10px !important;
    }
}

/* Address line — wrap long addresses */
body.page-hospital-profile .hospital-address,
body.page-hospital-profile .hero-location-inline,
body.page-hospital-profile .hp-hero-meta .hospital-address-line {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Section nav — smooth horizontal scroll on phones */
body.page-hospital-profile .profile-quick-nav {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding-bottom: 4px;
}

body.page-hospital-profile .profile-quick-nav::-webkit-scrollbar {
    display: none;
}

body.page-hospital-profile .profile-quick-nav a {
    flex-shrink: 0;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

@media (max-width: 768px) {
    body.page-hospital-profile .profile-quick-nav a {
        min-height: 44px;
        font-size: 12px !important;
    }
}

/* About text — readable width */
body.page-hospital-profile .hp-about-body {
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
    max-width: 72ch;
}

/* Clinical services tiles — 3 per row on mobile */
@media (max-width: 768px) {
    body.page-hospital-profile .clinical-section-services .clinical-tiles {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    body.page-hospital-profile .clinical-section-services .clinical-tile {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 4px !important;
        min-height: 0 !important;
        padding: 8px 4px !important;
    }

    body.page-hospital-profile .clinical-section-services .clinical-tile::before {
        display: none !important;
    }

    body.page-hospital-profile .clinical-section-services .clinical-tile__icon {
        width: 30px !important;
        height: 30px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    body.page-hospital-profile .clinical-section-services .clinical-tile__label {
        font-size: 10px !important;
        line-height: 1.2 !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    body.page-hospital-profile .clinical-section-services .clinical-tiles-scroll {
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 !important;
    }
}

/* Departments grid */
@media (max-width: 768px) {
    body.page-hospital-profile .dept-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}

@media (min-width: 769px) and (max-width: 1100px) {
    body.page-hospital-profile .dept-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Expert / doctor cards */
body.page-hospital-profile .experts-grid {
    gap: 16px;
}

@media (min-width: 601px) and (max-width: 1024px) {
    body.page-hospital-profile .experts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

body.page-hospital-profile .expert-card--pro > .expert-desc {
    -webkit-line-clamp: 3;
    line-clamp: 3;
    max-height: calc(1.5em * 3);
}

body.page-hospital-profile .expert-foot .btn,
body.page-hospital-profile .expert-foot a {
    min-height: 44px;
}

/* Sidebar contact + booking */
body.page-hospital-profile .sidebar-card .contact-item,
body.page-hospital-profile .hp-contact-info--compact .contact-item {
    word-break: break-word;
}

body.page-hospital-profile .hp-sidebar-booking .hp-book-btn,
body.page-hospital-profile .hp-sidebar-booking .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
    box-sizing: border-box;
}

body.page-hospital-profile .hp-sidebar-booking {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Working hours list */
body.page-hospital-profile .hp-working-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
}

body.page-hospital-profile .hp-working-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
}

body.page-hospital-profile .hp-working-days {
    font-weight: 600;
    color: #334155;
    min-width: 88px;
}

body.page-hospital-profile .hp-working-time {
    color: #64748b;
    text-align: right;
}

/* FAQ accordions — touch targets */
body.page-hospital-profile .faq-item .faq-question {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

/* Reviews block */
body.page-hospital-profile .reviews-section .btn,
body.page-hospital-profile .reviews-section button {
    min-height: 44px;
}

/* Map embed */
body.page-hospital-profile .sidebar-card iframe,
body.page-hospital-profile .location-map-compact iframe {
    max-width: 100%;
    border-radius: 12px;
}

/* Mobile quick action bar spacing */
@media (max-width: 768px) {
    body.page-hospital-profile {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    body.page-hospital-profile .main-content {
        overflow-x: hidden;
    }

    body.page-hospital-profile .content-section,
    body.page-hospital-profile .sidebar-card {
        max-width: 100%;
        box-sizing: border-box;
    }

    body.page-hospital-profile .hp-mobile-bar {
        position: sticky;
        bottom: 0;
        z-index: 45;
        background: linear-gradient(180deg, transparent, rgba(241, 245, 249, 0.92) 24%);
        padding-top: 8px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
}

/* Gallery carousel — cleaner cards & arrows */
body.page-hospital-profile .hp-rg-card,
body.page-hospital-profile .hp-coverflow-card {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.12) !important;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

body.page-hospital-profile .hp-rg-viewport {
    border-radius: 16px;
}

body.page-hospital-profile .hp-rg-arrow {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    border: 1px solid #99f6e4 !important;
    background: linear-gradient(180deg, #ffffff, #ecfdf5) !important;
    color: #0f766e !important;
    font-size: 18px !important;
    box-shadow: 0 6px 18px rgba(13, 148, 136, 0.18) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

body.page-hospital-profile .hp-rg-arrow:hover {
    background: #0d9488 !important;
    color: #fff !important;
    border-color: #0f766e !important;
    transform: scale(1.05);
}

body.page-hospital-profile .hp-rg-dot.is-active {
    background: linear-gradient(90deg, #0d9488, #14b8a6) !important;
}

/* Lightbox — refined image frame & nav arrows */
body.page-hospital-profile .lightbox.active {
    padding: 16px;
    box-sizing: border-box;
}

body.page-hospital-profile .lightbox-content {
    position: relative;
    border-radius: 16px;
    overflow: visible;
    background: transparent;
}

body.page-hospital-profile .lightbox-content img {
    border-radius: 16px !important;
    border: 3px solid rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55) !important;
    max-height: min(86vh, 900px) !important;
}

body.page-hospital-profile .lightbox-close {
    top: 8px !important;
    right: 8px !important;
    background: #ffffff !important;
    color: #0f766e !important;
    border: 2px solid #99f6e4 !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.35) !important;
}

body.page-hospital-profile .lightbox-close:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
    border-color: #fecaca !important;
}

body.page-hospital-profile .lightbox-nav {
    background: rgba(255, 255, 255, 0.96) !important;
    color: #0f766e !important;
    border: 1px solid #99f6e4 !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35) !important;
    backdrop-filter: blur(6px);
}

body.page-hospital-profile .lightbox-nav:hover {
    background: #0d9488 !important;
    color: #fff !important;
    transform: translateY(-50%) scale(1.06) !important;
}

body.page-hospital-profile .lightbox-prev {
    left: max(12px, env(safe-area-inset-left, 0px)) !important;
}

body.page-hospital-profile .lightbox-next {
    right: max(12px, env(safe-area-inset-right, 0px)) !important;
}

@media (max-width: 768px) {
    body.page-hospital-profile .lightbox-nav {
        width: 42px !important;
        height: 42px !important;
        font-size: 18px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.page-hospital-profile .expert-card:hover,
    body.page-hospital-profile .dept-card:hover,
    body.page-hospital-profile .offer-item:hover,
    body.page-hospital-profile .hp-rg-arrow:hover,
    body.page-hospital-profile .lightbox-nav:hover {
        transform: none;
    }
}

/* Mobile compact pass — tighter hero card, gallery, offers on profile */
@media (max-width: 768px) {
    body.page-hospital-profile .fb-cover-wrap {
        height: clamp(160px, 34vh, 220px) !important;
    }

    body.page-hospital-profile .fb-profile-shell {
        margin-top: -28px !important;
        padding: 0 10px !important;
    }

    body.page-hospital-profile .fb-profile-row {
        padding: 10px !important;
        gap: 10px !important;
        border-radius: 14px !important;
    }

    body.page-hospital-profile .hospital-image,
    body.page-hospital-profile .fb-profile-avatar {
        width: 58px !important;
        height: 58px !important;
        min-width: 58px !important;
        border-radius: 12px !important;
        border-width: 2px !important;
    }

    body.page-hospital-profile .fb-profile-main h1 {
        font-size: 1.02rem !important;
        margin-bottom: 4px !important;
    }

    body.page-hospital-profile .hero-location-inline,
    body.page-hospital-profile .hospital-address {
        font-size: 11px !important;
        padding: 6px 8px !important;
        margin-bottom: 6px !important;
    }

    body.page-hospital-profile .hp-hero-stat-grid,
    body.page-hospital-profile .hero-badges-key.hp-hero-stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 6px !important;
        margin-top: 8px !important;
    }

    body.page-hospital-profile .hp-mobile-bar {
        padding: 0 10px 8px !important;
        gap: 6px !important;
    }

    body.page-hospital-profile .hp-mobile-bar__btn {
        min-height: 40px !important;
        font-size: 12px !important;
        gap: 5px !important;
        border-radius: 10px !important;
    }

    body.page-hospital-profile .main-content {
        padding: 6px 10px 20px !important;
        gap: 10px !important;
    }

    body.page-hospital-profile .content-section {
        padding: 12px 10px !important;
        border-radius: 12px !important;
    }

    body.page-hospital-profile .section-title {
        margin: 0 0 8px !important;
        font-size: 0.95rem !important;
        padding: 8px 10px !important;
    }

    body.page-hospital-profile .hp-about-body,
    body.page-hospital-profile .description {
        font-size: 13px !important;
        line-height: 1.55 !important;
    }

    body.page-hospital-profile .hp-rg-viewport {
        height: min(44vw, 168px) !important;
    }

    body.page-hospital-profile .hp-rg-card {
        height: auto !important;
        max-height: 168px !important;
    }

    body.page-hospital-profile .hp-rg-toolbar {
        margin-bottom: 4px !important;
    }

    body.page-hospital-profile .hp-rg-title {
        font-size: 1rem !important;
    }

    body.page-hospital-profile .hp-rg-arrow {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }

    /* Hospital profile embedded offer cards */
    body.page-hospital-profile #offers .hp-offer-card__media {
        height: 120px !important;
        max-height: 120px !important;
    }

    body.page-hospital-profile #offers .hp-offer-card__body {
        padding: 8px 10px 6px !important;
    }

    body.page-hospital-profile #offers .hp-offer-card__title {
        font-size: 0.92rem !important;
        line-height: 1.22 !important;
        margin-bottom: 4px !important;
    }

    body.page-hospital-profile #offers .hp-offer-card__desc {
        font-size: 11px !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
    }

    body.page-hospital-profile #offers .hp-offer-card__pills {
        gap: 4px !important;
        margin-bottom: 4px !important;
    }

    body.page-hospital-profile #offers .hp-offer-card__pill {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }

    body.page-hospital-profile #offers .hp-offer-card__foot {
        padding: 0 10px 10px !important;
    }

    body.page-hospital-profile #offers .hp-offer-card__btn {
        min-height: 36px !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
    }

    body.page-hospital-profile #offers .hp-hospital-offers-grid {
        gap: 10px !important;
    }

    /* Department cards — compact */
    body.page-hospital-profile .dept-card {
        padding: 10px !important;
    }

    body.page-hospital-profile .dept-card h3 {
        font-size: 0.95rem !important;
    }

    body.page-hospital-profile .dept-card p {
        font-size: 12px !important;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
}
