/* ============================================================================
   FURNI DESIGN SYSTEM — single source of truth for typography & spacing
   ----------------------------------------------------------------------------
   Loaded as the LAST chain <link> in _partials/stylesheets.tpl (cachebusted
   automatically, no manual ?v= needed) so these tokens and base rules win the
   cascade over the other chain files; only custom.css loads after it.
   Brand font (Figtree) unchanged.

   Values MATCH the Figma file "Furni1.lt - Puslapiai" (mobile 360 / tablet 768
   / desktop 1920). 3-tier responsive scale — the type grows on larger screens.
   Breakpoints: mobile <=767 · tablet 768-991 · desktop >=992.
   Cascade: :root = desktop base; each smaller @media refines it.
   ============================================================================ */

:root {
  /* ---- type roles — DESKTOP ---- */
  /* Figma is drawn in Calibre; we use Figtree (~12% wider). Headings/hero are
     OPTICALLY MATCHED (~0.9x of the Figma px) so Figtree renders like the design.
     Body/small/tile keep the Figma px (not width-crowded). Figma px in comments. */
  --fz-small:          14px;   /* Figma 14  — meta, dates, labels        */
  --fz-body:           14px;   /* Figma 16  — base text, footer links    */
  --fz-body-lg:        22px;   /* Figma 24  — hero subtitle, intros      */
  --fz-button:         16px;   /* Figma 16                               */
  --fz-nav:            18px;   /* Figma 18  — header nav links           */
  --fz-tile-title:     18px;   /* Figma 18  — product tile title         */
  --fz-price:          22px;   /* Figma 24  — tile / list price          */
  --fz-price-main:     32px;   /* Figma 36  — product-page main price     */
  --fz-price-alt:      16px;   /* Figma 16                               */
  --fz-footer-heading: 22px;   /* Figma 24  — footer column heading      */
  --fz-hero:           42px;   /* Figma 48  — homepage hero banner       */
  --fz-h1:             28px;   /* Figma 32  — page title                 */
  --fz-h2:             28px;   /* Figma 32  — section heading            */
  --fz-h3:             24px;   /* Figma 28 (product "Savybės") optical    */
  --fz-h4:             20px;   /* Figma 20  — card / block title         */
  --fz-h5:             18px;   /* Figma 18                               */
  --fz-h6:             16px;   /* Figma 16                               */

  /* Heading tracking — Figtree runs a touch loose vs Calibre */
  --ls-heading:        -0.01em;

  /* ---- line-heights ---- */
  --lh-base:           1.5;
  --lh-heading:        1.2;

  /* ---- layout rhythm (Figma) — DESKTOP ---- */
  --section-gap:       40px;   /* base gap between content sections   */
  --section-gap-lg:    96px;   /* emphasised separator (newsletter/footer) */
  --footer-gap:        80px;
  --heading-gap:       20px;   /* heading → its own content; flat across breakpoints (per Figma) */
  --container-max:     var(--wDesctopMax);   /* 1280px */
  --container-pad:     24px;
  --card-pad:          20px;

  /* ---- a11y: secondary-text colour (was #989695 = 2.9:1, fails AA) ---- */
  --cTextLight:        #6f6a68;

  /* Product photos are multiplied onto this, so supplier white backgrounds
     read as a soft grey (bonami.lt technique) without re-processing files. */
  --bgcProductImage:   #f7f7f7;
}

/* ---- TABLET (Figma 768): 768-991px ---- */
@media (max-width: 991.98px) {
  :root {
    --fz-body-lg:        20px;
    --fz-nav:            16px;
    --fz-tile-title:     16px;
    --fz-price:          20px;
    --fz-price-alt:      14px;
    --fz-footer-heading: 20px;
    --fz-hero:           36px;   /* Figma 40 */
    --fz-h1:             24px;   /* Figma 26 */
    --fz-h2:             24px;   /* Figma 26 */
    --fz-h3:             20px;
    --fz-h4:             18px;
    --fz-h5:             16px;
    --section-gap:       32px;
    --section-gap-lg:    72px;
    --footer-gap:        64px;
  }
}

