/* Offers edge panel — loaded only when the tenant has a live offer (see _OffersPanel.cshtml).
 *
 * Two parts: a slim tab mounted on the inline-end edge, and a Bootstrap offcanvas that slides out
 * from that same edge. Colours come from the site tokens, which _Layout already rebinds to the
 * tenant's Primary/Secondary colours, so the panel follows each tenant's branding for free.
 */

/* ── Edge handle ─────────────────────────────────────────────────────── */
.offers-handle {
    position: fixed;
    top: 42%;
    z-index: 1020;              /* below the navbar, offcanvas (1045) and the mobile nav */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    width: 30px;
    padding: 0.9rem 0 0.8rem;
    margin: 0;
    background: var(--color-navy, #2C3E50);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 6px 18px rgba(44, 62, 80, 0.18);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.62rem;
    /* 400 at rest, 600 on hover — both real Montserrat weights (only 300/400/600 are loaded),
       so the hover reads as genuinely bolder rather than browser-faked bold. */
    font-weight: 400;
    letter-spacing: 0.24em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    opacity: 0.6;               /* see-through at rest so it does not sit heavily over the page */
    touch-action: none;         /* the handle is a drag surface; the page keeps its own gestures */
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease, opacity 0.2s ease, font-weight 0.2s ease;
}

.offers-handle[hidden] { display: none; }

/* Tucked a few pixels into the edge at rest; eases out on hover/focus. */
.offers-handle--end   { right: 0; border-right: 0; border-radius: 10px 0 0 10px; transform: translateX(4px); }
.offers-handle--start { left: 0;  border-left: 0;  border-radius: 0 10px 10px 0; transform: translateX(-4px); }

.offers-handle:hover,
.offers-handle:focus-visible {
    opacity: 1;
    font-weight: 600;
    transform: translateX(0);
}

.offers-handle:focus-visible {
    outline: 2px solid var(--color-brown, #6B4423);
    outline-offset: 2px;
}

/* While the panel is out (or being dragged out) the handle steps aside. */
.offers-handle.is-away {
    opacity: 0;
    pointer-events: none;
}

.offers-handle__grip {
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: currentColor;
    opacity: 0.45;
}

.offers-handle__label {
    writing-mode: vertical-rl;
    white-space: nowrap;
}

/* On the left edge the label reads bottom-to-top, facing into the page. */
.offers-handle--start .offers-handle__label { transform: rotate(180deg); }

[lang="ar"] .offers-handle {
    font-family: 'Amiri', 'Lato', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0;
    text-transform: none;
}

/* Amiri ships 400 and 700 only. */
[lang="ar"] .offers-handle:hover,
[lang="ar"] .offers-handle:focus-visible { font-weight: 700; }

/* ── Panel (Bootstrap offcanvas) ─────────────────────────────────────── */
.offers-panel.offcanvas {
    width: min(400px, 88vw);
    background: var(--color-background, #FDF8F3);
    border: 0;
    box-shadow: -14px 0 40px rgba(44, 62, 80, 0.16);
    transition-duration: 0.32s;
    transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1);
    touch-action: pan-y;        /* vertical scrolls the list; horizontal is ours (swipe to close) */
}

.offers-panel.offcanvas-start { box-shadow: 14px 0 40px rgba(44, 62, 80, 0.16); }

.offers-panel.is-dragging { transition: none !important; }

body.offers-open .offcanvas-backdrop.show {
    background: var(--color-navy, #2C3E50);
    opacity: 0.35;
}

.offers-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.6rem 1.5rem 1.1rem;
    border-bottom: 1px solid rgba(107, 68, 35, 0.12);
}

.offers-panel__eyebrow {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-brown, #6B4423);
    margin-bottom: 0.35rem;
}

.offers-panel .offers-panel__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    line-height: 1.2;
    color: var(--color-navy, #2C3E50);
    margin: 0;
}

.offers-panel__close {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(44, 62, 80, 0.15);
    background: transparent;
    color: var(--color-navy, #2C3E50);
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.offers-panel__close:hover { background: rgba(44, 62, 80, 0.06); }

.offers-panel__close:focus-visible {
    outline: 2px solid var(--color-brown, #6B4423);
    outline-offset: 2px;
}

.offers-panel__body {
    flex-grow: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;        /* repeated here: touch-action stops combining at a scroll container */
    padding: 1.25rem 1.5rem 2rem;
}

.offers-list {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ── Offer card ──────────────────────────────────────────────────────── */
.offer-card {
    background: #fff;
    border: 1px solid rgba(107, 68, 35, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 8px 25px rgba(44, 62, 80, 0.08));
}

.offer-card__media {
    aspect-ratio: 16 / 9;       /* reserves the space, so a late image never shifts the card */
    background: var(--color-light-gray, #F8F1EA);
}

.offer-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.offer-card__body { padding: 1.1rem 1.25rem 1.3rem; }

.offer-card__highlight {
    display: inline-block;
    margin-bottom: 0.6rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(107, 68, 35, 0.1);
    background: color-mix(in srgb, var(--color-brown, #6B4423) 12%, transparent);
    color: var(--color-brown, #6B4423);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.offers-panel .offer-card__title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    line-height: 1.3;
    color: var(--color-navy, #2C3E50);
    margin: 0 0 0.4rem;
}

.offer-card__text {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #5b5249;
    white-space: pre-line;      /* keep the admin's line breaks; the text itself is HTML-encoded */
}

.offer-card__dates {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.9rem;
    font-size: 0.78rem;
    color: #8a7f74;
}

.offer-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    border-radius: 20px;
    background: var(--color-brown, #6B4423);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: filter 0.2s ease;
}

.offer-card__cta:hover,
.offer-card__cta:focus-visible {
    color: #fff;
    filter: brightness(1.1);
}

.offer-card__cta:focus-visible {
    outline: 2px solid var(--color-navy, #2C3E50);
    outline-offset: 2px;
}

[dir="rtl"] .offer-card__cta .bi-arrow-right { transform: scaleX(-1); }

/* ── Arabic typography ───────────────────────────────────────────────── */
[lang="ar"] .offers-panel .offers-panel__title,
[lang="ar"] .offers-panel .offer-card__title {
    font-family: 'Amiri', serif;
}

[lang="ar"] .offers-panel__eyebrow,
[lang="ar"] .offer-card__highlight,
[lang="ar"] .offer-card__cta {
    font-family: 'Amiri', 'Lato', sans-serif;
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.85rem;
}

/* ── Motion & print ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .offers-handle,
    .offers-panel.offcanvas,
    .offer-card__cta { transition: none; }
}

@media print {
    .offers-handle,
    .offers-panel { display: none !important; }
}
