/* ============================
   Restaurant Page v1
   ============================ */

.restaurant-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 1.25rem;
}

/* ===== Header ===== */

.restaurant-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.restaurant-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.25rem 0;
}

.restaurant-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.85;
}

.restaurant-meta a {
    color: inherit;
    text-decoration: none;
}

.restaurant-meta a:hover {
    text-decoration: underline;
}

/* ===== Actions ===== */

.restaurant-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.restaurant-actions .order-btn {
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: #111;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

.restaurant-actions .order-btn:hover {
    opacity: 0.9;
}

.restaurant-actions .restaurant-share-btn {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--tw-line-strong);
    border-radius: 999px;
    background: var(--tw-surface-elevated);
    color: var(--tw-text-main);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.restaurant-actions .restaurant-share-btn:hover {
    border-color: var(--tw-accent-cyan);
    background: var(--tw-surface-muted);
}

.restaurant-actions .restaurant-share-btn:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--tw-accent-cyan) 45%, transparent);
    outline-offset: 2px;
}

.restaurant-actions .restaurant-share-btn:disabled {
    cursor: wait;
    opacity: 0.65;
}

/* ===== Description ===== */

.restaurant-description {
    margin: 1.25rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* ===== Hours ===== */

.restaurant-hours {
    margin-bottom: 1.25rem;
}

.restaurant-hours h2 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.restaurant-hours p {
    font-size: 0.9rem;
    opacity: 0.85;
}

/* ===== Menu ===== */

.restaurant-menu {
    margin-top: 1.5rem;
}

.menu-loading {
    opacity: 0.7;
    font-size: 0.95rem;
}

/* ===== Menu Categories ===== */

.menu-category {
    margin-bottom: 2rem;
}

.menu-category h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-transform: capitalize;
}

/* ===== Menu Items ===== */

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.menu-item {
    padding: 0.6rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: baseline;
}

.menu-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.menu-item-title-wrap {
    position: relative;
    padding-right: 2.75rem;
}

