/* ePalacinky – konfigurátor palačiniek */

:root {
    --orange: #f39c12;
    --orange-dark: #e67e22;
    --dark: #2c3e50;
    --gray: #7f8c8d;
    --bg: #fdf2e9;
    --white: #fff;
    --viz-size: 320px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--dark);
    min-height: 100vh;
    padding-bottom: 120px;
}

/* Header */
.header {
    background: var(--white);
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    margin: 0 0 4px 0;
    font-size: 1.75rem;
}

.header-logo-link {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.header-logo-link:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.header p {
    margin: 0;
    color: var(--gray);
    font-size: 0.95rem;
}

.header-prevadzka {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 4px 0 0 0;
}

.header-prevadzka-label {
    font-weight: 600;
    color: var(--dark);
    font-size: 0.95rem;
}

.header-prevadzka-select {
    min-width: 11.5rem;
    max-width: 100%;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
    box-sizing: border-box;
}

.header-prevadzka-select:focus {
    border-color: var(--orange);
    outline: none;
}

.basket-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fef5e7;
    color: var(--orange);
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.basket-link:hover {
    background: var(--orange);
    color: var(--white);
    transform: scale(1.05);
}

.basket-icon {
    font-size: 1.5rem;
}

.basket-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 20px;
    text-align: center;
    background: var(--orange);
    color: var(--white);
    border-radius: 10px;
}

.basket-badge.empty {
    display: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-mgr-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.mgr-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #eef8f0;
    color: var(--dark);
    text-decoration: none;
    font-size: 1.15rem;
    transition: background 0.2s, transform 0.1s;
}

.mgr-nav-link:hover {
    background: #d5f5e3;
    transform: scale(1.05);
}

.mgr-nav-emoji {
    line-height: 1;
}

.mgr-nav-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    background: var(--orange);
    color: var(--white);
    border-radius: 999px;
}

.mgr-nav-badge.empty {
    display: none;
}

.account-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eaf2fb;
    color: #2874a6;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.account-link:hover {
    background: #2874a6;
    color: var(--white);
    transform: scale(1.05);
}

.account-icon {
    display: block;
}

/* Main – dva stĺpce */
.main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 16px;
}

.layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

/* Ľavý stĺpec – vizualizácia (bez obdĺžnikového pozadia). Ak je pod obrázkom stále viditeľný obdĺžnik, PNG (pancake01–06, vrstvy) nemajú alpha kanál – nahraď assets. */
.viz-column {
    position: sticky;
    top: 24px;
    background: transparent;
}

.viz-container {
    position: relative;
    width: var(--viz-size);
    height: var(--viz-size);
    margin: 0 auto;
    overflow: hidden;
    background: transparent;
}

.viz-base {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

.viz-layers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.viz-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Pravý stĺpec – menu */
.menu-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.menu-section {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.menu-title {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    border-left: 4px solid var(--orange);
    padding-left: 10px;
}

.menu-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.menu-title-row .menu-title {
    margin-bottom: 0;
}

.plnka-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter-btn {
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 999px;
    border: 2px solid #e0e0e0;
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--orange);
    background: #fef9f0;
}

.filter-btn.selected {
    border-color: var(--orange);
    background: #fef5e7;
}

.filter-btn:active {
    transform: scale(0.98);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

.menu-title .menu-subtitle {
    font-weight: 400;
    color: var(--gray);
    font-size: 0.85em;
}

.menu-note {
    margin: 0 0 14px 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--gray);
}

/* Počet palačiniek – +/- kruhové tlačidlá */
.count-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.btn-count {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--orange);
    background: var(--white);
    color: var(--orange);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.btn-count:hover {
    background: var(--orange);
    color: var(--white);
}

.btn-count:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--gray);
    color: var(--gray);
}

.btn-count:disabled:hover {
    background: var(--white);
    color: var(--gray);
}

.count-display {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 3.5em;
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.menu-btn {
    font-family: inherit;
    font-size: 0.9rem;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.menu-btn-title {
    display: block;
    font-weight: 600;
}

.menu-btn-meta {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: 2px;
}

.menu-btn:hover {
    border-color: var(--orange);
    background: #fef9f0;
}

.menu-btn.selected {
    border-color: var(--orange);
    background: #fef5e7;
    color: var(--dark);
}

.menu-btn .price-tag {
    color: var(--orange);
    font-weight: 600;
}

/* Tabuľka plniek */
.plnky-table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}
.plnky-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.plnky-table th,
.plnky-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
.plnky-table th {
    background: #faf8f5;
    font-weight: 600;
    color: var(--dark);
    white-space: nowrap;
}
.plnky-table tbody tr[data-plnka-id],
.plnky-table tbody tr[data-cesto-id] {
    cursor: pointer;
    transition: background 0.15s;
}
.plnky-table tbody tr[data-plnka-id]:hover,
.plnky-table tbody tr[data-cesto-id]:hover {
    background: #fef9f0;
}
.plnky-table tbody tr.selected {
    background: #fef5e7;
    box-shadow: inset 3px 0 0 var(--orange);
}
.plnky-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 22ch;
}
.plnky-loading,
.plnky-empty {
    text-align: center;
    color: var(--gray);
    padding: 16px !important;
}
.footer-left { display: flex; flex-direction: column; gap: 6px; }
.footer-totals {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px 24px;
    align-items: baseline;
}
.footer-line {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
}
.footer-order-summary {
    font-size: 0.85rem;
    color: var(--gray);
    max-height: 3em;
    overflow: auto;
}

.footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.btn-checkout {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    background: var(--white);
    color: var(--orange);
    border: 2px solid var(--orange);
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.btn-checkout:hover {
    background: #fef5e7;
}

/* Footer – cena a objednať */
.footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--white);
    padding: 16px 24px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.footer-price {
    display: flex;
    flex-direction: column;
}
.footer-bar .footer-left {
    flex: 1;
    min-width: 0;
}

.footer-label {
    font-size: 0.85rem;
    color: var(--gray);
}

.footer-total {
    font-size: 1.5rem;
    color: var(--dark);
}

.btn-order {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    background: var(--orange);
    color: var(--white);
    border: none;
    padding: 14px 32px;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-order:hover {
    background: var(--orange-dark);
}

.btn-order:active {
    transform: scale(0.98);
}

.btn-order:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.btn-order:disabled:hover {
    background: var(--orange);
}

/* Responsive – mobile: stĺpce pod sebou */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .viz-column {
        position: static;
        order: 1;
    }

    .viz-container {
        width: 100%;
        max-width: var(--viz-size);
        height: 280px;
    }

    .menu-column {
        order: 2;
    }

    .menu-buttons {
        flex-direction: column;
    }

    .menu-btn {
        width: 100%;
        text-align: left;
    }
}

@media (max-width: 480px) {
    :root {
        --viz-size: 260px;
    }

    .main {
        padding: 16px 12px;
    }

    .footer-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .footer-actions {
        justify-content: center;
    }

    .footer-line {
        justify-content: center;
    }
}

/* Kuchyňa zatvorená – informácia na úvodnej stránke */
.kitchen-closed-banner {
    max-width: 1000px;
    margin: 0 auto 16px auto;
    padding: 12px 16px;
    background: #fdebd0;
    border: 1px solid var(--orange);
    border-radius: 10px;
    color: var(--dark);
    font-size: 0.92rem;
    line-height: 1.45;
}

.kitchen-closed .plnka-filters {
    display: none;
}
