/* Update Menu Header Styles for smooth transition */
.menu-header {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4) 70%, rgba(245, 245, 245, 0.8) 100%),
                url('../images/menu.jpg') center/cover;
    background-attachment: fixed;
    color: white;
    text-align: center;
    padding: clamp(3rem, 10vh, 6rem) 0 clamp(4rem, 12vh, 8rem) 0; /* Increased bottom padding */
    margin-top: 60px;
    position: relative;
    margin-bottom: -50px; /* Create overlap with content */
    z-index: 1;
}

/* Mobile background fix for menu header */
@media (max-width: 768px) {
    .menu-header {
        background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4) 70%, rgba(245, 245, 245, 0.8) 100%),
                    url('../images/menu.jpg') center/cover !important;
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        transform: translateZ(0) !important;
        -webkit-transform: translateZ(0) !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
        min-height: 250px !important;
        z-index: 5 !important; /* Higher than content but lower than nav */
    }
}

/* Add this transition element */
.menu-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #f5f5f5);
    z-index: 0;
}

.menu-header .container {
    position: relative;
    z-index: 2; /* Keep text above gradient */
}

/* Menu Header Styles */
.menu-header {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.4)),
                url('../images/menu.jpg') center/cover;
    color: white;
    text-align: center;
    padding: clamp(3rem, 10vh, 6rem) 0;
    margin-top: 60px;
    position: relative;
}

.menu-header h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.menu-header p {
    font-size: clamp(1rem, 3vw, 1.4rem);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Menu Content - remove height restriction and scrolling */
.menu-content {
    padding: clamp(2rem, 3vw, 3rem) 0 clamp(3rem, 5vw, 5rem) 0; /* Increased bottom padding */
    position: relative;
    z-index: 2;
    background: #f5f5f5;
    border-radius: 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.05);
    max-height: none; /* Remove height restriction */
    overflow-y: visible; /* Remove scrolling */
}

/* Remove scroll indicator */
.menu-content::before {
    display: none; /* Remove scroll indicator */
}

