/* ParmWorld - Italian-inspired design */

:root {
    --red: #8B1A1A;
    --red-light: #A52A2A;
    --cream: #FFF8F0;
    --cream-dark: #F5E6D3;
    --gold: #D4A843;
    --green: #2D5016;
    --green-light: #3A6B1E;
    --text: #2C1810;
    --text-light: #6B5B4F;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(44, 24, 16, 0.12);
    --shadow-lg: 0 4px 20px rgba(44, 24, 16, 0.15);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
    padding: 0.75rem 1rem;
    background: var(--red);
    color: var(--white);
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    left: 0.75rem;
    top: 0.75rem;
}

/* Hero / Header */
.hero {
    background: linear-gradient(135deg, var(--red) 0%, var(--red-light) 100%);
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.logo {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

h1.tagline,
.tagline {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

h1.results-heading,
.results-heading {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.98);
    margin-top: 0.35rem;
    line-height: 1.35;
}

/* Favorites button in header */
.favorites-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: var(--white);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.favorites-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.favorites-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--gold);
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 700;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Container */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
}

/* Search Section */
.search-section {
    position: relative;
    padding: 2rem 0 1rem;
}

/* Protein selector */
.protein-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.protein-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.6rem 1.4rem;
    min-height: 44px;
    border: 2px solid var(--red);
    background: var(--white);
    color: var(--red);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.protein-btn:hover {
    background: var(--cream-dark);
}

.protein-btn.active {
    background: var(--red);
    color: var(--white);
}

/* Mode selector (All / Dine In / Order Out) */
.mode-selector {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.mode-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.45rem 1.1rem;
    min-height: 44px;
    border: 2px solid var(--green);
    background: var(--white);
    color: var(--green);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    background: #eaf2e3;
}

.mode-btn.active {
    background: var(--green);
    color: var(--white);
}

/* Search bar */
.search-bar {
    display: flex;
    gap: 0;
    max-width: 560px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    overflow: hidden;
}

.geo-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 48px;
    background: var(--white);
    border: 2px solid var(--cream-dark);
    border-right: none;
    border-radius: var(--radius) 0 0 var(--radius);
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
    flex-shrink: 0;
}

.geo-btn:hover {
    color: var(--red);
    background: var(--cream);
}

.geo-btn.active {
    color: var(--green);
    background: #eaf2e3;
}

.geo-btn.loading {
    animation: pulse 1s ease infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

#location-input {
    flex: 1;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid var(--cream-dark);
    border-right: none;
    border-left: none;
    outline: none;
    transition: border-color 0.2s;
    min-width: 0;
}

#location-input:focus {
    border-color: var(--gold);
}

#search-btn {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.9rem 1.8rem;
    background: var(--green);
    color: var(--white);
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

#search-btn:hover {
    background: var(--green-light);
}

#search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Autocomplete dropdown */
.autocomplete-dropdown {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 560px;
    background: var(--white);
    border: 1px solid var(--cream-dark);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    padding: 0.7rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    border-bottom: 1px solid var(--cream);
}

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

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--cream);
}

.autocomplete-main {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
}

.autocomplete-secondary {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* Filters panel */
.filters-panel {
    max-width: 560px;
    margin: 0.85rem auto 0;
}

.filters-toggle {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--white);
    border: 1.5px solid var(--cream-dark);
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    min-height: 44px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filters-toggle:hover {
    border-color: var(--gold);
}

.filters-toggle[aria-expanded="true"] {
    border-radius: 12px 12px 0 0;
    border-bottom-color: transparent;
    box-shadow: none;
}

.filters-toggle-label {
    font-size: 0.88rem;
    font-weight: 600;
}

.filters-toggle-hint {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55%;
}

.filters-chevron {
    flex-shrink: 0;
    color: var(--text-light);
    transition: transform 0.2s;
}

.filters-toggle[aria-expanded="true"] .filters-chevron {
    transform: rotate(180deg);
}

.advanced-options {
    max-width: 560px;
    margin: 0 auto;
    padding: 0.85rem 1rem 1rem;
    background: var(--white);
    border: 1.5px solid var(--cream-dark);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow);
}

.advanced-options.hidden {
    display: none;
}

.filter-block {
    padding: 0.65rem 0;
}

.filter-block + .filter-block {
    border-top: 1px solid var(--cream-dark);
}

.filter-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.filter-block-head label,
.filter-block-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
    margin: 0 0 0.55rem;
}

.filter-block-head label {
    margin-bottom: 0;
}

