/* ==========================================================================
   Project overrides — Kiki's Barbecue Place
   ==========================================================================

   The only stylesheet in this project that is ours. Everything else under
   assets/css/ ships with the theme.

   Why changes go here and not in style.css:
   style.css is COMPILED SASS OUTPUT. The source tree is assets/sass/ and
   style.css.map ships beside it, so any hand edit to style.css is discarded
   the moment anyone rebuilds. This file is loaded after it and wins on
   ordering at equal specificity.

   Loaded from:
     app/views/partials/header.php   (every page except pizza)
     public_html/pizza.php           (inlines its own <head>)

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


/* --------------------------------------------------------------------------
   1. The page-title banner was burying the products
   --------------------------------------------------------------------------

   Measured on menu-grid.html before this change, first product card vs. the
   fold:

     1189px laptop   banner 363px   first product 889px   fold 733px   -156
      849px tablet   banner 303px   first product 796px   fold 733px    -63
      355px phone    banner 257px   first product 630px   fold 733px    ok

   A customer on a laptop saw no food at all without scrolling. The banner was
   the biggest block on the way down and the emptiest: the title sits in its
   top third and the rest is padding.

   The banner has no min-height anywhere — its height is purely padding plus
   content — so halving the padding is the whole fix. The theme sets it on a
   four-step ladder; each step is halved here rather than flattened to one
   value, so it stays in proportion with the title's own font-size ladder
   (64px down to 34px across the same breakpoints).

   The decorative .breadcumb-shape2/3/4 divs are position:absolute inside an
   overflow:hidden wrapper, so they cannot hold the banner open and are not
   affected. They are hidden below 991px by the theme in any case.           */

.breadcumb-wrapper .breadcumb-content {
    padding: 75px 0;
}

@media (max-width: 1199px) {
    .breadcumb-wrapper .breadcumb-content {
        padding: 60px 0;
    }
}

@media (max-width: 991px) {
    .breadcumb-wrapper .breadcumb-content {
        padding: 60px 0;
    }
}

@media (max-width: 575px) {
    .breadcumb-wrapper .breadcumb-content {
        padding: 55px 0;
    }
}


/* --------------------------------------------------------------------------
   2. The gap between the banner and the first content block

   The section under the banner carries the theme's `space` utility — 120px of
   top padding on desktop. That utility is used on sections all over the site
   and its rhythm is right everywhere else, so this does NOT redefine `.space`.

   The adjacent-sibling selector targets exactly one thing: whatever element
   comes directly after a banner. Nothing else on any page matches.

   Both element types are needed. contact.php is the only page whose first
   element after the banner is a <div class="space contact-area-3"> rather
   than a <section>; every other page uses <section>.                        */

.breadcumb-wrapper + section,
.breadcumb-wrapper + div {
    padding-top: 50px;
}

@media (max-width: 991px) {
    .breadcumb-wrapper + section,
    .breadcumb-wrapper + div {
        padding-top: 40px;
    }
}


/* --------------------------------------------------------------------------
   3. Make the whole category card clickable, not just its title

   On the homepage's category strip only the small title text was a link. The
   card reads as a button — icon, name, item count, the lot — so people click
   the card, not the four words in the middle of it.

   The card is turned into the positioning context so Bootstrap's
   .stretched-link on the title anchor covers exactly this card. Without this
   the card computes as `position: static`, and the stretched link would climb
   to the nearest positioned ancestor — the swiper slide — and swallow clicks
   beyond the card's own bounds.

   This also fixes something that was true by luck: `.cat-i-bottom`, the
   decorative strip along the card's foot, is absolutely positioned and was
   anchoring to the slide rather than the card. It lined up only because the
   two happened to share a bottom edge.                                       */

.category-card {
    position: relative;
}

/* The strip is decoration and must not eat the clicks the card now accepts. */
.category-card .cat-i-bottom {
    pointer-events: none;
}

/* Dish cards and menu rows add to the order when tapped, so they need to look
   like they do something. Category cards on the homepage are excluded — they
   navigate, and already carry a link cursor. */
.category-card.style-2,
.food-card-1,
.menu-item-1 {
    cursor: pointer;
}

