/**
 * WP PDC Price - Styles Frontend (Accordéon)
 */

/* Container principal */
.wpprice-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    width: 100%;
    margin: 20px 0;
}

/* Titre principal */
.wpprice-title {
    margin: 0 0 10px 0;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
}

/* Sous-titre */
.wpprice-subtitle {
    font-weight: 400;
    color: #64748b;
}

/* Texte d'intro */
.wpprice-intro {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 1rem 0;
    font-style: italic;
}

/* Accordéon */
.wpprice-accordion {
    border: 1px solid #e2e8f0;
}

/* Panel accordéon */
.wpprice-panel {
    border-bottom: 1px solid #e2e8f0;
}

.wpprice-panel:last-child {
    border-bottom: none;
}

/* Header du panel (cliquable) */
.wpprice-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.wpprice-panel-header:hover {
    background: #f1f5f9;
}

.wpprice-panel.is-open .wpprice-panel-header {
    background: #e2e8f0;
}

/* Titre du panel */
.wpprice-panel-title {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Icône du panel */
.wpprice-panel-icon {
    font-size: 1.1em;
}

/* Chevron */
.wpprice-panel-chevron {
    font-size: 12px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.wpprice-panel.is-open .wpprice-panel-chevron {
    transform: rotate(180deg);
}

/* Contenu du panel */
.wpprice-panel-content {
    display: none;
    padding: 0;
    background: #fff;
}

.wpprice-panel.is-open .wpprice-panel-content {
    display: block;
}

/* Liste des items */
.wpprice-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Item individuel */
.wpprice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f1f5f9;
}

.wpprice-item:last-child {
    border-bottom: none;
}

.wpprice-item:nth-child(odd) {
    background: #fafbfc;
}

/* Label de l'item */
.wpprice-item-label {
    flex: 1;
    font-size: 0.9em;
    color: #475569;
}

/* Prix de l'item */
.wpprice-item-price {
    font-size: 0.9em;
    font-weight: 600;
    color: #1e40af;
    white-space: nowrap;
    margin-left: 10px;
}

/* Date de mise à jour */
.wpprice-updated {
    margin: 10px 0 0 0;
    padding: 0;
    font-size: 0.75em;
    color: #94a3b8;
    text-align: right;
}

/* Message d'erreur */
.wpprice-error {
    padding: 15px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 0.9em;
}

/* ========================================
 * Header avec Toggle (même style que météo)
 * ======================================== */

.wpprice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.wpprice-header .wpprice-title {
    margin: 0;
}

.wpprice-view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: 8px;
}

.wpprice-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.75rem;
    border: none !important;
    background: transparent !important;
    border-radius: 6px;
    cursor: pointer;
    color: #64748b !important;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    font-family: inherit;
}

.wpprice-toggle-btn:hover {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

.wpprice-toggle-btn.is-active,
.wpprice-toggle-btn.is-active:hover {
    background: white !important;
    color: #3b82f6 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Vues */
.wpprice-view {
    display: none;
}

.wpprice-view.is-active {
    display: block;
}

/* ========================================
 * Tableau Comparatif SEO
 * ======================================== */

.wpprice-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    border: 1px solid #e2e8f0;
}

.wpprice-compare-table thead {
    background: #f8fafc;
}

.wpprice-compare-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    color: #334155;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.9em;
}

.wpprice-compare-table th.wpprice-col-city,
.wpprice-compare-table th.wpprice-col-region,
.wpprice-compare-table th.wpprice-col-country {
    text-align: center;
    min-width: 100px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpprice-compare-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.wpprice-compare-table .wpprice-col-city,
.wpprice-compare-table .wpprice-col-region,
.wpprice-compare-table .wpprice-col-country {
    text-align: center;
}

/* Ligne de catégorie */
.wpprice-category-row td {
    background: #f1f5f9;
    padding: 10px;
    font-size: 0.95em;
}

/* Ligne d'item */
.wpprice-item-row:nth-child(odd) {
    background: #fafbfc;
}

.wpprice-item-row .wpprice-col-item {
    color: #475569;
    padding-left: 20px;
}

.wpprice-item-row .wpprice-col-city {
    font-weight: 600;
    color: #1e40af;
}

/* Valeur de comparaison */
.wpprice-compare-value {
    display: inline;
    font-size: 0.9em;
    color: #64748b;
}

/* Différence en pourcentage */
.wpprice-compare-diff {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
    margin-left: 4px;
    vertical-align: middle;
}

.wpprice-diff-equal {
    background: #f1f5f9;
    color: #64748b;
}

.wpprice-diff-higher {
    background: #fef2f2;
    color: #dc2626;
}

.wpprice-diff-lower {
    background: #f0fdf4;
    color: #16a34a;
}

/* Pas de données */
.wpprice-no-data {
    color: #cbd5e1;
}

/* Notes de bas de tableau */
.wpprice-compare-note {
    margin: 8px 0 0 0;
    font-size: 0.75em;
    color: #94a3b8;
    font-style: italic;
}

/* ========================================
 * Responsive
 * ======================================== */

@media (max-width: 600px) {
    .wpprice-title {
        font-size: 1.2em;
    }

    .wpprice-panel-header {
        padding: 10px 12px;
    }

    .wpprice-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 10px 12px;
    }

    .wpprice-item-price {
        margin-left: 0;
    }

    /* Header responsive */
    .wpprice-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .wpprice-view-toggle {
        width: 100%;
    }

    .wpprice-toggle-btn {
        flex: 1;
        text-align: center;
    }

    /* Tableau responsive */
    .wpprice-compare-table {
        font-size: 0.8em;
    }

    .wpprice-compare-table th,
    .wpprice-compare-table td {
        padding: 6px 5px;
    }

    .wpprice-compare-table th.wpprice-col-city,
    .wpprice-compare-table th.wpprice-col-region,
    .wpprice-compare-table th.wpprice-col-country {
        min-width: 70px;
    }

    .wpprice-item-row .wpprice-col-item {
        padding-left: 10px;
    }

    .wpprice-compare-value {
        font-size: 0.85em;
    }

    .wpprice-compare-diff {
        font-size: 0.7em;
        padding: 1px 4px;
    }
}
