/* v1.31 - Marquee mobile 11px, menu styling, popup layout fixes */
/* ═══════════════════════════════════════════════════════════════════
   SMAAKVERZET - UNIFIED STYLESHEET
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   CSS VARIABLES
   ═══════════════════════════════════════════════════════════════════ */

:root {
    --primary-color: #ff6a0c;
    --primary-color-hover: rgba(255, 106, 12, 0.1);
    --background-color: #1a1a1a;
    --text-color: #f0f0f0;
    --text-color-dark: #000000;
    --dark-grey: #2c2c2c;
    --light-grey: #f0f0f0;
}

/* ═══════════════════════════════════════════════════════════════════
   RESET & BASE STYLES
   ═══════════════════════════════════════════════════════════════════ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    font-family: 'DM Mono', monospace;
    color: #ffffff;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   BACKGROUNDS - Fixed: proper alignment, no jumping
   ═══════════════════════════════════════════════════════════════════ */

/* Framework page (index.html) - no background */
body.framework-page {
    background: #1a1a1a;
}

/* Home page in iframe - FIXED */
body.home-page {
    background-color: #1a1a1a;
    background-image: url('../images/index_bg.jpg');
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed; /* ALWAYS FIXED */
    min-height: 100vh;
    overflow: hidden;
}

/* Menu page in iframe */
body.menu-display {
    background: #000000;
}

/* Menu page in iframe (menu.html) - background with white overlay */
body.menu-iframe {
    margin: 0;
    padding: 0;
    position: relative;
    min-height: 100vh;
}

body.menu-iframe::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/menu_bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    z-index: -2;
}

body.menu-iframe::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    z-index: -1;
    pointer-events: none;
}

body.menu-iframe header {
    display: none !important;
}

body.menu-iframe footer {
    display: none !important;
}

body.menu-iframe #app-wrapper {
    padding-top: 0 !important;
}

body.menu-iframe #main-content {
    padding-top: 10px !important;
}

/* Marquee container in menu.html (different from index marquee) */
body.menu-iframe #marquee-container {
    background-color: transparent;
    color: #000000;
    overflow: hidden;
    display: flex;
    min-height: 24px;
    padding: 2px 0 0 0;
    position: relative;
    width: 100%;
    font-size: 14px;
    margin-bottom: 0;
    margin-top: 0;
}

body.menu-iframe #marquee-text {
    display: flex;
    flex-shrink: 0;
    will-change: transform;
    white-space: nowrap;
}

body.menu-iframe .popup-grid h3 {
    display: block;
    background: #000000;
    color: #ffffff;
    padding: 8px 16px;
    margin: 0 0 12px 0;
    width: 100%;
    box-sizing: border-box;
}

body.menu-iframe .popup-grid .popup-left-top {
    display: flex;
    justify-content: flex-start;
}

body.menu-iframe .popup-grid #popup-item-image {
    width: auto !important;
    min-width: 200px !important;
    max-width: none !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: cover !important;
}

/* Catering page in iframe */
body.catering-display {
    background-color: #000000;
    min-height: 100vh;
    overflow: hidden;
}

/* Inquiry page in iframe - FIXED: background stays fixed */
body.inquiry-display {
    background-color: #000000;
    background-image: url('../images/inquiry_bg.jpg');
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    overflow-y: auto;
}

/* About page in iframe - FIXED */
body.about-display {
    background-color: #000000;
    background-image: url('../images/about_bg.jpg');
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════════ */

.hidden {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* ═══════════════════════════════════════════════════════════════════
   HEADER & BANNER (index.html)
   ═══════════════════════════════════════════════════════════════════ */

#fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

#banner-container {
    background: var(--primary-color);
    padding: 8px 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    position: relative;
}

#header-banner {
    height: 60px !important;
    width: auto !important;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

#top-bar {
    background: #ffffff;
    padding: 0 0 2px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-top: 2px solid #000000;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 0;
}

#action-buttons {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    gap: 4px;
}

.top-btn {
    color: #000000;
    background: transparent;
    text-decoration: none;
    padding: 2px 6px 2px 6px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.top-btn:hover {
    color: var(--primary-color);
}

.instagram-icon {
    width: 14px;
    height: 14px;
}

.btn-separator {
    color: #000000;
    font-size: 14px;
    padding: 0 2px;
}

/* ═══════════════════════════════════════════════════════════════════
   LANGUAGE SWITCHER
   ═══════════════════════════════════════════════════════════════════ */

#language-switcher-container {
    position: absolute;
    top: 5px;
    right: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
}

.language-option {
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    color: #ffffff;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.language-option:hover {
    opacity: 1;
}

.language-option.active {
    opacity: 1;
    font-weight: bold;
}

.lang-separator {
    color: #ffffff;
    opacity: 0.5;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════
   MARQUEE (index.html)
   ═══════════════════════════════════════════════════════════════════ */

#marquee-index-container {
    background-color: #ffffff;
    color: #000000;
    overflow: hidden;
    display: flex;
    min-height: 24px;
    padding: 2px 0 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    font-size: 14px;
    margin-bottom: calc(6px + (10px * 1.4) + 6px - 2px);
}

