/*
 * The business profile header, made compact.
 *
 * It used to be four stacked bands - the name block (logo bottom-aligned to a top-aligned name), then a divider with 46px of space, then three wide
 * "Find us / Today's hours / Products" cards spread across the whole page, then a row of buttons - about 360-400px on a laptop and 700-790px on a phone
 * before any real content. Now it is one block:
 *
 *   wide screen (992px and up)         [logo] Name  Verified                                   [Call] [WhatsApp] [Request a booking] [Save]
 *                                             category - rating - Open/Closed - badges                       Compare quotes for this service ->
 *                                             Find us Gaborone - ...   Today's hours 08:00-17:00 - See weekly hours
 *   tablet and phone                   [logo] Name  Verified
 *                                             category - rating - Open/Closed - badges
 *                                      Find us ... / Today's hours ...        (one line each)
 *                                      [Save]  Compare quotes ->               (Call / WhatsApp / Book are hidden on a phone: the fixed bar at the bottom has them)
 *
 *   .profile-head             the grid           .profile-head__id    logo + name + the one wrapping line of small facts (.profile-meta)
 *   .profile-facts            where / when / what, one line each, under the name
 *   .profile-primary-actions  buttons, Save and "compare quotes"      .profile-act  the three buttons the phone's bottom bar duplicates
 *
 * Colours come from the --ui-* variables (they switch for dark mode). The selectors start with .profile-header (and #mainContent for the logo) so they win
 * over the older rules in experience.css without !important.
 *
 * TO GO BACK: delete the <link> to this file in resources/views/layouts/main.php (the old stacked look needs resources/views/business/show.php and
 * partials/profile-summary.php from the earlier package - without them the new markup simply shows as plain stacked blocks).
 */

.profile-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 28px; align-items: start; }
/* the summary partial wraps the facts and the actions: take the wrapper out of the layout so they become grid items of .profile-head */
.profile-head > .profile-summary { display: contents; }
.profile-head__id { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.profile-head__text { flex: 1 1 auto; min-width: 0; }
.profile-head__text h1 { line-height: 1.2; }

/* the logo: top-aligned with the name, smaller (84px; 64px on a phone) */
#mainContent .profile-header .biz-logo-lg,
#mainContent .profile-header .biz-logo-placeholder-lg { width: 84px; height: 84px; flex: 0 0 84px; margin-top: 0; border-width: 4px; border-radius: 18px; font-size: 1.45rem; }

/* category, rating, open/closed and the other small facts: ONE wrapping line */
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.profile-meta .badge, .profile-meta .first-review-link, .profile-meta .open-badge-inline { margin: 0; }

/* where, when, what: one line each under the name - no divider, no 40px icon tiles, no wide cards */
.profile-header .profile-facts { display: flex; flex-wrap: wrap; gap: 4px 26px; margin: 2px 0 0; }
.profile-header .profile-facts > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.profile-header .profile-facts > div > i { display: inline-block; flex: 0 0 auto; width: auto; height: auto; background: none; border-radius: 0; font-size: 1.05rem; line-height: 1; color: var(--ui-muted); }
.profile-header .profile-facts span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.profile-header .profile-facts small { color: var(--ui-muted); font-size: .78rem; }
.profile-header .profile-facts strong { color: var(--ui-text); font-size: .95rem; }
.profile-header .profile-facts .fact-note { color: var(--ui-muted); font-size: .8rem; }
.profile-header .profile-facts .fact-note::before { content: "\00B7"; display: inline-block; margin-right: 8px; text-decoration: none; }
.profile-header .profile-facts a.fact-note { display: inline-block; min-height: 24px; padding: 2px 0; color: var(--ui-text); text-decoration: underline; }

/* the buttons, Save and "compare quotes" */
/* tablet and phone: Save and "compare quotes" (and the three buttons on a tablet) flow in one wrapping row */
.profile-header .profile-primary-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; }
.profile-header .profile-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-header .profile-primary-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: 0 0 auto; min-height: 40px; padding: .35rem .85rem; font-size: .84rem; }
.profile-header .profile-save { margin: 0; }
.profile-header .profile-quote-link { flex: 0 1 auto; min-height: 32px; padding: 2px 4px; font-size: .8rem; }

@media (min-width: 992px) {
    /* the right column is only as wide as its buttons (up to 420px, then they wrap); the facts line runs under both columns */
    .profile-head { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id actions" "facts facts"; }
    .profile-head__id { grid-area: id; }
    .profile-header .profile-facts { grid-area: facts; }
    .profile-header .profile-primary-actions { grid-area: actions; flex-direction: column; align-items: flex-end; align-self: start; max-width: 420px; }
    .profile-header .profile-btns { justify-content: flex-end; }
}

/* light mode: Bootstrap's red "Save" text is 4.49:1 on the page background, a hair under the 4.5:1 minimum - a slightly deeper red (the Marketplace page uses the same one) */
:root:not([data-bs-theme="dark"]) .profile-header .profile-save .btn-outline-danger { --bs-btn-color: #b02a37; --bs-btn-border-color: #b02a37; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #b02a37; --bs-btn-hover-border-color: #b02a37; --bs-btn-active-color: #fff; --bs-btn-active-bg: #b02a37; --bs-btn-active-border-color: #b02a37; }

/* a finger needs a bigger target than a mouse pointer: the site's 44px standard on touch screens */
@media (pointer: coarse) {
    .profile-header .profile-primary-actions .btn, .profile-header .profile-quote-link { min-height: 44px; }
    .profile-header .profile-facts a.fact-note { min-height: 44px; display: inline-flex; align-items: center; padding-block: 0; }
}

@media (max-width: 575.98px) {
    #mainContent .profile-header .biz-logo-lg,
    #mainContent .profile-header .biz-logo-placeholder-lg { width: 64px; height: 64px; flex-basis: 64px; border-width: 3px; border-radius: 14px; font-size: 1.15rem; }
    .profile-head__id { gap: 12px; }
    .profile-head__text h1 { font-size: 1.3rem; }
    /* the fixed Call / WhatsApp / Book bar at the bottom of the screen already offers these three */
    .profile-header .profile-primary-actions .profile-act { display: none; }
}
