/* =========================================================================
   SGK FAQ – Stylesheet v1.8.0
   Compatible PrestaShop 1.7 / 8 / 9 – Bootstrap 4 / Classic / Panda
   Mise en page : 2/3 FAQ + 1/3 formulaire de soumission
   ========================================================================= */

/* =========================================================================
   RESET & WRAPPER
   ========================================================================= */

.sgkfaq-wrapper {
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.sgkfaq-wrapper *,
.sgkfaq-wrapper *::before,
.sgkfaq-wrapper *::after {
    box-sizing: border-box;
}

/* =========================================================================
   LAYOUT 2 COLONNES (2/3 FAQ + 1/3 formulaire)
   Mobile first : colonne unique → desktop : côte à côte
   ========================================================================= */

.sgkfaq-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .sgkfaq-layout--with-form {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.75rem;
    }

    .sgkfaq-layout--with-form .sgkfaq-col-faq {
        flex: 0 0 calc(66.666% - 0.875rem);
        max-width: calc(66.666% - 0.875rem);
    }

    .sgkfaq-layout--with-form .sgkfaq-col-form {
        flex: 0 0 calc(33.333% - 0.875rem);
        max-width: calc(33.333% - 0.875rem);
        /* Sticky optionnel : le formulaire suit lors du scroll */
        position: sticky;
        top: 1rem;
    }
}

/* Sans formulaire : colonne unique pleine largeur */
.sgkfaq-layout:not(.sgkfaq-layout--with-form) .sgkfaq-col-faq {
    width: 100%;
}

/* =========================================================================
   ALERTES (succès / erreur après soumission)
   ========================================================================= */

.sgkfaq-alert {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .75rem 1rem;
    border-radius: .375rem;
    font-size: .875rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.sgkfaq-alert--success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.sgkfaq-alert--error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.sgkfaq-alert [class^="fto-"],
.sgkfaq-alert [class*=" fto-"] {
    font-size: 1.125rem;
    flex-shrink: 0;
}

/* =========================================================================
   GROUPE CATÉGORIE
   ========================================================================= */

.sgkfaq-group {
    margin-bottom: 1.75rem;
}

.sgkfaq-group__header {
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid #e4eaf5;
}

.sgkfaq-group__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    letter-spacing: .01em;
}

/* =========================================================================
   LISTE FAQ
   ========================================================================= */

.sgkfaq-list {
    border: 1px solid #dde3ed;
    border-radius: .375rem;
    overflow: hidden;
    width: 100%;
}

.sgkfaq-item {
    border-bottom: 1px solid #dde3ed;
}

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

/* =========================================================================
   BOUTON QUESTION
   ========================================================================= */

