/* ==========================================================================
   Listing Detail — mobile-first tabbed layout
   --------------------------------------------------------------------------
   Standalone stylesheet, loaded per-page by listing-detail.php and
   write-review.php. NOT loaded from includes/header.php.

   Why its own file rather than an addition to style.css:
   sw.js precaches style.css under a CACHE_NAME that is never bumped, so
   repeat visitors keep a stale copy and the ?v= bust does not reach them
   (docs/KNOWN-ISSUES.md §9). A new filename is not in that precache list.

   Loads AFTER style.css and revamp.css, so it wins on cascade order.
   Uses the shared design tokens only — no hardcoded brand colours.

   Everything is one centred column at every width. There is no sidebar and
   no duplicated mobile markup; the old page carried both and reordered them
   with `order:` at 768px.
   ========================================================================== */

/* padding-top: 58px clears the fixed site nav (revamp.css overrides it to a
   38px logo + 10px/10px padding = 58px tall, at every width down to 481px —
   see the .ld-backbar comment below) so the back bar isn't hidden underneath
   it on load. Kept exactly at the nav's height, no extra buffer, since
   .ld-backbar already carries its own vertical padding. */
.ld-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 58px 16px 56px;
}

/* style.css sets a global `img { height: 50px }`; every image below therefore
   needs an explicit height or it collapses. Do not remove these. */

/* ── Back bar ───────────────────────────────────────────────────────────── */
/* top: 58px, not 0 — the site nav is `position: fixed` at z-index 1000, and
   revamp.css (which loads after style.css and wins) pins its logo to 38px
   with 10px/10px padding = 58px tall (32px logo at <=480px, see the media
   query below). Sticking at top:0 — or anything less than the nav's real
   height — tucks this bar behind that fixed nav once the page scrolls, since
   .ld-backbar's z-index (30) loses to it. */
.ld-backbar {
    position: sticky;
    top: 58px;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 0 12px;
    background: var(--bg, #fff);
}

.ld-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: none;
    padding: 4px;
    font-size: 19px;
    font-weight: 700;
    color: var(--text, #0f172a);
    cursor: pointer;
    text-decoration: none;
}

.ld-back-btn i {
    color: var(--blue, #2563eb);
    font-size: 20px;
}

/* ── Hero: thumbnail + primary info ─────────────────────────────────────── */
.ld-hero {
    margin-bottom: 18px;
    position: relative;
}

.ld-hero-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.ld-hero-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ld-hero-top-actions .listing-bookmark {
    position: static !important;
}

.ld-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e8ecf0);
    color: var(--text, #0f172a);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    transition: all .15s ease;
    text-decoration: none;
}

.ld-hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .1);
}

/* Only the heart icon should turn red when saved — the circle stays neutral.
   revamp.css's shared `.listing-bookmark:hover, .listing-bookmark.saved` rule
   fills the whole circle red, and because that fill is tied to :hover too, it
   sticks on mobile after a tap (touch simulates :hover) until the user taps
   elsewhere on the page. This file loads after revamp.css, so an equal-
   specificity override here wins the cascade and neutralizes both states. */
