/* ============================================================
   restaurants.css – Restoranlar Sayfası
   ============================================================ */

/* ── HERO ── */
.rest-hero {
    background: #fdfaf7; /* back to a subtle warm/light background */
    padding: 32px 0 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(104, 135, 69, 0.08);
}

.rest-hero::before {
    display: none;
}

.rest-hero__inner {
    position: relative;
    z-index: 1;
}

.rest-hero__title {
    font-size: 32px;
    font-weight: 800;
    color: var(--color-secondary-dark);
    margin: 0 0 8px;
    letter-spacing: -.3px;
}

.rest-hero__subtitle {
    font-size: 15px;
    color: var(--color-muted);
    margin: 0 0 28px;
}

/* ── SEARCH BAR ── */
.rest-search {
    display: flex;
    gap: 10px;
    max-width: 440px; /* narrowed down further from 480px */
    margin: 0 auto;
}

.rest-search__input-wrap {
    flex: 1;
    position: relative;
}

.rest-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--color-muted);
    pointer-events: none;
}

.rest-search__input-wrap input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, .1);
    outline: none;
    transition: box-shadow .2s;
}

.rest-search__input-wrap input:focus {
    box-shadow: 0 4px 24px rgba(104, 135, 69, .3);
}

.rest-search__btn {
    height: 48px;
    padding: 0 28px;
    border-radius: 14px !important;
    font-size: 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── LAYOUT ── */
.rest-content {
    padding: 32px 0 64px;
}

.rest-content__layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    column-gap: 32px;
    align-items: start;
}

.container--wide {
    max-width: 1320px !important; /* wider than standard container (1160px) */
    padding: 0 12px !important; /* halved from standard 24px per side */
    margin: 0 auto;
}

.rest-filters__custom-distance {
    margin-top: 12px;
}

.rest-custom-dist {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(104, 135, 69, 0.2);
    border-radius: 12px;
    padding: 3px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.rest-custom-dist:focus-within {
    border-color: var(--color-primary);
    background: #fff;
    box-shadow: 0 4px 14px rgba(104, 135, 69, 0.12);
}

.rest-custom-dist input {
    flex: 1;
    min-width: 0;
    border: none !important;
    background: transparent !important;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-main);
    outline: none !important;
    appearance: textfield; /* Remove arrows for a cleaner look */
}

/* Hide spin buttons for Chrome/Safari/Edge */
.rest-custom-dist input::-webkit-outer-spin-button,
.rest-custom-dist input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rest-custom-dist__unit {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-muted);
    margin-right: 10px;
}

.rest-custom-dist__btn {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(104, 135, 69, 0.2);
}

.rest-custom-dist__btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(104, 135, 69, 0.3);
}

.rest-custom-dist__btn:active {
    transform: translateY(0);
}

/* ── MAP ROW ── */
.rest-map-row {
    display: grid;
    grid-template-columns: 1fr 300px;
    column-gap: 24px;
    margin-bottom: 32px;
}

.rest-map-filters {
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(104, 135, 69, .12);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.rest-map-filters .rest-filters__group {
    margin-bottom: 0;
}

/* ── FILTER SIDEBAR ── */
.rest-filters {
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(104, 135, 69, .12);
    border-radius: 20px;
    padding: 24px;
    position: sticky;
    top: 100px;
}

.rest-filters__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.rest-filters__title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-secondary-dark);
}

.rest-filters__clear {
    font-size: 13px;
    color: var(--color-primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background .15s;
}

.rest-filters__clear:hover {
    background: rgba(104, 135, 69, .08);
}

.rest-filters__group {
    margin-bottom: 22px;
}

.rest-filters__group:last-child {
    margin-bottom: 0;
}

.rest-filters__group-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-muted);
    margin: 0 0 12px;
}

/* Chips */
.rest-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rest-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(104, 135, 69, .2);
    background: rgba(255, 255, 255, .6);
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-main);
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
}

.rest-chip:hover {
    border-color: var(--color-primary);
    background: rgba(104, 135, 69, .06);
}

.rest-chip.is-active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(104, 135, 69, .25);
}

.rest-chip__icon {
    font-size: 14px;
}

/* Toggle */
.rest-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.rest-toggle__input {
    display: none;
}