/* Keep menu categories compact but ensure all are visible */
.menu-category {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.9));
    margin-bottom: clamp(1rem, 2.5vw, 1.5rem); /* Slightly increase margin */
    border-radius: clamp(4px, 1vw, 6px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    padding: clamp(0.8rem, 1.8vw, 1.2rem); /* Slightly increase padding */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Optimize container for better flow */
.container {
    width: min(95%, 1200px);
    margin-inline: auto;
    padding: clamp(0.5rem, 1.5vw, 1.5rem);
}

/* Ensure footer appears at the end */
footer {
    margin-top: auto; /* Push footer to bottom */
    position: relative; /* Ensure proper stacking */
}

/* Adjust menu-item spacing for better readability */
.menu-item {
    display: grid !important; 
    grid-template-columns: auto 1fr auto !important; 
    align-items: center !important;
    gap: 15px !important;
    padding: 8px 0 !important;
    margin-bottom: 8px !important;
    border-bottom: 1px dotted #eee !important;
    background: none !important;
    box-shadow: none !important;
}

.menu-item .portion {
    font-size: 0.9rem !important;
    color: #555 !important;
    white-space: nowrap !important;
    text-align: left !important;
    min-width: 45px !important;
}

.menu-item .menu-item-content {
    min-width: 0 !important; /* Aby fungovalo text-overflow */
}

.menu-item .menu-item-content h3 {
    display: block !important;
    font-size: 1rem !important;
    margin: 0 !important;
    padding: 0 !important;
    font-weight: normal !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.menu-item .description {
    display: block !important; 
    font-size: 0.85rem !important;
    color: #777 !important;
    margin-top: 3px !important;
}

.menu-item .price {
    font-weight: bold !important;
    white-space: nowrap !important;
    font-size: 1rem !important;
    text-align: right !important;
    min-width: 60px !important;
    color: #333 !important;
}

/* Tablet layout adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .menu-item .portion {
        font-size: 0.85rem !important;
        min-width: 40px !important;
    }
    
    .menu-item .menu-item-content h3 {
        font-size: 0.95rem !important;
    }
    
    .menu-item .price {
        font-size: 0.95rem !important;
        min-width: 55px !important;
    }
}

/* Fix for mobile view to make sure it matches desktop */
@media (max-width: 768px) {
    .menu-item .description {
        display: none !important; /* Skrýt pro úsporu místa na mobilu */
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .menu-category {
        transition: none;
    }
    
    .menu-category:hover {
        transform: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-header {
        padding: 4rem 0 2rem;
    }

    .menu-header h1 {
        font-size: 2.2rem;
    }

    .menu-header p {
        font-size: 1.1rem;
    }

    /* Simplified mobile design */
    .menu-category {
        background: transparent;
        box-shadow: none;
        border-bottom: 1px solid rgba(0,0,0,0.2);
        padding: 0.5rem;
        margin-bottom: 0.8rem;
    }
    
    .menu-category h3 {
        background: #f0f0f0;
        padding: 0.5rem;
        border-radius: 4px;
        font-size: 1rem;
        text-align: center;
        margin-bottom: 0.8rem;
    }
    
    /* Remove section titles completely for mobile */
    .menu-section-title {
        display: none;
    }
    
    /* Remove section separators */
    .menu-section + .menu-section {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
    
    /* Simplify sections */
    .menu-section {
        margin-top: 0;
    }
    
    /* OPRAVENO: Položky menu na jednom řádku */
    .menu-item {
        display: grid !important; /* Vynutí grid layout */
        grid-template-columns: auto 1fr auto !important; /* Tři sloupce: porce, název, cena */
        align-items: center !important;
        gap: 10px !important;
        padding: 5px 0 !important;
        margin-bottom: 5px !important;
        border-bottom: 1px dotted #eee !important;
        background: none !important;
        box-shadow: none !important;
    }
    
    .menu-item .portion {
        font-size: 0.75rem !important;
        color: #333 !important;
        white-space: nowrap !important;
        text-align: left !important;
        min-width: 30px !important;
    }
    
    .menu-item .menu-item-content {
        min-width: 0 !important; /* Aby fungovalo text-overflow */
    }
    
    .menu-item .menu-item-content h3 {
        display: block !important; /* Zabrání zmizení */
        font-size: 0.85rem !important;
        margin: 0 !important;
        padding: 0 !important;
        font-weight: normal !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .menu-item .description {
        display: none !important; /* Skrýt pro úsporu místa */
    }
    
    .menu-item .price {
        font-weight: bold !important;
        white-space: nowrap !important;
        font-size: 0.8rem !important;
        text-align: right !important;
        min-width: 45px !important;
    }
}

/* Přidejte tyto styly na konec souboru menu.css */

/* Mobilní úpravy pro jídelníček */
@media (max-width: 768px) {
    /* Odstranění podtržení/ohraničení pod položkami */
    .menu-item {
        border-bottom: none !important;
        margin-bottom: 10px !important;
        padding-bottom: 10px !important;
    }
    
    /* Zobrazení celého názvu jídla */
    .menu-item .menu-item-content h3 {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: 1.3 !important;
    }
    
    /* Více prostoru pro název jídla */
    .menu-item-content {
        padding-right: 5px !important;
    }
    
    /* Oddělení položek jemnějším způsobem */
    .menu-item + .menu-item {
        position: relative !important;
    }
    
    .menu-item + .menu-item::before {
        content: '' !important;
        position: absolute !important;
        top: -5px !important;
        left: 15% !important;
        right: 15% !important;
        height: 1px !important;
        background-color: rgba(0,0,0,0.05) !important;
    }
    
    /* Zajištění správného zarovnání ceny a porce */
    .menu-item {
        grid-template-columns: auto 1fr auto !important;
        align-items: start !important;
    }
    
    .menu-item .portion {
        padding-top: 2px !important;
    }
    
    .menu-item .price {
        padding-top: 2px !important;
        font-weight: bold !important;
    }
    
    /* Zlepšení struktury položek menu */
    .menu-category {
        padding: 0.8rem !important;
        margin-bottom: 1rem !important;
    }
}

/* Extra úpravy pro velmi malé displeje */
@media (max-width: 480px) {
    .menu-item .menu-item-content h3 {
        font-size: 0.85rem !important;
    }
    
    .menu-item {
        gap: 5px !important;
    }
    
    .menu-category h3 {
        font-size: 1rem !important;
    }
}

/* Print optimization */
@media print {
    .menu-header {
        background: none;
        color: black;
        padding: 1rem 0;
    }
    
    .menu-category {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .menu-item {
        border: none;
    }
}

/* Speciální styly pro stálé menu */
.permanent-menu-item {
    display: grid !important; 
    grid-template-columns: auto 1fr auto !important; 
    align-items: center !important;
    gap: 15px !important;
    padding: 8px 0 !important;
    margin-bottom: 8px !important;
    border-bottom: 1px dotted #eee !important;
}

/* Responzivní design pro stálé menu */
@media (max-width: 768px) {
    .permanent-menu-item {
        grid-template-columns: 1fr auto !important;
    }
    
    .permanent-menu-item .portion {
        display: none !important;
    }
}

/* Úprava pro aktivní odkaz v menu */
.nav-links a[href="permanent-menu.php"].active {
    color: var(--secondary-color) !important;
    position: relative !important;
    text-shadow: 0 0 8px rgba(255, 119, 0, 0.6) !important;
}

.nav-links a[href="permanent-menu.php"].active::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 3px !important;
    background-color: #ff7700 !important;
    box-shadow: 0 0 8px 1px #ff7700 !important;
    transform: scaleX(1) !important;
    transition: all 0.3s ease !important;
}

/* Přidejte tyto styly úplně na konec souboru menu.css - pořadí je důležité! */

/* Silnější oprava pro mobilní zobrazení - tyto styly musí být úplně poslední */
@media (max-width: 768px) {
    /* Vynucené odstranění šedého boxu a zalamování textu */
    .menu-item {
        border: none !important;
        border-bottom: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    
    /* Kompletní reset všech možných ohraničení */
    .menu-item,
    .menu-item::before,
    .menu-item::after {
        border-radius: 0 !important;
        background-image: none !important;
    }
    
    /* Absolutně zajistit zalamování textu */
    .menu-item .menu-item-content h3,
    .menu-item-content h3,
    h3.menu-item-title,
    .menu-item h3 {
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        word-break: break-word !important;
        line-height: 1.3 !important;
        max-width: 100% !important;
        text-align: left !important;
    }
    
    /* Pokud se používá více kontejnerů */
    .menu-item .menu-item-content,
    .menu-item-content {
        max-width: 100% !important;
        width: 100% !important;
        white-space: normal !important;
    }
    
    /* Ostatní položky menu */
    .menu-item .description {
        display: block !important; /* Zobrazit popis */
        font-size: 0.8rem !important;
        color: #777 !important;
        margin-top: 3px !important;
    }
    
    /* Lepší rozložení celé položky */
    .menu-items .menu-item,
    .menu-item {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr) auto !important;
        grid-gap: 8px !important;
        margin-bottom: 15px !important;
        padding: 5px 0 !important;
        background: none !important;
    }
    
    /* Zajištění struktury položek */
    .menu-item + .menu-item {
        margin-top: 8px !important;
        position: relative !important;
    }
    
    /* Jemné oddělení položek bez ohraničení */
    .menu-item + .menu-item::before {
        content: '' !important;
        position: absolute !important;
        top: -4px !important;
        left: 20% !important;
        right: 20% !important;
        height: 1px !important;
        background-color: rgba(0,0,0,0.03) !important;
    }
}

/* Ještě silnější úpravy pro nejmenší obrazovky */
@media (max-width: 480px) {
    .menu-item .menu-item-content h3 {
        font-size: 0.9rem !important;
        font-weight: normal !important;
    }
}
