/**
 * TD Restaurant - popup de personnalisation produit
 * Étend popup.css (composant .tdresto-popup déjà défini)
 * mobile-first, breakpoint 1000px
 */

/* =======================================================
   overlay spécifique personnalisation (z-index au-dessus du drawer)
   ======================================================= */
#tdresto-custom-overlay {
    z-index: 9999998;
}

/* =======================================================
   popup personnalisation : largeur étendue
   ======================================================= */
#tdresto-custom-popup {
    max-width: 560px;
    padding: 28px 24px 24px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tdresto-custom__product-name {
    margin: 0 0 4px;
    font-size: 1.15em;
    font-weight: 700;
    color: #111;
    text-align: center;
}

.tdresto-custom__base-price {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
}

/* =======================================================
   sections (Suppléments / Ingrédients à retirer)
   ======================================================= */
.tdresto-custom__section {
    margin-bottom: 20px;
}

.tdresto-custom__section-title {
    margin: 0 0 10px;
    font-size: 0.78em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    padding-bottom: 6px;
    border-bottom: 1px solid #f0f0f0;
}

/* =======================================================
   ligne supplément
   ======================================================= */
.tdresto-custom__sup-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.1s;
}

.tdresto-custom__sup-row:last-child {
    border-bottom: none;
}

.tdresto-custom__sup-label {
    flex: 1;
    font-size: 0.9em;
    color: #333;
    line-height: 1.3;
}

.tdresto-custom__sup-price {
    font-size: 0.82em;
    color: #888;
    white-space: nowrap;
}

.tdresto-custom__sup-row--active .tdresto-custom__sup-label {
    font-weight: 600;
    color: #111;
}

/* bouton toggle supplément */
.tdresto-custom__sup-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    color: #aaa;
}

.tdresto-custom__sup-toggle:hover {
    border-color: var(--tdresto-color-primary, #e74c3c);
    color: var(--tdresto-color-primary, #e74c3c);
}

.tdresto-custom__sup-row--active .tdresto-custom__sup-toggle {
    background: var(--tdresto-color-primary, #e74c3c);
    border-color: var(--tdresto-color-primary, #e74c3c);
    color: #fff;
}

/* =======================================================
   ligne retrait (checkbox style custom)
   ======================================================= */
.tdresto-custom__rem-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
}

.tdresto-custom__rem-row:last-child {
    border-bottom: none;
}

.tdresto-custom__rem-check {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #ddd;
    background: #fff;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
    font-size: 0.8rem;
    color: transparent;
}

.tdresto-custom__rem-row--active .tdresto-custom__rem-check {
    background: #333;
    border-color: #333;
    color: #fff;
}

.tdresto-custom__rem-label {
    font-size: 0.9em;
    color: #333;
    flex: 1;
    line-height: 1.3;
    user-select: none;
}

.tdresto-custom__rem-row--active .tdresto-custom__rem-label {
    text-decoration: line-through;
    color: #888;
}

/* =======================================================
   pied de popup : prix total + bouton
   ======================================================= */
.tdresto-custom__footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.tdresto-custom__total-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}

.tdresto-custom__total-label {
    font-size: 0.85em;
    color: #666;
}

.tdresto-custom__total-price {
    font-size: 1.3em;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
}

/* bouton "Ajouter au panier · 14,50 €" */
.tdresto-custom__add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: var(--tdresto-color-primary, #e74c3c);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
    letter-spacing: 0.01em;
}

.tdresto-custom__add-btn:hover:not(:disabled) {
    opacity: 0.88;
}

.tdresto-custom__add-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.tdresto-custom__add-btn-price {
    opacity: 0.85;
    font-weight: 600;
}

/* bouton fermer en haut à droite */
.tdresto-custom__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.15s;
}

.tdresto-custom__close:hover {
    color: #333;
}

/* positionnement relatif sur le popup pour le bouton close absolu */
#tdresto-custom-popup {
    position: relative;
}

/* message "aucune option" */
.tdresto-custom__empty {
    text-align: center;
    color: #aaa;
    font-size: 0.85em;
    padding: 12px 0;
}

/* =======================================================
   desktop
   ======================================================= */
@media (min-width: 1000px) {
    #tdresto-custom-popup {
        padding: 32px 32px 28px;
    }

    .tdresto-custom__sup-row,
    .tdresto-custom__rem-row {
        padding: 10px 0;
    }
}
