/* =============================================================================
   header.css  -  Top Strip: announcement + availability (+ navbar offset)
   -----------------------------------------------------------------------------
   Component: .ts  ("Top Strip")
   Single responsibility: this file only styles the fixed top strip and the
   .page-content spacer that offsets the page below it. Navbar itself is
   styled in style.css / common.css.

============================================================================= */


/* --- 1. Strip shell ------------------------------------------------------- */

.ts {
    /* Strip-local palette (safe fallbacks if brand tokens are absent) */
    --gold:          var(--gold);                        /* ayurvedic gold   */
    --gold-soft:     var(--gold);
    --gold-hairline: rgba(183, 154, 98, .42);
    --ivory:         rgba(248, 247, 239, .95);
    --ivory-dim:     rgba(248, 247, 239, .66);
    --chip-bg:       rgba(248, 247, 239, .07);
    --chip-border:   rgba(248, 247, 239, .17);

    /* Solid deep forest - no gradient. Overridden inline per-deal by JS. */
    background:var(--ink-deep);
    color: var(--ivory);
    border-bottom: 1px solid var(--gold-hairline);

    min-height: 42px;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;

    /* Fixed to viewport top */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;

    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    font-size: 12.5px;
    letter-spacing: .01em;

    box-shadow: 0 2px 8px rgba(3, 41, 30, .18);
}

.ts a { color: inherit; text-decoration: none; }


/* --- 2. Deal zone --------------------------------------------------------- */

.ts__deal {
    flex: 1;
    min-width: 0;           /* allow text to truncate / ticker to measure */
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 12px 0 16px;
}


/* --- 3. Pulse dot --------------------------------------------------------- */

.ts__pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background:var(--gold-soft);
    flex: none;
    animation: ts-ping 2.6s cubic-bezier(.4, 0, .6, 1) infinite;
}

@keyframes ts-ping {
    0%   { box-shadow: 0 0 0 0 rgba(203, 186, 150, .5); }
    72%  { box-shadow: 0 0 0 6px rgba(203, 186, 150, 0); }
    100% { box-shadow: 0 0 0 0 rgba(203, 186, 150, 0); }
}


/* --- 4. Tag badge (optional) - slim hairline outline, no fill ------------ */

.ts__tag {
    flex: none;
    display: inline-flex;
    align-items: center;
    padding: 1px 4px;
    border-radius: 3px;
    border: 1px solid rgba(183, 154, 98, .55);
    color: var(--gold-soft);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .10em;
    text-transform: uppercase;
    line-height: 1.9;
    white-space: nowrap;
    transition: background-color .18s ease;
    cursor: pointer;
}

.ts__tag:hover,
.ts__tag:focus-visible {
    background:rgba(183, 154, 98, .14);
    color: var(--gold-soft);
    text-decoration: none;
}


/* --- 5. Main deal link - the whole text line is the tap target ----------- */

.ts__main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    outline-offset: 2px;
}

.ts__main:hover .ts__text,
.ts__main:focus-visible .ts__text { color: var(--paper); }


/* --- 6. Deal heading + slow ticker ---------------------------------------- */
/*
   Short headings: static, ellipsis when tight.
   Overflowing headings (mobile): JS adds .is-overflowing to the strip and
   sets --ticker-shift / --ticker-duration; the inner span then scrolls
   gently right→left with hold pauses at both ends.
*/

.ts__text {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    will-change: opacity, transform;
}

.ts__text-inner {
    display: inline-block;
    white-space: nowrap;
}

.ts.is-overflowing .ts__text { text-overflow: clip; }

.ts.is-overflowing .ts__text-inner {
    animation: ts-marquee var(--ticker-duration, 12s) cubic-bezier(.35, 0, .3, 1) infinite;
}

@keyframes ts-marquee {
    0%, 12%   { transform: translateX(0); }
    88%, 100% { transform: translateX(var(--ticker-shift, -80px)); }
}


/* --- 7. CTA - quiet outline pill (DESKTOP ONLY; hidden on mobile) ------- */
/* Mobile has no CTA at all - the heading itself is the tap target there.  */

.ts__btn-label {
    display: none;              /* shown at ≥ 768px via media query */
    align-items: center;
    flex: none;
    padding: 3px 12px;
    border-radius: 999px;
    border: 1px solid rgba(248, 247, 239, .34);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .05em;
    white-space: nowrap;
    transition: background-color .18s ease, border-color .18s ease;
}

.ts__main:hover .ts__btn-label,
.ts__main:focus-visible .ts__btn-label {
    background:rgba(248, 247, 239, .09);
    border-color: rgba(248, 247, 239, .5);
}

/* Blink (soft opacity pulse) for urgent/flash deals - toggled by JS */
.blink-btn {
    animation: ts-blink 1.6s ease-in-out infinite;
}

@keyframes ts-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: .45; }
}


/* --- 8. Separator - hairline dividers between zones / chip groups -------- */

.ts__sep {
    width: 1px;
    align-self: stretch;
    margin: 9px 0;
    background:rgba(248, 247, 239, .16);
    flex: none;
}