.ld-hero-top-actions .listing-bookmark:hover,
.ld-hero-top-actions .listing-bookmark.saved {
    background: var(--surface, #fff);
    border-color: var(--border, #e8ecf0);
    color: var(--text, #0f172a);
}

.ld-hero-btn.saved i {
    color: #ef4444;
}

.ld-hero-media {
    position: relative;
    flex: 0 0 35%;
    min-width: 130px;
    max-width: 220px;
    min-height: 190px;
    aspect-ratio: 3 / 4;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-alt, #f1f5f9);
    cursor: pointer;
    border: 1px solid var(--border, #e8ecf0);
    padding: 0;
}

.ld-hero-media img,
.ld-hero-media .listing-placeholder-modern {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* Small variant: thumbnail pinned to the hero's left corner, sized to its
   own content instead of stretching to match the text column's height.
   Compound selector so it beats the base .ld-hero-media's max-width/
   flex-basis overrides in the responsive blocks further down, regardless
   of source order. */
.ld-hero-media.ld-hero-media--sm {
    flex: 0 0 96px;
    align-self: flex-start;
    min-width: 0;
    max-width: 96px;
    min-height: 0;
    width: 96px;
    height: 96px;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
}

.ld-hero-media--sm .ld-hero-count {
    left: 5px;
    bottom: 5px;
    padding: 2px 6px;
    font-size: 9.5px;
    gap: 3px;
    border-radius: 6px;
}

.ld-hero-count {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    pointer-events: none;
}

.ld-hero-info {
    flex: 1;
    min-width: 0;
}

/* ── Badge / chip rows ──────────────────────────────────────────────────── */
.ld-chip-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ld-chip-row::-webkit-scrollbar {
    display: none;
}

.ld-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.5;
    flex-shrink: 0;
}

.ld-chip--24x7 {
    background: rgba(239, 68, 68, .1);
    color: #dc2626;
}

.ld-chip--open {
    background: rgba(67, 182, 73, .12);
    color: #15803d;
}

.ld-chip--closed {
    background: rgba(239, 68, 68, .1);
    color: #dc2626;
}

.ld-chip--trusted {
    background: rgba(245, 158, 11, .12);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, .3);
}

.ld-chip--verified {
    background: rgba(43, 125, 233, .1);
    color: var(--blue, #2563eb);
    border: 1px solid rgba(43, 125, 233, .28);
}

.ld-title {
    font-size: clamp(18px, 5vw, 27px);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--text, #0f172a);
    margin: 0 0 6px;
}

/* Hero heading: smaller, fixed size, never truncated with an ellipsis.
   Compound selector (two classes) so its specificity beats the .ld-title
   font-size overrides in the responsive blocks further down, regardless of
   source order. */
.ld-title.ld-title--hero {
    font-size: 1.2rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    cursor: default;
}

.ld-subtitle {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary, #5a6b80);
}

.ld-divider {
    border: 0;
    border-top: 1px solid var(--border, #e8ecf0);
    margin: 14px 0;
}

/* ── Rating ─────────────────────────────────────────────────────────────── */
.ld-rating-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ld-rating-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #15803d;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.ld-rating-chip i {
    font-size: 11px;
}

.ld-rating-count {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--blue, #2563eb);
}

/* ── Address (collapsible) ──────────────────────────────────────────────── */
.ld-addr-wrap {
    margin-bottom: 4px;
}

.ld-distance-chip {
    color: var(--blue, #2563eb);
    font-weight: 700;
}

.ld-addr-dot {
    margin: 0 6px;
    color: var(--text-muted, #94a3b8);
    font-weight: 400;
}

.ld-addr-panel {
    margin: 2px 0 4px 29px;
    color: var(--text-secondary, #5a6b80);
    font-size: 14px;
    line-height: 1.5;
}

.ld-addr-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 0 29px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--blue, #2563eb);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

.ld-addr-caret {
    font-size: 11px;
    transition: transform .2s ease;
}

.ld-addr-toggle[aria-expanded="true"] .ld-addr-caret {
    transform: rotate(90deg);
}

/* ── Hours: boxed card ───────────────────────────────────────────────────── */
.ld-hours-card {
    background: var(--bg-alt, #f1f5f9);
    border-radius: 12px;
    padding: 2px 12px;
    margin-bottom: 8px;
}

/* ── Meta rows (address / hours) ────────────────────────────────────────── */
.ld-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 12px;
}

.ld-meta-row {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    width: 100%;
    padding: 5px 0;
    background: none;
    border: 0;
    text-align: left;
    font: inherit;
    color: var(--text, #0f172a);
    font-size: 15px;
}

.ld-meta-row > i:first-child {
    flex: 0 0 18px;
    margin-top: 2px;
    color: var(--text-muted, #94a3b8);
    font-size: 15px;
}

.ld-meta-text {
    flex: 1;
    min-width: 0;
}

.ld-meta-text--truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Mobile: truncate address initially */
@media (max-width: 699px) {
    .ld-meta-text--truncate {
        max-width: 100%;
    }

    .ld-meta-text--truncate.expanded {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}

/* Desktop: always show full address */
@media (min-width: 700px) {
    .ld-meta-text--truncate {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        cursor: default;
    }
}

/* Hours row is a disclosure button */
button.ld-meta-row {
    cursor: pointer;
}

.ld-hours-status {
    font-weight: 700;
}

.ld-hours-status.open { color: #15803d; }
.ld-hours-status.closed { color: #dc2626; }

.ld-hours-caret {
    flex: 0 0 auto;
    margin-top: 3px;
    color: var(--text-muted, #94a3b8);
    transition: transform .2s ease;
}

button.ld-meta-row[aria-expanded="true"] .ld-hours-caret {
    transform: rotate(180deg);
}

/* Anchor for the overlaying panel below. */
.ld-hours-wrap {
    position: relative;
}

/* Overlays the rows beneath it rather than pushing them down, so opening the
   schedule doesn't reflow the rest of the card.
   z-index 25 sits above the sticky .ld-tabs (20) — an equal value loses to it
   on DOM order — but below .ld-backbar (30), which should stay on top.
   Background must be --bg, not --surface: revamp.css redefines --surface as a
   translucent glass fill (rgba(255,255,255,.70)), which the rows show through.
   --bg is opaque in all four themes and is what .ld-tabs itself uses. */
.ld-hours-panel {
    position: absolute;
    top: 100%;
    left: 29px;
    right: 0;
    z-index: 25;
    margin: 2px 0 0;
    padding: 10px 14px;
    border: 1px solid var(--border, #e8ecf0);
    border-radius: 12px;
    background: var(--bg, #fff);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
}

.ld-hours-panel[hidden] {
    display: none;
}

.ld-hours-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--border, #e8ecf0);
}

.ld-hours-row:last-child {
    border-bottom: 0;
}

.ld-hours-row.is-today {
    font-weight: 700;
    color: var(--blue, #2563eb);
}

.ld-hours-row.is-closed .ld-hours-time {
    color: var(--text-muted, #94a3b8);
}

.ld-hours-day em {
    font-style: normal;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--blue, #2563eb);
}

.ld-hours-time {
    text-align: right;
    color: var(--text-secondary, #5a6b80);
}

.ld-hours-time span {
    display: block;
}

.ld-hours-247 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.ld-hours-247 i {
    font-size: 20px;
    color: var(--green, #43b649);
}

/* ── Action buttons ─────────────────────────────────────────────────────── */
/* Fixed 2-column grid, label always visible (icon + text) at every width —
   Call/WhatsApp/Directions/Book, plus Promote/Edit for owners flow into the
   same grid. Claim/Pending are visually distinct (dashed banner) and live
   outside this grid — see .ld-action-claim below. */
.ld-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

/* Owners get Promote + Edit added to the grid (up to 6 items). 
   Use 2 columns on very small mobile to prevent text overflow, 
   and 3 columns on slightly larger screens. */
.ld-actions-grid--tri {
    grid-template-columns: 1fr 1fr;
}

@media (min-width: 420px) {
    .ld-actions-grid--tri {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.ld-actions-grid--tri .ld-action-label {
    font-size: 13px;
}

.ld-actions-grid--tri .ld-action i {
    font-size: 1.15em;
}

.ld-actions-grid--tri .ld-action--call i,
.ld-actions-grid--tri .ld-action--wa i,
.ld-actions-grid--tri .ld-action--dir i {
    font-size: 1.5em;
}

/* Non-owners only ever see 4 items (Call/WhatsApp/Directions/Book) — one row
   of 4, icon-only for a clean toolbar look. Book keeps its "Book" label
   since a calendar icon alone isn't self-explanatory. */
.ld-actions-grid:not(.ld-actions-grid--tri) {
    grid-template-columns: repeat(4, 1fr);
}

.ld-actions-grid:not(.ld-actions-grid--tri) .ld-action {
    padding: 10px 2px;
    flex-direction: column;
    gap: 6px;
}

.ld-actions-grid:not(.ld-actions-grid--tri) .ld-action-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.ld-actions-grid:not(.ld-actions-grid--tri) .ld-action i {
    font-size: 1.35em;
}

.ld-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 10px;
    border-radius: 14px;
    border: 1px solid var(--border, #e8ecf0);
    background: var(--surface, #fff);
    color: var(--text, #0f172a);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .14s, box-shadow .14s;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ld-action i {
    color: var(--blue, #2563eb);
}

.ld-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.ld-action--call {
    background: var(--blue, #2563eb);
    border-color: transparent;
    color: #fff;
}

.ld-action--wa {
    background: #25d366;
    border-color: transparent;
    color: #fff;
}

.ld-action--promote {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: transparent;
    color: #fff;
}

.ld-action--call i,
.ld-action--wa i,
.ld-action--promote i {
    color: #fff;
}

.ld-action[disabled] {
    opacity: .65;
    cursor: default;
}

/* Call/WhatsApp/Directions icons a little bigger than the other action
   buttons' icons — em-based so it scales with .ld-action's own font-size. */
.ld-action--call i,
.ld-action--wa i,
.ld-action--dir i {
    font-size: 1.35em;
}

/* Claim / claim-pending: a distinct dashed banner below the grid rather than
   another grid cell. */
.ld-action-claim {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    margin-bottom: 12px;
    border: 2px dashed rgba(37, 99, 235, .4);
    border-radius: 14px;
    background: rgba(37, 99, 235, .04);
    color: var(--blue, #2563eb);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.ld-action-claim[disabled] {
    opacity: .65;
    cursor: default;
}

/* ── Write-a-review CTA ─────────────────────────────────────────────────── */
/* Stays one row at every width — text shrinks/ellipsizes and the button
   swaps to a short label (.ld-review-cta-btn-short) instead of dropping
   below the text. Widens back out to the full label at 700px+ — see below. */
.ld-review-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    margin-bottom: 26px;
    border-radius: 14px;
    background: rgba(43, 125, 233, .06);
    border: 1px solid rgba(43, 125, 233, .14);
}

.ld-review-cta-text {
    flex: 1;
    min-width: 0;
}

.ld-review-cta-text strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ld-review-cta-text span {
    display: block;
    font-size: 12px;
    color: var(--text-secondary, #5a6b80);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ld-review-cta-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 11px;
    background: var(--blue, #2563eb);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.ld-review-cta-btn-full {
    display: none;
}

/* ── Tab bar ────────────────────────────────────────────────────────────── */
.ld-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: stretch;
    gap: 2px;
    border-bottom: 1px solid var(--border, #e8ecf0);
    background: var(--bg, #fff);
    margin: 0 -16px 22px;
    padding: 0 16px;
}

/* All tabs share the row equally and shrink with an ellipsis fallback (flex:
   1 1 0 + min-width:0) so the bar never needs to scroll on mobile, even with
   the owner-only QR tab added — that one stays icon-sized (flex: 0 0 auto)
   since it has no label to shrink. Widens back out to comfortable fixed-size
   tabs at 700px+ — see below. */
.ld-tab {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    padding: 12px 4px;
    border: 0;
    background: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary, #5a6b80);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.ld-tab[aria-selected="true"] {
    color: var(--blue, #2563eb);
    font-weight: 700;
}

.ld-tab[aria-selected="true"]::after {
    content: '';
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--blue, #2563eb);
}

.ld-tab--qr {
    flex: 0 0 auto;
    font-size: 17px;
    padding: 10px 12px;
}

.ld-panel[hidden] {
    display: none;
}

/* ── Cards inside panels ────────────────────────────────────────────────── */
.ld-card {
    padding: 18px;
    margin-bottom: 20px;
    border-radius: 14px;
    border: 1px solid var(--border, #e8ecf0);
    background: var(--surface, #fff);
}

.ld-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 12px;
}

.ld-card-title i {
    color: var(--blue, #2563eb);
}

.ld-about p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary, #5a6b80);
    margin: 0;
}

/* Map card renders as a single flush visual (pin + address + CTA overlaid on
   the live embed) rather than an iframe with a heading and button underneath —
   pointer-events are disabled on the iframe since this is a preview, not a
   pannable widget; "View Full Map" is the real interactive escape hatch. */
.ld-map {
    padding: 0;
    overflow: hidden;
}

.ld-map-visual {
    position: relative;
    width: 100%;
    height: 170px;
    overflow: hidden;
}

.ld-map-visual iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
    filter: grayscale(.35) contrast(.92) brightness(1.08);
}

.ld-map-overlay-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, .92), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.ld-map-addr {
    font-size: 13px;
    font-weight: 700;
    color: var(--text, #0f172a);
    line-height: 1.3;
    max-width: 60%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ld-map-city {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary, #5a6b80);
    white-space: nowrap;
    flex-shrink: 0;
}

.ld-map-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    pointer-events: none;
}

.ld-map-pin .fa-location-dot {
    font-size: 40px;
    color: #ef4444;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25));
}

.ld-map-pin .fa-plus {
    position: absolute;
    top: 32%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    color: #fff;
}

.ld-map-cta {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--blue, #2563eb);
    color: var(--blue, #2563eb);
    font-size: 12.5px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
}

.ld-map-cta i {
    font-size: 12px;
}

/* ── Section header with a "View all" ───────────────────────────────────── */
.ld-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.ld-section-head h3 {
    font-size: 19px;
    font-weight: 800;
    margin: 0;
}

.ld-viewall {
    border: 0;
    background: none;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--blue, #2563eb);
    cursor: pointer;
}

/* ── Reviews ────────────────────────────────────────────────────────────── */
.ld-reviews-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 8px;
    margin-bottom: 22px;
}

.ld-reviews-strip .ld-review {
    flex: 0 0 264px;
    scroll-snap-align: start;
}

.ld-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ld-review {
    padding: 15px;
    border-radius: 13px;
    border: 1px solid var(--border, #e8ecf0);
    background: var(--surface, #fff);
}

.ld-review-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}

.ld-review-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue, #2563eb);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.ld-review-who {
    flex: 1;
    min-width: 0;
}

.ld-review-name {
    font-size: 14.5px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ld-review-date {
    font-size: 12.5px;
    color: var(--text-muted, #94a3b8);
}

.ld-review-stars {
    font-size: 14px;
    letter-spacing: 1px;
    color: #d1d5db;
    margin-bottom: 7px;
}

.ld-review-stars .on {
    color: #f59e0b;
}

.ld-review-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary, #5a6b80);
    margin: 0;
}

.ld-review-delete {
    flex-shrink: 0;
    border: 0;
    background: none;
    padding: 6px;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
}

.ld-review-delete:hover {
    color: var(--danger, #ef4444);
}

.ld-empty {
    padding: 26px 16px;
    text-align: center;
    font-size: 14.5px;
    color: var(--text-muted, #94a3b8);
}

/* ── Photos tab ─────────────────────────────────────────────────────────── */
.ld-photos {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
}

.ld-photo {
    flex: 0 0 82%;
    max-width: 520px;
    scroll-snap-align: center;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-alt, #f1f5f9);
}

.ld-photo img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Doctors ────────────────────────────────────────────────────────────── */
.ld-doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    gap: 12px;
}

.ld-doctor-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 16px 10px;
    border-radius: 13px;
    border: 1px solid var(--border, #e8ecf0);
    background: var(--surface, #fff);
    text-decoration: none;
    text-align: center;
    color: var(--text, #0f172a);
}

.ld-doctor-photo {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(43, 125, 233, .1);
    color: var(--blue, #2563eb);
    font-size: 22px;
}

.ld-doctor-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 58px;
    object-fit: cover;
}

.ld-doctor-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.ld-doctor-spec {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

.ld-doctors-nudge {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px;
    border-radius: 13px;
    background: rgba(43, 125, 233, .06);
    border: 1px dashed rgba(43, 125, 233, .3);
    font-size: 14px;
}

.ld-doctors-nudge i {
    color: var(--blue, #2563eb);
    font-size: 18px;
}

.ld-doctors-nudge a {
    margin-left: auto;
    font-weight: 600;
    color: var(--blue, #2563eb);
}

/* ── QR tab (owner only) ────────────────────────────────────────────────── */
.ld-qr-card {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    padding: 22px;
    border-radius: 16px;
    border: 1px solid var(--border, #e8ecf0);
    background: var(--surface, #fff);
}

.ld-qr-canvas {
    flex: 0 0 auto;
    width: 178px;
    height: 178px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 12px;
    background: #fff;
}

.ld-qr-canvas img,
.ld-qr-canvas canvas {
    width: 100%;
    height: auto;
    max-height: 178px;
}

.ld-qr-locked {
    flex: 0 0 auto;
    width: 178px;
    height: 178px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    background: var(--bg-alt, #f1f5f9);
    border: 2px dashed var(--border, #e8ecf0);
}

.ld-qr-lock-icon {
    font-size: 34px;
    color: var(--text-muted, #94a3b8);
}

.ld-qr-lock-price {
    font-size: 21px;
    font-weight: 800;
    color: var(--text, #0f172a);
}

.ld-qr-info {
    flex: 1;
    min-width: 220px;
}

.ld-qr-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(67, 182, 73, .12);
    color: #15803d;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.ld-qr-badge--locked {
    background: rgba(245, 158, 11, .13);
    color: #b45309;
}

.ld-qr-info h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
}

.ld-qr-info p {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary, #5a6b80);
    margin: 0 0 14px;
}

.ld-qr-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ld-qr-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid var(--border, #e8ecf0);
    background: var(--surface, #fff);
    color: var(--text, #0f172a);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.ld-qr-btn--primary,
.ld-qr-btn--pay {
    background: var(--blue, #2563eb);
    border-color: transparent;
    color: #fff;
}

/* ── Write-review page (write-review.php) ───────────────────────────────── */
.wr-page {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 16px 56px;
}

.wr-listing {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border, #e8ecf0);
    background: var(--surface, #fff);
    margin-bottom: 22px;
}

.wr-listing img {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 11px;
    object-fit: cover;
}

.wr-listing-name {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}

.wr-listing-addr {
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
}

.wr-field {
    margin-bottom: 20px;
}

.wr-label {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    margin-bottom: 9px;
}

.wr-stars {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wr-star {
    border: 0;
    background: none;
    padding: 2px;
    font-size: 36px;
    line-height: 1;
    color: #d1d5db;
    cursor: pointer;
    transition: transform .12s;
}

.wr-star.on {
    color: #f59e0b;
}

.wr-star:hover {
    transform: scale(1.12);
}

.wr-star-label {
    margin-left: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
}

.wr-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.wr-chip {
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border, #e8ecf0);
    background: var(--surface, #fff);
    color: var(--text-secondary, #475569);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background .12s, border-color .12s, color .12s;
}

.wr-chip:hover {
    border-color: var(--blue, #2563eb);
}

.wr-chip.on {
    background: var(--blue, #2563eb);
    border-color: var(--blue, #2563eb);
    color: #fff;
}

.wr-textarea {
    width: 100%;
    min-height: 150px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border, #e8ecf0);
    background: var(--surface, #fff);
    color: var(--text, #0f172a);
    font: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
}

.wr-textarea:focus {
    outline: none;
    border-color: var(--blue, #2563eb);
    box-shadow: 0 0 0 3px rgba(43, 125, 233, .14);
}

.wr-count {
    display: block;
    margin-top: 6px;
    text-align: right;
    font-size: 12.5px;
    color: var(--text-muted, #94a3b8);
}

.wr-submit {
    width: 100%;
    padding: 15px;
    border: 0;
    border-radius: 12px;
    background: var(--blue, #2563eb);
    color: #fff;
    font-size: 15.5px;
    font-weight: 700;
    cursor: pointer;
}

.wr-submit:hover {
    filter: brightness(1.06);
}

.wr-error {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 11px;
    background: rgba(239, 68, 68, .09);
    border: 1px solid rgba(239, 68, 68, .25);
    color: #b91c1c;
    font-size: 14px;
}

.wr-note {
    margin-top: 14px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted, #94a3b8);
}

/* ── Dark theme ─────────────────────────────────────────────────────────── */
[data-theme="dark"] .ld-backbar,
[data-theme="dark"] .ld-tabs {
    background: var(--bg, #0b1220);
}

[data-theme="dark"] .ld-hero-count {
    background: rgba(0, 0, 0, .8);
}

[data-theme="dark"] .ld-review-stars,
[data-theme="dark"] .wr-star {
    color: #3f4a5a;
}

[data-theme="dark"] .ld-qr-canvas {
    background: #fff;
}

[data-theme="dark"] .ld-chip--closed {
    background: rgba(239, 68, 68, .16);
}

/* ── Wider screens ──────────────────────────────────────────────────────── */
@media (min-width: 700px) {
    .ld-hero-media {
        max-width: 240px;
    }

    .ld-title {
        font-size: 32px;
    }

    .ld-tabs {
        gap: 4px;
    }

    .ld-tab {
        flex: 0 0 auto;
        padding: 15px 14px;
        font-size: 15px;
    }

    .ld-tab--qr {
        padding: 12px 14px;
        font-size: 19px;
    }

    .ld-review-cta {
        gap: 14px;
        padding: 16px;
    }

    .ld-review-cta-text strong {
        font-size: 15.5px;
    }

    .ld-review-cta-text span {
        font-size: 13px;
    }

    .ld-review-cta-btn {
        gap: 8px;
        padding: 13px 18px;
        font-size: 14.5px;
    }

    .ld-review-cta-btn-full {
        display: inline;
    }

    .ld-review-cta-btn-short {
        display: none;
    }

    .ld-map-visual {
        height: 240px;
    }

    .ld-map-addr {
        font-size: 14.5px;
    }

    .ld-map-city {
        font-size: 13.5px;
    }

    .ld-map-pin .fa-location-dot {
        font-size: 48px;
    }

    .ld-map-pin .fa-plus {
        font-size: 15px;
    }

    .ld-map-cta {
        padding: 10px 18px;
        font-size: 13.5px;
    }

    .ld-photo {
        flex-basis: 46%;
    }
}

@media (max-width: 460px) {
    /* revamp.css shrinks the nav logo to 32px below 480px, so the fixed nav
       itself is only ~52px tall here (vs. 58px above that width). */
    .ld-page {
        padding-top: 52px;
    }

    .ld-backbar {
        top: 52px;
    }

    .ld-hero-top {
        gap: 13px;
    }

    .ld-hero-media {
        flex-basis: 36%;
    }

    .ld-title {
        font-size: 23px;
    }

    .ld-qr-canvas,
    .ld-qr-locked {
        margin: 0 auto;
    }
}

/* ── Listing title: one line on mobile, tap to reveal ───────────────────── */
/* Mirrors the address row. Scoped to a modifier so write-review.php's
   .ld-title heading is unaffected, and kept after the 460px block above,
   which also sets .ld-title font-size. */
@media (max-width: 699px) {
    /* .ld-title--truncate is no longer applied in markup (the hero heading
       uses .ld-title--hero instead, which never truncates) — kept only in
       case another page opts back into the old one-line-with-ellipsis title. */
    .ld-title--truncate {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        cursor: pointer;
    }

    .ld-title--truncate.expanded {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}

/* --- Photo Carousel Modal --- */
.ld-carousel-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 999999999; display: none; align-items: center; justify-content: center; }
.ld-carousel-modal.active { display: flex; }
.ld-carousel-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.92); cursor: pointer; }
.ld-carousel-content { position: relative; max-width: 100%; width: 100%; height: 100%; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 20px 0; }
.ld-carousel-content img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }

/* Fixed controls so they are independent of the image size */
.ld-carousel-close { position: absolute; top: 15px; right: 20px; background: rgba(0,0,0,0.5); border: none; color: #fff; font-size: 26px; cursor: pointer; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 100001; transition: background 0.2s; }
.ld-carousel-close:hover { background: rgba(0,0,0,0.8); }

.ld-carousel-prev, .ld-carousel-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); border: none; color: #fff; font-size: 20px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 50%; backdrop-filter: blur(4px); transition: background 0.2s; z-index: 100001; }
.ld-carousel-prev:hover, .ld-carousel-next:hover { background: rgba(0,0,0,0.8); }
.ld-carousel-prev { left: 15px; }
.ld-carousel-next { right: 15px; }

.ld-carousel-counter { position: absolute; top: 25px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px; z-index: 100001; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }

@media (max-width: 768px) {
    .ld-carousel-prev { left: 10px; }
    .ld-carousel-next { right: 10px; }
    .ld-carousel-close { right: 10px; top: 10px; }
    .ld-carousel-counter { top: 20px; }
}

.ld-photo img { cursor: pointer; }
