/**
 * Offer summary card + public popup shell
 * Uses site theme CSS variables (--primary, --primary-dark)
 */
.offer-summary-card {
    --osc-accent: var(--primary-dark, #1f2937);
    --osc-accent-soft: var(--primary, #374151);
    background: #fff;
    border: 1.5px solid color-mix(in srgb, var(--osc-accent) 55%, #fff);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: fit-content;
    max-height: none;
}
.offer-summary-card.is-admin-live-preview {
    height: 100%;
    min-height: 100%;
}
.offer-summary-card.is-admin-live-preview .osc-body {
    flex: 1 1 auto;
}
.offer-summary-card.is-admin-live-preview .osc-divider {
    margin-top: auto;
}
.osc-header {
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    min-height: 0;
    background-color: var(--osc-accent);
    background-image:
        linear-gradient(160deg, color-mix(in srgb, var(--osc-accent) 88%, #000) 0%, color-mix(in srgb, var(--osc-accent-soft) 70%, transparent) 100%),
        var(--osc-header-image, none);
    background-size: cover;
    background-position: center;
}
.osc-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.35), rgba(0,0,0,0.12));
    pointer-events: none;
}
.osc-brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; min-width: 0; }
.osc-logo {
    width: 40px; height: 40px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; background: rgba(255,255,255,0.95);
    overflow: hidden;
}
.osc-logo img { width: 100%; height: 100%; object-fit: contain; }
.osc-logo i { color: var(--osc-accent); font-size: 0.95rem; }
.osc-brand-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem; font-weight: 600; line-height: 1.1;
    font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.osc-brand-tag { font-size: 0.65rem; opacity: 0.92; margin-top: 2px; }
.osc-header-badge {
    position: relative; z-index: 2;
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 4px 9px; border-radius: 999px;
    background: #fff; color: var(--osc-accent);
    border: 1px solid rgba(255,255,255,0.55);
    max-width: 42%; text-align: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
    animation: oscBadgePop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes oscBadgePop {
    0% { transform: scale(0.4) translateY(-8px); opacity: 0; }
    70% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}
.osc-media {
    width: 100%;
    aspect-ratio: 16 / 7;
    max-height: 110px;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
}
.osc-media img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.osc-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: visible;
}
.osc-offer-title { font-size: 0.95rem; font-weight: 700; color: var(--osc-accent); margin: 0; line-height: 1.25; }
.osc-offer-desc {
    font-size: 0.75rem; color: #6b7280; margin: 0; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.osc-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.osc-stat {
    border: 1px solid color-mix(in srgb, var(--osc-accent) 18%, #e5e7eb);
    border-radius: 10px; padding: 7px 9px;
    background: color-mix(in srgb, var(--osc-accent) 6%, #fff);
}
.osc-stat-label { font-size: 0.62rem; color: #6b7280; margin-bottom: 2px; }
.osc-stat-value { font-size: 0.95rem; font-weight: 800; color: var(--osc-accent); line-height: 1.15; }
.osc-stat-sub { font-size: 0.62rem; color: var(--osc-accent-soft); margin-top: 2px; }
.osc-stat-sub.muted { color: #6b7280; }
.osc-services-title { font-size: 0.72rem; font-weight: 700; color: #374151; margin: 0; }
.osc-badges { display: flex; flex-wrap: wrap; gap: 5px; max-height: none; overflow: visible; }
.osc-svc-badge {
    display: inline-flex; align-items: center; gap: 4px;
    border-radius: 8px; padding: 3px 7px; font-size: 0.68rem; font-weight: 600;
    border: 1px solid currentColor; background: color-mix(in srgb, currentColor 12%, #fff);
}
.osc-svc-badge i { font-size: 0.65rem; opacity: 0.9; }
.osc-divider {
    display: flex; align-items: center; gap: 8px; margin: 0; color: var(--osc-accent);
}
.osc-divider::before, .osc-divider::after {
    content: ''; flex: 1; height: 1px; background: #e5e7eb;
}
.osc-actions {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    position: relative;
    z-index: 2;
}
.osc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    border: none; border-radius: 10px; padding: 8px 6px; font-size: 0.66rem; font-weight: 700;
    text-decoration: none; color: #fff; cursor: pointer; line-height: 1.1;
    width: 100%;
}
.osc-btn-call { background: var(--osc-accent); }
.osc-btn-call:hover { color: #fff; filter: brightness(0.92); }
.osc-btn-email { background: var(--osc-accent-soft); }
.osc-btn-email:hover { color: #fff; filter: brightness(0.92); }
.osc-btn-wa { background: #25d366; }
.osc-btn-wa:hover { color: #fff; background: #1ebe57; }
.osc-btn.disabled, .osc-btn[aria-disabled="true"], .osc-btn-missing {
    opacity: 0.72; cursor: pointer;
}
.osc-btn-missing:hover { filter: brightness(0.95); color: #fff; }

/* Public popup */
.offers-popup-overlay {
    position: fixed !important; inset: 0; z-index: 10500;
    background:
        linear-gradient(160deg,
            color-mix(in srgb, var(--primary, #374151) 22%, transparent) 0%,
            color-mix(in srgb, var(--bg, #0f172a) 55%, transparent) 55%,
            color-mix(in srgb, var(--primary-dark, #1f2937) 28%, transparent) 100%);
    backdrop-filter: blur(14px) saturate(1.12);
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.offers-popup-overlay.is-visible {
    opacity: 1;
}
/* Saved site animation replaces decorative modal-fx orbs */
.offers-popup-overlay.has-bg-anim.modal-fx::before,
.offers-popup-overlay.has-bg-anim.modal-fx::after {
    display: none !important;
}
.offers-popup-overlay.has-bg-anim .modal-fx-orbs {
    display: none !important;
}
.offers-popup-overlay .site-bg-surface.is-offers-surface {
    opacity: 0.9;
    z-index: 0;
}
.offers-popup-overlay .site-bg-surface.is-offers-surface .site-bg-surface-balls .fb-ball {
    mix-blend-mode: screen;
}
.offers-popup {
    position: fixed; inset: 0; z-index: 10510;
    display: flex; align-items: center; justify-content: center;
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
    pointer-events: none;
}
.offers-popup-panel {
    pointer-events: auto;
    width: min(400px, 100%);
    position: relative;
    transform: translate3d(0, 28px, 0) scale(0.96);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.offers-popup-panel.is-visible {
    transform: none;
    opacity: 1;
}
.offers-popup-panel.is-hiding {
    transform: translate3d(0, 48px, 0) scale(0.94);
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.32s ease;
}
.offers-popup-overlay.is-hiding {
    opacity: 0;
}

/* Soft blur + dim page content behind offer card */
body.offers-popup-open .app-shell {
    filter: blur(10px) brightness(0.72);
    transform: scale(0.985);
    transition: filter 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}
body.offers-popup-open .bottom-nav,
body.offers-popup-open .chat-fab,
body.offers-popup-open .offers-fab {
    filter: blur(8px);
    pointer-events: none;
}
body:not(.offers-popup-open) .app-shell {
    filter: none;
    transform: none;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.offers-popup-close {
    position: absolute; top: -10px; right: -6px; z-index: 5;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid #e5e7eb; background: #fff; color: #111827;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(15,23,42,0.12); cursor: pointer;
}
.offers-carousel {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-behavior: smooth; gap: 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px 8px;
}
.offers-carousel::-webkit-scrollbar { display: none; }
.offers-carousel-slide {
    flex: 0 0 calc(100% - 8px);
    scroll-snap-align: center;
    min-width: calc(100% - 8px);
    height: fit-content;
    box-sizing: border-box;
}
.offers-carousel-slide .offer-summary-card {
    max-height: min(82vh, 720px);
    overflow: auto;
}
.offers-carousel-dots {
    display: flex; justify-content: center; gap: 6px; margin-top: 10px;
}
.offers-carousel-dots button {
    width: 7px; height: 7px; border-radius: 50%; border: 0;
    background: rgba(255,255,255,0.45); padding: 0;
}
.offers-carousel-dots button.active { background: #fff; transform: scale(1.2); }

.offers-fab {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(var(--bottom-nav-h, 64px) + 80px + env(safe-area-inset-bottom));
    z-index: 940;
    width: 52px; height: 52px; border-radius: 50%;
    border: none; cursor: pointer;
    background: var(--primary-dark, #1f2937); color: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.28);
    display: none; align-items: center; justify-content: center;
    font-size: 1.15rem;
}
.offers-fab.visible { display: inline-flex; }
.offers-fab-badge {
    position: absolute; top: -2px; right: -2px;
    min-width: 18px; height: 18px; border-radius: 999px;
    background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
@media (min-width: 992px) {
    .offers-fab { bottom: 92px; right: 24px; }
}
@media (max-width: 420px) {
    .offer-summary-card { border-radius: 16px; }
    .osc-header { padding: 10px 12px; }
    .osc-brand-name { font-size: 1rem; }
    .osc-media { max-height: 96px; aspect-ratio: 16 / 6.5; }
    .osc-body { padding: 8px 10px 10px; gap: 6px; }
    .osc-offer-desc { -webkit-line-clamp: 2; }
    .osc-stat-value { font-size: 0.88rem; }
    .osc-btn { font-size: 0.6rem; padding: 8px 4px; }
    .osc-btn span.osc-btn-label { display: none; }
}
