/**
 * Styles pour Menu pour la 12
 * Front-end
 */

/* Container principal */
.mpl12-menu-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Barre d'onglets */
.mpl12-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Onglets principaux (Niveau 1) */
.mpl12-tabs-primary {
    border-bottom: 2px solid #e5e7eb;
}

.mpl12-tab-primary {
    flex: 1 1 auto;
    min-width: 150px;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mpl12-tab-primary:hover {
    color: #111827;
    background-color: #f9fafb;
}

.mpl12-tab-primary.active {
    color: #111827;
    border-bottom-color: #EA792E;
    font-weight: 600;
}

/* Onglets secondaires (Niveau 2) */
.mpl12-tabs-secondary {
    border-bottom: 1px solid #e5e7eb;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    background-color: #f9fafb;
    border-radius: 8px 8px 0 0;
}

.mpl12-tab-secondary {
    flex: 1 1 auto;
    min-width: 120px;
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mpl12-tab-secondary:hover {
    color: #111827;
    background-color: #e5e7eb;
}

.mpl12-tab-secondary.active {
    color: #EA792E;
    border-bottom-color: #EA792E;
    font-weight: 600;
    background-color: #fff;
}

/* Prix dans les onglets secondaires */
.mpl12-tab-price {
    display: inline-block;
    background-color: #EA792E;
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.mpl12-tab-secondary.active .mpl12-tab-price {
    background-color: #d66a26;
}

.mpl12-tab-secondary:hover .mpl12-tab-price {
    background-color: #d66a26;
}

.mpl12-tab {
    flex: 1 1 auto;
    min-width: 150px;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.mpl12-tab:hover {
    color: #111827;
    background-color: #f9fafb;
}

.mpl12-tab.active {
    color: #111827;
    border-bottom-color: #EA792E;
    font-weight: 600;
}

/* Contenu des onglets */
.mpl12-content {
    position: relative;
    min-height: 300px;
}

.mpl12-content-primary {
    position: relative;
    min-height: 300px;
}

.mpl12-content-secondary {
    position: relative;
    min-height: 200px;
}

.mpl12-tab-content {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.mpl12-tab-content.active {
    display: block;
}

.mpl12-tab-content-primary {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.mpl12-tab-content-primary.active {
    display: block;
}

.mpl12-tab-content-secondary {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.mpl12-tab-content-secondary.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading */
.mpl12-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6b7280;
}

.mpl12-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #EA792E;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Catégories */
.mpl12-category {
    margin-bottom: 3rem;
}

.mpl12-category:last-child {
    margin-bottom: 0;
}

.mpl12-category-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

/* Items du menu */
.mpl12-items {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mpl12-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.mpl12-item:hover {
    background-color: #f9fafb;
}

.mpl12-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.mpl12-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mpl12-item-content {
    flex: 1;
}

.mpl12-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.mpl12-item-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    flex: 1;
}

.mpl12-item-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #EA792E;
    white-space: nowrap;
}

.mpl12-item-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.mpl12-item-description p {
    margin: 0;
}

.mpl12-item-allergens {
    font-size: 0.85rem;
    color: #9ca3af;
    font-style: italic;
}

/* Masquer les prix si nécessaire */
.mpl12-menu-container[data-show-prices="no"] .mpl12-item-price {
    display: none;
}

/* Thème sombre */
.mpl12-menu-container[data-theme="dark"] {
    background-color: #1f2937;
    padding: 2rem;
    border-radius: 12px;
}

.mpl12-menu-container[data-theme="dark"] .mpl12-tabs {
    border-bottom-color: #374151;
}

.mpl12-menu-container[data-theme="dark"] .mpl12-tab {
    color: #9ca3af;
}

.mpl12-menu-container[data-theme="dark"] .mpl12-tab:hover {
    color: #f9fafb;
    background-color: #374151;
}

.mpl12-menu-container[data-theme="dark"] .mpl12-tab.active {
    color: #f9fafb;
    border-bottom-color: #EA792E;
}

.mpl12-menu-container[data-theme="dark"] .mpl12-category-title {
    color: #f9fafb;
    border-bottom-color: #374151;
}

.mpl12-menu-container[data-theme="dark"] .mpl12-item:hover {
    background-color: #374151;
}

.mpl12-menu-container[data-theme="dark"] .mpl12-item-title {
    color: #f9fafb;
}

.mpl12-menu-container[data-theme="dark"] .mpl12-item-description {
    color: #d1d5db;
}

.mpl12-menu-container[data-theme="dark"] .mpl12-item-allergens {
    color: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
    .mpl12-tabs {
        gap: 0;
    }
    
    .mpl12-tab,
    .mpl12-tab-primary {
        min-width: 120px;
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .mpl12-tab-secondary {
        min-width: 100px;
        padding: 0.625rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .mpl12-category-title {
        font-size: 1.5rem;
    }
    
    .mpl12-item {
        flex-direction: column;
    }
    
    .mpl12-item-image {
        width: 100%;
        height: 200px;
    }
    
    .mpl12-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .mpl12-tab,
    .mpl12-tab-primary {
        min-width: 100px;
        padding: 0.75rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .mpl12-tab-secondary {
        min-width: 80px;
        padding: 0.5rem 0.625rem;
        font-size: 0.8rem;
    }
    
    .mpl12-category-title {
        font-size: 1.25rem;
    }
    
    .mpl12-item-title {
        font-size: 1rem;
    }
    
    .mpl12-item-price {
        font-size: 1rem;
    }
}
