/*
====================================================================================================
VILLEM SÖÖGI- JA JOOGIKAART — Frontend stiil (2026, moodne/mobiilisõbralik versioon)
====================================================================================================
*/

.vm-wrap {
    --vm-accent: #93bda9;
    --vm-ink: #2b2317;
    --vm-muted: #8a8378;
    --vm-border: #ece4d4;
    --vm-card: #fffdf9;
    --vm-radius: 18px;
    --vm-radius-sm: 12px;
    --vm-shadow: 0 2px 10px rgba(43, 35, 23, .05);
    --vm-shadow-hover: 0 10px 28px rgba(43, 35, 23, .13);

    max-width: 860px;
    margin: 0 auto;
    padding: 0 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Tööriistariba: vahekaardid + keelevalik ---------- */
.vm-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.vm-tabs {
    position: relative;
    display: inline-flex;
    background: #f1ede3;
    border-radius: 999px;
    padding: 5px;
    gap: 2px;
}
.vm-tab {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    min-height: 44px;
    border: none;
    background: transparent;
    border-radius: 999px;
    color: var(--vm-muted);
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: .2px;
    cursor: pointer;
    transition: color .25s ease;
    -webkit-tap-highlight-color: transparent;
}
.vm-tab-icon { font-size: 16px; line-height: 1; }
.vm-tab.active { color: #fff; }
.vm-tab-indicator {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc(50% - 5px);
    background: var(--vm-accent);
    border-radius: 999px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    z-index: 1;
}
.vm-tabs[data-active="drink"] .vm-tab-indicator { transform: translateX(100%); }

.vm-langs { display: flex; gap: 6px; }
.vm-langs a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--vm-border);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--vm-muted);
    text-decoration: none;
    background: #fff;
    transition: all .18s ease;
}
.vm-langs a:hover { border-color: var(--vm-accent); color: var(--vm-accent); }
.vm-langs a.active { background: var(--vm-ink); border-color: var(--vm-ink); color: #fff; }

/* ---------- Otsing ---------- */
.vm-search {
    position: relative;
    margin-bottom: 18px;
}
.vm-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--vm-muted);
    pointer-events: none;
}
.vm-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 44px;
    font-size: 16px;
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius-sm);
    background: #fff;
    color: var(--vm-ink);
    outline: none;
    -webkit-appearance: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.vm-search-input:focus {
    border-color: var(--vm-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--vm-accent) 18%, transparent);
}
.vm-search-input::-webkit-search-cancel-button { display: none; }
.vm-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #f1ede3;
    color: var(--vm-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.vm-search-clear:hover { background: #e6ded0; }
.vm-search-noresults {
    display: none;
    text-align: center;
    padding: 40px 20px;
    color: var(--vm-muted);
    font-size: 15px;
}
.vm-wrap.vm-searching .vm-search-noresults.vm-has-no-results { display: block; }

/* ---------- Kategooria kiirvalik (kleepuv, klaasjas) ---------- */
.vm-cat-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 2px 14px 2px;
    margin-bottom: 6px;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(250, 248, 244, .92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.vm-cat-nav::-webkit-scrollbar { display: none; }
.vm-cat-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 18px;
    background: #fff;
    border: 1px solid var(--vm-border);
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: #5a4d33;
    text-decoration: none;
    white-space: nowrap;
    transition: all .18s ease;
}
.vm-cat-chip:hover, .vm-cat-chip.vm-chip-active {
    background: var(--vm-accent);
    border-color: var(--vm-accent);
    color: #fff;
    box-shadow: var(--vm-shadow-hover);
}

/* ---------- Kategooria sisu ---------- */
.vm-category {
    margin-bottom: 40px;
    scroll-margin-top: 76px;
}
.vm-cat-title {
    text-align: center;
    margin: 0 0 20px 0;
}
.vm-cat-title span {
    position: relative;
    display: inline-block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 22px;
    color: #8a6d2f;
    letter-spacing: .5px;
    padding: 0 18px;
}
.vm-cat-title span::before,
.vm-cat-title span::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 34px;
    height: 1px;
    background: #d9c9a0;
}
.vm-cat-title span::before { right: 100%; }
.vm-cat-title span::after { left: 100%; }

.vm-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* ---------- Toote kaart ---------- */
.vm-item {
    display: flex;
    gap: 14px;
    width: 100%;
    background: var(--vm-card);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    padding: 14px;
    box-shadow: var(--vm-shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .45s ease, transform .45s ease, box-shadow .25s ease, border-color .25s ease;
}
.vm-item.vm-in-view { opacity: 1; transform: translateY(0); }
.vm-item:hover {
    border-color: color-mix(in srgb, var(--vm-accent) 40%, var(--vm-border));
    box-shadow: var(--vm-shadow-hover);
}
.vm-item.vm-search-hidden { display: none; }

.vm-item-img {
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    border-radius: var(--vm-radius-sm);
    overflow: hidden;
    background: #f1ede3;
}
.vm-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vm-item-body { flex: 1; min-width: 0; }

.vm-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}
.vm-item-name {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16.5px;
    line-height: 1.35;
    color: var(--vm-ink);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}
.vm-item-name-text { font-weight: 700; }

.vm-item-price {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    padding: 5px 12px;
    background: #fbf1e6;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 700;
    color: #b0562e;
    white-space: nowrap;
}
.vm-item-currency { font-size: 12px; opacity: .85; margin-left: 1px; }

.vm-item-desc {
    margin-top: 5px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--vm-muted);
    font-style: italic;
}

.vm-flag { font-size: 17px; margin-right: 1px; line-height: 1; }

.vm-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    font-size: 11px;
    color: #fff;
    flex: 0 0 auto;
}
.vm-tag-new {
    box-shadow: 0 0 0 0 rgba(200, 162, 75, .5);
    animation: vm-pulse 2.2s ease-out infinite;
}
@keyframes vm-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(200, 162, 75, .45); }
    70%  { box-shadow: 0 0 0 7px rgba(200, 162, 75, 0); }
    100% { box-shadow: 0 0 0 0 rgba(200, 162, 75, 0); }
}

/* ---------- Tühi olek ---------- */
.vm-empty {
    text-align: center;
    color: var(--vm-muted);
    padding: 50px 20px;
    font-size: 15px;
    font-style: italic;
    line-height: 1.8;
}

/* ==========================================================================
   MOBIIL — pisut kompaktsem, aga puutesõbralikud sihtmärgid
   ========================================================================== */
@media screen and (max-width: 640px) {
    .vm-wrap { padding: 0; }

    .vm-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
    .vm-tabs { width: 100%; }
    .vm-tab { flex: 1; justify-content: center; }
    .vm-tab-indicator { width: calc(50% - 5px); }
    .vm-langs { justify-content: center; }

    .vm-item-img { flex-basis: 68px; width: 68px; height: 68px; }
    .vm-item { padding: 12px; border-radius: 14px; }
    .vm-item-name { font-size: 15.5px; }
    .vm-item-price { font-size: 13.5px; padding: 4px 10px; }
    .vm-cat-title span { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
    .vm-item, .vm-tab-indicator { transition: none; }
    .vm-tag-new { animation: none; }
}