/* ---- MOBILE (Figma 360): <=767px ---- */
@media (max-width: 767.98px) {
  :root {
    --fz-body-lg:        18px;
    --fz-tile-title:     16px;
    --fz-price:          20px;
    --fz-price-alt:      14px;
    --fz-footer-heading: 20px;
    --fz-hero:           28px;   /* Figma 32 */
    --fz-h1:             22px;   /* Figma 24 */
    --fz-h2:             22px;   /* Figma 24 */
    --fz-h3:             18px;
    --fz-h4:             18px;
    --fz-h5:             16px;
    --section-gap:       32px;
    --section-gap-lg:    56px;
    --footer-gap:        56px;
    --container-pad:     16px;
    --card-pad:          16px;
  }
}

/* ---------------------------------------------------------------------------
   Base typography
   --------------------------------------------------------------------------- */
body {
  font-family: var(--ffPrimary), sans-serif;
  font-size: var(--fz-body);
  line-height: var(--lh-base);
  color: var(--cText);
}
/* Neutralise the hard-coded mobile 13px hack (responsive/mobile.css) */
#content-wrapper { font-size: var(--fz-body); }

/* Plain headings (override Bootstrap defaults) */
h1 { font-size: var(--fz-h1); }
h2 { font-size: var(--fz-h2); }
h3 { font-size: var(--fz-h3); }
h4 { font-size: var(--fz-h4); }
h5 { font-size: var(--fz-h5); }
h6 { font-size: var(--fz-h6); }
h1, h2, h3, h4, h5, h6 { line-height: var(--lh-heading); letter-spacing: var(--ls-heading); }
.frn-heading,
.frn-hero-carousel__slide-content-heading { letter-spacing: var(--ls-heading); }

/* ---------------------------------------------------------------------------
   Theme heading hooks — unify the .frn-heading scale (overrides all_styles.css
   base + its >=997px bumps, and the common.css section/page overrides).
   --------------------------------------------------------------------------- */
.frn-heading--h1 { font-size: var(--fz-h1); }
.frn-heading--h2 { font-size: var(--fz-h2); }
.frn-heading--h3 { font-size: var(--fz-h3); }
.frn-heading--h4 { font-size: var(--fz-h4); }
.frn-heading--h5 { font-size: var(--fz-h5); }

.frn-content-heading.frn-page-title .frn-heading  { font-size: var(--fz-h1) !important; }
.frn-content-heading .frn-heading.frn-heading--h1 { font-size: var(--fz-h1); }
/* Figma section headings are Medium (500); the theme overrides to 600 — align back. */
.frn-content-heading .frn-heading.frn-heading--h2 { font-size: var(--fz-h2); font-weight: 500; }

/* Footer column heading + links (Figma: heading 24/20, links 16) */
.frn-footer__heading .frn-heading { font-size: var(--fz-footer-heading); }
.frn-footer__top-links-item a { font-size: var(--fz-body); }

/* Homepage hero banner title (Figma 48 / 40 / 32) */
.frn-hero-carousel__slide-content-heading { font-size: var(--fz-hero); }

/* Hero subtitle (Figma 24 / 20 / 18) — wires the --fz-body-lg token; overrides
   header.css/all_styles/tablet.css hardcoded 24/20/18 raw values. */
.frn-hero-carousel__slide-content-text { font-size: var(--fz-body-lg); }

/* NOTE: the footer BOTTOM contacts bar (ps_customtext .frn-custom-text: phone +
   hours, same block as the header top line) is 14 in Figma on ALL breakpoints —
   the 16px "+370 658 13 837" in Figma lives in the footer "Kontaktai" LINKS
   column (already 16 via .frn-footer__top-links-item a). Do NOT bump the bottom
   bar to 16: the phone+hours row stops fitting a 360px viewport. */

/* News list article titles (Figma 24 desktop / 20 mobile) — responsive token
   instead of all_styles' fixed --fz-24. */
.frn-news-list__item-title { font-size: var(--fz-h3); }

/* Product page crossed-out old price (Figma 20 -> Figtree-adjusted 18; was 14).
   Figma mobile draws it at 16. */
