/* ══════════════════════════════════════════════════════════════════
   Étterem Heti Menü  –  Frontend CSS  v6  (FoodRevo stílus)
   ══════════════════════════════════════════════════════════════════ */

:root {
    --em-primary:       #e8431a;
    --em-primary-dark:  #c23510;
    --em-primary-light: #fff2ee;
    --em-green:         #7ED957;
    --em-green-dark:    #5fb83d;
    --em-bg:            #f4f5f7;
    --em-surface:       #ffffff;
    --em-border:        #e8e8e8;
    --em-text:          #1a1a2e;
    --em-muted:         #8c8c9a;
    --em-radius:        16px;
    --em-radius-sm:     10px;
    --em-shadow:        0 2px 16px rgba(0,0,0,.07);
    --em-shadow-hover:  0 8px 32px rgba(0,0,0,.13);
    --em-tab-h:         68px;
    --em-font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.em-wrapper *, .em-wrapper *::before, .em-wrapper *::after { box-sizing: border-box; margin: 0; padding: 0; }
.em-wrapper {
    font-family: var(--em-font);
    color: var(--em-text);
    background: var(--em-bg);
    border-radius: var(--em-radius);
    padding: 20px;
    -webkit-tap-highlight-color: transparent;
    /* Mobilon a horizontális scroll kártyasor ne legyen levágva */
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   TAB SÁV  – pill stílus
   ══════════════════════════════════════════════════════════════════ */
.em-tabs-track-wrap {
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.em-tabs-track {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 2px 8px;
    overflow: visible;
    transform: translateX(0);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    will-change: transform;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}
.em-tabs-track.is-dragging { cursor: grabbing; transition: none; }


/* TAB GOMB – pill */
.em-tab {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    height: var(--em-tab-h);
    padding: 8px 12px;
    background: var(--em-surface);
    border: 2px solid transparent;
    border-radius: 14px;
    cursor: pointer;
    gap: 2px;
    color: var(--em-muted);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: all .18s ease;
    position: relative;
}
.em-tab:hover {
    border-color: var(--em-primary);
    color: var(--em-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232,67,26,.15);
}
.em-tab--active {
    background: var(--em-primary) !important;
    border-color: var(--em-primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(232,67,26,.35) !important;
    transform: translateY(-2px);
}
.em-tab--closed {
    background: #f0f0f0 !important;
    border-color: transparent !important;
    color: #bbb !important;
    box-shadow: none !important;
    transform: none !important;
}
.em-tab--closed:hover { border-color: #ddd !important; color: #999 !important; transform: none !important; }
.em-tab--urgent { border-color: #f59e0b !important; color: #d97706 !important; }
.em-tab--urgent:hover { box-shadow: 0 4px 12px rgba(245,158,11,.2) !important; }

.em-tab__day  { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .8; }
.em-tab--active .em-tab__day { opacity: 1; }
.em-tab__date { font-size: 18px; font-weight: 800; line-height: 1; }

.em-tab__badge {
    font-size: 9px; font-weight: 700;
    border-radius: 6px; padding: 1px 5px;
    background: rgba(255,255,255,.22); color: inherit;
    white-space: nowrap; margin-top: 1px;
}
.em-tab__badge--closed { background: rgba(0,0,0,.06); color: #aaa; }
.em-tab__dot { width: 5px; height: 5px; border-radius: 50%; margin-top: 2px; }
.em-tab__dot--open   { background: #22c55e; }
.em-tab__dot--closed { background: #ccc; }
.em-tab__dot--urgent { background: #f59e0b; animation: emPulse 1.2s infinite; }
@keyframes emPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.3;transform:scale(.5)} }

/* ══════════════════════════════════════════════════════════════════
   PANEL TERÜLET
   ══════════════════════════════════════════════════════════════════ */
.em-panels { overflow: visible; }

.em-panel        { display: none; }
.em-panel--active { display: block; animation: emFadeIn .2s ease; }
@keyframes emFadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

/* Panel fejléc */
.em-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding: 0 2px;
}
.em-panel-header__title {
    font-size: 20px;
    font-weight: 800;
    color: var(--em-text);
    letter-spacing: -.01em;
}
.em-panel-header__title strong { color: var(--em-primary); }

.em-deadline-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--em-muted);
    background: var(--em-surface);
    padding: 6px 14px; border-radius: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    white-space: nowrap;
}
.em-deadline-badge strong { color: var(--em-text); }
.em-deadline-badge--closed {
    background: #fee2e2; color: #991b1b;
    font-weight: 700;
}

/* Zárt nap sáv */
.em-closed-notice {
    background: #fef9f0;
    border: 1.5px solid #fcd34d;
    border-radius: var(--em-radius-sm);
    padding: 12px 16px; margin-bottom: 16px;
    font-size: 13px; color: #92400e;
    display: flex; flex-direction: column; gap: 3px;
}
.em-closed-notice small { opacity: .75; font-size: 12px; }

/* Visszaszámláló */
.em-countdown__label { font-size: 12px; font-weight: 700; color: #16a34a; }
.em-countdown--warning .em-countdown__label { color: #d97706; }
.em-countdown--urgent  .em-countdown__label { color: #dc2626; animation: emTextPulse 1s infinite; }
.em-countdown--expired { color: #dc2626; font-size: 12px; font-weight: 700; }
@keyframes emTextPulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ══════════════════════════════════════════════════════════════════
   TERMÉK RÁCS
   ══════════════════════════════════════════════════════════════════ */
.em-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(266px, 1fr));
    gap: 18px;
    align-items: stretch;
}

/* ══════════════════════════════════════════════════════════════════
   KÁRTYA  – FoodRevo stílus
   ══════════════════════════════════════════════════════════════════ */
.em-card {
    background: var(--em-surface);
    border-radius: var(--em-radius);
    overflow: hidden;
    box-shadow: var(--em-shadow);
    display: flex; flex-direction: column;
    transition: box-shadow .22s, transform .22s;
    border: 1.5px solid transparent;
}
.em-card:hover {
    box-shadow: var(--em-shadow-hover);
    transform: translateY(-3px);
    border-color: var(--em-border);
}
.em-card--sold-out  { opacity: .58; filter: grayscale(.5); }
.em-card--view-only { opacity: .72; }
.em-card--view-only .em-card__image img { filter: grayscale(.5) brightness(.94); }

/* Kép nélküli kártya – kompakt, vízszintes layout */
.em-card--no-image {
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
}
.em-card--no-image .em-card__body {
    padding: 16px 18px;
    flex: 1;
    justify-content: center;
}
.em-card--no-image .em-card__title {
    font-size: 15px;
}
.em-card--no-image .em-card__actions {
    margin-top: 10px;
}

/* Státusz badge kép nélküli kártyán */
.em-card__badge--inline {
    display: inline-block;
    font-size: 11px; font-weight: 700;
    padding: 3px 10px; border-radius: 20px;
    margin-bottom: 6px;
}
.em-card__badge--inline.em-card__badge--out    { background: rgba(0,0,0,.08); color: #555; }
.em-card__badge--inline.em-card__badge--locked { background: rgba(107,114,128,.12); color: #555; }

/* ── Kép – fix 220px, biztosan kitölti ── */
.em-card__image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--em-bg);
    flex-shrink: 0;
    display: block;
}
.em-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform .4s ease;
}
.em-card:hover .em-card__image img { transform: scale(1.06); }

.em-card__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    background: #f0f0f0;
}

.em-card__badge {
    position: absolute; top: 10px; right: 10px;
    font-size: 11px; font-weight: 700;
    padding: 4px 10px; border-radius: 20px;
    backdrop-filter: blur(6px);
}
.em-card__badge--out    { background: rgba(0,0,0,.55);       color: #fff; }
.em-card__badge--locked { background: rgba(107,114,128,.65); color: #fff; }

/* Kategória chip a képen (opcionális jövőbeli feature helye) */
.em-card__cat {
    position: absolute; bottom: 10px; left: 10px;
    font-size: 10px; font-weight: 700;
    background: rgba(255,255,255,.9);
    color: var(--em-primary);
    padding: 3px 8px; border-radius: 8px;
    text-transform: uppercase; letter-spacing: .05em;
}

/* ── Törzs ── */
.em-card__body {
    padding: 14px 18px 18px;
    display: flex; flex-direction: column;
    flex: 0 0 auto;
    gap: 6px;
    background: var(--em-surface);
}

.em-card__title {
    font-size: 15px; font-weight: 800;
    line-height: 1.25; color: var(--em-text);
}
.em-card__desc {
    font-size: 12px; color: var(--em-muted);
    line-height: 1.5; flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ár + gombok sor */
.em-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 8px;
}
.em-card__price {
    font-size: 17px; font-weight: 900;
    color: var(--em-primary);
    white-space: nowrap;
}
.em-card__price .woocommerce-Price-amount { color: inherit; }
.em-card__status { font-size: 12px; color: var(--em-muted); font-style: italic; }

/* Gombok */
.em-card__actions {
    display: flex; gap: 6px;
    width: 100%; margin-top: 12px;
}

/* ── Általános gomb ── */
.em-btn {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--em-radius-sm);
    padding: 10px 10px; font-size: 12px; font-weight: 700;
    cursor: pointer; white-space: nowrap; text-decoration: none;
    border: 2px solid transparent;
    transition: all .15s ease;
    line-height: 1; font-family: var(--em-font);
    text-align: center;
}

/* Ansehen – kisebb, fix szélesség */
.em-btn--outline { flex: 0 0 auto; padding: 10px 12px; }

/* In den Warenkorb – kitölti a maradékot */
.em-btn--primary { flex: 1 1 auto; }
.em-btn:active { transform: scale(.95); }

/* Kosárba – narancs */
.em-btn--primary {
    background: var(--em-primary); color: #fff;
    border-color: var(--em-primary);
}
.em-btn--primary:hover { background: var(--em-primary-dark); border-color: var(--em-primary-dark); }
.em-btn--primary.em-loading { opacity: .65; cursor: wait; pointer-events: none; }

/* Megtekintés – zöld */
.em-btn--outline {
    background: var(--em-green); color: #fff;
    border-color: var(--em-green);
}
.em-btn--outline:hover { background: var(--em-green-dark); border-color: var(--em-green-dark); }

/* Lezárt napon halvány */
.em-products--view-only .em-btn--outline {
    background: #d4edda; color: #555; border-color: #d4edda;
}
.em-products--view-only .em-btn--primary {
    display: none;
}

/* ══════════════════════════════════════════════════════════════════
   ÜRES ÁLLAPOT / ZÁRVA
   ══════════════════════════════════════════════════════════════════ */
.em-empty {
    background: var(--em-surface);
    border-radius: var(--em-radius);
    padding: 56px 24px;
    text-align: center; color: var(--em-muted);
    box-shadow: var(--em-shadow);
}
.em-empty span { font-size: 44px; display: block; margin-bottom: 12px; }
.em-empty p    { font-size: 14px; font-weight: 500; }

.em-closed {
    background: #fef9f0;
    border: 1.5px solid #fcd34d;
    border-radius: var(--em-radius);
    padding: 28px; text-align: center;
    color: #92400e; font-size: 15px; font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════════ */
.em-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 99999;
    background: #1a1a2e; color: #fff;
    padding: 14px 20px; border-radius: 12px;
    font-size: 14px; font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    max-width: 320px;
    opacity: 0; transform: translateY(12px);
    transition: opacity .25s, transform .25s; pointer-events: none;
}
.em-toast--visible  { opacity: 1; transform: translateY(0); pointer-events: auto; }
.em-toast--success  { border-left: 4px solid #22c55e; }
.em-toast--error    { border-left: 4px solid #ef4444; }
.em-cart-link       { color: #7ED957; text-decoration: none; font-weight: 700; margin-left: 6px; }
.em-cart-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════
   RESZPONZÍV
   ══════════════════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
    .em-products {
        grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
        gap: 14px;
    }
}

/* ── MOBIL: horizontális scroll kártyasor ── */
@media (max-width: 640px) {

    .em-wrapper { padding: 10px; }

    /* Tab fejléc */
    .em-tab         { min-width: 58px; }
    .em-tab__date   { font-size: 15px; }
    .em-panel-header { padding: 10px 12px; }
    .em-panel-header__title { font-size: 16px; }
    .em-deadline-badge { font-size: 11px; }

    /* Kategória szekció: overflow-x scroll konténer */
    .em-category-section {
        margin-bottom: 24px;
    }

    /* A .em-products horizontális scroll sorrá alakul */
    .em-products {
        /* Grid helyett flex sor */
        display: flex;
        flex-direction: row;
        gap: 12px;
        /* Scrollozható, de elrejti a scrollbárt */
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;          /* Firefox */
        padding-bottom: 8px;
        /* Kilógó rész láthatósága: a wrapper ne vágja le */
        padding-right: 0;
    }
    .em-products::-webkit-scrollbar { display: none; } /* Chrome/Safari */

    /* Minden kártya: 85% szélesség, a következő széle látszik */
    .em-products .em-card {
        flex: 0 0 85%;
        min-width: 0;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    /* Az utolsó kártya után kis üres hely, hogy a következő kártya
       széle is látsszon az utolsónál is */
    .em-products .em-card:last-child {
        margin-right: 6px;
    }

    /* Kép magasság mobilon */
    .em-card__image { height: 200px; }

    /* Body kisebb padding */
    .em-card__body  { padding: 12px 14px 14px; gap: 4px; }
    .em-card__title { font-size: 14px; }
    .em-card__desc  { -webkit-line-clamp: 2; }
    .em-card__price { font-size: 15px; }
    .em-btn         { font-size: 11.5px; padding: 9px 8px; }

    /* Toast */
    .em-toast { bottom: 12px; right: 12px; left: 12px; max-width: unset; }
}

/* Nagyon kis képernyő – tab fülek kisebbek */
@media (max-width: 360px) {
    .em-tab     { min-width: 52px; }
    .em-tab__date { font-size: 14px; }
    .em-products .em-card { flex: 0 0 88%; }
}

/* ══════════════════════════════════════════════════════════════════
   KATEGÓRIA SZEKCIÓK
   ══════════════════════════════════════════════════════════════════ */

.em-category-section {
    margin-bottom: 28px;
}
.em-category-section:last-child {
    margin-bottom: 0;
}

/* Kategória fejléc sor */
.em-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--em-border);
    position: relative;
}
.em-category-header::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 48px; height: 2px;
    background: var(--em-primary);
    border-radius: 2px;
}

.em-category-header__icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}
.em-category-header__label {
    font-size: 15px;
    font-weight: 800;
    color: var(--em-text);
    letter-spacing: -.01em;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: .06em;
}
.em-category-header__count {
    background: var(--em-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ── Kosár link a gombok ALATT, alapból rejtett ── */
.em-card__cart-link {
    display: none !important;
    width: 100%;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--em-border);
}
.em-card__cart-link.em-visible {
    display: block !important;
}
.em-card__cart-link a {
    font-size: 12px;
    font-weight: 600;
    color: var(--em-primary);
    text-decoration: underline;
    display: block;
    text-align: center;
    transition: color .15s;
}
.em-card__cart-link a:hover {
    color: var(--em-primary-dark);
}

/* ── WooCommerce auto-link elrejtése (added_to_cart class) ── */
.em-wrapper .added_to_cart,
.em-wrapper .wc-forward,
.em-wrapper .woocommerce-message {
    display: none !important;
}

/* Mobilon a kép nélküli kártya is normál függőleges */
@media (max-width: 640px) {
    .em-card--no-image {
        flex-direction: column;
    }
    .em-card--no-image .em-card__body {
        padding: 12px 14px 14px;
    }
}
