/* ==========================================================================
   Hlavná stránka – kompaktné ovládanie a zoznam jedál (rovnaký štýl ako
   detail reštaurácie). Riadky jedál štýluje css/menu-list.css.
   ========================================================================== */

.results-section {
    --hc-ink: #1f1b2e;
    --hc-muted: #6e6a80;
    --hc-line: #ebe8f3;
    --hc-tint: #f4f2fb;
    --hc-violet: #5b4bd6;
    --hc-violet-ink: #4535b8;
}

/* Hlavička denného menu */
.results-section .daily-menu-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.results-section .daily-menu-toolbar-title {
    margin: 0;
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--hc-ink);
}

.results-section .daily-menu-toolbar-city {
    font-weight: 500;
    color: var(--hc-muted);
}

.results-section .daily-menu-day-btn {
    min-width: 44px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--hc-line);
    border-radius: 999px;
    background: #fff;
    color: var(--hc-ink);
    font-weight: 600;
    box-shadow: none;
}

.results-section .daily-menu-day-btn:hover:not(:disabled) {
    border-color: rgba(91, 75, 214, 0.45);
    color: var(--hc-violet-ink);
    transform: none;
}

.results-section .daily-menu-day-btn.active {
    background: var(--hc-violet);
    border-color: var(--hc-violet);
    color: #fff;
    box-shadow: none;
}

/* Riadok ovládania: Jedlá/Reštaurácie + vyhľadávanie + alergény */
.home-controls {
    margin: 0 0 28px;
}

.home-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.home-seg {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--hc-line);
    border-radius: 999px;
    background: #fff;
}

.home-seg-btn {
    height: 36px;
    padding: 0 18px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--hc-muted);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.home-seg-btn:hover { color: var(--hc-ink); }

.home-seg-btn.active {
    background: var(--hc-ink);
    color: #fff;
}

.home-search-slot {
    flex: 1 1 320px;
    min-width: 0;
}

.home-search-slot:empty { display: none; }

#homeControls .search-results-header {
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
}

#homeControls .search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.home-search {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
}

.home-search svg {
    position: absolute;
    left: 14px;
    color: var(--hc-muted);
    pointer-events: none;
}

#homeControls .home-search input {
    width: 100%;
    height: 44px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--hc-line);
    border-radius: 999px;
    background: #fff;
    color: var(--hc-ink);
    font: inherit;
    font-size: 15px;
    box-shadow: none;
}

#homeControls .home-search input:focus {
    outline: none;
    border-color: var(--hc-violet);
    box-shadow: 0 0 0 3px rgba(91, 75, 214, 0.15);
}

.home-fav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--hc-line);
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--hc-ink);
    cursor: pointer;
}

.home-fav input { accent-color: var(--hc-violet); width: 16px; height: 16px; }

/* Štítky (kategórie, strava, výživa, alergény) */
.home-chip,
#homeControls .advanced-filters-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--hc-line);
    border-radius: 999px;
    background: #fff;
    color: var(--hc-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#homeControls .advanced-filters-btn { height: 44px; }

.home-chip:hover,
#homeControls .advanced-filters-btn:hover { border-color: rgba(91, 75, 214, 0.45); }

.home-chip.active,
.home-chip.filter-btn.active {
    background: var(--hc-ink);
    border-color: var(--hc-ink);
    color: #fff;
}

.home-chip.diet-filter-btn.active {
    background: var(--hc-tint);
    border-color: var(--hc-violet);
    color: var(--hc-violet-ink);
}

.home-chip.is-open,
#homeControls .advanced-filters-btn[aria-expanded="true"] {
    border-color: var(--hc-violet);
    color: var(--hc-violet-ink);
}

.home-chip:focus-visible,
.home-seg-btn:focus-visible,
#homeControls .advanced-filters-btn:focus-visible {
    outline: 3px solid rgba(91, 75, 214, 0.45);
    outline-offset: 2px;
}

.home-filters {
    margin-top: 12px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.home-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.home-chips-sep {
    width: 1px;
    height: 22px;
    margin: 0 4px;
    background: var(--hc-line);
}

/* Panel výživy */
.home-nutrition {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid var(--hc-line);
    border-radius: 16px;
    background: #fff;
}

.home-nutrition[hidden] { display: none; }

.home-nutrition .slider-group-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
}

.home-nutrition .slider-label-inline {
    font-size: 14px;
    font-weight: 600;
    color: var(--hc-ink);
}

.home-nutrition .slider-label-inline span {
    font-weight: 500;
    color: var(--hc-muted);
    margin-left: 6px;
}

/* Panel alergénov (vkladá ho app.js) – štítky namiesto checkboxov */
#homeControls .advanced-filters-panel {
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid var(--hc-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: none;
}

#homeControls .advanced-filters-panel h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hc-muted);
}

#homeControls .allergen-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#homeControls .allergen-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 7px 13px;
    border: 1px solid var(--hc-line);
    border-radius: 999px;
    background: #fff;
    font-size: 14px;
    color: var(--hc-ink);
    cursor: pointer;
}

#homeControls .allergen-checkbox input,
#homeControls .allergen-checkbox .checkmark {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

#homeControls .allergen-checkbox:has(input:checked) {
    background: #fdecec;
    border-color: #f3b4b4;
    color: #a3261f;
    text-decoration: line-through;
}

#homeControls .filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

#homeControls .apply-filter-btn,
#homeControls .clear-filter-btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

