/* ==========================================================================
   Avis clients - Flam'Comtoise
   S'appuie sur le thème du site (main.css) : couleur #ab2c31, police Poppins
   ========================================================================== */
:root {
    --avis-primary: #ab2c31;
    --avis-primary-dark: #8a2227;
    --avis-star: #f5a623;
    --avis-text: #333333;
    --avis-muted: #6d6d6d;
    --avis-border: #e6e6e6;
    --avis-bg-soft: #f6f6f6;
    --avis-radius: 6px;
}

/* --- Synthèse (note moyenne + répartition) ------------------------------ */
.avis-summary {
    background: var(--avis-bg-soft);
    border-radius: var(--avis-radius);
    padding: 35px 30px;
    margin-bottom: 50px;
}
.avis-summary-score {
    text-align: center;
    border-right: 1px solid var(--avis-border);
}
.avis-summary-average {
    font-size: 56px;
    line-height: 1;
    font-weight: 700;
    color: var(--avis-primary);
}
.avis-summary-average small {
    font-size: 22px;
    color: var(--avis-muted);
    font-weight: 500;
}
.avis-summary-score .avis-stars {
    font-size: 24px;
    margin: 12px 0 8px;
    display: block;
}
.avis-summary-count {
    color: var(--avis-muted);
}
.avis-summary-cta {
    margin-top: 18px;
}
.avis-breakdown {
    list-style: none;
    margin: 0;
    padding: 0 0 0 20px;
}
.avis-breakdown li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 14px;
}
.avis-breakdown-label {
    width: 70px;
    white-space: nowrap;
    color: var(--avis-text);
}
.avis-breakdown-label .fa { color: var(--avis-star); }
.avis-breakdown-bar {
    flex: 1;
    height: 10px;
    background: #e3e3e3;
    border-radius: 5px;
    overflow: hidden;
}
.avis-breakdown-bar span {
    display: block;
    height: 100%;
    background: var(--avis-star);
    border-radius: 5px;
}
.avis-breakdown-count {
    width: 40px;
    text-align: right;
    color: var(--avis-muted);
}

/* --- Étoiles ------------------------------------------------------------ */
.avis-stars { color: var(--avis-star); letter-spacing: 2px; white-space: nowrap; }
.avis-stars .fa-star-o { color: #cfcfcf; }

/* --- Grille des avis ---------------------------------------------------- */
.avis-card {
    background: #fff;
    border-radius: var(--avis-radius);
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.08);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: box-shadow .3s ease, transform .3s ease;
}
.avis-card:hover {
    box-shadow: 0 8px 25px 0 rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}
.avis-card-media {
    position: relative;
    display: block;
    padding-top: 66%;
    background: #ececec;
    overflow: hidden;
}
.avis-card-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.avis-card-badge {
    position: absolute;
    right: 12px;
    bottom: 12px;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 19px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
}
.avis-card-body {
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.avis-card-quote {
    color: var(--avis-primary);
    font-size: 28px;
    line-height: 1;
    margin-bottom: 10px;
    opacity: .25;
}
.avis-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
}
.avis-card-author {
    font-size: 17px;
    line-height: 24px;
    margin: 0;
    color: #000;
}
.avis-card-date {
    font-size: 13px;
    color: var(--avis-muted);
    margin-bottom: 12px;
}
.avis-card-text {
    color: var(--avis-text);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}
.avis-card-more {
    margin-top: auto;
    padding-top: 15px;
    font-weight: 600;
    color: var(--avis-primary);
}
.avis-card-more:hover { color: var(--avis-primary-dark); }

.avis-empty {
    text-align: center;
    padding: 50px 20px;
    background: var(--avis-bg-soft);
    border-radius: var(--avis-radius);
    color: var(--avis-muted);
}
.avis-empty .fa {
    font-size: 48px;
    color: var(--avis-primary);
    opacity: .5;
    margin-bottom: 15px;
}

/* --- Pagination --------------------------------------------------------- */
.avis-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding: 0;
    list-style: none;
}
.avis-pagination a,
.avis-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--avis-border);
    border-radius: var(--avis-radius);
    color: var(--avis-text);
    background: #fff;
}
.avis-pagination a:hover {
    border-color: var(--avis-primary);
    color: var(--avis-primary);
}
.avis-pagination .is-ellipsis {
    border-color: transparent;
    background: transparent;
    min-width: 24px;
    padding: 0 4px;
    color: var(--avis-muted);
}
.avis-pagination .is-current {
    background: var(--avis-primary);
    border-color: var(--avis-primary);
    color: #fff;
}

