/* ==========================================================================
   MODULE TARIF (LISTE DE PRIX)
   ========================================================================== */

/* --- 1. INTERFACE DE SAISIE (Panneau Gauche) --- */

.tarif-controls-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Barre de gestion des tarifs */
.tarif-manager-bar {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ccc;
    align-items: center;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    flex-wrap: wrap;
}

/* Indicateur de sauvegarde (Nouveau) */
.tarif-unsaved-warning {
    width: 100%;
    color: #c5221f;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    margin-top: 5px;
    display: none; /* Masqué par défaut */
}
.tarif-unsaved-warning.visible {
    display: block;
    animation: pulse 2s infinite;
}
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }

.tarif-select {
    flex-grow: 1;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    font-family: 'Roboto', sans-serif;
    min-width: 150px;
}

/* Boutons d'action */
.btn-tarif-action {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #ccc; background: white;
    border-radius: 4px; cursor: pointer; color: #555;
    transition: all 0.2s;
}
.btn-tarif-action:hover { background-color: #eee; color: #333; }
.btn-tarif-action.btn-save { color: #2e7d32; border-color: #a5d6a7; background-color: #e8f5e9; }
.btn-tarif-action.btn-new { color: #1565c0; border-color: #90caf9; background-color: #e3f2fd; }
.btn-tarif-action.btn-delete { color: #c62828; border-color: #ef9a9a; background-color: #ffebee; }

/* Zone des produits */
.tarif-products-list {
    max-height: 450px;
    overflow-y: auto;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 5px;
    margin-bottom: 10px;
}

/* Ligne de saisie */
.tarif-row-input {
    display: flex; flex-direction: column; gap: 4px;
    background: white; padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px; transition: all 0.2s; position: relative;
}
.tarif-row-input:hover { box-shadow: 0 2px 5px rgba(0,0,0,0.05); border-color: #ccc; }
.tarif-row-input.is-highlight { border-left: 4px solid var(--color-promo, #D75000); background-color: #fff8f0; }
.tarif-row-input.is-hidden { opacity: 0.6; background-color: #f0f0f0; }

.tarif-row-top, .tarif-row-bottom { display: flex; gap: 5px; align-items: flex-start; }
.tarif-row-bottom { align-items: center; }

/* Wrappers Toolbar */
.tarif-input-wrapper { position: relative; display: flex; flex-direction: column; }
.tarif-input-wrapper.name-wrapper { flex-grow: 1; min-width: 0; }
.tarif-input-wrapper.price-wrapper { width: 75px; flex-shrink: 0; }
.tarif-input-wrapper.info-wrapper { flex-grow: 1; min-width: 0; }

/* Champs de saisie - CORRECTION CASSE & VALIDATION */
.tarif-input-name { width: 100%; font-weight: 600; text-transform: none !important; }
.tarif-input-info { width: 100%; font-size: 0.85em; color: #666; font-style: italic; text-transform: none !important; }
.tarif-input-price { width: 100% !important; text-align: right; font-weight: 700; color: #386641; }

/* Supprime la bordure rouge d'erreur sur l'info complémentaire */
.tarif-input-info.input-error { border-color: #ccc !important; box-shadow: none !important; padding-left: 8px !important; }
.tarif-input-info.input-error::before { content: '' !important; }

/* Actions */
.tarif-row-actions { display: flex; gap: 2px; margin-left: auto; }
.btn-row-action { width: 24px; height: 24px; padding: 2px; border: 1px solid transparent; background: transparent; border-radius: 3px; cursor: pointer; color: #999; display: flex; align-items: center; justify-content: center; }
.btn-row-action:hover { background-color: #eee; color: #333; }
.btn-row-action.active-visibility { color: #386641; }
.btn-row-action.active-highlight { color: #D75000; }
.btn-row-action.active-promo { color: white; background-color: #D75000; border-color: #D75000; }
.btn-row-action.action-delete:hover { color: #c5221f; background-color: #fee2e2; }

.btn-add-row { width: 100%; padding: 8px; background-color: #e8f5e9; color: #1B5E20; border: 1px dashed #1B5E20; border-radius: 6px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn-add-row:hover { background-color: #c8e6c9; }

#tarifDisclaimerInput { text-transform: none !important; }


/* --- 2. RENDU DE L'AFFICHE (PREVIEW) --- */

.affiche.type-tarif { display: flex; flex-direction: column; }

.tarif-poster-container {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    padding: 0; box-sizing: border-box;
}

/* EN-TÊTE */
.tarif-poster-header {
    flex-shrink: 0; text-align: center;
    background-color: var(--color-primary);
    padding: 1em; width: 100%;
    display: flex; justify-content: center;
    margin-bottom: 1em;
}
.tarif-poster-header img { height: 6em; width: auto; filter: brightness(0) invert(1); }

.tarif-title-container { text-align: center; margin-bottom: 1em; padding: 0 2em; }

.tarif-poster-title {
    font-family: var(--font-primary); font-weight: 900;
    font-size: 3.5em; line-height: 1.1;
    color: var(--color-primary);
    text-transform: uppercase; margin: 0;
}

/* CORPS (LISTE) */
.tarif-poster-body {
    flex-grow: 1;
    display: flex; flex-direction: column;
    /* Utilisation de variable pour le gap dynamique */
    gap: var(--tarif-list-gap, 0.8em); 
    overflow: hidden;
    padding: 0 2em;
    /* Base size pour le scaling global de la liste */
    --base-list-size: 1em;
    font-size: var(--base-list-size); 
}

/* Item Container */
.tarif-item-container { display: flex; flex-direction: column; width: 100%; }

/* Ligne Principale */
.tarif-item-row { display: flex; align-items: baseline; width: 100%; font-family: var(--font-secondary); }

.tarif-item-name {
    font-size: 2em; font-weight: 600;
    color: var(--color-text); flex-shrink: 1; text-align: left;
}

.tarif-item-dots {
    flex-grow: 1; border-bottom: 3px dotted #ccc;
    margin: 0 0.5em; position: relative; top: -0.3em; opacity: 0.5;
}

.tarif-item-price-group { display: flex; align-items: baseline; flex-shrink: 0; text-align: right; }

.tarif-item-price {
    font-family: var(--font-primary); font-weight: 700;
    font-size: 2.2em; color: var(--color-text); white-space: nowrap;
}

/* Ligne Info Complémentaire */
.tarif-item-info {
    font-family: var(--font-secondary);
    font-size: 1.3em; 
    font-style: italic; color: #666;
    margin-top: -0.2em; padding-left: 0.5em;
}

/* STYLE STANDARD */
/* Utilisation de variable pour le padding dynamique */
.layout-standard .tarif-item-container { padding: var(--tarif-item-padding, 0.2em) 0; }
.layout-standard .tarif-item-container.highlight { background-color: rgba(0,0,0,0.03); padding: 0.5em; border-radius: 4px; }
.layout-standard .tarif-item-container.highlight .tarif-item-name { color: var(--color-primary); font-weight: 800; }

/* STYLE PROMO */
.layout-promo .tarif-item-container { background: white; border: 2px solid #eee; border-radius: 8px; padding: 0.5em 1em; box-shadow: 0 4px 0 rgba(0,0,0,0.05); }
.layout-promo .tarif-item-dots { display: none; }
.layout-promo .tarif-item-row { justify-content: space-between; }
.layout-promo .tarif-item-price { color: var(--color-promo); font-size: 2.8em; }
.layout-promo .tarif-item-container.highlight { border-color: var(--color-promo); background-color: #fffbf0; }

.tarif-badge-promo {
    background-color: var(--color-promo); color: var(--color-promo-title);
    font-family: var(--font-primary); font-weight: 700;
    font-size: 0.4em; padding: 0.2em 0.5em;
    border-radius: 4px; text-transform: uppercase;
    margin-right: 0.5em; vertical-align: middle;
    display: inline-block; transform: rotate(-2deg);
}

/* FOOTER */
.tarif-poster-footer {
    flex-shrink: 0; margin-top: 1em;
    padding: 1em 2em 2em 2em; border-top: 2px solid #eee;
    text-align: center;
}

.tarif-disclaimer {
    font-family: var(--font-secondary);
    font-size: 1.2em; color: var(--color-text);
    opacity: 0.8; white-space: pre-wrap;
    text-transform: none;
}

/* --- MODIFICATIONS PAYSAGE (REDUCTION 50%) --- */
.affiche.type-tarif.landscape .tarif-poster-container {
    font-size: 0.5em; /* 50% de la taille normale */
}

/* Ajustements spécifiques paysage */
.affiche.type-tarif.landscape .tarif-poster-title { font-size: 5em; } /* Pour compenser un peu la réduction drastique */

/* MODE ZEBRE */
.layout-zebra .tarif-item-container:nth-child(even) {
    background-color: var(--zebra-bg, rgba(0,0,0,0.05)); /* Variable CSS pour la couleur */
    border-radius: 4px;
}

/* FOOTER */
.tarif-poster-footer {
    flex-shrink: 0; margin-top: 1em;
    padding: 1em 2em 2em 2em; border-top: 2px solid #eee;
    text-align: center;
}

.tarif-disclaimer {
    font-family: var(--font-secondary);
    font-size: 1.2em; color: var(--color-text);
    opacity: 0.8; white-space: pre-wrap;
    text-transform: none;
}

/* --- MODIFICATIONS PAYSAGE (REDUCTION 50%) --- */
.affiche.type-tarif.landscape .tarif-poster-container {
    font-size: 0.5em; /* 50% de la taille normale */
}

/* Ajustements spécifiques paysage */
.affiche.type-tarif.landscape .tarif-poster-title { font-size: 5em; } /* Pour compenser un peu la réduction drastique */