.menu-item-title-wrap .tw-favorite-toggle {
    position: absolute;
    top: -4px;
    right: 0;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.menu-item-price {
    font-size: 0.9rem;
    opacity: 0.85;
    white-space: nowrap;
}

.menu-item-desc {
    font-size: 0.85rem;
    opacity: 0.75;
    margin-top: 0.15rem;
    line-height: 1.4;
}

/* ===== Error ===== */

.restaurant-page .error {
    color: #f87171;
    font-size: 0.95rem;
}

/* ============================
   Responsive
   ============================ */

@media (min-width: 768px) {
    .restaurant-header h1 {
        font-size: 2.1rem;
    }

    .restaurant-page {
        padding: 2rem;
    }

    .menu-item-title {
        font-size: 1rem;
    }

    .menu-item-title-wrap {
        padding-right: 2.7rem;
    }

    .menu-item-desc {
        font-size: 0.9rem;
    }
}


.back-to-search {
    display: inline-block;
    font-size: 0.85rem;
    opacity: 0.75;
    margin-bottom: 0.5rem;
    text-decoration: none;
}

.back-to-search:hover {
    opacity: 1;
    text-decoration: underline;
}

.restaurant-badge {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.restaurant-badge.national {
    background: linear-gradient(135deg, #facc15, #fde047);
    color: #111;
}

.restaurant-badge.city {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.menu-item-order {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    white-space: nowrap;
}

.menu-item-order:hover {
    background: rgba(255, 255, 255, 0.15);
}

.menu-controls {
    margin-bottom: 1rem;
}

#menu-search {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #020617;
    color: #e5e7eb;
}

/* Light theme inherits bright inputs instead of the dark shell */
[data-theme="light"] #menu-search {
    background: var(--tw-surface, #ffffff);
    color: var(--color-text, #0f172a);
    border-color: var(--tw-border, rgba(15, 23, 42, 0.18));
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.menu-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.menu-table th,
.menu-table td {
    padding: 0.6rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.menu-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}

.menu-title {
    font-weight: 600;
}

.menu-price {
    white-space: nowrap;
}

.menu-item-order {
    font-size: 0.85rem;
    text-decoration: none;
    color: #38bdf8;
}

.menu-controls.sticky {
    position: sticky;
    top: var(--tw-sticky-offset, 128px);
    z-index: 20;
    background: #020617;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);

    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .menu-controls.sticky {
        grid-template-columns: 1fr auto auto auto;
        align-items: center;
    }
}

.menu-toggle {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.menu-controls select {
    padding: 0.55rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #020617;
    color: #e5e7eb;
}

.menu-controls select option {
    background: #020617;
    color: #e5e7eb;
}

.menu-toggle {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.menu-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.menu-table td:first-child {
    font-weight: 600;
}

.menu-table td:nth-child(3) {
    white-space: nowrap;
    opacity: 0.9;
}

.menu-item-inline-order {
    font-size: 0.72rem;
    color: var(--neo-accent-2);
    text-decoration: none;
    font-weight: 600;
}

.menu-item-inline-order:hover {
    opacity: 1;
}


.result-specials {
    margin-top: 0.35rem;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    font-size: 0.78rem;
    line-height: 1.4;
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.35);
    color: #fde68a;
}

.result-specials strong {
    color: #f97316;
    font-weight: 600;
    margin-right: 0.25rem;
}

/* Back button uses base tokens to keep dark-theme contrast without JS */
.back-results-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.1);
    color: var(--color-text, #f9fafb);
    font: inherit;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
}

/* Anchor-based back buttons should ignore visited link purple states */
.back-results-btn:link,
.back-results-btn:visited {
    color: var(--color-text, #f9fafb);
}

.back-results-btn:hover {
    transform: translateY(-1px);
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.55);
    color: var(--color-text, #fefce8);
}

.back-results-btn:focus-visible {
    outline: 2px solid var(--tw-focus-ring, #22d3ee);
    outline-offset: 2px;
}

.back-results-btn.is-hidden {
    display: none;
}

.restaurant-header-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.restaurant-header-nav .back-results-btn {
    margin-bottom: 0;
}

.restaurant-discover-link {
    text-decoration: none;
}

/* =====================================================
   Phase 1 polish layer: restaurant detail experience
   ===================================================== */
.restaurant-page {
    max-width: 1080px;
    padding: clamp(1rem, 2vw, 2rem);
}

.restaurant-header {
    position: relative;
    padding: clamp(1.15rem, 3vw, 2rem);
    margin-bottom: 1.25rem;
    border: 1px solid var(--tw-premium-border, rgba(226, 232, 240, 0.13));
    border-radius: var(--tw-radius-lg, 18px);
    background:
        linear-gradient(145deg, rgba(249, 115, 22, 0.14), transparent 42%),
        linear-gradient(315deg, rgba(34, 211, 238, 0.09), transparent 46%),
        var(--tw-premium-surface, rgba(15, 23, 42, 0.82));
    box-shadow: var(--tw-premium-shadow, 0 18px 46px rgba(0, 0, 0, 0.42));
}

.restaurant-header h1 {
    max-width: 760px;
    margin-top: 0.2rem;
    font-size: 2.6rem;
    letter-spacing: 0;
}

.restaurant-meta {
    margin-top: 0.55rem;
    gap: 0.55rem;
    opacity: 1;
}

.restaurant-meta address {
    font-style: normal;
}

.restaurant-meta span:not(:empty),
.restaurant-meta address:not(:empty),
.restaurant-meta a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: var(--color-text-muted);
}

.restaurant-actions {
    margin-top: 1rem;
    gap: 0.65rem;
}

.restaurant-actions .order-btn,
.menu-item-inline-order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f97316, #facc15);
    border: 1px solid rgba(250, 204, 21, 0.36);
    color: #111827;
    box-shadow: 0 10px 22px rgba(249, 115, 22, 0.18);
}

.restaurant-description,
.restaurant-hours,
.restaurant-specials {
    padding: 1rem 1.1rem;
    margin: 1rem 0;
    border: 1px solid var(--tw-premium-border, rgba(226, 232, 240, 0.13));
    border-radius: var(--tw-radius-lg, 18px);
    background: var(--tw-premium-surface, rgba(15, 23, 42, 0.82));
    box-shadow: var(--tw-premium-shadow-soft, 0 12px 28px rgba(0, 0, 0, 0.26));
}

.restaurant-description p {
    margin-block: 0;
    white-space: pre-line;
}

.restaurant-description:empty,
.restaurant-hours:empty,
.restaurant-specials:empty {
    display: none;
}

.restaurant-description h2,
.restaurant-hours h2,
.restaurant-specials h2 {
    margin-top: 0;
    color: var(--tw-accent-gold);
    letter-spacing: 0.04em;
}

.restaurant-menu {
    margin-top: 1.25rem;
}

.menu-controls.sticky {
    top: var(--tw-sticky-offset, 128px);
    padding: 0.85rem;
    border: 1px solid var(--tw-premium-border, rgba(226, 232, 240, 0.13));
    border-radius: var(--tw-radius-lg, 18px);
    background: var(--tw-premium-surface-strong, rgba(15, 23, 42, 0.94));
    box-shadow: var(--tw-premium-shadow-soft, 0 12px 28px rgba(0, 0, 0, 0.26));
}

[data-theme="light"] .menu-controls.sticky {
    background: var(--tw-premium-surface-strong, #ffffff);
}

#menu-search,
.menu-controls select {
    min-height: 44px;
    border-radius: var(--tw-radius-sm, 10px);
    border-color: var(--tw-premium-border, rgba(226, 232, 240, 0.13));
    background: var(--tw-premium-surface-strong, rgba(15, 23, 42, 0.94));
    color: var(--color-text);
}

[data-theme="light"] #menu-search,
[data-theme="light"] .menu-controls select,
[data-theme="light"] .menu-controls select option {
    background: #ffffff;
    color: var(--color-text);
}

.menu-category {
    margin-top: 1.15rem;
    padding: 1rem;
    border: 1px solid var(--tw-premium-border, rgba(226, 232, 240, 0.13));
    border-radius: var(--tw-radius-lg, 18px);
    background: var(--tw-premium-surface, rgba(15, 23, 42, 0.82));
    box-shadow: var(--tw-premium-shadow-soft, 0 12px 28px rgba(0, 0, 0, 0.26));
    overflow-x: auto;
}

.menu-category h3 {
    margin-top: 0;
    color: var(--tw-accent-gold);
    border-bottom-color: var(--tw-premium-border, rgba(226, 232, 240, 0.13));
}

.menu-table {
    min-width: 720px;
    border-collapse: separate;
    border-spacing: 0;
}

.menu-table th {
    color: var(--color-text-muted);
}

.menu-table th,
.menu-table td {
    border-bottom-color: var(--tw-premium-border, rgba(226, 232, 240, 0.13));
}

.menu-table tbody tr:hover {
    background: rgba(249, 115, 22, 0.06);
}

.menu-item-title {
    color: var(--color-text);
    font-weight: 800;
}

.menu-item-title-wrap .tw-favorite-toggle {
    width: var(--favorite-size, 40px);
    height: var(--favorite-size, 40px);
}

.back-results-btn {
    min-height: 40px;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--tw-premium-border, rgba(226, 232, 240, 0.13));
}

.menu-debug,
.restaurant-page .error,
.menu-loading {
    padding: 1rem;
    border-radius: var(--tw-radius-md, 14px);
    border: 1px solid var(--tw-premium-border, rgba(226, 232, 240, 0.13));
    background: var(--tw-premium-surface, rgba(15, 23, 42, 0.82));
}

.restaurant-features,
.restaurant-menu-summary {
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--tw-card-border);
    border-radius: 14px;
    background: var(--tw-surface);
}

.restaurant-features h2,
.restaurant-menu-summary h2 {
    margin-top: 0;
}

.restaurant-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.restaurant-feature-list li {
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--tw-line-strong);
    border-radius: 999px;
    color: var(--tw-text-muted);
}

.menu-filter-empty {
    margin-top: 1.15rem;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    text-align: center;
    border-radius: var(--tw-radius-lg, 18px);
    border: 1px solid var(--tw-premium-border, rgba(226, 232, 240, 0.13));
    background: var(--tw-premium-surface, rgba(15, 23, 42, 0.82));
}

.menu-filter-empty__title {
    margin: 0;
    color: var(--color-text);
    font-weight: 800;
}

.menu-filter-empty__body {
    margin: 0.45rem auto 1rem;
    max-width: 46ch;
    color: var(--color-text-muted);
}

.menu-filter-empty__clear {
    min-height: 44px;
}

@media (max-width: 768px) {
    .restaurant-header h1 {
        font-size: 2rem;
    }

    .menu-controls.sticky {
        top: var(--tw-sticky-offset-mobile, 180px);
    }
}

@media (max-width: 768px) {
    .restaurant-page {
        padding-inline: 0.85rem;
    }

    .menu-item-title-wrap {
        padding-right: 3.35rem;
    }

    .restaurant-header,
    .restaurant-description,
    .restaurant-hours,
    .restaurant-specials,
    .menu-category {
        border-radius: 16px;
    }

    .restaurant-actions .order-btn {
        width: 100%;
    }

    .menu-controls.sticky {
        position: relative;
        top: auto;
    }

    .menu-category {
        padding: 0.85rem;
        overflow: visible;
    }

    .menu-table,
    .menu-table tbody,
    .menu-table tr,
    .menu-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .menu-table thead {
        display: none;
    }

    .menu-table tr {
        margin-bottom: 0.85rem;
        padding: 0.85rem;
        border: 1px solid var(--tw-premium-border, rgba(226, 232, 240, 0.13));
        border-radius: var(--tw-radius-md, 14px);
        background: var(--tw-premium-surface-strong, rgba(15, 23, 42, 0.94));
    }

    .menu-table td {
        border-bottom: 0;
        padding: 0.25rem 0;
    }

    .menu-table td:nth-child(2) {
        color: var(--color-text-muted);
        line-height: 1.45;
    }

    .menu-table td:nth-child(3) {
        margin-top: 0.45rem;
        font-weight: 800;
    }

    .menu-table td:nth-child(3)::before {
        content: "Price: ";
        color: var(--color-text-muted);
        font-weight: 600;
    }
}

/* =====================================================
   Sharp-1 precision layer: restaurant detail
   ===================================================== */
.restaurant-page {
    width: min(100%, var(--tw-shell-max-app, 1040px));
    max-width: var(--tw-shell-max-app, 1040px);
    padding: clamp(0.85rem, 1.6vw, 1.55rem);
}

.restaurant-header {
    padding: clamp(1rem, 2.2vw, 1.55rem);
    border-radius: var(--tw-ui-radius-card, var(--tw-radius-lg, 14px));
    background:
        linear-gradient(145deg, rgba(249, 115, 22, 0.055), transparent 44%),
        var(--tw-premium-surface, rgba(15, 23, 42, 0.82));
    border-color: var(--tw-premium-border, rgba(226, 232, 240, 0.16));
    box-shadow: var(--tw-premium-shadow, 0 12px 30px rgba(0, 0, 0, 0.28));
    transition:
        border-color var(--tw-motion-quick, 160ms ease),
        box-shadow var(--tw-motion-quick, 160ms ease);
}

.restaurant-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    line-height: 1.08;
}

.restaurant-meta {
    gap: 0.45rem;
}

.restaurant-meta span:not(:empty),
.restaurant-meta address:not(:empty),
.restaurant-meta a {
    min-height: 28px;
}

.restaurant-actions {
    gap: 0.5rem;
}

.restaurant-actions .order-btn,
.menu-item-inline-order,
.back-results-btn {
    min-height: var(--tw-ui-control-min-height, 40px);
    border-radius: var(--tw-ui-radius-control, var(--tw-radius-md, 10px));
    box-shadow: none;
}

.restaurant-description,
.restaurant-hours,
.restaurant-specials,
.menu-controls.sticky,
.menu-category,
.menu-debug,
.restaurant-page .error,
.menu-loading {
    border-radius: var(--tw-ui-radius-card, var(--tw-radius-md, 10px));
    border-color: var(--tw-premium-border, rgba(226, 232, 240, 0.16));
    box-shadow: var(--tw-premium-shadow-soft, 0 8px 18px rgba(0, 0, 0, 0.18));
}

.restaurant-description,
.restaurant-hours,
.restaurant-specials {
    padding: var(--tw-ui-card-pad-md, 0.82rem) var(--tw-ui-card-pad-lg, 0.95rem);
    margin: 0.82rem 0;
}

.menu-controls.sticky {
    top: var(--tw-sticky-offset, 128px);
    padding: var(--tw-ui-card-pad-sm, 0.68rem);
    gap: var(--tw-ui-gap-sm, 0.55rem);
    grid-template-columns: minmax(16rem, 1fr) minmax(9rem, max-content) minmax(7rem, max-content);
    align-items: center;
    scroll-margin-top: var(--tw-sticky-offset, 128px);
}

#menu-search,
.menu-controls select {
    min-height: var(--tw-ui-control-min-height, 40px);
    border-radius: var(--tw-ui-radius-chip, var(--tw-radius-sm, 8px));
}

.menu-category {
    margin-top: 0.9rem;
    padding: var(--tw-ui-card-pad-md, 0.82rem);
    scroll-margin-top: var(--tw-sticky-offset, 128px);
}

.menu-category h3 {
    margin-bottom: 0.62rem;
    padding-bottom: 0.42rem;
    font-size: 1rem;
}

.menu-table th,
.menu-table td {
    padding: 0.62rem 0.55rem;
}

.menu-table th {
    font-size: 0.72rem;
    letter-spacing: 0.055em;
}

.menu-item-title-wrap {
    gap: 0.42rem;
}

.menu-item-title-wrap .tw-favorite-toggle {
    width: var(--favorite-size, 34px);
    height: var(--favorite-size, 34px);
}

@media (max-width: 768px) {
    .menu-controls.sticky {
        top: var(--tw-sticky-offset-mobile, 180px);
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .restaurant-page {
        padding-inline: 0.75rem;
    }

    .restaurant-header,
    .restaurant-description,
    .restaurant-hours,
    .restaurant-specials,
    .menu-category {
        border-radius: 12px;
    }

    .menu-controls.sticky {
        padding: 0.62rem;
        position: relative;
        top: auto;
    }

    .menu-table tr {
        padding: 0.72rem;
        border-radius: var(--tw-radius-md, 10px);
    }

    .menu-item-title-wrap .tw-favorite-toggle {
        width: 40px;
        height: 40px;
    }
}
