/* ============================================================================
   THEME ACCORDION — Yngredient (porté depuis Carteetmenu, adapté Yngredient)
   Navigation par sections pliantes + recherche + navigation rapide + détail item
   ============================================================================ */

body.theme-accordion {
    margin: 0;
    padding: 0;
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #1a1a2e, #0f0f1e);
    color: #f0f0f0;
    min-height: 100vh;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

body.theme-accordion * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

.acc-container { max-width: 1200px; margin: 0 auto; }

.acc-header { text-align: center; margin-bottom: 2rem; position: relative; }
.acc-header h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 300; letter-spacing: 3px; color: #d4af37;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
    margin: 0 0 0.4rem;
}
.acc-header .acc-subtitle { font-size: 0.95rem; color: #b8b8b8; letter-spacing: 1px; }

/* Search bar + controls ------------------------------------------------------ */
.acc-search-bar {
    position: sticky; top: 0; z-index: 50;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0; margin: 0 -1rem 1.5rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}
.acc-search-container {
    max-width: 1200px; margin: 0 auto; padding: 0 1rem;
    display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
}
.acc-search-input {
    flex: 1; min-width: 200px;
    padding: 0.75rem 1rem; font-size: 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px; color: #f0f0f0; font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}
.acc-search-input:focus {
    outline: none;
    border-color: #d4af37;
    background: rgba(255,255,255,0.08);
}
.acc-search-input::placeholder { color: rgba(240,240,240,0.5); }

.acc-quick-nav select {
    padding: 0.75rem 2rem 0.75rem 1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px; color: #f0f0f0; font-family: inherit;
    font-size: 0.95rem; cursor: pointer; min-width: 200px;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23d4af37' stroke-width='1.5' fill='none'/></svg>");
    background-repeat: no-repeat; background-position: right 0.75rem center;
}
.acc-quick-nav select:focus { outline: none; border-color: #d4af37; }

/* Style des options du dropdown : sur Chrome/Firefox/Edge les <option> n'héritent
   pas du style du <select> parent une fois le menu ouvert (style natif OS).
   On force le fond sombre + texte clair pour rester cohérent avec le reste du site. */
.acc-quick-nav select option {
    background: #1a1a2e;
    color: #f0f0f0;
    padding: 0.5rem;
}
.acc-quick-nav select option:checked,
.acc-quick-nav select option:hover {
    background: #d4af37;
    color: #1a1a2e;
}

/* Sections accordion --------------------------------------------------------- */
.acc-section {
    margin-bottom: 0.75rem;
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.02);
    transition: background 0.3s, border-color 0.3s;
}
.acc-section.acc-highlight { animation: accFlash 1.6s ease; }
@keyframes accFlash {
    0%,100% { box-shadow: 0 0 0 rgba(212,175,55,0); }
    30%,60% { box-shadow: 0 0 24px rgba(212,175,55,0.5); }
}

.acc-section-header {
    padding: 1.1rem 1.5rem;
    cursor: pointer; user-select: none;
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(90deg, rgba(212,175,55,0.08), rgba(212,175,55,0.02));
    transition: background 0.2s;
}
.acc-section-header:hover { background: linear-gradient(90deg, rgba(212,175,55,0.15), rgba(212,175,55,0.04)); }
.acc-section-header h2 {
    font-size: 1.4rem; font-weight: 400; color: #d4af37;
    letter-spacing: 2px; margin: 0;
}
.acc-section-header::after {
    content: '+'; font-size: 1.6rem; color: #d4af37; font-weight: 300;
    transition: transform 0.3s; line-height: 1;
}
.acc-section.acc-active > .acc-section-header::after { content: '−'; }

.acc-section-content {
    max-height: 0; overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s;
    padding: 0 1.5rem;
}
.acc-section.acc-active > .acc-section-content {
    max-height: none; padding: 1rem 1.5rem 1.5rem;
}
.acc-section-description {
    font-style: italic; color: #b8b8b8; font-size: 0.95rem;
    margin-bottom: 1rem; padding: 0.75rem 1rem;
    border-left: 2px solid #d4af37; background: rgba(212,175,55,0.05);
    border-radius: 0 4px 4px 0;
}

/* Subsections ---------------------------------------------------------------- */
.acc-subsection {
    margin-bottom: 0.75rem; margin-top: 0.5rem;
    border: 1px solid rgba(212,175,55,0.15);
    border-radius: 6px; overflow: hidden;
    background: rgba(0,0,0,0.15);
}
.acc-subsection-header {
    padding: 0.85rem 1.25rem; cursor: pointer; user-select: none;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(212,175,55,0.04);
    transition: background 0.2s;
}
.acc-subsection-header:hover { background: rgba(212,175,55,0.08); }
.acc-subsection-header h3 {
    font-size: 1.1rem; font-weight: 400; color: #e8c87a;
    letter-spacing: 1px; margin: 0;
}
.acc-subsection-header::after {
    content: '+'; font-size: 1.3rem; color: #e8c87a; font-weight: 300; line-height: 1;
}
.acc-subsection.acc-active > .acc-subsection-header::after { content: '−'; }
.acc-subsection-content {
    max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.3s;
    padding: 0 1.25rem;
}
.acc-subsection.acc-active > .acc-subsection-content { max-height: none; padding: 0.75rem 1.25rem 1rem; }

/* Items (compact + détail au clic) ------------------------------------------- */
.acc-item {
    padding: 0.85rem 0; border-bottom: 1px solid rgba(212,175,55,0.08);
    cursor: pointer;
    transition: padding-left 0.2s;
}
.acc-item:last-child { border-bottom: none; }
.acc-item:hover { padding-left: 0.5rem; }
.acc-item-row {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 0.85rem;
}
.acc-item-text { flex: 1; min-width: 0; }

/* Thumb carré en ligne compacte (visible si recette a show_image_carte=true) */
.acc-item-thumb {
    width: 64px; height: 64px;
    flex-shrink: 0;
    border-radius: 6px;
    object-fit: cover;
    cursor: zoom-in;
    border: 1px solid rgba(212,175,55,0.25);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.acc-item-thumb:hover {
    transform: scale(1.04);
    border-color: #d4af37;
}
@media (max-width: 600px) {
    .acc-item-thumb { width: 56px; height: 56px; }
}
.acc-item-title {
    font-size: 1.05rem; font-weight: 500; color: #f0f0f0;
    margin-bottom: 0.2rem;
}
.acc-item-subtitle {
    font-size: 0.9rem; color: #b8b8b8; font-style: italic;
    line-height: 1.4;
}
.acc-item-price {
    font-size: 1.15rem; font-weight: 500; color: #d4af37;
    white-space: nowrap; min-width: 60px; text-align: right;
}

/* Variant table (Kronenbourg 25/50/1L) --------------------------------------- */
.acc-item-variants {
    display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem;
    width: 100%;
}
.acc-variant-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 0.4rem 0.6rem;
    background: rgba(212,175,55,0.06);
    border-left: 2px solid rgba(212,175,55,0.3);
    border-radius: 4px;
}
.acc-variant-volume { color: #b8b8b8; font-size: 0.9rem; letter-spacing: 0.5px; }
.acc-variant-price { color: #d4af37; font-size: 1.05rem; font-weight: 500; }

/* Détail (hybride : expansion inline) ---------------------------------------- */
.acc-item-detail {
    max-height: 0; overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s, margin 0.25s;
    padding: 0; margin: 0;
}
.acc-item.acc-detail-open .acc-item-detail {
    max-height: none; padding: 0.85rem 0 0.25rem; margin-top: 0.5rem;
    border-top: 1px dashed rgba(212,175,55,0.2);
}
.acc-item-detail-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: start;
}
@media (max-width: 600px) {
    .acc-item-detail-grid { grid-template-columns: 1fr; }
}
.acc-item-detail-img {
    width: 120px; height: 120px; border-radius: 6px;
    object-fit: cover; cursor: zoom-in;
    border: 1px solid rgba(212,175,55,0.2);
}
.acc-item-detail-info { font-size: 0.92rem; line-height: 1.55; }
.acc-item-detail-info strong { color: #e8c87a; }
.acc-item-detail-meta {
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin-top: 0.5rem;
    color: #b8b8b8; font-size: 0.85rem;
}
.acc-item-detail-meta span::before { content: '· '; color: #d4af37; margin-right: 0.2rem; }
.acc-item-detail-meta span:first-child::before { content: ''; margin: 0; }

/* Search highlight & no-results --------------------------------------------- */
mark { background: rgba(212,175,55,0.35); color: inherit; padding: 0 2px; border-radius: 2px; }
.acc-no-results {
    text-align: center; padding: 3rem 1rem; color: #b8b8b8; font-style: italic;
}

/* Bouton Infos + panel coulissant ------------------------------------------- */
.acc-info-button {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    color: #f0f0f0;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.acc-info-button:hover {
    background: rgba(212, 175, 55, 0.18);
    border-color: #d4af37;
}
.acc-info-button::before { content: 'ℹ'; color: #d4af37; font-style: normal; font-weight: 700; }

.acc-info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 999;
}
.acc-info-overlay.acc-active {
    opacity: 1;
    pointer-events: auto;
}

.acc-info-panel {
    position: fixed;
    top: 0; right: -480px;
    width: 100%; max-width: 460px;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #0f0f1e);
    border-left: 1px solid rgba(212, 175, 55, 0.3);
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.5);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding: 1.5rem 1.5rem 3rem;
    color: #f0f0f0;
}
.acc-info-panel.acc-active { right: 0; }

.acc-info-panel-close {
    position: absolute;
    top: 0.85rem; right: 1rem;
    background: none; border: none;
    font-size: 1.75rem; line-height: 1;
    cursor: pointer; color: #d4af37;
    padding: 0.25rem 0.5rem;
}

.acc-restaurant-info { margin-top: 1.5rem; }

.acc-restaurant-info h2 {
    color: #d4af37;
    margin: 0 0 1.25rem;
    font-weight: 300;
    letter-spacing: 2px;
    font-size: 1.4rem;
}

.acc-info-section { margin-bottom: 1.5rem; }

.acc-info-section h3 {
    color: #d4af37;
    font-size: 1rem;
    margin: 0 0 0.5rem;
    font-weight: 400;
    letter-spacing: 1px;
}

.acc-info-section p {
    margin: 0 0 0.35rem;
    color: #d8d8d8;
    line-height: 1.55;
    font-size: 0.95rem;
}
.acc-info-section a { color: #d4af37; }

.acc-hours-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.35rem 0;
}
.acc-hours-table tr { border-bottom: 1px solid rgba(212, 175, 55, 0.1); }
.acc-hours-table td { padding: 0.55rem 0; color: #b8b8b8; font-size: 0.92rem; }
.acc-hours-table td:last-child { text-align: right; color: #f0f0f0; }

.acc-social-links {
    display: flex; gap: 1rem; margin-top: 0.5rem;
    flex-wrap: wrap;
}
.acc-social-links a {
    color: #d4af37;
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.acc-social-links a:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: #d4af37;
}

/* Mobile : le panel occupe toute la largeur */
@media (max-width: 600px) {
    .acc-info-panel { max-width: 100%; padding: 1.25rem 1rem 3rem; }
}

/* Back to top --------------------------------------------------------------- */
.acc-back-to-top {
    position: fixed; bottom: 5.2rem; right: 1.5rem;
    width: 44px; height: 44px; border-radius: 50%;
    background: #d4af37; color: #1a1a2e;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    font-size: 1.4rem; font-weight: 700; z-index: 40;
}
.acc-back-to-top.acc-visible { opacity: 1; pointer-events: auto; }
.acc-back-to-top:hover { transform: translateY(-3px); }
.acc-back-to-top::before { content: '↑'; }

/* Footer -------------------------------------------------------------------- */
.acc-footer {
    text-align: center; margin-top: 3rem; padding: 1.5rem 1rem;
    border-top: 1px solid rgba(212,175,55,0.2);
    color: #b8b8b8; font-size: 0.85rem; line-height: 1.6;
}

/* Loading state ------------------------------------------------------------- */
.acc-loading { text-align: center; padding: 3rem 1rem; color: #b8b8b8; font-style: italic; }

/* Mobile tweaks ------------------------------------------------------------- */
@media (max-width: 600px) {
    body.theme-accordion { padding: 1rem 0.75rem; }
    .acc-section-header { padding: 0.9rem 1rem; }
    .acc-section-header h2 { font-size: 1.15rem; letter-spacing: 1.5px; }
    .acc-section.acc-active > .acc-section-content { padding: 0.75rem 1rem 1rem; }
    .acc-subsection-header { padding: 0.7rem 0.9rem; }
    .acc-subsection.acc-active > .acc-subsection-content { padding: 0.6rem 0.9rem 0.8rem; }
    .acc-item-title { font-size: 1rem; }
    .acc-item-price { font-size: 1.05rem; }
    .acc-search-container { gap: 0.5rem; }
    .acc-quick-nav select { min-width: 100%; }
}

/* ============================================================================
   En-tête de carte publique — logo (optionnel) + nom de l'établissement
   Rendu serveur-side dans carte.php ; le bloc complet est omis si ni logo ni
   nom ne sont définis (pas besoin de masquage CSS).
   ============================================================================ */
.acc-page-header {
    text-align: center;
    margin: 0 0 1.5rem;
    padding: 0.5rem 0;
}
.acc-page-logo {
    display: block;
    max-height: 80px;
    width: auto;
    max-width: 90%;
    margin: 0 auto 0.75rem;
    object-fit: contain;
}
.acc-page-name {
    margin: 0;
    font-size: clamp(1.6rem, 4.5vw, 2.4rem);
    font-weight: 300;
    letter-spacing: 2px;
    color: #d4af37;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}
/* Si pas de logo : le nom seul prend un peu plus d'espace vertical pour l'aération */
.acc-page-header:not(:has(.acc-page-logo)) .acc-page-name {
    padding-top: 0.5rem;
}
/* Mobile : réduit le logo et resserre */
@media (max-width: 640px) {
    .acc-page-header { margin-bottom: 1rem; }
    .acc-page-logo { max-height: 64px; margin-bottom: 0.5rem; }
}

/* ============================================================
   Mode 'tableau' : section.affichage === 'tableau'
   Minimaliste : en-têtes jaunes (uniquement), 5px entre colonnes
   via border-spacing, +5px padding-right sur la colonne produit
   pour 10px total avec la 1ère colonne prix. Pas de bordures.
   ============================================================ */
.acc-section-variants-table-wrap {
    margin: 0.5rem 0 0.75rem;
    overflow-x: auto;
}
.acc-section-variants-table {
    border-collapse: separate;
    border-spacing: 5px 0;
    font-variant-numeric: tabular-nums;
}
.acc-section-variants-table thead th {
    text-align: center;
    padding: 0.35rem 0;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d4af37;                 /* jaune : EN-TÊTES UNIQUEMENT */
    opacity: 0.85;
    white-space: nowrap;
}
.acc-section-variants-table thead th.acc-vt-product {
    text-align: left;
    padding-right: 5px;
    color: inherit;
}
.acc-section-variants-table tbody td {
    padding: 0.28rem 0;
    text-align: right;
    white-space: nowrap;
}
.acc-section-variants-table tbody td.acc-vt-product {
    text-align: left;
    font-weight: 500;
    color: inherit;
    padding-right: 5px;
}
.acc-section-variants-table tbody td.acc-vt-price {
    font-weight: 500;
    /* couleur héritée du thème (pas de jaune sur les prix) */
}
.acc-section-variants-table tbody td.acc-vt-empty {
    color: rgba(127, 127, 127, 0.35);
}
@media (max-width: 600px) {
    .acc-section-variants-table thead th,
    .acc-section-variants-table tbody td {
        font-size: 0.82rem;
    }
}