/* --- Formulaire de dépôt ------------------------------------------------ */
.avis-form-section {
    background: var(--avis-bg-soft);
}
.avis-form {
    background: #fff;
    border-radius: var(--avis-radius);
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.06);
    padding: 40px;
}
.avis-form label {
    font-weight: 600;
    color: #000;
    margin-bottom: 6px;
    display: block;
}
.avis-form .form-control {
    border: 1px solid var(--avis-border);
    border-radius: var(--avis-radius);
    padding: 12px 15px;
    height: auto;
    font-size: 14px;
    box-shadow: none;
}
.avis-form .form-control:focus {
    border-color: var(--avis-primary);
    box-shadow: 0 0 0 3px rgba(171, 44, 49, 0.12);
}
.avis-form textarea.form-control { min-height: 140px; resize: vertical; }
.avis-form .form-group { margin-bottom: 22px; }
.avis-form-help {
    display: block;
    font-size: 12px;
    color: var(--avis-muted);
    margin-top: 5px;
}
.avis-form-counter { float: right; }
.avis-required { color: var(--avis-primary); }

/* Note : boutons radio stylés en étoiles (accessible au clavier) */
.avis-rating-input {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 4px;
    border: 0;
    padding: 0;
    margin: 0;
}
.avis-rating-input input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.avis-rating-input label {
    font-size: 34px;
    line-height: 1;
    color: #d5d5d5;
    cursor: pointer;
    margin: 0;
    transition: color .15s ease, transform .15s ease;
}
.avis-rating-input label:hover,
.avis-rating-input label:hover ~ label,
.avis-rating-input input:checked ~ label {
    color: var(--avis-star);
}
.avis-rating-input label:hover { transform: scale(1.1); }
.avis-rating-input input:focus-visible + label {
    outline: 2px solid var(--avis-primary);
    outline-offset: 2px;
    border-radius: 3px;
}
.avis-rating-text {
    display: inline-block;
    margin-left: 12px;
    color: var(--avis-muted);
    font-style: italic;
    vertical-align: super;
}

/* Champ piège anti-robots : invisible pour les humains */
.avis-hp {
    position: absolute !important;
    left: -10000px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.avis-alert {
    border-radius: var(--avis-radius);
    padding: 15px 18px;
    margin-top: 20px;
    display: none;
}
.avis-alert.is-visible { display: block; }
.avis-alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }
.avis-alert-error   { background: #fdecea; color: #8a1c1c; border: 1px solid #f5c6cb; }

.avis-form button[disabled] { opacity: .7; cursor: wait; }

.avis-form-closed {
    text-align: center;
    color: var(--avis-muted);
}

/* --- Page détail -------------------------------------------------------- */
.avis-detail {
    background: #fff;
    border-radius: var(--avis-radius);
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.08);
    padding: 35px;
}
.avis-detail-author {
    font-size: 26px;
    line-height: 32px;
    margin-bottom: 8px;
    text-transform: none;
}
.avis-detail-meta {
    color: var(--avis-muted);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}
.avis-detail-meta .avis-stars { font-size: 20px; }
.avis-detail-text {
    font-size: 16px;
    line-height: 28px;
    color: var(--avis-text);
    position: relative;
    padding-left: 22px;
    border-left: 3px solid var(--avis-primary);
    word-wrap: break-word;
}
.avis-gallery-main {
    position: relative;
    border-radius: var(--avis-radius);
    overflow: hidden;
    background: #ececec;
    margin-bottom: 12px;
}
.avis-gallery-main img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    display: block;
}
.avis-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.avis-gallery-thumbs button {
    width: 72px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    background: none;
}
.avis-gallery-thumbs button.is-active { border-color: var(--avis-primary); }
.avis-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.avis-video {
    position: relative;
    padding-top: 56.25%;
    border-radius: var(--avis-radius);
    overflow: hidden;
    margin-top: 25px;
    background: #000;
}
.avis-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.avis-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
}

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 991px) {
    .avis-summary-score {
        border-right: 0;
        border-bottom: 1px solid var(--avis-border);
        padding-bottom: 25px;
        margin-bottom: 25px;
    }
    .avis-breakdown { padding-left: 0; }
}
@media (max-width: 575px) {
    .avis-form { padding: 25px 18px; }
    .avis-detail { padding: 22px 18px; }
    .avis-summary { padding: 25px 16px; }
    .avis-rating-text { display: block; margin: 6px 0 0; vertical-align: baseline; }
}