.sgkfaq-item__btn {
    display: flex;
    align-items: flex-start;
    width: 100%;
    padding: .9rem 1.125rem;
    background: #ffffff;
    border: none;
    text-align: left;
    cursor: pointer;
    gap: .6rem;
    margin: 0;
    line-height: 1.5;
    transition: background .18s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.sgkfaq-item__btn:hover { background: #f5f7fc; }
.sgkfaq-item__btn:focus-visible { outline: 2px solid #1a73e8; outline-offset: -2px; }
.sgkfaq-item--open > .sgkfaq-item__btn { background: #f5f7fc; }

/* =========================================================================
   ICÔNE "?" — fto-help-circle
   ========================================================================= */

.sgkfaq-item__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    background: #eef2ff;
    flex-shrink: 0;
    transition: background .18s ease;
    margin-top: 3px;
}

.sgkfaq-item--open > .sgkfaq-item__btn .sgkfaq-item__icon {
    background: #d8e4fc;
}

.sgkfaq-item__icon [class^="fto-"],
.sgkfaq-item__icon [class*=" fto-"] {
    font-size: .9375rem;
    color: #1a73e8;
    line-height: 1;
}

/* =========================================================================
   TEXTE QUESTION
   ========================================================================= */

.sgkfaq-item__question {
    flex: 1;
    font-weight: 600;
    font-size: .9375rem;
    color: #2c2c3e;
    line-height: 1.45;
    word-break: break-word;
}

/* =========================================================================
   CHEVRON – fto-resize-vertical-1
   Couleur + scaleY uniquement (icône symétrique ▲▼, pas de rotation)
   ========================================================================= */

.sgkfaq-item__chevron {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
    width: 22px;
    height: 22px;
}

.sgkfaq-item__chevron [class^="fto-"],
.sgkfaq-item__chevron [class*=" fto-"] {
    font-size: 1.1875rem;
    color: #b0b8c9;
    transition: color .22s ease, transform .22s ease;
    display: block;
    line-height: 1;
}

.sgkfaq-item__chevron--open [class^="fto-"],
.sgkfaq-item__chevron--open [class*=" fto-"] {
    color: #1a73e8;
    transform: scaleY(.75);
}

/* =========================================================================
   RÉPONSE
   ========================================================================= */

.sgkfaq-item__answer { background: #ffffff; overflow: hidden; }

.sgkfaq-item__answer-body {
    padding: .75rem 1.125rem .9rem 3.25rem;
    font-size: .9375rem;
    color: #4a4a5a;
    line-height: 1.75;
    word-break: break-word;
}

.sgkfaq-item__answer-body p:last-child { margin-bottom: 0; }
.sgkfaq-item__answer-body img { max-width: 100%; height: auto; border-radius: .25rem; }
.sgkfaq-item__answer-body a { color: #1a73e8; }
.sgkfaq-item__answer-body ul,
.sgkfaq-item__answer-body ol { padding-left: 1.375rem; margin-bottom: .625rem; }

/* =========================================================================
   ÉTAT VIDE
   ========================================================================= */

.sgkfaq-empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: #f8f9fb;
    border-radius: .5rem;
    border: 1px dashed #d0d9ea;
    margin-bottom: 1.5rem;
}

.sgkfaq-empty-state__icon { margin-bottom: .75rem; }

.sgkfaq-empty-state__icon [class^="fto-"],
.sgkfaq-empty-state__icon [class*=" fto-"] {
    font-size: 2.75rem;
    color: #b0b8c9;
}

.sgkfaq-empty-state__text { margin: 0; color: #6c757d; font-size: .9375rem; }

/* =========================================================================
   BOUTON RETOUR ACCUEIL
   ========================================================================= */

.sgkfaq-home-link-wrap {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e8edf5;
}

.sgkfaq-home-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #5a6275;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 18px 8px 14px;
    border: 1px solid #d0d9ea;
    border-radius: 99px;
    background: #f4f6fb;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .15s ease;
    white-space: nowrap;
}

.sgkfaq-home-link:hover,
.sgkfaq-home-link:focus {
    color: #1a73e8;
    background: #e8f0fe;
    border-color: #a8c4f8;
    text-decoration: none;
    transform: translateX(-3px);
    outline: none;
}

.sgkfaq-home-link__icon [class^="fto-"],
.sgkfaq-home-link__icon [class*=" fto-"] {
    font-size: 1.0625rem;
    line-height: 1;
}

/* =========================================================================
   FORMULAIRE DE SOUMISSION
   ========================================================================= */

/* Carte formulaire */
.sgkfaq-form-card {
    background: #ffffff;
    border: 1px solid #dde3ed;
    border-radius: .5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* En-tête de la carte */
.sgkfaq-form-card__header {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #1a73e8, #1558b0);
    color: #fff;
}

.sgkfaq-form-card__header-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sgkfaq-form-card__header-icon [class^="fto-"],
.sgkfaq-form-card__header-icon [class*=" fto-"] {
    font-size: 1.25rem;
    color: #fff;
}

.sgkfaq-form-card__title {
    margin: 0 0 2px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.sgkfaq-form-card__subtitle {
    margin: 0;
    font-size: .8125rem;
    color: rgba(255,255,255,.8);
    line-height: 1.4;
}

.sgkfaq-form-card__body {
    padding: 1.25rem;
}

/* Groupes de champs */
.sgkfaq-form__group {
    margin-bottom: 1rem;
}

.sgkfaq-form__label {
    display: block;
    font-size: .8125rem;
    font-weight: 600;
    color: #2c2c3e;
    margin-bottom: .35rem;
}

.sgkfaq-form__required {
    color: #e53935;
}

.sgkfaq-form__input,
.sgkfaq-form__textarea {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    font-size: .875rem;
    color: #333;
    background: #fff;
    border: 1px solid #c8cfe0;
    border-radius: .3125rem;
    line-height: 1.5;
    transition: border-color .18s ease, box-shadow .18s ease;
    font-family: inherit;
}

.sgkfaq-form__input::placeholder,
.sgkfaq-form__textarea::placeholder {
    color: #9aa5b4;
}

.sgkfaq-form__input:focus,
.sgkfaq-form__textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}

.sgkfaq-form__textarea {
    resize: vertical;
    min-height: 100px;
}

.sgkfaq-form__hint {
    display: block;
    font-size: .75rem;
    color: #6c757d;
    margin-top: .25rem;
}

.sgkfaq-form__char-count {
    text-align: right;
    transition: color .15s ease;
}

.sgkfaq-form__char-count.sgkfaq-form__char-count--warn {
    color: #e65100;
}

/* RGPD */
.sgkfaq-form__rgpd {
    font-size: .75rem;
    color: #9aa5b4;
    margin: .75rem 0 1rem;
    line-height: 1.5;
}

/* Bouton submit */
.sgkfaq-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    padding: .625rem 1rem;
    background: #1a73e8;
    color: #fff;
    border: none;
    border-radius: .375rem;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .18s ease, transform .12s ease;
    line-height: 1.4;
}

.sgkfaq-form__submit:hover {
    background: #1558b0;
    transform: translateY(-1px);
}

.sgkfaq-form__submit:active {
    transform: translateY(0);
}

.sgkfaq-form__submit [class^="fto-"],
.sgkfaq-form__submit [class*=" fto-"] {
    font-size: 1rem;
}

/* Honeypot anti-spam – caché visuellement ET pour les lecteurs d'écran */
.sgkfaq-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    tab-size: 0;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */

/* Petit mobile */
@media (max-width: 575.98px) {
    .sgkfaq-item__icon  { display: none; }
    .sgkfaq-item__btn   { padding: .75rem .875rem; gap: .5rem; }
    .sgkfaq-item__answer-body { padding: .625rem .875rem .75rem; }
    .sgkfaq-item__question    { font-size: .875rem; }
    .sgkfaq-group__title      { font-size: .9375rem; }
    .sgkfaq-home-link         { font-size: .8125rem; }
    .sgkfaq-form-card__body   { padding: 1rem; }
}

/* Tablette portrait */
@media (min-width: 576px) and (max-width: 767.98px) {
    .sgkfaq-item__icon { display: none; }
    .sgkfaq-item__answer-body { padding-left: 1.125rem; }
}

/* Desktop */
@media (min-width: 768px) {
    .sgkfaq-item__icon { display: flex; }
}
