/* ============================================================
   PRARVI CONSULTANCY — ADMIN-MANAGED OFFER SYSTEM
   ------------------------------------------------------------
   Styles for the offer popup + top banner rendered by
   assets/js/site-offer.js. Every colour comes from the CSS vars
   the script sets inline from admin → Offer Center:

     --soffer-bg            solid colour or linear-gradient()
     --soffer-c1 / c2       the two chosen colours (also as -rgb)
     --soffer-text          body text colour
     --soffer-accent        primary button background
     --soffer-accent-text   primary button label colour

   The same stylesheet is loaded inside the admin preview, so what
   editors see there is exactly what visitors get.
   ============================================================ */

body.soffer-lock {
    overflow: hidden;
}

/* ---------- 1. Overlay ---------- */
.soffer-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background: rgba(8, 10, 28, 0.62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.soffer-modal.is-open {
    opacity: 1;
}

/* ---------- 2. Card ---------- */
.soffer-card {
    position: relative;
    width: min(540px, 100%);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border-radius: 22px;
    background: var(--soffer-bg, #0b0a88);
    color: var(--soffer-text, #ffffff);
    box-shadow:
        0 30px 80px rgba(6, 8, 30, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    transform: translateY(16px) scale(0.97);
    opacity: 0;
    transition:
        transform 0.34s cubic-bezier(0.2, 0.8, 0.3, 1),
        opacity 0.34s ease;
}

.soffer-modal.is-open .soffer-card {
    transform: none;
    opacity: 1;
}

/* Soft colour wash on top of the chosen background */
.soffer-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(var(--soffer-c1-rgb, 11, 10, 136), 0.55) 0%, rgba(255, 255, 255, 0) 60%),
        radial-gradient(100% 80% at 0% 100%, rgba(var(--soffer-c2-rgb, 13, 148, 136), 0.45) 0%, rgba(255, 255, 255, 0) 62%);
    opacity: 0.9;
}

.soffer-card > * {
    position: relative;
    z-index: 1;
}

.soffer-media {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

.soffer-body {
    padding: 26px 26px 24px;
}

.soffer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.24);
    color: inherit;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.soffer-close:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.06);
}

/* ---------- 3. Content ---------- */
.soffer-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    margin: 0 0 2px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    line-height: 1.5;
    text-transform: uppercase;
}

.soffer-badge {
    font-size: 15px;
    letter-spacing: 0;
    line-height: 1;
}

.soffer-title {
    margin: 14px 0 6px;
    font-size: clamp(22px, 4vw, 29px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.soffer-subtitle {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    opacity: 0.94;
}

.soffer-richtext {
    margin: 0 0 14px;
    font-size: 14.5px;
    line-height: 1.65;
    opacity: 0.95;
}

.soffer-richtext > :first-child {
    margin-top: 0;
}

.soffer-richtext > :last-child {
    margin-bottom: 0;
}

.soffer-richtext p {
    margin: 0 0 10px;
}

.soffer-richtext ul,
.soffer-richtext ol {
    margin: 0 0 10px;
    padding-left: 20px;
}

.soffer-richtext li {
    margin: 0 0 5px;
}

.soffer-richtext strong,
.soffer-richtext b {
    font-weight: 800;
}

.soffer-richtext a {
    color: inherit;
    text-decoration: underline;
}

.soffer-richtext img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.soffer-validity {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.5;
}

.soffer-validity::before {
    content: "⏳";
    font-size: 13px;
}

/* ---------- 4. Buttons ---------- */
.soffer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.soffer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.soffer-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.soffer-btn--primary {
    flex: 1 1 auto;
    background: var(--soffer-accent, #ffd166);
    color: var(--soffer-accent-text, #141726);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.soffer-btn--ghost {
    background: rgba(255, 255, 255, 0.14);
    color: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

/* ---------- 5. Top banner ---------- */
.soffer-bar {
    position: relative;
    z-index: 10002;
    background: var(--soffer-bg, #0b0a88);
    color: var(--soffer-text, #ffffff);
    font-family: inherit;
    -webkit-font-smoothing: antialiased;
}

.soffer-bar__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 18px;
}

.soffer-bar__thumb {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.soffer-bar__msg {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.soffer-bar__title {
    overflow: hidden;
    font-size: 14.5px;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soffer-bar__sub {
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.35;
    opacity: 0.92;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.soffer-bar__cta {
    flex: 0 0 auto;
    padding: 9px 16px;
    border-radius: 10px;
    background: var(--soffer-accent, #ffd166);
    color: var(--soffer-accent-text, #141726);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.18s ease;
}

.soffer-bar__cta:hover {
    filter: brightness(1.06);
}

.soffer-bar__close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.18);
    color: inherit;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.18s ease;
}

.soffer-bar__close:hover {
    background: rgba(0, 0, 0, 0.34);
}

/* ---------- 6. Admin preview (inline, no overlay) ---------- */
.soffer-modal--inline {
    position: relative;
    inset: auto;
    display: block;
    padding: 0;
    overflow: visible;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 1;
}

.soffer-modal--inline .soffer-card {
    width: 100%;
    max-height: none;
    transform: none;
    opacity: 1;
}

/* ---------- 7. Small screens ---------- */
@media (max-width: 640px) {
    .soffer-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .soffer-card {
        max-height: calc(100vh - 24px);
        border-radius: 20px;
    }

    .soffer-body {
        padding: 22px 18px 20px;
    }

    .soffer-media {
        max-height: 190px;
    }

    .soffer-actions {
        flex-direction: column;
    }

    .soffer-btn {
        width: 100%;
    }

    .soffer-bar__inner {
        gap: 10px;
        padding: 9px 12px;
    }

    .soffer-bar__sub {
        display: none;
    }

    .soffer-bar__cta {
        padding: 8px 12px;
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .soffer-modal,
    .soffer-card,
    .soffer-btn,
    .soffer-close,
    .soffer-bar__cta {
        transition: none;
    }
}
