/* ========================================
   Template Base - Styles communs
   ======================================== */

.menu-template {
    font-family: var(--t-body-font, 'Lato', sans-serif);
    color: var(--t-text, #333333);
    background: var(--t-bg, #ffffff);
    line-height: 1.6;
    position: relative;
    overflow: hidden;
}

/* Texture overlay — chaque template peut ajouter sa propre texture */
.menu-texture-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: multiply;
    opacity: 0.5;
}

/* Tout le contenu doit être au-dessus de la texture */
.menu-template .menu-header,
.menu-template .menu-body,
.menu-template .menu-footer,
.menu-template .menu-corner,
.menu-template .menu-deco-border,
.menu-template .menu-inner-border {
    position: relative;
    z-index: 1;
}

/* Mode PDF : dimensions A4 */
.menu-pdf-render .menu-template {
    width: 210mm;
    min-height: 297mm;
    padding: 15mm 20mm;
    box-sizing: border-box;
    margin: 0 auto;
}

/* Mode preview dans l'éditeur — même largeur que le PDF (A4 = 793px) */
.editor-preview-content .menu-template {
    width: 100%;
    min-height: 297mm;
}

/* ========================================
   SVG Ornaments — styles communs
   ======================================== */

.menu-svg-ornament {
    display: block;
    width: 160px;
    height: 20px;
    margin: 0 auto;
    color: var(--t-secondary, #c9a96e);
}

.menu-svg-ornament.menu-svg-ornament--lg {
    width: 40px;
    height: 50px;
}

.menu-header-deco .menu-svg-ornament {
    margin-top: 4px;
}

.menu-category-separator .menu-svg-ornament {
    width: 140px;
    height: 18px;
}

.menu-footer-separator .menu-svg-ornament {
    width: 120px;
    height: 12px;
    opacity: 0.5;
}

/* ========================================
   Éléments communs
   ======================================== */

.menu-restaurant-name {
    font-family: var(--t-heading-font, 'Playfair Display', serif);
    color: var(--t-primary, #2c3e50);
}

.menu-restaurant-subtitle {
    color: var(--t-secondary, #c9a96e);
}

.menu-category-name {
    font-family: var(--t-heading-font, 'Playfair Display', serif);
    color: var(--t-primary, #2c3e50);
}

.menu-item-name {
    font-weight: 600;
}

.menu-item-price {
    color: var(--t-primary, #2c3e50);
    font-weight: 600;
    white-space: nowrap;
}

.menu-item-description {
    font-size: 0.85em;
    opacity: 0.7;
    font-style: italic;
}

/* Flags / icônes diététiques */
.menu-item-flags {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    vertical-align: middle;
}

.menu-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
}

.menu-flag--vegetarian { background: #dcfce7; color: #166534; }
.menu-flag--vegan { background: #d1fae5; color: #065f46; }
.menu-flag--spicy { background: #fef2f2; color: #dc2626; }
.menu-flag--gluten-free { background: #fef3c7; color: #92400e; }
.menu-flag--signature { background: #fef3c7; color: #c9a96e; }

/* Info restaurant */
.menu-restaurant-info {
    font-size: 0.85em;
    opacity: 0.7;
}

.menu-restaurant-logo {
    max-height: 80px;
    width: auto;
    display: block;
}

/* Layout 2 colonnes */
.menu-body.menu-columns-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 30px;
    align-items: start;
}

.menu-body.menu-columns-2 .menu-category {
    break-inside: avoid;
}

/* ========================================
   Édition inline
   ======================================== */

.menu-inline-editable {
    cursor: text;
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-radius: 2px;
    transition: outline-color 0.15s ease;
}

.menu-inline-editable:hover {
    outline-color: rgba(201, 169, 110, 0.3);
}

.menu-inline-editable.is-editing {
    outline-color: rgba(201, 169, 110, 0.6);
    background: rgba(201, 169, 110, 0.05);
}

/* Masquer édition inline en mode PDF */
.menu-pdf-render .menu-inline-editable {
    cursor: default;
    outline: none !important;
    background: none !important;
}

/* Conteneur PDF hors-écran */
.menu-pdf-render {
    overflow: visible;
}

/* Saut de page PDF */
.page-break-before {
    page-break-before: always;
}

.html2pdf__page-break {
    page-break-before: always;
    display: block;
    height: 0;
    margin: 0;
    padding: 0;
}
