/* Provider detail page — layout & presentation */

.provider-detail-content {
    --pd-radius: 14px;
    --pd-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --pd-border: 1px solid rgba(15, 23, 42, 0.08);
}

.provider-breadcrumb {
    font-size: 0.875rem;
    color: var(--text-gray, #6b7280);
    margin-bottom: 1.25rem;
}

.provider-breadcrumb ol {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.provider-breadcrumb li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    white-space: nowrap;
}

.provider-breadcrumb li:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.provider-breadcrumb li + li::before {
    content: '›';
    margin-right: 0.35rem;
    color: #9ca3af;
    flex-shrink: 0;
}

.provider-breadcrumb a {
    color: var(--primary-blue, #2563eb);
    text-decoration: none;
}

.provider-breadcrumb a:hover {
    text-decoration: underline;
}

/* Hero */
.provider-hero {
    padding: 0;
    overflow: hidden;
    border: var(--pd-border);
    box-shadow: var(--pd-shadow);
    margin-bottom: 1.5rem;
}

.provider-hero--pro-plus {
    border-color: rgba(217, 119, 6, 0.22);
    box-shadow: 0 8px 32px rgba(217, 119, 6, 0.1), var(--pd-shadow);
}

.provider-hero--pro-plus .provider-hero__banner {
    display: block;
}

.provider-hero__banner {
    display: none;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #fde68a);
}

.provider-hero__inner {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem 2rem;
    padding: 1.75rem;
    align-items: start;
}

.provider-hero__media {
    flex-shrink: 0;
}

.provider-hero__avatar {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

.provider-hero--pro-plus .provider-hero__avatar {
    border-color: #fef3c7;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.2);
}

.provider-hero__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.provider-hero__avatar-trigger {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: default;
    position: relative;
    overflow: hidden;
    font: inherit;
    color: inherit;
}

.provider-hero__avatar-trigger[hidden] {
    display: none !important;
}

.provider-hero__avatar--interactive .provider-hero__avatar-trigger {
    cursor: pointer;
    transition: transform 0.25s ease;
}

.provider-hero__avatar--interactive:hover .provider-hero__avatar-trigger,
.provider-hero__avatar--interactive:focus-within .provider-hero__avatar-trigger {
    transform: scale(1.03);
}

.provider-hero__avatar--interactive .provider-hero__avatar-trigger:focus-visible {
    outline: 2px solid var(--primary-blue, #2563eb);
    outline-offset: 3px;
}

.provider-hero__avatar-zoom {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.4);
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.provider-hero__avatar--interactive:hover .provider-hero__avatar-zoom,
.provider-hero__avatar--interactive:focus-within .provider-hero__avatar-zoom {
    opacity: 1;
}

/* PRO+ profile photo lightbox */
body.stavbahub-profile-photo-lightbox-open {
    overflow: hidden;
}

.stavbahub-profile-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.stavbahub-profile-photo-lightbox[hidden] {
    display: none !important;
}

.stavbahub-profile-photo-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
}

.stavbahub-profile-photo-lightbox__panel {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 720px);
    max-height: min(88vh, 720px);
    width: 100%;
}

.stavbahub-profile-photo-lightbox__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.stavbahub-profile-photo-lightbox__image {
    display: block;
    max-width: min(92vw, 720px);
    max-height: min(88vh, 720px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.stavbahub-profile-photo-lightbox__close {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stavbahub-profile-photo-lightbox__close:hover {
    background: #fff;
}

@media (max-width: 768px) {
    .stavbahub-profile-photo-lightbox {
        padding: 0.75rem;
    }

    .stavbahub-profile-photo-lightbox__close {
        top: 0.5rem;
        right: 0.5rem;
    }
}

.provider-hero__avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.provider-hero__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.65rem 1rem;
    margin-bottom: 0.35rem;
}

.provider-hero__title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
    color: #0f172a;
}

.provider-hero__type {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.provider-hero__location {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: #475569;
}

.provider-hero__location:empty {
    display: none;
}

.provider-hero__rating {
    margin-bottom: 1rem;
    min-height: 0;
}

.provider-hero__rating:empty {
    display: none;
}

.provider-hero__rating-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    font-size: 0.9rem;
    font-weight: 600;
    color: #92400e;
}

.provider-hero__rating-inner--muted {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
    font-weight: 500;
}

.provider-hero__rating-score {
    font-size: 1.05rem;
    font-weight: 700;
}

.provider-hero__services {
    margin-bottom: 1.25rem;
}

.provider-hero__section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin: 0 0 0.5rem;
}

.provider-services-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
}

.provider-service-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.provider-hero--pro-plus .provider-service-badge {
    background: #fffbeb;
    border-color: #fde68a;
    color: #78350f;
}

.provider-services-more {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: #64748b;
}

.provider-hero__contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin: 0.75rem 0 0.35rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.provider-hero__contact[hidden] {
    display: none !important;
}

.provider-hero__contact-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.provider-hero__phone-link {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    line-height: 1.3;
    word-break: break-word;
}

.provider-hero__phone-link:hover {
    color: var(--primary-blue, #2563eb);
    text-decoration: underline;
}

.provider-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
    margin-top: 0.5rem;
}

.provider-hero__actions .btn {
    min-height: 44px;
}

.provider-hero__actions .btn[hidden] {
    display: none !important;
}

.provider-hero__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.provider-hero__share-icon {
    flex-shrink: 0;
}

.provider-share-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 10040;
    transform: translateX(-50%) translateY(12px);
    padding: 0.65rem 1.1rem;
    border-radius: 999px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.provider-share-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.provider-share-toast[hidden] {
    display: block !important;
}

.provider-share-toast[hidden]:not(.is-visible) {
    visibility: hidden;
}

/* Gallery */
.provider-gallery-card {
    margin-bottom: 1.5rem;
}

.provider-gallery-card .card-title {
    margin-bottom: 1rem;
}

.provider-description-card[hidden] {
    display: none !important;
}

.provider-description-card__text {
    margin: 0;
    color: #374151;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    cursor: pointer;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.04);
}

.provider-gallery-empty {
    color: var(--text-gray, #6b7280);
    text-align: center;
    padding: 1.5rem 1rem;
    margin: 0;
    font-size: 0.95rem;
}

/* Reviews */
.provider-reviews-card {
    margin-bottom: 1.5rem;
}

.provider-reviews-card .card-title {
    margin-bottom: 0.25rem;
}

.provider-reviews-subtitle {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    color: #64748b;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0;
}

.review-item {
    padding: 1.25rem 1.35rem;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--primary-blue, #2563eb);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.review-author {
    font-weight: 600;
    color: #0f172a;
}

.review-author-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.4rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    color: #065f46;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.22);
    vertical-align: middle;
}

.review-stars {
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: #fffbeb;
    color: #b45309;
    font-size: 0.875rem;
    font-weight: 700;
}

.review-date {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0 0 0.5rem;
}

.review-text {
    color: #475569;
    line-height: 1.65;
    margin: 0;
}

.review-reply {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.review-reply__title {
    margin: 0 0 0.35rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #334155;
}

.review-reply__text {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
}

/* Loading / error */
.provider-detail-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 280px;
    padding: 2rem 1rem;
    color: var(--text-gray);
}

.provider-detail-loading[hidden],
.provider-detail-content[hidden],
.provider-detail-error[hidden] {
    display: none !important;
}

.provider-detail-loading__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary-blue, #2563eb);
    border-radius: 50%;
    animation: provider-detail-spin 0.8s linear infinite;
}