.rest-toggle__slider {
    width: 44px;
    height: 24px;
    background: #d4d4d4;
    border-radius: 999px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}

.rest-toggle__slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

.rest-toggle__input:checked+.rest-toggle__slider {
    background: var(--color-primary);
}

.rest-toggle__input:checked+.rest-toggle__slider::after {
    transform: translateX(20px);
}

.rest-toggle__label {
    font-size: 14px;
    font-weight: 500;
    line-height: normal;
    display: flex;
    align-items: center;
    height: 24px; /* match slider height */
}

/* Distance buttons */
.rest-filters__distance-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.rest-dist-btn {
    padding: 8px 0;
    border-radius: 10px;
    border: 1px solid rgba(104, 135, 69, .18);
    background: rgba(255, 255, 255, .6);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-main);
    cursor: pointer;
    transition: all .18s;
    text-align: center;
}

.rest-dist-btn:hover {
    border-color: var(--color-primary);
    background: rgba(104, 135, 69, .06);
}

.rest-dist-btn.is-active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    box-shadow: 0 4px 12px rgba(104, 135, 69, .25);
}

/* Location inputs */
.rest-filters__location {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.rest-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, .8);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.rest-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(104, 135, 69, .12);
}

.rest-filters__loc-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px dashed rgba(104, 135, 69, .3);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .18s;
    width: 100%;
    justify-content: center;
}

.rest-filters__loc-btn:hover {
    background: rgba(104, 135, 69, .06);
    border-color: var(--color-primary);
}

/* ── FILTER CLOSE BUTTON (only visible on mobile) ── */
.rest-filters__close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0,0,0,.06);
    border-radius: 8px;
    cursor: pointer;
    color: var(--color-text-main);
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background .15s;
}

.rest-filters__close:hover {
    background: rgba(0,0,0,.12);
}

/* ── FILTER TOGGLE (MOBILE) ── */
.rest-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(104, 135, 69, .2);
    background: rgba(255, 255, 255, .8);
    backdrop-filter: blur(8px);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
    cursor: pointer;
    margin-bottom: 8px;
    transition: all .18s;
}

.rest-filter-toggle:hover {
    border-color: var(--color-primary);
}

/* Chevron icon inside the toggle button */
.rest-filter-toggle__chevron {
    margin-left: auto;
    transition: transform .25s ease;
    color: var(--color-primary);
    display: flex;
    align-items: center;
}

.rest-filter-toggle[aria-expanded="true"] .rest-filter-toggle__chevron {
    transform: rotate(180deg);
}

/* Filter panel entrance animation */
@keyframes filterDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes filterDropOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-6px); }
}

.rest-filters.is-open {
    animation: filterDropIn .2s ease forwards;
}

.rest-filters.is-closing {
    animation: filterDropOut .2s ease forwards;
}

/* ── RESULTS ── */
.rest-results__header {
    margin-bottom: 20px;
}

.rest-results__count {
    font-size: 14px;
    color: var(--color-muted);
    margin: 0;
}

.rest-results__count strong {
    color: var(--color-text-main);
}

.rest-results__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ── STORE CARD ── */
.store-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .05);
    box-shadow: 0 8px 28px rgba(0, 0, 0, .06);
    transition: transform .25s ease, box-shadow .25s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.store-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .1);
}

.store-card__img-wrap {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: linear-gradient(135deg, #e8e0d8 0%, #d4cec6 100%);
}

.store-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.store-card:hover .store-card__img {
    transform: scale(1.05);
}

.store-card__no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: rgba(0, 0, 0, .12);
}

.store-card__distance {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
}

.store-card__body {
    padding: 16px;
}

.store-card__name {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--color-secondary-dark);
    line-height: 1.3;
}

.store-card__location {
    font-size: 13px;
    color: var(--color-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.store-card__location svg {
    flex-shrink: 0;
}

/* ── MATCHED PRODUCT CARD ── */
.matched-product {
    margin: 0 16px 16px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(104, 135, 69, .06) 0%, rgba(175, 199, 148, .1) 100%);
    border: 1px solid rgba(104, 135, 69, .15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.matched-product__badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-primary);
    margin-bottom: 2px;
}

.matched-product__img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(0, 0, 0, .04);
}

.matched-product__info {
    flex: 1;
    min-width: 0;
}