#marquee-index-text {
    display: flex;
    flex-shrink: 0;
    will-change: transform;
    white-space: nowrap;
}

.marquee-index-segment {
    flex-shrink: 0;
    white-space: nowrap;
    padding-right: var(--marquee-index-gap, 100px);
    color: #000000;
    font-size: 14px;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════════
   IFRAME CONTAINER (index.html) - FIXED: no 2px gap
   ═══════════════════════════════════════════════════════════════════ */

#content-iframe-container {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
    z-index: 1;
}

#content-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   POPUPS
   ═══════════════════════════════════════════════════════════════════ */

.popup-form, .popup-simple {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.popup-form:not(.hidden), .popup-simple:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.popup-content {
    background: #ffffff;
    color: #000000;
    padding: 24px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.popup-header h3 {
    margin: 0 0 16px 0;
    color: var(--primary-color);
    font-size: 20px;
}

.popup-body {
    margin-bottom: 20px;
    line-height: 1.6;
    color: #000000;
}

.popup-footer {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Item popup (menu.html) */
#order-item-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#order-item-popup:not(.hidden) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.popup-grid {
    background: #ffffff;
    color: #000000;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 300px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: center;
    /* Ensure content stays together */
    position: relative;
}

/* Two-column layout for popup - MUST stay as unit */
.popup-two-column-layout {
    display: block;
    width: 100%;
    position: relative;
}

.popup-left-column,
.popup-right-column {
    width: 100%;
    position: relative;
}

.popup-left-top,
.popup-left-bottom,
.popup-right-top,
.popup-right-middle {
    position: relative;
    width: 100%;
}

.popup-grid h3 {
    margin: 0 0 12px 0;
    background-color: #000000;
    color: #ffffff;
    padding: 12px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

#popup-item-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 auto 8px auto;
    display: block;
    cursor: pointer;
}

.popup-grid p {
    margin: 0 0 8px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #000000;
}

#popup-item-badges {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: var(--primary-color);
    font-style: italic;
}

#cancel-order-item-button {
    margin: 20px auto 0 auto;
    width: auto;
    display: block;
    padding: 8px 20px;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#cancel-order-item-button:hover {
    background: var(--primary-color-hover);
}

/* Popup navigation arrows */
.popup-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
}

.popup-nav-arrow:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.popup-nav-prev {
    left: 10px;
}

.popup-nav-next {
    right: 10px;
}

/* Mobile: hide arrows, use swipe */
@media (max-width: 768px) {
    .popup-nav-arrow {
        display: none !important;
    }
    
    /* Mobile popup - scrollable card over background */
    #order-item-popup {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #order-item-popup .popup-grid {
        margin: 20px auto;
        margin-bottom: 100px; /* Extra ruimte onderaan */
        max-height: none;
        overflow: visible;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    border-radius: 4px;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-cancel {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    cursor: pointer;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    border-radius: 4px;
}

.btn-cancel:hover {
    background: var(--primary-color-hover);
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER (index.html)
   ═══════════════════════════════════════════════════════════════════ */

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #000000;
    text-align: center;
    padding: 6px 10px;
    z-index: 999;
    line-height: 1.4;
}

footer p {
    margin: 0;
    font-size: 10px;
    color: #ffffff;
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════════ */

/* Home page - vertically centered */
body.home-page #main-content {
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Menu page - no centering (stays top) */
body.menu-display #main-content {
    padding: 20px 0 0 0;
    margin: 0;
}

/* Loading spinner (menu.html) */
body.is-loading #loading-indicator {
    display: flex;
}

#loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #2c2c2c;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Catering page - vertically centered */
body.catering-display #main-content {
    padding: 20px;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#catering-container {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

/* Inquiry page - start top (form can scroll) */
body.inquiry-display #main-content {
    padding: 20px;
    padding-bottom: 100px; /* Extra ruimte voor footer + marquee */
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
}

#inquiry-container {
    width: 100%;
    max-width: 900px;
    background: #ffffff;
    color: #000000;
    padding: 24px;
    margin-top: 0;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#inquiry-container h2 {
    color: var(--primary-color);
    font-size: 22px;
    margin: 0 0 12px 0;
    text-align: center;
}

#inquiry-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

#inquiry-form .form-group.full-width {
    grid-column: 1 / -1;
}

#inquiry-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #000000;
    font-size: 14px;
}

#inquiry-form .form-group input,
#inquiry-form .form-group select,
#inquiry-form .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

#inquiry-form .form-footer {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    grid-column: 1 / -1;
}

/* About page - popup centered both desktop and mobile */
body.about-display #main-content {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center; /* CENTER vertically on desktop too */
    min-height: calc(100vh - 80px);
}