.filter-value-pill {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--red);
    background: rgba(139, 26, 26, 0.08);
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
}

#radius-slider {
    width: 100%;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--red) 0%, var(--red) var(--radius-pct, 20%), var(--cream-dark) var(--radius-pct, 20%), var(--cream-dark) 100%);
    outline: none;
    cursor: pointer;
}

#radius-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--red);
    box-shadow: 0 1px 4px rgba(44, 24, 16, 0.2);
    cursor: pointer;
}

#radius-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--red);
    box-shadow: 0 1px 4px rgba(44, 24, 16, 0.2);
    cursor: pointer;
}

.filter-range-ends {
    display: flex;
    justify-content: space-between;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--text-light);
}

.filter-check {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.55rem 0.35rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
}

.filter-check:hover {
    background: var(--cream);
}

.filter-check input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
}

.filter-check-ui {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.5px solid var(--cream-dark);
    border-radius: 4px;
    background: var(--white);
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}

.filter-check input:checked + .filter-check-ui {
    background: var(--red);
    border-color: var(--red);
}

.filter-check input:checked + .filter-check-ui::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-check input:focus-visible + .filter-check-ui {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.filter-check-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.filter-check-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.filter-check-desc {
    font-size: 0.78rem;
    color: var(--text-light);
    line-height: 1.35;
}

.search-status {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-light);
    min-height: 1.4rem;
}

.search-status.error {
    color: var(--red);
}

/* Sort controls */
.sort-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.sort-label {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 500;
}

.sort-buttons {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.sort-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.45rem 0.9rem;
    min-height: 44px;
    border: 1.5px solid var(--gold);
    background: var(--white);
    color: var(--gold);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: #fdf6e8;
}

.sort-btn.active {
    background: var(--gold);
    color: var(--white);
}

/* View toggle (grid / map) */
.view-toggle {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.view-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    min-height: 44px;
    border: 2px solid var(--red);
    background: var(--white);
    color: var(--red);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.view-btn:hover {
    background: #fef2f2;
}

.card-name-link {
    color: inherit;
    text-decoration: none;
}
.card-name-link:hover {
    text-decoration: underline;
}

.map-unavailable {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-light);
}

/* Map */
.map-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.5rem 0 2rem;
}

.map {
    width: 100%;
    height: 450px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

.map-popup-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: 50px;
    cursor: pointer;
}

.map-popup-btn:hover {
    opacity: 0.85;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    padding: 0.5rem 0 3rem;
}

/* Card fade-in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.35s ease forwards;
    opacity: 0;
}

/* Restaurant Card */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-photo-wrap {
    position: relative;
}

.card-photo {
    width: 100%;
    height: 180px;
    aspect-ratio: 414 / 180;
    object-fit: cover;
    background: var(--cream-dark);
    display: block;
}

.card-photo-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--cream-dark) 0%, var(--cream) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    opacity: 0.5;
}

/* Heart / Favorite button on cards */
.heart-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s;
    z-index: 2;
}

.heart-btn:hover {
    background: var(--white);
    color: var(--red);
}

.heart-btn.active {
    color: var(--red);
}

.card-body {
    padding: 1rem 1.2rem 1.2rem;
}

.card-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

h3.card-name {
    font-size: 1.15rem;
}

.card-address {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gold);
}

.card-rating .stars {
    letter-spacing: -1px;
}

.card-rating .count {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-light);
}

.card-price {
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 600;
}

.card-distance {
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 500;
}

.card-status {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
}

.card-status.open {
    background: #E8F5E9;
    color: #2E7D32;
}

.card-status.closed {
    background: #FFEBEE;
    color: #C62828;
}

/* Service badges */
.card-services {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    min-height: 1.4rem;
}

.service-badge {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    background: var(--cream);
    color: var(--text-light);
    border: 1px solid var(--cream-dark);
}

.service-badge.dinein {
    color: var(--red);
    border-color: var(--red);
    background: #fef2f2;
}

.service-badge.delivery {
    color: #1565C0;
    border-color: #1565C0;
    background: #E3F2FD;
}

.service-badge.takeout {
    color: #E65100;
    border-color: #E65100;
    background: #FFF3E0;
}