/* The homepage menu rows gained a cart button beside the price. The theme lays
   the row out as name/description on the left and price on the right, so the
   button joins the price rather than displacing anything: they sit on one line,
   nowrap so a long dish name cannot push the price onto two.

   The theme's .icon-btn defaults to 56px, which is a card-sized control in a
   row only 84px tall. --btn-size and --btn-font-size are the theme's own
   custom properties, so this resizes it without redefining the button. */
/* The theme set no gap between the name/description column and the price, so
   they sat flush. That was survivable when the right side was just a price;
   with a button beside it the description ran straight into the money. The
   left column also needs min-width:0, or a long description refuses to wrap
   and pushes the price out instead. */
.menu-item-1 .content {
    gap: 20px;
}

.menu-item-1 .content .left {
    min-width: 0;
}

.menu-item-1 .content .right {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}

/* The theme drew a dashed leader line from the description across to the price
   — the classic printed-menu device — sized as a percentage of the description
   box (right: -88%, width: 78%). Those percentages were tuned when the price was
   the only thing on the right. The button widens that column by 54px, so the
   line now stops short and points at blank space beside the button rather than
   at the money. The theme already hides it below 1399px, which is most screens;
   hiding it at every width keeps one consistent layout instead of a misaligned
   line on wide monitors only. */
.menu-item-1 .content .left .box-text::before {
    display: none;
}

/* The theme nudged the price down with a 25px top margin because it was the
   only thing in the column. Now that the column is a centred flex row, that
   margin is what makes the price sit 13px lower than the button beside it. */
.menu-item-1 .content .right .price {
    margin: 0;
}

.menu-item-1 .content .right .icon-btn {
    --btn-size: 40px;
    --btn-font-size: 16px;
    flex: 0 0 auto;
}


/* --------------------------------------------------------------------------
   4. The pizza page's add-to-cart button was hover-only

   The button was already there — a real POST form with a proper label, on all
   four cards. The theme just never showed it: `.actions` is opacity 0 and
   visibility hidden, revealed only by `.category-card.style-2:hover`.

   On a phone there is no hover. The single control for ordering a dish was
   unreachable for every touch customer, which is most of them.

   `right` matters as much as the visibility pair. The theme parks the hidden
   state at 10px and slides it to 35px on hover, so 35px is where the button is
   meant to sit when it is being looked at; 10px is only the slide-in origin.
   Setting just opacity and visibility would rest the button 25px off target and
   then have it jump sideways the moment a mouse crossed the card.

   Scoped to .style-2, which pizza-card.php is the only view that uses. The
   homepage category strip is plain .category-card and keeps its own behaviour. */

.category-card.style-2 .actions {
    opacity: 1;
    visibility: visible;
    right: 35px;
}


/* --------------------------------------------------------------------------
   5. The menu page's category tabs sat 55px clear of the first card

   This has to be here rather than as an `mb-30` on the markup: the theme's
   rule is `.menu-1-content-wrap.style-2 .nav-tabs` — three classes, 0,3,0 —
   which outranks any single-class `mb-*` utility. Changing the class in
   menu-grid.php looked right and did nothing at all.

   Same specificity as the theme's rule, so this wins purely on load order.  */

.menu-1-content-wrap.style-2 .nav-tabs {
    margin-bottom: 30px;
}


/* --------------------------------------------------------------------------
   6. "Place your order" was unclickable on phones
   --------------------------------------------------------------------------

   The hero badge is a real conversion element — an <a> to menu-grid — but
   below 425px it could not be tapped at all.

   Two rules in the compiled theme fight, and the mobile one loses:

     style.css:11089  .hero-img-shape-1 { z-index: 7 }          base
     style.css:11265  @media (max-width:425px)
                      .hero-img-shape-1 { z-index: 3 }          phone
     style.css:11108  .hero-style1      { z-index: 6 }          hero text block

   At 7 the badge sits above the hero text block and takes the tap. At 3 it
   sits under it. .hero-style1 has no background, so the badge still SHOWS
   through — it just stops receiving pointer events, which is why this reads
   as "the link is dead" rather than "the badge is missing". Confirmed with
   elementFromPoint at the badge's centre: it returned div.hero-style1.

   Position is reset too, not just the stacking. The theme placed the badge
   with `top: 82%` of the hero, calibrated for a hero that contained a large
   photograph. That photo has since been removed, the hero collapsed from
   429px to 195px, and 82% of the shorter box landed the badge on top of the
   heading. Anchoring to the bottom instead of a percentage keeps it clear of
   the text regardless of how tall the hero ends up.

   The padding restores the room that removing the photo took away; without
   it there is no gap below the heading to put a 146px badge in.

   Measured after, at 375px: badge 146x146, 55px clear of the h1, and
   elementFromPoint at its centre returns a[href="menu-grid.html"].          */