.frn-price-pay__price strike { font-size: var(--fz-18); }
@media (max-width: 767.98px) {
  .frn-price-pay__price strike { font-size: var(--fz-16); }
}

/* ---------------------------------------------------------------------------
   Controls & forms
   --------------------------------------------------------------------------- */
.btn,
.frn-button__text { font-size: var(--fz-button); }

label,.form-control-label { font-size: var(--fz-small); }

/* Inputs — Figma draws all form controls at 16 (all_styles had 14 with 13px
   labels). 16 also stops iOS Safari zooming focused fields. */
.frn-input__control { font-size: var(--fz-body); }
.frn-input__label,
.frn-input__label span { font-size: var(--fz-small); }

/* ---------------------------------------------------------------------------
   Product tile — title, price, alternate price
   --------------------------------------------------------------------------- */
.frn-product-item__title { font-size: var(--fz-tile-title); }
.frn-product-item__price { font-size: var(--fz-price); }
.frn-product-item__price-alternate { font-size: var(--fz-price-alt); }

/* ---------------------------------------------------------------------------
   Section rhythm (per Figma): base gap on .frn-content-block; emphasised
   separator on the newsletter and above the footer.
   --------------------------------------------------------------------------- */
.frn-content-block:has(.frn-discount) { padding-top: var(--section-gap); }

/* Consistent gap above the footer on EVERY page = one --section-gap (40/32/24).
   Previously the footer had no top-gap rule, so the space above it came from each
   page's last section and varied wildly (catalog ~15 via the <section> bottom
   padding, checkout ~100 via the payment module). Put the gap on the footer and
   zero the content <section>'s bottom padding so nothing stacks on top of it. */
.frn-footer { margin-top: var(--footer-gap); }
#wrapper,
#checkout #wrapper,
#cart #wrapper { padding-bottom: 0; }   /* was 15px (all_styles), 20 on checkout — the footer margin owns the gap now */

.frn-main__content:last-child { padding-bottom: 0; }
.frn-main__content > :last-child { margin-bottom: 0; }

/* Breadcrumb hugs the header (Figma: 20 desktop / 16 mobile), not a full section gap;
   text 14px per Figma (was 13). */
.frn-content-block.frn-brdcr { padding-top: 20px; }
.frn-thumbnails { font-size: var(--fz-small); }

/* Product page: nothing under the breadcrumb supplies a gap, because the
   unscoped .frn-product-item-list__content{padding-top:unset} in cart.css
   zeroes this wrapper on every page. Figma wants 40 desktop / 24 below. */
#product #wrapper > .frn-content-block.frn-product-item-list__content { padding-top: 40px; }

@media (max-width: 991.98px) {
  #product #wrapper > .frn-content-block.frn-product-item-list__content { padding-top: 24px; }
}


/* ---------------------------------------------------------------------------
   Catalog (Prekių sąrašas): filter panel title + pagination (Figma)
   --------------------------------------------------------------------------- */
.frn-product-item-list__content-side-top-title { font-size: var(--fz-h3); }
.pagination a, .page-list a, .frn-pagination a { font-size: var(--fz-body); }

/* Vertical rhythm below the pills divider (Figma desktop, divider = 0):
   filter/sort header ~+48, first product ~+105. The theme stacks THREE nested
   `.frn-content-block`s here (list wrapper + total-found + search-list), each
   adding a full --section-gap padding-top → a ~112px gap. Collapse to single
   gaps: the list wrapper owns the divider→header gap; the inner blocks reset. */
.frn-product-item-list__total-found.frn-content-block { padding-top: 0; }        /* no double gap above "Rasta prekių" */
.frn-product-item-list__content-side .frn-content-block { padding-top: 0; }      /* left column: same */
.frn-product-search-list.frn-content-block { padding-top: 12px; }                /* header → products (Figma ~24 below sort-bar bottom) */
/* Tablet sort/filter control: the last action item carries a trailing 16px
   margin, making the header row 64px (vs Figma's 48px) and pushing products
   down. Drop it so tablet matches the Figma product position. */
.frn-content-block__actions_tablet .frn-content-block__actions-item:last-child { margin-bottom: 0; }
/* Tablet: slightly larger header→products gap so products land at Figma's ~97px
   below the divider (pairs with the tighter .mt-2 padding-top in custom.css). */
