/* cards/css/themes/business_site.css — the business card as a website (cards/themes/business_site.html).
   Phones (< 768px): business.html's card, filling the screen width; the extra bars are hidden and Home keeps
   business.html's order.
   Tablets (768–991px): the website (top bar, hero, menu bar, footer) in one column; Home's contact cards follow it.
   Laptops (992px+): the same with the contact sidebar beside every tab.
   Logical properties only, so RTL needs no overrides. */

:root {
    --site-max: 1200px;
    --site-gutter: 24px;
    --site-radius: 20px;
    --site-topbar-h: 64px;
    --site-card-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
}

/* ---------- Phones: the card as it is ---------- */
.site-topbar,
.site-footer { display: none; }

/* Home: the story and the contact columns melt into one list, in business.html's order */
.site-home { display: flex; flex-direction: column; }
.site-home__main,
.site-home__aside,
.site-home__item { display: contents; }
.site-order-0 > * { order: 0; }
.site-order-1 > * { order: 1; }
.site-order-2 > * { order: 2; }
.site-order-3 > * { order: 3; }
.site-order-4 > * { order: 4; }
.site-order-5 > * { order: 5; }
.site-order-6 > * { order: 6; }
/* each partial is now the last child of its wrapper: keep the separators business.html shows */
.site-home__item > .info-section { border-bottom: 1px solid #f0f0f0; }

/* Large phones / small tablets in portrait: the card fills the screen instead of a 400px strip with gaps
   (at 400px and below the card already is the full width, so phones look exactly as before) */
@media (max-width: 767.98px) {
    .site-layout :is(.vcard-container, .vcard-header-container, .vcard-body-container, .nav-container, .tab-content-section) {
        max-width: none;
    }
}

/* ---------- Tablets and up: a website ---------- */
@media (min-width: 768px) {
    body:has(.site-layout) { background: #f4f5f7; }

    .site-wrap { max-width: var(--site-max); margin-inline: auto; padding-inline: var(--site-gutter); }

    /* Top bar */
    .site-topbar {
        display: block; position: sticky; top: 0; z-index: 1030;
        background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(0, 0, 0, .06);
    }
    .site-topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--site-topbar-h); }
    .site-topbar__actions { display: flex; align-items: center; gap: .5rem; }

    .site-brand { display: inline-flex; align-items: center; gap: .65rem; min-width: 0; color: #111827; text-decoration: none; }
    .site-brand:hover { color: #111827; text-decoration: none; }
    .site-brand__logo { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: #fff; }
    .site-brand__initial { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--on-primary, #fff);
        background: var(--primary-color, #ff6b93); }
    .site-brand__name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .site-btn {
        display: inline-flex; align-items: center; gap: .45rem; height: 40px; padding-inline: 1rem; border-radius: 12px;
        font-size: .9rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: filter .15s, background-color .15s;
    }
    .site-btn:hover { text-decoration: none; }
    .site-btn--ghost { color: #111827; border-color: rgba(0, 0, 0, .1); background: #fff; }
    .site-btn--ghost:hover { color: #111827; background: #f9fafb; }
    .site-btn--primary { color: var(--on-primary, #fff); background: var(--primary-color, #ff6b93); }
    .site-btn--primary:hover { color: var(--on-primary, #fff); filter: brightness(.94); }

    /* The card frame becomes the page column (sticky children need overflow: visible) */
    .site-layout .vcard-container {
        max-width: none; margin: 0; padding: 0; border-radius: 0; overflow: visible; box-shadow: none; background: transparent;
    }
    .site-layout .site-frame { max-width: var(--site-max); margin: 24px auto 0; padding-inline: var(--site-gutter); }

    /* Hero */
    .site-hero .vcard-header { min-height: 340px; border-radius: var(--site-radius); overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
    .site-hero .header-content { padding-block: 1.5rem 2.5rem; }
    .site-hero .header-content h2 { font-size: 2.4rem; font-weight: 800; }
    .site-hero .header-content p { font-size: 1.15rem; opacity: .95; }
    .site-hero .profile-image { width: 128px; height: 128px; }
    .site-hero .profile-image img { width: 100%; height: 100%; }

    /* Menu: the tabs as a sticky bar under the top bar */
    .site-menu { position: sticky; top: calc(var(--site-topbar-h) + 12px); z-index: 1020; margin-top: 16px; }
    .site-menu .nav-container {
        max-width: none; background: #fff; border-radius: 16px; box-shadow: var(--site-card-shadow); padding: 6px;
    }
    /* one row: centred while the tabs fit, scrolls sideways (like on phones) when a card has many */
    .site-menu .nav-tabs-scroll { justify-content: safe center; flex-wrap: nowrap; gap: 4px; }

    /* ---------- Content: [active tab | contact sidebar] ----------
       The sidebar is Home's contact, hours and locations (their partials live in Home for the phone order):
       #vcard and its wrappers become "display: contents", so Home's two columns are grid items of
       .site-content. The aside stays on every tab; Home's main column shows only while Home is active. */
    .site-content {
        --site-sticky-top: calc(var(--site-topbar-h) + 12px + 62px + 16px);   /* top bar + menu bar + gap */
        display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; margin-top: 24px;
    }
    .site-content > .tab-pane { grid-column: 1; grid-row: 1; min-width: 0; }
    .site-content > #vcard,
    .site-content > #vcard > .vcard-container,
    .site-content .site-home { display: contents !important; }
    .site-home__main { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
    .site-content > #vcard:not(.active) .site-home__main { display: none; }
    .site-home__aside {
        grid-column: 2; grid-row: 1; display: flex; flex-direction: column; gap: 16px; min-width: 0;
        position: sticky; top: var(--site-sticky-top); max-height: calc(100vh - var(--site-sticky-top) - 16px);
        overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; border-radius: var(--site-radius);
    }
    .site-home__item { display: block; }
    .site-home__item > .info-section {
        background: #fff; border: 0; border-radius: var(--site-radius); box-shadow: var(--site-card-shadow); padding: 28px;
    }
    .site-home__aside .site-home__item > .info-section { padding: 20px; }
    /* checkout needs the whole width and the visitor's full attention */
    /* ... and so does the board (filters column, results, map: board/css/card_board.css) */
    .site-content:has(> #checkout-stepper.active, > #shop-checkout.active, > #board.active) { grid-template-columns: minmax(0, 1fr); }
    .site-content:has(> #checkout-stepper.active, > #shop-checkout.active, > #board.active) .site-home__aside { display: none; }
    .site-content > :is(#checkout-stepper, #shop-checkout) { max-width: 880px; margin-inline: auto; width: 100%; }

    .site-layout .tab-content-section {
        max-width: none; margin: 0; padding: 28px; background: #fff; border-radius: var(--site-radius); box-shadow: var(--site-card-shadow);
    }
    /* tabs whose partial has no .tab-content-section get the same white panel */
    .site-content > #board > .cboard,
    .site-content > #flashcards > :first-child {
        padding: 28px !important; background: #fff; border-radius: var(--site-radius); box-shadow: var(--site-card-shadow);
    }

    /* Home main column */
    .site-order-2 .row > .col-6 { flex: 0 0 25%; max-width: 25%; }               /* feature shortcuts: 4 across */
    .site-layout :is(.site-order-4, #services) .fx-service-list {                 /* services: 2 across */
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
    }
    .site-layout :is(.site-order-4, #services) .fx-service { margin: 0; }

    /* Grids sized for the ~790px main column */
    .site-layout .gallery-grid:not(.list-layout) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .site-layout #menu :is(.category-grid, .subcategories-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .site-layout #menu .items-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

    /* Contact form: short fields in pairs, the message and the button full width */
    .site-layout #contactForm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
    .site-layout #contactForm > * { grid-column: 1 / -1; }
    .site-layout #contactForm > div:nth-of-type(-n+4) { grid-column: auto; }
    .site-layout #contactForm > .btn { justify-self: end; width: auto !important; min-width: 200px; }

    /* ---------- Booking: a website booking widget ----------
       service → [calendar | times] → details → confirm; the calendar keeps its phone size */
    .site-layout #booking .booking-progress { max-width: 600px; margin-inline: auto; }
    .site-layout #booking .service-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .site-layout #booking .service-grid .service-card { margin: 0; }
    .site-layout #booking .datetime-selection {
        display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start;
    }
    .site-layout #booking .datetime-selection .calendar-section { margin-bottom: 0 !important; }
    .site-layout #booking .datetime-selection > :not(.calendar-section) { grid-column: 2; grid-row: 1; }
    .site-layout #booking .time-slots-placeholder { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
    /* actions: Back at the start, Continue at the end of the step (not a bar pinned to the screen) */
    .site-layout #booking .booking-actions {
        position: static; display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding: 0;
        background: none; box-shadow: none; border: 0;
    }
    .site-layout #booking .booking-actions .btn { flex: 0 0 auto; width: auto; min-width: 160px; }
    .site-layout #booking .booking-actions .btn:only-child { margin-inline-start: auto; }
    /* shop / menu checkout: same — the step's own buttons at both ends, not pinned to the screen */
    .site-layout :is(#shop-checkout, #checkout-stepper) .restaurant-stepper-actions {
        position: static; margin-top: 24px; padding: 0; background: none; box-shadow: none; border: 0;
    }
    .site-layout :is(#shop-checkout, #checkout-stepper) .restaurant-stepper-actions .btn { flex: 0 0 auto; width: auto; min-width: 160px; }

    /* ---------- The bottom bar's actions live in the top bar (moved there by business_site.html) ---------- */
    .site-topbar .mobile-bottom-nav {
        position: static; display: flex; align-items: center; gap: 4px; width: auto; max-width: none; min-height: 0;
        margin: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none;
        backdrop-filter: none; -webkit-backdrop-filter: none; z-index: auto;
    }
    .site-topbar .mobile-bottom-nav :is(.bottom-nav-btn, .bottom-nav-dropdown) { flex: 0 0 auto; width: auto; }
    .site-topbar .bottom-nav-btn {
        flex-direction: row; gap: 6px; height: 40px; padding: 0 12px; border-radius: 12px; color: #374151;
    }
    .site-topbar .bottom-nav-btn i { font-size: 1rem; }
    .site-topbar .bottom-nav-btn.active i { transform: none; }
    .site-topbar .bottom-nav-label { font-size: .875rem; }
    /* Home and Back: the brand and the menu already do that on a website */
    .site-topbar .bottom-nav-btn:is([data-action="home"], [data-action="back"]) { display: none !important; }
    .site-topbar :is(.cart-nav-badge, .shop-cart-nav-badge) { top: 2px; inset-inline-start: 20px; }
    /* "More" opens downwards */
    .site-topbar .bottom-nav-dropdown .dropdown-menu {
        top: calc(100% + 8px) !important; bottom: auto !important; inset-inline-end: 0; inset-inline-start: auto;
        transform: none !important; margin: 0; box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
    }
    body:has(.site-layout) { padding-bottom: 0; }

    /* Footer */
    .site-footer { display: block; margin-top: 48px; background: #fff; border-top: 1px solid rgba(0, 0, 0, .06); }
    .site-footer__grid { display: grid; grid-template-columns: 1.2fr 1.2fr 2.2fr; gap: 32px; padding-block: 40px 24px; }
    .site-footer__title { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; margin-bottom: .9rem; }
    .site-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .92rem; color: #374151; }
    .site-footer__list i { color: var(--primary-color, #ff6b93); margin-inline-end: .35rem; }
    .site-footer__list a { color: inherit; }
    /* section links flow into as many columns as fit, instead of one long two-column list */
    .site-footer__links { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); column-gap: 1.5rem; }
    .site-footer__muted { color: #6b7280; }
    .site-footer__social { display: flex; gap: .5rem; margin-top: 1rem; }
    .site-footer__social a {
        display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px;
        background: #f3f4f6; color: #374151; transition: background-color .15s, color .15s;
    }
    .site-footer__social a:hover { background: var(--primary-color, #ff6b93); color: #fff; }
    .site-footer__bottom { padding-block: 16px; border-top: 1px solid rgba(0, 0, 0, .06); font-size: .85rem; color: #6b7280; }
    body:has(.site-layout) .platform-attribution { background: #fff; padding-bottom: 96px !important; }
}

/* Small laptops (992–1199px): the main column is ~600px — a narrower sidebar, one column less everywhere,
   and the booking calendar above the times instead of beside them */
/* Tablets (768–991px): no sidebar — one column; on Home the contact cards follow the content, two across */
@media (min-width: 768px) and (max-width: 991.98px) {
    :root { --site-gutter: 16px; }
    .site-content { grid-template-columns: minmax(0, 1fr); }
    .site-home__aside {
        grid-column: 1; grid-row: 2; position: static; max-height: none; overflow: visible;
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start;
    }
    .site-content > #vcard:not(.active) .site-home__aside { display: none; }
    /* top bar: the phone number as an icon to leave room for the cart and More */
    .site-topbar .site-btn--ghost span { display: none; }
    .site-hero .vcard-header { min-height: 280px; }
    .site-hero .header-content h2 { font-size: 2rem; }
    .site-order-2 .row > .col-6 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .site-footer__grid { grid-template-columns: 1fr 1fr; }
    .site-footer__grid > :last-child { grid-column: 1 / -1; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .site-content { grid-template-columns: minmax(0, 1fr) 320px; }
    .site-order-2 .row > .col-6 { flex: 0 0 33.3333%; max-width: 33.3333%; }
    .site-layout #menu :is(.category-grid, .subcategories-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .site-layout #menu .items-list { grid-template-columns: minmax(0, 1fr); }
    .site-layout #booking .datetime-selection { grid-template-columns: minmax(0, 1fr); }
    .site-layout #booking .datetime-selection > :not(.calendar-section) { grid-column: 1; grid-row: auto; }
    .site-layout #booking .datetime-selection .calendar-section { width: 100%; max-width: 380px; margin-inline: auto; }
}

@media (min-width: 1400px) {
    :root { --site-max: 1280px; }
}
