/* ============================================================
   Browse / search page styles  (css/restaurants.css)
   Depends on the shared tokens in css/main.css
   ============================================================ */

/* ---------- Utility bar (search + filters) ---------- */
.utility-bar {
    position: relative;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 48px;
    isolation: isolate;
    background: transparent;
    border-bottom: none;
}

.utility-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
    max-width: 290px;
    background: rgba(33, 16, 8, 0.92);
    border: 1px solid rgba(242, 238, 227, 0.16);
    border-radius: 10px;
    padding: 10px 18px;
    color: var(--muted);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.search-box:focus-within {
    border-color: var(--amber);
}

.search-box input {
    flex-grow: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--cream);
}

.search-box input::placeholder {
    color: var(--muted);
}

.clear-search[hidden] {
    display: none;
}

.clear-search {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(242, 238, 227, 0.16);
    color: var(--cream);
    cursor: pointer;
    flex-shrink: 0;
}

.clear-search:hover {
    background: rgba(242, 238, 227, 0.22);
}

/* Filter dropdown */
.filter-wrapper {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(33, 16, 8, 0.92);
    border: 1.5px solid rgba(242, 238, 227, 0.16);
    border-radius: 10px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--cream);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--amber);
}

/* Small amber badge showing how many filters are active */
.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--amber);
    color: #1a1207;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.filter-count[hidden] {
    display: none;
}

.arrow-icon {
    display: flex;
    transition: transform 0.25s ease;
}

.filter-btn.active .arrow-icon {
    transform: rotate(180deg);
}

.filter-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-height: min(560px, calc(100vh - 140px));
    overflow-y: auto;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 100;
}

.filter-dropdown.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.filter-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.filter-clear-btn {
    background: transparent;
    border: none;
    color: var(--amber);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.filter-clear-btn:hover {
    text-decoration: underline;
}

.filter-section + .filter-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.filter-title svg {
    color: var(--herb);
    flex-shrink: 0;
}

.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    font-size: 0.9rem;
    color: var(--cream);
    cursor: pointer;
}

.filter-option input {
    accent-color: var(--amber);
    width: 16px;
    height: 16px;
}

/* ---------- Browse area ---------- */
.browse-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 48px 56px 78px 56px;
}

.cuisine-tabs {
    display: flex;
    gap: 9px;
    overflow-x: auto;
    padding-bottom: 14px;
    margin-bottom: 36px;
    border-bottom: 1px solid var(--line);
    /* Swipeable chip strip - hide the scrollbar itself */
    scrollbar-width: none;
}

.cuisine-tabs::-webkit-scrollbar { display: none; }

.view-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 28px;
}

/* ---------- Restaurant cards ---------- */
.restaurant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 28px;
}

.restaurant-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    opacity: 0;
    animation: fadeUp 0.45s ease forwards;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.restaurant-card:hover {
    transform: translateY(-4px) scale(1.01);
}

.restaurant-card .thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.restaurant-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.restaurant-card:hover .thumb img {
    transform: scale(1.05);
}

/* Favourite heart sits top-left of each card image */
.restaurant-card .fav-heart {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    width: 34px;
    height: 34px;
}

.badge-offer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--amber);
    color: #1a1207;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 10px;
}

.restaurant-card .body {
    padding: 20px 22px 24px 22px;
}

.restaurant-card .card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.restaurant-card h3 {
    font-size: 1.06rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-sub {
    font-size: 0.85rem;
    color: var(--cream);
    opacity: 0.85;
    margin-bottom: 3px;
}

.card-sub.muted {
    color: var(--muted);
    opacity: 1;
    font-size: 0.8rem;
}

/* ---------- Empty state & map link ---------- */
.empty-state {
    text-align: center;
    padding: 70px 20px;
    color: var(--muted);
}

.empty-state svg {
    color: var(--amber);
    opacity: 0.6;
    margin: 0 auto 14px auto;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--cream);
    margin-bottom: 6px;
}

.map-cta {
    text-align: center;
    margin-top: 44px;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
    .utility-bar {
        padding: 10px 22px;
    }

    .browse-container {
        padding: 26px 22px 50px 22px;
    }
}

@media (max-width: 576px) {
    .utility-bar { padding: 10px 16px; gap: 8px; }
    .search-box { padding: 8px 13px; }
    .search-box input { font-size: 0.88rem; }
    .filter-btn { padding: 8px 13px; font-size: 0.85rem; }
    .browse-container { padding: 24px 16px 54px 16px; }
    .view-title { font-size: 1.28rem; margin-bottom: 18px; }
    /* Two tidy columns on phones so the list feels app-like, not endless;
       smaller card text with a bit more gap between cards so it breathes */
    .restaurant-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
    .restaurant-card .body { padding: 11px 12px 14px 12px; }
    .restaurant-card h3 { font-size: 0.92rem; }
    .card-sub { font-size: 0.76rem; margin-bottom: 4px; }
    .card-sub.muted { font-size: 0.72rem; }
    .restaurant-card .fav-heart { width: 30px; height: 30px; }
    /* Keep the filter dropdown inside the screen */
    .filter-dropdown { width: min(320px, calc(100vw - 32px)); padding: 18px; }
    .cuisine-tabs { gap: 7px; margin-bottom: 22px; }
}