@media (max-width: 425px) {
    .hero-inner {
        padding-bottom: 150px;
    }

    .hero-img-shape-1 {
        left: 50%;
        right: auto;
        top: auto;
        bottom: 18px;
        transform: translateX(-50%) scale(0.45);
        z-index: 7;
    }
}


/* --------------------------------------------------------------------------
   7. The order control moved out of the hover overlay, and grew a quantity

   Was: `.food-card-1 .thumb .actions` — a 40px-wide absolutely-positioned
   column over the photo, opacity 0 and visibility hidden until the card was
   hovered. Two problems, and the second is what forced the move:

     - a phone has no hover, so the only visible route to ordering a dish was
       knowing that tapping the card works (card-add.js), which nothing said
     - a three-part quantity stepper does not fit in a 40px column at any size

   It now renders inside `.content`, below the description, in the card body.
   The pizza carousel card keeps its overlay (see §4) — it is a tighter layout
   and it opts out of the quantity field.

   The ± buttons are hidden unless cart-async.js has set .js-cart on <html>.
   They do nothing without its click handler, and a visible control that does
   not respond is worse than one never offered; without the class the number
   input's own native spinners do the job with no JavaScript at all. The
   spinners are hidden only when the buttons replace them, so there is always
   exactly one way to change the number and never two.                       */

.food-card-1 .content .th-add,
.menu-item-1 .content .th-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.menu-item-1 .content .th-add {
    justify-content: flex-end;
    margin-top: 8px;
}

.th-add-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--th-border-color);
    border-radius: 99px;
    overflow: hidden;
}

.th-add-step {
    display: none;                     /* revealed by .js-cart, see above */
    width: 32px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--title-color);
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: 0.3s ease-in-out;
}

.js-cart .th-add-step {
    display: inline-flex;
}

.th-add-step:hover {
    background-color: var(--theme-color);
    color: var(--white-color);
}

.th-add-qty-input {
    width: 46px;
    height: 36px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 600;
    color: var(--title-color);
    padding: 0;
    -moz-appearance: textfield;
}

/* Only once the ± buttons have taken over the job. */
.js-cart .th-add-qty-input::-webkit-outer-spin-button,
.js-cart .th-add-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.food-card-1 .content .th-add .icon-btn,
.menu-item-1 .content .th-add .icon-btn {
    --btn-size: 38px;
    --btn-font-size: 15px;
    border-radius: 99px;
    flex: 0 0 auto;
}


/* --------------------------------------------------------------------------
   8. Confirmation for an add that no longer reloads the page

   With the reload gone there is no fresh page render to carry the notice from
   notice(), so nothing told the customer the add had worked. This is that
   feedback. cart-async.js creates the element on first use, so it costs
   nothing on a page where nobody orders anything.

   Bottom-centre rather than top-right: the add controls are down in the cards,
   and on a phone a top-right toast appears in the opposite corner from the
   thumb that just tapped.

   pointer-events: none matters — the toast sits over the cards for 2.6s, and
   without it every confirmation would swallow the next tap.                  */

.th-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 999;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 22px;
    border-radius: 99px;
    background-color: var(--title-color);
    color: var(--white-color);
    font-weight: 500;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    transform: translate(-50%, 12px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out, visibility 0.2s;
}

.th-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* A refusal — sold out, or over the 50-per-line ceiling — reads as a problem,
   not a confirmation. */
.th-toast.is-error {
    background-color: var(--theme-color);
}


