/* =========================================================
   BASE
========================================================= */

.icrea-battery-wrap {
    margin: 30px 0;
    font-size: 15px;
    line-height: 1.45;
}

.icrea-battery-header h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
}

/* =========================================================
   INTRO TEXT (wp_editor) - CENTRÉ ET STYLISÉ
========================================================= */

.icrea-battery-intro {
    max-width: 900px;
    margin: 0 auto 35px;
    padding: 25px 30px;
    font-size: 16px;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.icrea-battery-intro h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 15px;
    color: #1a1a1a;
}

.icrea-battery-intro p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #333;
}

.icrea-battery-intro strong {
    color: #ff6b00;
}

/* =========================================================
   SONDAGE
========================================================= */

.icrea-survey-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.icrea-survey-header {
    text-align: center;
    margin-bottom: 25px;
}

.icrea-survey-header h3 {
    font-size: 24px;
    margin: 0 0 10px;
    color: #1a1a1a;
}

.icrea-survey-header p {
    font-size: 15px;
    color: #666;
    margin: 0;
}

.icrea-survey-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.icrea-survey-btn {
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.icrea-survey-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.icrea-survey-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.icrea-survey-results {
    margin-top: 25px;
}

.icrea-survey-results h4 {
    font-size: 20px;
    margin: 0 0 20px;
    text-align: center;
    color: #1a1a1a;
}

.icrea-survey-bars {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.icrea-survey-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.icrea-survey-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.icrea-survey-percentage {
    color: #667eea;
    font-size: 16px;
}

.icrea-survey-bar-bg {
    height: 28px;
    background: #e8ecef;
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.icrea-survey-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 14px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
}

.icrea-survey-message {
    text-align: center;
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
}

/* =========================================================
   CRITÈRES / FILTRES
========================================================= */

.icrea-battery-criteria {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
    margin-bottom: 15px;
}

.icrea-battery-criteria-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
    width: 100%;
}

.icrea-battery-criteria-label {
    font-weight: 700;
}

.icrea-battery-criteria-item {
    font-size: 14px;
    cursor: pointer;
}

.icrea-battery-criteria-item input {
    margin-right: 6px;
}

.icrea-battery-criteria-clear {
    background: #222;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.icrea-battery-brand-filter {
    padding: 5px 8px;
    font-size: 14px;
}

/* =========================================================
   TABLE
========================================================= */

.icrea-battery-table-wrap {
    overflow-x: auto;
}

.icrea-battery-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1100px;
}

.icrea-battery-table thead th {
    background: #f5f5f5;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 8px;
    border-bottom: 2px solid #ddd;
    text-align: center;
}

.icrea-battery-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid #eee;
    text-align: center;
    vertical-align: middle;
    font-size: 14px;
}

/* =========================================================
   IMAGES
========================================================= */

.icrea-brand-logo {
    max-height: 40px;
    max-width: 90px;
    object-fit: contain;
}

.icrea-product-img {
    max-height: 80px;
    max-width: 110px;
    object-fit: contain;
}

.icrea-ext-img {
    max-height: 60px;
}

.icrea-video-thumb {
    max-width: 80px;
    max-height: 60px;
    border-radius: 6px;
    object-fit: cover;
}

/* =========================================================
   BADGE EXTENSION
========================================================= */