#homeControls .apply-filter-btn {
    border: 1px solid var(--hc-violet);
    background: var(--hc-violet);
    color: #fff;
}

#homeControls .clear-filter-btn {
    border: 1px solid var(--hc-line);
    background: #fff;
    color: var(--hc-muted);
}

/* V režime reštaurácií filtre jedál nedávajú zmysel */
.home-controls.is-restaurant-mode .home-search-slot,
.home-controls.is-restaurant-mode .home-filters { display: none; }

/* Kategórie jedál ako zoznam */
#menuItemsList .menu-category-section { margin-bottom: 36px; }

#menuItemsList .menu-category-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 4px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--hc-ink);
}

#menuItemsList .menu-category-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--hc-ink);
}

#menuItemsList .menu-category-count {
    padding: 0;
    background: none;
    color: var(--hc-muted);
    font-size: 15px;
    font-weight: 500;
}

/* Riadok jedla prebije staré štýly kariet zo style.css */
.home-menu-list .menu-item-card.menu-row {
    flex: none !important;
    max-width: none !important;
    min-width: 0 !important;
    background: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    transform: none;
}

.home-menu-list .menu-item-card.menu-row:hover {
    box-shadow: none;
    transform: none;
}

.home-menu-list .menu-item-card.menu-row:focus-visible {
    box-shadow: 0 0 0 3px rgba(91, 75, 214, 0.35);
    border-radius: 14px;
}

.menu-row-label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
}

.menu-row-restaurant {
    color: var(--ml-violet-ink, #4535b8);
    text-decoration: none;
}

.menu-row-restaurant:hover { text-decoration: underline; }

.menu-row-distance,
.menu-row-menu {
    font-weight: 500;
    color: var(--ml-muted, #6e6a80);
}

.menu-row-rating { color: #b7791f; font-weight: 600; }

.menu-row.is-featured .menu-row-photo { box-shadow: 0 0 0 3px #f5c451; }

@media (max-width: 768px) {
    .home-controls-row { gap: 8px; }
    .home-seg { order: 1; }
    .home-fav { order: 2; }
    .home-search-slot { order: 3; flex-basis: 100%; }

    /* Štítky v jednom posúvateľnom riadku namiesto 3 – 4 riadkov */
    .home-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -16px;
        padding: 2px 16px;
        scrollbar-width: none;
    }

    .home-chips::-webkit-scrollbar { display: none; }

    .home-nutrition { gap: 16px; }
    .home-nutrition .slider-group-inline { min-width: 0; flex: 1 1 140px; }

    .results-section .daily-menu-toolbar { gap: 10px; }
    .results-section .daily-menu-days { display: flex; gap: 6px; width: 100%; }
    .results-section .daily-menu-day-btn { flex: 1 1 0; min-width: 0; padding: 0; }
}

/* --- Prebitie starých globálnych štýlov (style.css) --- */
#homeControls #foodSearchBtn { display: none !important; }

#homeControls .home-chip.filter-btn,
#homeControls .home-chip.diet-filter-btn {
    background: #fff !important;
    background-image: none !important;
    border: 1px solid var(--hc-line) !important;
    color: var(--hc-ink) !important;
    box-shadow: none !important;
    transform: none !important;
}

#homeControls .home-chip.filter-btn.active {
    background: var(--hc-ink) !important;
    border-color: var(--hc-ink) !important;
    color: #fff !important;
}

#homeControls .home-chip.diet-filter-btn.active {
    background: var(--hc-tint) !important;
    border-color: var(--hc-violet) !important;
    color: var(--hc-violet-ink) !important;
}

/* kategória je v nadpise sekcie – v riadku ju len skryjeme (filtre ju čítajú) */
.home-menu-list .menu-row .menu-item-category {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.home-menu-list .menu-row .menu-row-nutrition,
.home-menu-list .menu-row .menu-row-nutrition span {
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    color: var(--ml-muted, #6e6a80);
    font-size: 13px;
    font-weight: 400;
    box-shadow: none;
}

.home-menu-list .menu-row .menu-row-nutrition { display: flex; gap: 2px 14px; margin-top: 7px; }

.home-menu-list .menu-row .menu-row-add.add-to-list-btn {
    position: static;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--ml-line, #ebe8f3);
    background: #fff;
    background-image: none;
    color: var(--ml-violet-ink, #4535b8);
    box-shadow: none;
    transform: none;
}

.home-menu-list .menu-row .menu-row-add.add-to-list-btn:hover {
    background: var(--ml-violet, #5b4bd6);
    border-color: var(--ml-violet, #5b4bd6);
    color: #fff;
}

.home-menu-list .menu-row .menu-row-name {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
    -webkit-line-clamp: unset;
    display: block;
}

@media (max-width: 480px) {
    .home-menu-list .menu-row .menu-row-name { font-size: 16px; }
}

.home-menu-list .menu-row .menu-row-name.menu-item-name {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    line-height: 1.35 !important;
    overflow: visible !important;
}

#homeControls .advanced-filters-btn .filter-text-desktop { display: inline !important; }
#homeControls .advanced-filters-btn { width: auto !important; min-width: 0 !important; padding: 0 16px !important; }
#homeControls .advanced-filters-btn .toggle-arrow:empty { display: none; }

.home-controls-row { align-items: flex-start; }
.home-nutrition input[type="range"] { accent-color: var(--hc-violet); }