.matched-product__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.matched-product__price {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
}

/* ── LOADING / EMPTY ── */
.rest-results__loading {
    text-align: center;
    padding: 48px 0;
    color: var(--color-muted);
}

.rest-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(104, 135, 69, .15);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 14px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.rest-results__empty {
    text-align: center;
    padding: 64px 0;
    color: var(--color-muted);
}

.rest-results__empty svg {
    margin: 0 auto 16px;
    opacity: .3;
}

.rest-results__empty h3 {
    font-size: 18px;
    color: var(--color-text-main);
    margin: 0 0 6px;
}

.rest-results__empty p {
    font-size: 14px;
    margin: 0;
}

/* Load more */
.rest-results__load-more {
    text-align: center;
    padding: 32px 0 0;
}

.rest-results__load-btn {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
    padding: 12px 36px;
    border-radius: 14px;
    font-weight: 600;
    transition: all .2s;
}

.rest-results__load-btn:hover {
    background: var(--color-primary);
    color: #fff;
}


/* ── RESPONSIVE ── */
@media (max-width: 860px) {
    .rest-content__layout {
        grid-template-columns: 1fr;
    }

    .rest-map-row {
        grid-template-columns: 1fr;
    }

    /* Map filter panel: show as collapsible section */
    .rest-map-filters summary {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 14px 18px;
        font-size: 14px;
        font-weight: 600;
        color: var(--color-text-main);
        cursor: pointer;
        user-select: none;
    }

    .rest-map-filters[open] summary {
        border-bottom: 1px solid rgba(104, 135, 69, .12);
        margin-bottom: 0;
    }

    /* Filter layout columns */
    /* ── UNIFIED MOBILE DROPDOWN PANELS ── */
    
    /* Toggle Buttons */
    .rest-filter-toggle {
        width: 100%;
        margin-bottom: 0 !important; /* Force no margin to stick to panel */
        justify-content: flex-start;
        border-radius: 16px;
    }

    /* Make toggles attach perfectly to the opened panel below them */
    .rest-filter-toggle[aria-expanded="true"] {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-bottom: 1px solid rgba(0, 0, 0, .05);
    }

    /* Panels themselves */
    .rest-filters,
    .rest-map-filters {
        display: none;
        position: static;
        border-radius: 0 0 16px 16px;
        border-top: none;
        overflow-y: auto;
        padding: 20px;
        background: rgba(255, 255, 255, .98);
        backdrop-filter: blur(16px);
        border: 1px solid rgba(104, 135, 69, .18);
        border-top: none; /* remove top border so it flows from the button */
        box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
        margin-top: 0; /* stick to button */
        margin-bottom: 24px;
        gap: 22px;
    }

    /* Ensure specific headers/titles are hidden inside the dropdowns on mobile */
    .desktop-only-title,
    .rest-filters__title {
        display: none !important;
    }

    /* Keep the 'Clear' button row visible but without the title */
    .rest-filters__header {
        margin-bottom: 12px;
        padding-bottom: 12px;
        justify-content: flex-end; /* Align "Temizle" to the right */
        border-bottom: 1px solid rgba(0, 0, 0, .06);
    }

    @keyframes filterDropIn {
        from { opacity: 0; transform: translateY(-4px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    @keyframes filterDropOut {
        from { opacity: 1; transform: translateY(0); }
        to   { opacity: 0; transform: translateY(-8px); }
    }

    .rest-filters.is-open {
        display: block;
        animation: filterDropIn .2s ease forwards;
    }

    .rest-map-filters.is-open {
        display: flex;
        animation: filterDropIn .2s ease forwards;
    }

    .rest-filters.is-closing,
    .rest-map-filters.is-closing {
        animation: filterDropOut .2s ease forwards;
    }

    /* Close button inside filter panel */
    .rest-filters__close {
        display: flex;
    }

    .rest-filter-toggle {
        display: inline-flex;
    }

    .rest-hero__title {
        font-size: 26px;
    }

    .rest-search {
        flex-direction: column;
    }

    .rest-search__btn {
        width: 100%;
    }

    .rest-results__grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .rest-hero {
        padding: 40px 0 36px;
    }

    .rest-hero__title {
        font-size: 22px;
    }

    .rest-results__grid {
        grid-template-columns: 1fr;
    }
}