/* =========================================================================
   Totana a la Carta - Shared desktop layer
   -------------------------------------------------------------------------
   Chrome that every desktop page has in common: the top bar, restaurant
   cards, the search control, the filter dialog and the footer.

   Everything visual lives inside @media (min-width: 1024px); the single
   rule outside it hides desktop-only markup, so the mobile rendering is
   untouched. Load this BEFORE the page-specific desktop stylesheet.
   ========================================================================= */

/* Desktop-only markup is hidden everywhere by default. */
.desktop-only {
    display: none !important;
}

@media (min-width: 1024px) {

    :root {
        --dsk-max: 1240px;
        --dsk-gutter: max(32px, calc((100% - 1240px) / 2));
        --dsk-ink: #1f1b16;
        --dsk-ink-soft: #6b6259;
        --dsk-line: rgba(31, 27, 22, 0.10);
        --dsk-shadow-sm: 0 1px 2px rgba(31, 27, 22, .05), 0 6px 18px rgba(31, 27, 22, .06);
        --dsk-shadow-md: 0 2px 4px rgba(31, 27, 22, .05), 0 16px 40px rgba(31, 27, 22, .12);
    }

    .desktop-only {
        display: block !important;
    }

    html {
        scroll-padding-top: 88px;
    }

    /* ---------------------------------------------------------------------
       1. Top navigation bar
       --------------------------------------------------------------------- */
    .dsk-nav {
        display: block !important;
        position: sticky;
        top: 0;
        z-index: 900;
        background: rgba(249, 243, 238, .82);
        backdrop-filter: saturate(180%) blur(14px);
        -webkit-backdrop-filter: saturate(180%) blur(14px);
        border-bottom: 1px solid var(--dsk-line);
    }

    .dsk-nav--deferred {
        position: sticky;
    }

    .dsk-nav--deferred .dsk-nav-links {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
    }

    .dsk-nav--deferred.is-visible .dsk-nav-links {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }

    .dsk-nav-inner {
        max-width: var(--dsk-max);
        margin: 0 auto;
        padding: 0 32px;
        height: 72px;
        display: flex;
        align-items: center;
        gap: 32px;
    }

    .dsk-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        flex-shrink: 0;
    }

    .dsk-brand img {
        height: 34px;
        width: auto;
    }

    .dsk-brand span {
        font-family: inherit;
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--dsk-ink);
        line-height: 1;
        letter-spacing: -0.01em;
    }

    .dsk-nav-links {
        display: flex;
        align-items: center;
        gap: 4px;
        margin-left: auto;
        min-width: 0;
        flex-wrap: nowrap;
    }

    .dsk-nav-links a {
        position: relative;
        padding: 8px 14px;
        border-radius: 10px;
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--dsk-ink-soft);
        text-decoration: none;
        transition: color .18s ease, background-color .18s ease;
        white-space: nowrap;
    }

    .dsk-nav-links a:hover {
        color: var(--dsk-ink);
        background: rgba(31, 27, 22, .05);
    }

    .dsk-nav-links a.is-active {
        color: var(--dsk-ink);
        font-weight: 600;
        background: rgba(31, 27, 22, .07);
    }

    [data-desktop-menu-nav-pill].is-desktop-active {
        background-color: rgb(243, 164, 44) !important;
        color: #fff !important;
    }

    /* ---------------------------------------------------------------------
       2. Section headings
       --------------------------------------------------------------------- */
    .category-title {
        font-family: inherit;
        font-size: 2.6rem !important;
        line-height: 1.1;
        letter-spacing: -0.02em;
        margin-bottom: .4rem !important;
        color: white !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, .1) !important;
    }

    .section-lede {
        display: block !important;
        max-width: 560px;
        font-size: 1.05rem;
        line-height: 1.55;
        color: white;
    }

    /* Search + filter control */
    .search-container {
        padding: 6px 6px 6px 8px;
        border-radius: 999px;
        box-shadow: var(--dsk-shadow-sm);
        gap: .5rem;
    }

    .search-input {
        border: 0;
        border-radius: 999px;
        padding: .7rem 1rem .7rem 2.5rem;
        color: var(--dsk-ink);
        font-size: .98rem;
    }

    .search-input::placeholder {
        color: #a29a91;
    }

    .search-input:focus {
        border-color: transparent;
    }

    .search-icon {
        left: .9rem;
    }

    .filter-button {
        border: 0;
        border-radius: 999px;
        padding: .7rem 1.1rem;
        background: #f4efe9;
        color: var(--dsk-ink);
        font-weight: 500;
    }

    .filter-button:hover {
        background: #ece5dd;
    }

    .filter-button svg {
        color: var(--dsk-ink);
    }

    /* Restaurant grid */
    .restaurant-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
        gap: 18px;
        max-width: none;
    }

    .restaurant-card {
        align-items: center;
        background: #fff;
        border-radius: 18px;
        padding: 1rem 2.4rem 1rem 1rem;
        box-shadow: var(--dsk-shadow-sm);
        transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s ease;
    }

    .restaurant-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--dsk-shadow-md);
    }

    .restaurant-card::after {
        content: '';
        position: absolute;
        right: 20px;
        top: 50%;
        width: 9px;
        height: 9px;
        border-right: 2px solid #b6ada3;
        border-top: 2px solid #b6ada3;
        transform: translateY(-50%) rotate(45deg) translateX(-4px);
        opacity: 0;
        transition: opacity .2s ease, transform .2s ease;
    }

    .restaurant-card:hover::after {
        opacity: 1;
        transform: translateY(-50%) rotate(45deg) translateX(0);
    }

    .restaurant-logo,
    .promo-badge-container,
    .stories,
    .stories.carousel .story > a > .img {
        width: 76px;
        height: 76px;
    }

    .restaurant-logo {
        border-radius: 12px;
    }

    .restaurant-info {
        height: auto;
        gap: .45rem;
    }

    .restaurant-name {
        font-size: 1.08rem;
        line-height: 1.3;
        color: var(--dsk-ink);
    }

    .restaurant-detail {
        font-size: .82rem;
        color: #7a716a;
        white-space: nowrap;
    }

    .restaurant-details {
        flex-wrap: wrap;
        gap: .35rem .85rem;
    }

    .no-results-message,
    .no-restaurants-message {
        grid-column: 1 / -1;
    }

    .no-results-message,
    .no-restaurants-message,
    .no-events-message {
        color: var(--dsk-ink);
        background: rgba(255, 255, 255, .55);
        border-radius: 18px;
    }

    .no-results-text {
        max-width: 420px;
        font-size: 1.05rem;
        color: var(--dsk-ink);
    }

    /* Event cards without artwork need a calmer gap between their compact
       heading block and the location/time metadata. */
    .event-card-no-image .event-content .event-date-badge + .event-title,
    .event-card-no-image .event-content .event-date-badge-range + .event-title {
        min-height: 88px;
    }

    .event-card-no-image .event-location {
        margin-top: 12px;
    }

    /* ---------------------------------------------------------------------
       5. Footer
       --------------------------------------------------------------------- */
    body > footer {
        padding-top: 4rem !important;
        padding-bottom: 2.5rem !important;
    }

    body > footer .container {
        max-width: var(--dsk-max);
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 4rem;
    }

    .footer-brand {
        display: block !important;
        max-width: 300px;
    }

    .footer-brand img {
        height: 34px;
        width: auto;
        margin-bottom: 12px;
    }

    .footer-brand-name {
        font-family: inherit;
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--dsk-ink);
        margin-bottom: 6px;
    }

    .footer-brand-claim {
        font-size: .9rem;
        line-height: 1.55;
        color: var(--dsk-ink-soft);
    }

    body > footer .grid {
        display: flex;
        justify-content: flex-end;
        gap: 5rem;
        margin-bottom: 0;
        margin-left: auto;
    }

    body > footer .grid > div {
        align-items: flex-start !important;
        gap: .15rem;
    }

    body > footer a {
        font-size: .95rem;
    }

    body > footer .container > .text-center {
        text-align: right !important;
        flex-shrink: 0;
        line-height: 1.6;
    }

    /* ---------------------------------------------------------------------
       6. Filter bottom sheet becomes a centred dialog
       --------------------------------------------------------------------- */
    .bottom-sheet {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: 620px;
        max-height: 76vh;
        border-radius: 20px;
        padding: 2rem;
        transform: translate(-50%, -46%) scale(.97);
        opacity: 0;
        visibility: hidden;
        box-shadow: 0 24px 70px rgba(31, 27, 22, .28);
        transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
    }

    .bottom-sheet.active {
        bottom: auto;
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }

    .filter-chips-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }

    .filter-chip {
        padding: .75rem .5rem;
        border: 1px solid transparent;
    }

    .filter-chip:hover {
        background: #faf7f4;
        border-color: var(--dsk-line);
    }
}

@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
    .dsk-nav--deferred .dsk-nav-links {
        transition: none;
    }
}

/* -------------------------------------------------------------------------
   Narrow desktops (1024-1279px): the full navigation does not fit, so the
   bar tightens up and the optional link drops out.
   ------------------------------------------------------------------------- */
@media (min-width: 1024px) and (max-width: 1279px) {
    .dsk-nav-inner {
        padding: 0 20px;
        gap: 16px;
    }

    .dsk-brand img {
        height: 28px;
    }

    .dsk-brand span {
        font-size: 1.05rem;
    }

    .dsk-nav-links a {
        padding: 8px 9px;
        font-size: .875rem;
    }

    .dsk-nav-optional {
        display: none;
    }

    .restaurant-list {
        grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    }
}