.icrea-ext-badge {
    background: #ff6b00;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 5px 8px;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.icrea-cluster-sub {
    margin-top: 6px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* =========================================================
   PRIX
========================================================= */

.icrea-price-old {
    display: inline-block;
    font-size: 13px;
    color: #888;
    text-decoration: line-through;
}

.icrea-price-new {
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
    color: #d80000;
}

/* =========================================================
   SCORES (2 badges différents)
========================================================= */

.icrea-score-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.icrea-score-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.icrea-score-user {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* =========================================================
   BOUTONS
========================================================= */

.icrea-battery-offer-btn,
.icrea-battery-price-btn {
    display: inline-block;
    margin: 4px 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.icrea-battery-offer-btn {
    background: linear-gradient(135deg, #ff6b00 0%, #ff8c00 100%);
    color: #fff;
}

.icrea-battery-offer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
}

.icrea-battery-price-btn {
    background: #eee;
    color: #333;
}

.icrea-battery-price-btn:hover {
    background: #ddd;
}

.icrea-offer-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* =========================================================
   MODALES
========================================================= */

.icrea-battery-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.35);
    max-width: 440px;
    width: calc(100% - 40px);
    padding: 0;
    display: none;
}

.icrea-battery-modal.is-visible {
    display: block;
}

.icrea-battery-modal-inner {
    padding: 25px 28px;
    position: relative;
}

.icrea-battery-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.icrea-battery-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.icrea-battery-modal h3 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #1a1a1a;
}

.icrea-offer-main-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #ff6b00 0%, #ff8c00 100%);
    color: #fff;
    text-align: center;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.icrea-offer-main-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 107, 0, 0.4);
}

.icrea-offer-code-box {
    margin-top: 20px;
    padding: 15px;
    background: #f5f7fa;
    border-radius: 8px;
}

.icrea-offer-code-box.is-hidden {
    display: none;
}

.icrea-offer-code-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.icrea-offer-code-line span {
    flex: 1;
    padding: 10px 14px;
    background: #fff;
    border: 2px dashed #667eea;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 16px;
    color: #667eea;
    text-align: center;
}

.icrea-offer-copy-btn {
    padding: 10px 16px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.icrea-offer-copy-btn:hover {
    background: #5568d3;
}

.icrea-offer-discount {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
}

.icrea-offer-discount span {
    font-weight: 700;
    color: #d80000;
    font-size: 16px;
}

.icrea-offer-copy-feedback {
    font-size: 13px;
    color: #0f9d58;
    font-weight: 600;
    margin-top: 8px;
}

.icrea-battery-form-row {
    margin-bottom: 15px;
}

.icrea-battery-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.icrea-battery-form-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.icrea-battery-form-submit {
    width: 100%;
    padding: 12px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icrea-battery-form-submit:hover {
    background: #5568d3;
}

/* =========================================================
   TRI VISUEL (icônes ↑ ↓)
========================================================= */

.icrea-battery-table thead th.icrea-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px;
}

.icrea-battery-table thead th .icrea-sort-indicator {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: .55;
}

.icrea-battery-table thead th.icrea-sortable .icrea-sort-indicator::before {
    content: "↕";
}

.icrea-battery-table thead th.icrea-sortable.is-sorted-asc .icrea-sort-indicator::before {
    content: "↑";
    opacity: 1;
}

.icrea-battery-table thead th.icrea-sortable.is-sorted-desc .icrea-sort-indicator::before {
    content: "↓";
    opacity: 1;
}

/* =========================================================
   MEILLEUR €/kWh (highlight + badge)
========================================================= */

.icrea-best-kwh {
    background: rgba(255, 107, 0, 0.10);
    position: relative;
}

.icrea-best-kwh-badge {
    margin-top: 6px;
    display: inline-block;
    background: #ff6b00;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    line-height: 1;
}

/* ================================
   OVERLAY MODALES (fond flouté)
================================ */

.icrea-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
}

/* Animation */
.icrea-battery-modal,
.icrea-modal-overlay {
    animation: icreaFadeIn 0.2s ease-out;
}

@keyframes icreaFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body.icrea-modal-open {
    overflow: hidden;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 768px) {

    .icrea-battery-wrap {
        font-size: 14px;
    }

    .icrea-battery-table {
        min-width: 900px;
    }

    .icrea-product-img {
        max-height: 65px;
    }

    .icrea-battery-intro {
        padding: 20px;
    }

    .icrea-battery-intro h2 {
        font-size: 22px;
    }

    .icrea-survey-container {
        padding: 20px;
    }

    .icrea-survey-form {
        grid-template-columns: 1fr;
    }
}