@media (min-width: 768px) and (max-width: 991.98px) {
  .frn-product-search-list.frn-content-block { padding-top: 24px; }
}
/* Mobile: "Rasta prekių" carries its own 16px top pad (≈ Figma's 19 below the
   divider); trim the header→products gap so the first product lands at Figma's
   ~47px below the divider (was ~52). */
@media (max-width: 767.98px) {
  .frn-product-search-list.frn-content-block { padding-top: 8px; }
}

/* Desktop only (mobile filters are a popup): the "Filtravimas" row takes the 40px
   height of the sort bar, so the title and the 40px "Išvalyti filtrus" button shown
   with active filters both centre on "Rasta prekių". custom.css sets the gap below
   so the first filter is level with the first product. */
@media (min-width: 992px) {
  .frn-product-item-list__content-side-top-title { min-height: 40px; }
}

/* ---------------------------------------------------------------------------
   Product page (Prekės informacija) — section rhythm per Figma.
   Existing web blocks: product (gallery+info) · Savybės (description) ·
   Panašios prekės (carousel) · newsletter. Figma gaps desktop / mobile:
   breadcrumb→product 40/24 · product→Savybės 56/24 · Savybės→carousel 32/24.
   --------------------------------------------------------------------------- */
/* breadcrumb → product = --section-gap (40 desktop / 32 tablet / 24 mobile).
   The shared .mt-2 rule (custom.css) forces 48 for the catalog filter divider;
   the product page has no pills, so restore the plain section gap here. */
/* !important: responsive/mobile.css forces padding-top:0!important on this
   shared wrapper (for the catalog) — override it for the product page. */
#product .frn-content-block.frn-product-item-list__content.mt-2 { padding-top: var(--section-gap) !important; }

/* Savybės → "Panašios prekės" carousel: the theme's mt-3 utility is 3rem/48px
   !important; Figma wants 32 desktop / 24 mobile. */
#product .featured-products.mt-3 { margin-top: 32px !important; }
@media (max-width: 767.98px) {
  #product .featured-products.mt-3 { margin-top: 24px !important; }
}

/* product → Savybės specs — match Figma's description-block internal rhythm.
   The frn-specs__table border-top is the section divider; the "Savybės" title
   sits inside, below the padding. Figma:
     product → divider (= block section-gap + table margin-top): 56 desktop / 24 mobile
     divider → title       (= table padding-top):                33 desktop / 25 mobile
     title  → content      (= title margin-bottom):              24 desktop / 20 mobile  */
#product .frn-specs__table { margin-top: 16px; padding-top: 33px; }   /* 40+16=56 · 33 */
#product .frn-specs__title { margin-bottom: 24px; }
@media (max-width: 767.98px) {
  #product .frn-specs__table { margin-top: 0; padding-top: 25px; }    /* 24+0=24 · 25 */
  #product .frn-specs__title { margin-bottom: 20px; }
}

/* ---------------------------------------------------------------------------
   Add-to-cart modal (Cart - Pop-up) — Figma spacing.
   --------------------------------------------------------------------------- */
/* The connected-items ("Susijusios prekės") section had no top spacing, so its
   heading butted against the free-delivery bar. Figma leaves 24px after the bar. */
.frn-cart__connected-items { margin-top: 24px; }

/* ---------------------------------------------------------------------------
   Cart page (Krepšelis) — Figma.
   --------------------------------------------------------------------------- */
/* Cart and checkout share one header, so it must read the same on both. The
   header itself is transparent, and #checkout paints the body #f8f8f8 for the
   white panels to sit on — which showed through and made the checkout header
   grey where the cart's was white. Figma's checkout frames are white
   throughout, so the header is white on both; the body grey stays, because
   without it the checkout panels lose their edges. */
#cart .frn-header,
#checkout .frn-header {
  background-color: #fff;
}

/* Header shares the content column's inset. Figma draws the header box as
   exactly the 1280 container on desktop (and one 20px margin on tablet and
   mobile); the theme let it run 20px wider on each side, so the logo sat
   outside the breadcrumb and panels below it. Tablet and mobile already match,
   so only the desktop container is set here. */