@keyframes provider-detail-spin {
    to {
        transform: rotate(360deg);
    }
}

.provider-detail-seo-static:empty {
    display: none;
}

.provider-seo-snapshot__location-summary {
    margin: 0.75rem 0 0;
    color: var(--text-gray, #64748b);
    font-size: 0.95rem;
    line-height: 1.55;
}

.provider-seo-snapshot__reviews-summary {
    margin-top: 0.75rem;
}

.provider-seo-snapshot__reviews-meta {
    margin: 0.35rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.95rem;
    color: var(--text-dark, #1e293b);
}

.provider-seo-snapshot__reviews-empty {
    margin: 0.35rem 0 0;
    color: var(--text-gray, #64748b);
    font-size: 0.95rem;
}

.provider-seo-snapshot__contact-summary {
    margin-top: 0.75rem;
}

body[data-provider-ssr="1"] #provider-detail-loading {
    display: none !important;
}

body.provider-detail-hydrated .provider-detail-seo-static {
    display: none !important;
}

.provider-related-sentinel {
    height: 1px;
    width: 100%;
    margin: 0;
    pointer-events: none;
}

.provider-related-section.is-loading {
    min-height: 12rem;
}

.provider-related-section.is-loading .provider-related-grid:empty::before {
    content: '';
    display: block;
    min-height: 10rem;
}

.provider-related-links-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.provider-related-links-list a {
    color: var(--primary-blue, #2563eb);
    text-decoration: none;
}

.provider-related-links-list a:hover {
    text-decoration: underline;
}

/* Legacy hidden (replaced by hero) */
.provider-detail-legacy {
    display: none !important;
}

@media (max-width: 768px) {
    .provider-hero__inner {
        grid-template-columns: 1fr;
        padding: 1.25rem;
        text-align: center;
    }

    .provider-hero__media {
        display: flex;
        justify-content: center;
    }

    .provider-hero__head {
        justify-content: center;
    }

    .provider-hero__location {
        justify-content: center;
    }

    .provider-hero__rating {
        display: flex;
        justify-content: center;
    }

    .provider-services-badges {
        justify-content: center;
    }

    .provider-hero__contact {
        align-items: center;
        text-align: center;
        width: 100%;
    }

    .provider-hero__actions {
        flex-direction: column;
        width: 100%;
    }

    .provider-hero__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 400px) {
    .photo-gallery {
        grid-template-columns: 1fr;
    }
}

/* Reviews — controls & rating picker */
.reviews-controls {
    margin-bottom: 1.25rem;
}

.reviews-controls__guest {
    display: grid;
    gap: 0.85rem;
    max-width: 28rem;
}

.reviews-controls__guest-lead {
    margin: 0;
}

.reviews-controls__guest-alt {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-gray, #6b7280);
}

.reviews-controls__guest-alt a {
    color: var(--primary-blue, #2563eb);
    text-decoration: none;
}

.reviews-controls__guest-alt a:hover {
    text-decoration: underline;
}

.btn-google-review {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 20rem;
    padding: 0.65rem 1.1rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.btn-google-review::before {
    content: 'G';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 4px;
    background: linear-gradient(135deg, #4285f4 0%, #34a853 45%, #fbbc05 70%, #ea4335 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.btn-google-review:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

.btn-google-review:focus-visible {
    outline: 2px solid var(--primary-blue, #2563eb);
    outline-offset: 2px;
}

.reviews-controls__hint {
    margin-bottom: 0.75rem;
}

.reviews-controls__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.review-form {
    display: grid;
    gap: 0.85rem;
}

.review-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
}

.review-rating-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.15rem 0 0.25rem;
}

.review-rating-btn {
    flex: 1 1 calc(10% - 0.35rem);
    min-width: 2.25rem;
    max-width: 2.75rem;
    padding: 0.5rem 0.25rem;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 8px;
    background: #fff;
    color: var(--text-dark, #1f2937);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}

.review-rating-btn:hover {
    border-color: var(--primary-blue, #2563eb);
    background: rgba(37, 99, 235, 0.06);
    color: var(--primary-blue, #2563eb);
}

.review-rating-btn:focus-visible {
    outline: 2px solid var(--primary-blue, #2563eb);
    outline-offset: 2px;
}

.review-rating-btn.is-selected {
    background: var(--primary-blue, #2563eb);
    border-color: var(--primary-blue, #2563eb);
    color: #fff;
}

.review-rating-btn.is-selected:hover {
    background: var(--primary-blue-dark, #1d4ed8);
    border-color: var(--primary-blue-dark, #1d4ed8);
    color: #fff;
}

@media (max-width: 480px) {
    .review-rating-btn {
        flex: 1 1 calc(20% - 0.35rem);
        min-width: 2rem;
        padding: 0.45rem 0.2rem;
        font-size: 0.875rem;
    }

    .reviews-controls__actions .btn,
    .review-form__actions .btn {
        width: 100%;
        justify-content: center;
    }
}