#about-container {
    position: relative;
    max-width: 600px; /* Breder - vergelijkbaar met banner */
    width: 90%;
    background: #ffffff;
    color: #000000;
    padding: 32px 28px;
    border-radius: var(--border-radius, 4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin: 20px;
}

/* Tape pieces - 70px (was 100px, now 30% smaller) */
.tape {
    position: absolute;
    width: 70px;
    height: auto;
    pointer-events: none;
    z-index: 10;
}

.tape-top-left {
    top: -14px;
    left: -14px;
    transform: rotate(var(--tape-rotation, -15deg));
}

.tape-top-right {
    top: -14px;
    right: -14px;
    transform: rotate(var(--tape-rotation, 15deg));
}

.tape-bottom-left {
    bottom: -14px;
    left: -14px;
    transform: rotate(var(--tape-rotation, 15deg));
}

.tape-bottom-right {
    bottom: -14px;
    right: -14px;
    transform: rotate(var(--tape-rotation, -15deg));
}

#about-container h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin: 0;
    text-align: center;
}

#about-container .about-subtitle {
    color: var(--primary-color);
    font-size: 14px;
    margin: 4px 0 16px 0;
    text-align: center;
}

.about-content {
    color: #000000;
    font-size: 16px;
    line-height: 1.6;
}

/* Mobile about page */
@media (max-width: 768px) {
    body.about-display {
        background-attachment: fixed;
    }
    
    body.about-display #main-content {
        padding: 20px 15px;
        min-height: calc(100vh - 120px);
        align-items: center;
    }
    
    #about-container {
        max-width: 100%;
        max-height: calc(100vh - 160px);
        margin: 10px;
        padding: 24px 20px;
        display: flex;
        flex-direction: column;
    }
    
    #about-container h2 {
        font-size: 20px;
        flex-shrink: 0;
    }
    
    #about-container .about-subtitle {
        font-size: 12px;
        flex-shrink: 0;
    }
    
    .about-content {
        font-size: 14px;
        line-height: 1.4;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
    
    /* Subtle scroll indicators */
    .about-content::-webkit-scrollbar {
        width: 2px;
    }
    
    .about-content::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .about-content::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 1px;
    }
    
    .tape {
        width: 50px;
    }
    
    .tape-top-left,
    .tape-top-right {
        top: -10px;
    }
    
    .tape-bottom-left,
    .tape-bottom-right {
        bottom: -10px;
    }
    
    .tape-top-left,
    .tape-bottom-left {
        left: -10px;
    }
    
    .tape-top-right,
    .tape-bottom-right {
        right: -10px;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   MENU DISPLAY (menu.html)
   ═══════════════════════════════════════════════════════════════════ */

#menu-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 2rem;
    margin: 0 auto;
    padding: 20px;
    padding-top: 2px;
    width: 100%;
    max-width: 95%;
    justify-content: flex-start;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

.menu-column {
    flex: 1;
    min-width: 0;
    align-self: flex-start;
}

@media (max-width: 768px) {
    #menu-container {
        flex-direction: column;
    }
    
    .menu-column {
        width: 100%;
    }
}

.category-title-compact {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff !important;
    background-color: #000000;
    padding: 6px 12px;
    margin: 0.5rem 0 0.6rem 0;
    border-radius: 4px;
    text-align: center;
}

.menu-column .category-title-compact:not(:first-child) {
    margin-top: 1rem;
}

.menu-list-compact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item-compact {
    margin-top: 1.4rem;
    margin-bottom: 0.7rem;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.item-header h3 {
    margin: 0;
    font-size: 0.95em;
    font-weight: normal;
    color: #000000 !important;
    background-color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 3px;
    display: inline-block;
}

.item-options {
    font-size: 0.9em;
    color: #cccccc !important;
    font-weight: normal;
}

.menu-item-compact p {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: var(--primary-color) !important;
    background-color: #ffffff;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
    line-height: 1.3;
}

.menu-item-compact .item-badges {
    margin: 4px 0 0 0;
    font-size: 0.75em;
    color: #000000 !important;
    line-height: 1.4;
}

.menu-item-compact .item-badges .badge-item {
    display: inline;
    margin-right: 8px;
}

.menu-item-compact .item-badges .badge-item em {
    font-style: italic;
    font-weight: 400;
    color: #000000 !important;
}

.menu-item-compact.interactive {
    cursor: pointer;
    transition: outline 0.2s;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.menu-item-compact.interactive:hover {
    background-color: rgba(255, 106, 12, 0.1); /* Orange 10% opacity */
    border-radius: var(--border-radius, 4px);
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE STYLES
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    #header-banner {
        max-width: calc(100% - 10px) !important;
    }
    
    .top-btn {
        font-size: 11px !important;
    }
    
    #marquee-index-container,
    #marquee-index-text,
    .marquee-index-segment {
        font-size: 11px !important; /* Zelfde als .top-btn op mobile */
    }
    
    #inquiry-form {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    #inquiry-form .form-footer {
        flex-direction: column;
    }
}