/* Card hours */
.card-hours {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

/* Card links */
.card-links {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.card-link {
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.55rem 0.85rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border-radius: 50px;
    transition: opacity 0.2s;
}

.card-link:hover {
    opacity: 0.8;
}

.card-link.maps {
    background: var(--red);
    color: var(--white);
}

.card-link.website {
    background: var(--green);
    color: var(--white);
}

.card-link.phone {
    background: var(--gold);
    color: var(--white);
}

.card-link.menu {
    background: #5C3D2E;
    color: var(--white);
}

.card-verified {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #16a34a;
    color: var(--white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.card-parm-score,
.modal-parm-score {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--red);
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.card-parm-score .platform-count,
.modal-parm-score .platform-count {
    font-weight: 500;
    opacity: 0.9;
}

.card-score-breakdown,
.modal-score-breakdown {
    font-size: 0.72rem;
    color: var(--text-light);
    margin: 0.2rem 0 0.45rem;
    line-height: 1.35;
}

.card-pizza-flag {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}

.card-platform-row,
.modal-platform-row {
    margin-bottom: 0.45rem;
}

.card-platform-ratings,
.modal-platform-ratings {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Context-aware links row (reserve / delivery note) */
.context-links {
    margin-top: 0.35rem;
    align-items: center;
}

.card-link.reserve {
    background: var(--red);
    color: var(--white);
}

.card-link.order {
    background: #fff4e8;
    color: var(--red);
    border: 1px solid var(--cream-dark);
}

.card-link.order:hover {
    background: var(--cream-dark);
}

.delivery-available {
    font-size: 0.78rem;
    color: var(--green);
    font-weight: 500;
    padding: 0.25rem 0;
}

/* Skeleton loading */
.skeleton-card {
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, var(--cream-dark) 25%, var(--cream) 50%, var(--cream-dark) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-photo {
    width: 100%;
    height: 180px;
    border-radius: 0;
}

.skeleton-title {
    height: 1.2rem;
    width: 70%;
    margin-bottom: 0.6rem;
}

.skeleton-text {
    height: 0.85rem;
    width: 90%;
    margin-bottom: 0.45rem;
}

.skeleton-text.short {
    width: 50%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--cream-dark);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No results */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-results h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44, 24, 16, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.hidden {
    display: none;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(44, 24, 16, 0.25);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 1.8rem;
    background: rgba(255,255,255,0.85);
    border: none;
    cursor: pointer;
    color: var(--text);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--cream-dark);
}

.modal-photo {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    border-radius: 12px 12px 0 0;
}

.modal-photo-wrap,
.modal-photo-wrap {
    position: relative;
}

.modal-photo-wrap .modal-photo,
.modal-photo-wrap .modal-photo {
    border-radius: 12px 12px 0 0;
}

.photo-gmaps-mark,
.photo-gmaps-mark,
.gmp-maps-word,
.gmp-maps-word {
    font-family: Inter, Roboto, sans-serif;
    font-style: normal;
    font-weight: 400;
    letter-spacing: normal;
    white-space: nowrap;
}

.photo-gmaps-mark,
.photo-gmaps-mark {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 2;
    background: rgba(255, 255, 255, 0.94);
    color: #1f1f1f;
    font-size: 12px;
    line-height: 1;
    padding: 5px 7px 4px;
    border-radius: 2px;
}

.photo-credit {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.75rem;
    align-items: center;
    padding: 1.6rem 4.5rem 0.45rem 0.7rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.3;
}

.photo-credit a {
    color: #fff;
    text-decoration: underline;
}

.photo-credit-avatar,
.photo-credit-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 0.3rem;
}

.gmp-maps-word,
.gmp-maps-word {
    font-size: 0.75rem;
    color: #5e5e5e;
}

.photo-credit .gmp-maps-word,
.photo-credit .gmp-maps-word {
    color: #fff;
}

.modal-gmaps-attr,
.modal-gmaps-attr,
.gmaps-attribution {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: normal;
    margin: 0.35rem 0 0;
}

.results-disclaimer .gmaps-attribution {
    display: inline;
}

.modal-placeholder {
    height: 200px;
    border-radius: 12px 12px 0 0;
}

/* Photo Gallery */
.modal-gallery {
    position: relative;
}

.gallery-main {
    position: relative;
    overflow: hidden;
}

.gallery-main .modal-photo {
    transition: opacity 0.2s ease;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    border: none;
    font-size: 1.8rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    transition: background 0.2s;
    z-index: 2;
    line-height: 1;
}

.gallery-nav:hover {
    background: var(--white);
}

.gallery-prev { left: 0.5rem; }
.gallery-next { right: 0.5rem; }

.gallery-counter {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    color: var(--white);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
}

.gallery-thumbs {
    display: flex;
    gap: 0.35rem;
    padding: 0.5rem;
    overflow-x: auto;
    background: var(--cream);
}

.gallery-thumb {
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
    border: 2px solid transparent;
}

.gallery-thumb:hover {
    opacity: 0.8;
}

.gallery-thumb.active {
    opacity: 1;
    border-color: var(--red);
}

.modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.modal-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

/* Modal actions (share + favorite) */
.modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.share-bar {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.share-chip {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    background: var(--cream);
    border: 1.5px solid var(--cream-dark);
    border-radius: 50px;
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

a.share-chip:hover,
button.share-chip:hover {
    background: var(--cream-dark);
    color: var(--text);
}

.share-chip.share-x:hover {
    border-color: #111;
    color: #111;
}

.share-chip.share-fb:hover {
    border-color: #1877F2;
    color: #1877F2;
}

.share-chip.share-wa:hover {
    border-color: #25D366;
    color: #128C7E;
}

.share-results-btn {
    margin-left: auto;
}

.share-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    background: var(--cream);
    border: 1.5px solid var(--cream-dark);
    border-radius: 50px;
    cursor: pointer;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

.share-btn:hover {
    background: var(--cream-dark);
    color: var(--text);
}

.heart-btn-modal {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    background: var(--cream);
    border: 1.5px solid var(--cream-dark);
    border-radius: 50px;
    cursor: pointer;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

.heart-btn-modal:hover {
    color: var(--red);
}

.heart-btn-modal.active {
    color: var(--red);
    border-color: var(--red);
    background: #fef2f2;
}

.modal-address {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.modal-distance {
    color: var(--red);
    font-weight: 600;
    font-size: 0.85rem;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.modal-rating {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gold);
}

.modal-rating .stars {
    letter-spacing: -1px;
}

.modal-rating .count {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-light);
}

.modal-services {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.modal-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* Modal sections (Reservations, Order Out, Hours) */
.modal-section {
    border-top: 1px solid var(--cream-dark);
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

.modal-section h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.modal-note {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.5;
}

.hours-list {
    list-style: none;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Favorites panel */
.favorites-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(44, 24, 16, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.favorites-panel.hidden {
    display: none;
}

.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--cream-dark);
}

.favorites-header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    color: var(--text);
}

.favorites-panel-close {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorites-panel-close:hover {
    color: var(--text);
}

.favorites-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.favorites-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 2rem 1rem;
}

.fav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.fav-item:hover {
    background: var(--cream);
}

.fav-photo {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.fav-photo-placeholder {
    width: 56px;
    height: 56px;
    background: var(--cream-dark);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.fav-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-address {
    font-size: 0.78rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-rating {
    font-size: 0.82rem;
    color: var(--gold);
    font-weight: 600;
}

.fav-remove {
    font-size: 1.3rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.fav-remove:hover {
    background: #FFEBEE;
    color: var(--red);
}

/* Search center marker on map */
.search-center-marker {
    background: none;
    border: none;
}

.search-center-dot {
    width: 16px;
    height: 16px;
    background: var(--red);
    border: 3px solid var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.show-more-wrap {
    text-align: center;
    padding: 0.5rem 1rem 2.5rem;
}

.show-more-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--red);
    background: var(--white);
    color: var(--red);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.show-more-btn:hover {
    background: var(--red);
    color: var(--white);
}

/* Ranked map markers tied to result list order */
.map-rank-icon {
    background: none !important;
    border: none !important;
}

.map-rank-marker {
    width: 36px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    filter: drop-shadow(0 2px 3px rgba(44, 24, 16, 0.35));
    pointer-events: auto;
}

.parm-map-overlay {
    position: absolute;
    transform: translate(-50%, -100%);
    cursor: pointer;
    z-index: 1;
}

.search-center-overlay {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.map-rank-num {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--red);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid var(--white);
    line-height: 1;
}

.map-rank-num span {
    transform: rotate(45deg);
    display: block;
}

.map-rank-score {
    margin-top: 2px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--red);
    background: rgba(255, 248, 240, 0.95);
    border-radius: 4px;
    padding: 0 3px;
    line-height: 1.2;
}

/* Results disclaimer */
.results-disclaimer {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 0.4rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    border-top: 1px solid var(--cream-dark);
    margin-top: auto;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--red);
    text-decoration: none;
    font-weight: 500;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-attribution {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.footer-attribution a {
    color: var(--text-light);
}

/* Newsletter digest signup */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.newsletter {
    max-width: 420px;
    margin: 0 auto 1.75rem;
    padding: 1.25rem 1rem;
    background: var(--cream-dark);
    text-align: left;
}

.newsletter h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--red);
    font-size: 1.35rem;
    margin-bottom: 0.35rem;
    text-align: center;
}

.newsletter-lead {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.45;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.newsletter-form input[type="email"],
.newsletter-form input[type="text"],
.newsletter-form select {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid var(--cream);
    background: var(--white);
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
}

.newsletter-form input:focus,
.newsletter-form select:focus {
    outline: none;
    border-color: var(--gold);
}

.newsletter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
}

.newsletter-row-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 520px) {
    .newsletter-row-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.newsletter-row label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.newsletter-btn {
    margin-top: 0.25rem;
    border: none;
    background: var(--red);
    color: var(--white);
    font: inherit;
    font-weight: 600;
    padding: 0.7rem 1rem;
    border-radius: 50px;
    cursor: pointer;
}

.newsletter-btn:hover {
    background: var(--red-light);
}

.newsletter-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.newsletter-status {
    font-size: 0.88rem;
    min-height: 1.2em;
    text-align: center;
}

.newsletter-status.is-ok {
    color: var(--green);
}

.newsletter-status.is-err {
    color: var(--red);
}

.newsletter-note {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    line-height: 1.4;
}

.newsletter-note a {
    color: var(--red);
}

/* SSR / crawlable result list + popular searches */
.ssr-results,
.popular-searches {
    max-width: 720px;
    margin: 1.5rem auto 2rem;
    padding: 0 0.5rem 1rem;
}

.ssr-results.hidden,
.popular-searches.hidden {
    display: none;
}

.ssr-lead,
.popular-searches h2 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--red);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.ssr-list,
.popular-searches-list {
    margin: 0;
    padding-left: 1.25rem;
    color: var(--text);
    line-height: 1.55;
}

.ssr-list li,
.popular-searches-list li {
    margin-bottom: 0.65rem;
}

.ssr-list a,
.popular-searches-list a {
    color: var(--red);
    font-weight: 600;
    text-decoration: none;
}

.ssr-list a:hover,
.popular-searches-list a:hover {
    text-decoration: underline;
}

.ssr-address,
.ssr-meta,
.ssr-note {
    font-size: 0.88rem;
    color: var(--text-light);
}

.ssr-note {
    margin-top: 1rem;
    font-style: italic;
}

.popular-searches-list {
    columns: 1;
}

@media (min-width: 640px) {
    .popular-searches-list {
        columns: 2;
        column-gap: 1.5rem;
    }
}

/* Static pages */
.hero-compact {
    padding: 1.75rem 1.5rem;
}

.logo-link {
    color: inherit;
    text-decoration: none;
}

.page-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3rem;
}

.prose h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2rem;
    color: var(--red);
    margin-bottom: 1rem;
}

.prose h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    margin: 1.75rem 0 0.6rem;
    color: var(--text);
}

.prose p,
.prose li {
    line-height: 1.65;
    margin-bottom: 0.85rem;
    color: var(--text);
}

.prose ul {
    padding-left: 1.25rem;
    margin-bottom: 1rem;
}

.prose a {
    color: var(--red);
}

.ugc-review {
    border-top: 1px solid var(--cream-dark);
    padding: 0.75rem 0;
}
.restaurant-page textarea {
    width: 100%;
    font-family: inherit;
    padding: 0.5rem;
    border: 1px solid var(--cream-dark);
    border-radius: 6px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    .logo {
        font-size: 2.2rem;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .protein-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }

    .mode-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.9rem;
    }

    .search-bar {
        flex-direction: column;
        border-radius: var(--radius);
    }

    .geo-btn {
        width: 100%;
        padding: 0.6rem;
        border: 2px solid var(--cream-dark);
        border-bottom: none;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    #location-input {
        border: 2px solid var(--cream-dark);
        border-bottom: none;
        border-radius: 0;
    }

    #search-btn {
        border-radius: 0 0 var(--radius) var(--radius);
    }

    .autocomplete-dropdown {
        left: 0;
        transform: none;
        max-width: 100%;
    }

    .sort-controls {
        flex-direction: column;
        gap: 0.3rem;
    }

    .map {
        height: 350px;
    }

    .gallery-thumb {
        width: 48px;
        height: 36px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        max-height: 95vh;
        border-radius: 8px;
    }

    .modal-photo {
        height: 180px;
        border-radius: 8px 8px 0 0;
    }
}