@media (min-width: 577px) {
  #cart .frn-header__content,
  #checkout .frn-header__content {
    width: calc(100% - 40px);
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
  }
}

/* Logo size is deliberately not set here: cart and checkout follow the same
   27px / 20px scale as every other page (common.css), so the header logo does
   not change size when the customer moves into the cart. */

/* Sticky footer: the column grows to fill the viewport and the footer follows
   the content. Replaces a min-height:81.3vh on #wrapper, which could not know
   the header and footer heights — it forced a scrollbar on short viewports and
   left white under the footer above ~1330px tall. */
#cart main,
#checkout main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#cart main > .frn-main,
#checkout main > .frn-main {
  flex: 1 0 auto;
}

/* The breadcrumb is shared too, but all_styles.css carried a checkout-only
   12/4 override so the two pages sat at different heights. Figma gives both
   20 above on desktop and 12 on mobile; the gap below belongs to the next
   block, not to the breadcrumb. */
#cart .frn-content-block.frn-brdcr,
#checkout .frn-content-block.frn-brdcr {
  padding-top: 20px;
  padding-bottom: 0;
}

@media (max-width: 767.98px) {
  #cart .frn-content-block.frn-brdcr,
  #checkout .frn-content-block.frn-brdcr {
    padding-top: 12px;
  }

  /* #cart is inset by its #wrapper padding; #checkout has none, so its
     breadcrumb ran to the screen edge while the cart's aligned to the logo. */
  #checkout .frn-content-block.frn-brdcr {
    padding-left: var(--spaceLeftL);
    padding-right: var(--spaceRightL);
  }
}

/* Page title "Prekių krepšelis" — Figma 24 desktop/tablet, 20 mobile. No
   heading tier matches that (--h3 drops to 18 on mobile), so it is sized here
   and the markup carries no tier modifier. */
#cart .frn-cart-head { font-size: 24px; }

@media (max-width: 767.98px) {
  #cart .frn-cart-head { font-size: 20px; }
}

/* Breadcrumb → title is 32 on the Figma cart frame, not the 40 the generic
   .frn-content-block rhythm gives it (Figma reserves 40 for the catalog). */
#cart #main > .frn-content-block:first-child { padding-top: 0px; }

@media (max-width: 991.98px) {
  #cart #main > .frn-content-block:first-child { padding-top: 0px; }
}

/* cart.css already unsets this wrapper's padding, but the blanket
   .frn-content-block rule in mobile.css re-applies it below 576px and the gap
   above the title doubles. */
#cart #wrapper > .frn-content-block.frn-product-item-list__content { padding-top: 0; }

/* ---------------------------------------------------------------------------
   Account pages (customer/page.tpl) — breadcrumb → content matches the cart
   rhythm (30 desktop/tablet · 20 mobile), owned by .account-layout padding.
   --------------------------------------------------------------------------- */
/* Same below-576px blanket repair as the cart above, so the section gap does
   not stack on top of the account-layout padding. #order-detail and
   #order-return render the account layout but PrestaShop gives them no
   page-customer-account class. */
.page-customer-account #wrapper > .frn-content-block.frn-product-item-list__content,
#order-detail #wrapper > .frn-content-block.frn-product-item-list__content,
#order-return #wrapper > .frn-content-block.frn-product-item-list__content,
#addresses #wrapper > .frn-content-block.frn-product-item-list__content { padding-top: 0; }

/* The wishlist page has no .account-layout to own the gap, so the wrapper
   carries the account rhythm (30 desktop/tablet · 20 mobile) directly. */
#module-blockwishlist-wishlist #wrapper > .frn-content-block.frn-product-item-list__content { padding-top: 30px; }
@media (max-width: 767.98px) {
  #module-blockwishlist-wishlist #wrapper > .frn-content-block.frn-product-item-list__content { padding-top: 20px; }
}
/* Logged in, the wishlist also renders .account-layout; the wrapper already owns the gap. */
#module-blockwishlist-wishlist .account-layout { padding-top: 0; }