/* --------------------------------------------------------------------------
   9. The entrance animation cost four times what the server did

   Measured on the staging host, menu-grid.html:

     TTFB                     43ms
     DOM complete            268ms
     preloader visible       365ms
     .fadeinup duration     1300ms   x 52 elements on the page
     stagger, 8th card       800ms   (data-wow-delay, .1s per card)

   So a page the server finished answering in 43ms took roughly 1.7s before it
   could be used, and the eighth dish card 2.1s. None of that was network.

   0.35s is still a visible fade — the point was never to strip the animation,
   it was that 1.3s is a third of the time a customer spends on the page. The
   -webkit- prefixed property is set alongside the standard one because that is
   the pair style.css declares, and overriding only one leaves the prefixed
   declaration winning in the browsers that still read it.

   food-card.php cuts the per-card stagger from .1s to .04s to match. Changing
   one without the other just moves the wait from the fade to the delay.

   Anyone who has asked their OS to reduce motion gets no animation at all,
   which the theme never honoured. opacity must be forced back to 1 there:
   .fadeinup sets opacity 0 and relies on the animation's forwards fill to
   reveal it, so removing the animation without the opacity would leave the
   whole page invisible.                                                      */

.fadeinup,
.fadeinleft,
.fadeinright {
    -webkit-animation-duration: 0.35s;
            animation-duration: 0.35s;
}

@media (prefers-reduced-motion: reduce) {
    .fadeinup,
    .fadeinleft,
    .fadeinright {
        -webkit-animation: none;
                animation: none;
        opacity: 1;
    }

    .preloader {
        display: none;
    }
}


/* --------------------------------------------------------------------------
   10. The preloader ran again on every navigation

   §9 covers the fade. This is the 365ms overlay in front of it, which the
   theme replays on every page load — so an order that crosses the menu, the
   cart and the checkout paid for it four times.

   The class is set by the inline script in header.php on the second and later
   page views of a session. Scoped to display:none rather than removing the
   markup, because main.js still expects `.preloader` to exist: it calls
   $(".preloader").fadeOut() on window load and binds the Cancel button, and
   both are harmless no-ops against a hidden element.

   Deliberately NOT extended to the fade animations here. WOW writes
   animation-name inline when it reveals a box, and inline style beats this
   stylesheet — a rule here claiming to disable them would be true for some
   elements and quietly false for the rest. §9 shortens them for everyone
   instead, which needs no such caveat.                                       */

.fp-seen-intro .preloader {
    display: none;
}

/* §N  Delivery / Collection toggle on checkout.
   style.css hides every input[type=radio] and draws its marker on an
   `input ~ label` sibling, so a bare radio is invisible. These inputs are
   siblings of their labels; the visible control is the label, drawn here as
   a two-option segmented toggle. The inputs stay in the DOM (display:none in
   style.css is overridden to a visually-hidden clip) so keyboard focus and
   form submission keep working.                                              */

.fp-toggle {
    display: inline-flex;
    border: 1px solid var(--theme-color);
    border-radius: 999px;
    overflow: hidden;
}
.fp-toggle input[type=radio] {
    display: inline-block;
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    visibility: visible;
}
.fp-toggle input[type=radio] ~ label {
    margin: 0;
    padding: 12px 28px;
    line-height: 1.2;
    font-weight: 600;
    cursor: pointer;
    background: var(--white-color);
    color: var(--title-color);
}
.fp-toggle input[type=radio] ~ label::before {
    display: none;
}
.fp-toggle input[type=radio]:checked ~ label::before {
    display: none;
}
.fp-toggle input[type=radio]:checked + label {
    background: var(--theme-color);
    color: var(--white-color);
}
.fp-toggle input[type=radio]:focus-visible + label {
    outline: 2px solid var(--title-color);
    outline-offset: -4px;
}
.fp-delivery-only[hidden] {
    display: none;
}


/* §N  Announcement banner (Admin -> Settings). A slim bar above the header. Not
   dismissible on purpose: it carries something the owner wants every visitor
   to see. Text colours are chosen for contrast against each background, not
   inherited from the theme (the theme's own green and orange fail on white).  */

.fp-banner {
    position: relative;
    z-index: 1001;
    padding: 10px 0;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
}
.fp-banner .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
}
.fp-banner__text {
    font-weight: 600;
}
.fp-banner--success { background: #1f6f47; color: #fff; }
.fp-banner--info    { background: #121212; color: #fff; }
.fp-banner--warning { background: #FFC15A; color: #121212; }
.fp-banner__btn {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 999px;
    background: #fff;
    color: #121212;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.fp-banner__btn:hover,
.fp-banner__btn:focus-visible {
    background: #121212;
    color: #fff;
}
@media (max-width: 575px) {
    .fp-banner { font-size: 14px; padding: 8px 0; }
}