/* A little breathing room around the marketplace↔app divider */
.ts__avail > .ts__sep { margin: 9px 3px; }


/* --- 9. Availability zone - marketplaces + our own app ------------------- */

.ts__avail {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    flex: none;
}

/* Micro-label - desktop only (CSS); always on in avail-only mode */
.ts__avail-label {
    display: none;
    align-items: center;
    gap: 6px;
    margin-right: 2px;
    color: var(--ivory-dim);
    font-size: 11px;
    letter-spacing: .02em;
    white-space: nowrap;
}

.ts__avail-label i { font-size: 10px; opacity: .85; }

/* Platform chip - quiet ghost chip, hairline border */
.ts__platform {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 11px;
    border-radius: 999px;
    background:var(--chip-bg);
    border: 1px solid var(--chip-border);
    color: var(--ivory);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.ts__platform i { font-size: 12.5px; }

.ts__platform:hover,
.ts__platform:focus-visible {
    background:rgba(248, 247, 239, .13);
    border-color: rgba(248, 247, 239, .3);
    color: var(--paper);
    text-decoration: none;
}

/* Amazon - muted amber glyph (not neon orange) */
.ts__platform--amazon i {
    color: var(--paper);
    line-height: 1;
    position: relative;
    top: 2px;
}

/* Flipkart - inline SVG mark: shopping bag + yellow italic f.
   Sized a touch larger than the FA glyphs so the bag detail reads. */
.ts__flipkart-icon {
    width: 14px;
    height: 14px;
    display: block;
    flex: none;
}

/* Our own app - the hero chip: soft gold tint */
.ts__platform--app {
    background:rgba(183, 154, 98, .14);
    border-color: rgba(183, 154, 98, .45);
    color: var(--gold-soft);
}

/* .ts__platform--app i { color: var(--gold); } */

.ts__platform--app:hover,
.ts__platform--app:focus-visible {
    background:rgba(183, 154, 98, .22);
    border-color: rgba(183, 154, 98, .6);
    color: var(--gold-soft);
}


/* --- 10. No active deals - availability message only, centred ------------ */

.ts--avail-only { justify-content: center; }

.ts--avail-only .ts__avail { padding: 0 16px; }

.ts--avail-only .ts__avail-label { display: inline-flex; }


/* --- 11. Page-content spacer ---------------------------------------------- */
/*
   .ts is position:fixed so the page would sit behind it. .page-content
   (rendered right after the strip in top-strip.blade.php) pushes the
   document flow down by exactly the strip height (single row, always).
*/
.page-content { padding-top: 42px; }


/* --- 12. Attribute-driven visibility -------------------------------------- */
/* Author display rules beat the UA's [hidden] default, so re-assert it.
   top-strip.js toggles the hidden attribute on #dealTag / #dealBtnLabel. */

.ts__tag[hidden],
.ts__btn-label[hidden] { display: none; }


/* --- 13. Accessibility ---------------------------------------------------- */

.ts a:focus-visible {
    outline: 2px solid rgba(203, 186, 150, .9);
    outline-offset: 2px;
    border-radius: 999px;
}


/* --- 14. Desktop (≥ 768px) ------------------------------------------------ */

@media (min-width: 768px) {
    .ts               { min-height: 44px; }
    .ts__deal         { padding: 0 14px 0 18px; gap: 10px; }
    .ts__text         { font-size: 12.5px; }
    .ts__btn-label    { display: inline-flex; }   /* show CTA pill   */
    .ts__avail        { padding: 0 16px 0 12px; gap: 7px; }
    .ts__avail-label  { display: inline-flex; }   /* "Also available on" */
    .ts__platform     { padding: 0 11px; }
    .page-content     { padding-top: 44px; }
    
}


/* --- 15. Mobile (< 768px) - no CTA, smaller type, icon-only chips -------- */

@media (max-width: 767.98px) {
    .ts                    { min-height: 42px; font-size: 11px; }
    .ts__deal              { gap: 7px; padding: 0 8px 0 10px; }
    .ts__text              { font-size: 11px; }
    .ts__tag               {display: none;}          /* no tag on mobile */
    .ts__btn-label         { display: none; }     /* no CTA - text is the tap */
    .ts__avail             { gap: 5px; padding: 0 8px; }
    .ts__platform          { padding: 0 7px; }
    .ts__platform-name     { display: none; }     /* icons only */
    .ts__platform i        { font-size: 13px; }
    .ts__flipkart-icon     { width: 16px; height: 16px; }
}


/* --- 16. Very small mobile (< 420px) -------------------------------------- */

@media (max-width: 419.98px) {
    .ts__deal   { gap: 6px; padding: 0 6px 0 8px; }
    .ts__avail  { gap: 4px; }
    .ts__sep    { display: none; }
}


/* --- 17. Reduced motion --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .ts__pulse,
    .blink-btn { animation: none; }

    /* Ticker off → restore plain ellipsis truncation */
    .ts.is-overflowing .ts__text-inner { animation: none; }
    .ts.is-overflowing .ts__text { text-overflow: ellipsis; }
}
