/**
* 2010-2026 SwissGeek | Web Developer Freelance
*
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https:// opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https:// devdocs.prestashop.com/ for more information.
*
* @Module		SGK FAQ
* @Description	FAQ module with categories: questions and answers grouped by category on a dedicated CMS page, animated accordion, customizable typography.
* @Version		1.9.1
* @Copyright	SwissGeek | Web Developer Freelance <https://swissgeek.dev/>
* @support		Support Requests <https://admin.swissgeek.dev/forms/ticket?styled=1&with_logo=1>
* @Blog			Breaking News <https://news.swissgeek.dev/> <https://news.prestageek.ch/>
* @Addons		Developments <https://prestageek.ch/> <https://add.swissgeek.dev/>
*
* @license		http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*				Valid for 1 website (or project) for each purchase of license International Registered 
*				Trademark & Property of SwissGeek. More information on <https://swissgeek.dev/license/>
*/

/* =========================================================================
   SGK FAQ - base front-office stylesheet, theme agnostic.

   Typography is driven by the CSS custom properties set on .sgkfaq-layout by
   the template (--sgkfaq-q-* for questions, --sgkfaq-a-* for answers). Every
   rule reads them through var() with a hard-coded fallback, so the module
   still renders correctly if the attribute is ever missing.
   ========================================================================= */

.sgkfaq-layout {
    width: 100%;
    box-sizing: border-box;
}

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

.sgkfaq-wrapper {
    width: 100%;
    margin-bottom: 1.5rem;
}

/* =========================================================================
   CATEGORY GROUP
   ========================================================================= */

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

.sgkfaq-group__header {
    margin-bottom: .75rem;
}

.sgkfaq-group__title {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #2c2c3e;
    line-height: 1.35;
}

.sgkfaq-group__desc {
    margin: .35rem 0 0;
    font-size: .875rem;
    line-height: 1.55;
    color: #6c757d;
}

/* =========================================================================
   LIST AND ITEMS
   ========================================================================= */

.sgkfaq-list {
    border: 1px solid #e4eaf5;
    border-radius: .5rem;
    overflow: hidden;
    background: #fff;
}

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

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

.sgkfaq-item__btn {
    display: flex;
    align-items: flex-start;
    gap: .625rem;
    width: 100%;
    padding: .875rem 1rem;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease;
}

.sgkfaq-item__btn:hover {
    background: #f8fafd;
}

/* Neutralise a theme's global `button:focus` native ring on mouse click while
   keeping a clear ring for keyboard users. The `.sgkfaq-list` scope raises
   specificity above a bare `button:focus` theme rule. */
.sgkfaq-list .sgkfaq-item__btn:focus {
    outline: none;
}

.sgkfaq-list .sgkfaq-item__btn:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: -2px;
}

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

/* =========================================================================
   ICONS - inline SVG, no icon font dependency
   ========================================================================= */

.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: 2px;
}

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

.sgkfaq-item__icon svg {
    width: 15px;
    height: 15px;
    display: block;
    fill: #1a73e8;
}

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

.sgkfaq-item__chevron svg {
    width: 19px;
    height: 19px;
    display: block;
    fill: #b0b8c9;
    transition: fill .22s ease, transform .22s ease;
}

.sgkfaq-item--open .sgkfaq-item__chevron svg {
    fill: #1a73e8;
    transform: rotate(180deg);
}

/* =========================================================================
   QUESTION TEXT - merchant typography
   ========================================================================= */

.sgkfaq-item__question {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    line-height: 1.45;
    text-align: var(--sgkfaq-q-align, left);
    font-family: var(--sgkfaq-q-font, inherit);
    font-size: var(--sgkfaq-q-size, .9375rem);
    font-weight: var(--sgkfaq-q-weight, 600);
    font-style: var(--sgkfaq-q-style, normal);
    color: var(--sgkfaq-q-color, #2c2c3e);
}

/* =========================================================================
   ANSWER - merchant typography
   ========================================================================= */

.sgkfaq-item__answer[hidden] {
    display: none;
}

.sgkfaq-item__answer-body {
    padding: .25rem 1rem 1rem 3rem;
    line-height: 1.65;
    text-align: var(--sgkfaq-a-align, left);
    font-family: var(--sgkfaq-a-font, inherit);
    font-size: var(--sgkfaq-a-size, .9375rem);
    font-weight: var(--sgkfaq-a-weight, 400);
    font-style: var(--sgkfaq-a-style, normal);
    color: var(--sgkfaq-a-color, #555);
}

.sgkfaq-item__answer-body p:last-child {
    margin-bottom: 0;
}

.sgkfaq-item__answer-body img {
    max-width: 100%;
    height: auto;
}

.sgkfaq-item__answer-body a {
    text-decoration: underline;
}

/* Some themes ship a global `ul { list-style: none }` reset, which would strip
   the bullets from the merchant's own answers. */
.sgkfaq-item__answer-body ul,
.sgkfaq-item__answer-body ol {
    margin: .5rem 0 .75rem;
    padding-left: 1.5rem;
}

.sgkfaq-item__answer-body ul {
    list-style: disc outside;
}

.sgkfaq-item__answer-body ol {
    list-style: decimal outside;
}

.sgkfaq-item__answer-body li {
    margin-bottom: .25rem;
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */

.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 svg {
    width: 44px;
    height: 44px;
    display: inline-block;
    fill: #b0b8c9;
}

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

/* =========================================================================
   BACK TO HOME LINK
   ========================================================================= */

.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 {
    color: #1a73e8;
    background: #e8f0fe;
    border-color: #a8c4f8;
    text-decoration: none;
    transform: translateX(-3px);
}

/* A keyboard user must keep a visible focus ring: the previous rule removed
   the outline on :focus without providing any replacement. */
.sgkfaq-home-link:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
    color: #1a73e8;
    background: #e8f0fe;
    border-color: #a8c4f8;
}

.sgkfaq-home-link__icon {
    display: flex;
    align-items: center;
}

.sgkfaq-home-link__icon svg {
    width: 17px;
    height: 17px;
    display: block;
    fill: currentColor;
}

/* =========================================================================
   SUGGEST-A-QUESTION FORM
   ========================================================================= */

.sgkfaq-contact {
    background: #fff;
    border: 1px solid #e4eaf5;
    border-radius: .5rem;
    padding: 1.25rem 1.25rem 1.5rem;
}

.sgkfaq-layout--after > .sgkfaq-contact {
    margin-top: 1.5rem;
}

.sgkfaq-layout--before > .sgkfaq-contact {
    margin-bottom: 1.5rem;
}

/* Side-by-side layouts (left / right) */
.sgkfaq-layout--has-form.sgkfaq-layout--left,
.sgkfaq-layout--has-form.sgkfaq-layout--right {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.75rem;
}

.sgkfaq-layout--has-form.sgkfaq-layout--left > .sgkfaq-wrapper,
.sgkfaq-layout--has-form.sgkfaq-layout--right > .sgkfaq-wrapper {
    flex: 1 1 340px;
    min-width: 0;
    margin-bottom: 0;
}

.sgkfaq-layout--has-form.sgkfaq-layout--left > .sgkfaq-contact,
.sgkfaq-layout--has-form.sgkfaq-layout--right > .sgkfaq-contact {
    flex: 0 1 340px;
    align-self: stretch;
}

.sgkfaq-contact__title {
    margin: 0 0 .35rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: #2c2c3e;
}

.sgkfaq-contact__intro {
    margin: 0 0 1rem;
    font-size: .875rem;
    color: #6c757d;
    line-height: 1.55;
}

.sgkfaq-contact__alert {
    margin-bottom: 1rem;
    padding: .625rem .875rem;
    border-radius: .375rem;
    font-size: .875rem;
    line-height: 1.5;
}

.sgkfaq-contact__alert--ok {
    background: #e7f6ec;
    border: 1px solid #b7e2c5;
    color: #1c6b38;
}

.sgkfaq-contact__alert--err {
    background: #fdeaea;
    border: 1px solid #f5c2c2;
    color: #9b2222;
}

/* Off-screen honeypot: kept in the stylesheet so the markup stays clean and
   compatible with a strict style-src policy. */
.sgkfaq-contact__hp {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.sgkfaq-contact__row {
    margin-bottom: .875rem;
}

.sgkfaq-contact__label {
    display: block;
    margin-bottom: .3rem;
    font-size: .8125rem;
    font-weight: 600;
    color: #5a6275;
}

.sgkfaq-contact__req {
    color: #d33;
}

.sgkfaq-contact__input,
.sgkfaq-contact__textarea {
    width: 100%;
    padding: .5rem .625rem;
    border: 1px solid #d0d9ea;
    border-radius: .375rem;
    font-size: .875rem;
    font-family: inherit;
    color: #2c2c3e;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.sgkfaq-contact__textarea {
    resize: vertical;
    min-height: 72px;
}

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

.sgkfaq-contact__row--consent {
    margin-top: 1rem;
}

.sgkfaq-contact__consent {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    font-size: .8125rem;
    line-height: 1.5;
    color: #5a6275;
    cursor: pointer;
}

.sgkfaq-contact__consent input {
    margin-top: .15rem;
    flex: none;
    width: 16px;
    height: 16px;
}

.sgkfaq-contact__consent a {
    text-decoration: underline;
}

.sgkfaq-contact__actions {
    margin-top: 1.125rem;
    display: flex;
    justify-content: flex-start;
}

.sgkfaq-contact__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .625rem 1.25rem;
    border: 0;
    border-radius: .375rem;
    background: #1a73e8;
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, transform .12s ease;
}

.sgkfaq-contact__btn:hover {
    background: #1560c4;
}

.sgkfaq-contact__btn:active {
    transform: translateY(1px);
}

.sgkfaq-contact__btn:focus {
    outline: none;
}

.sgkfaq-contact__btn:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

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

@media (max-width: 767.98px) {
    .sgkfaq-item__icon {
        display: none;
    }

    .sgkfaq-item__answer-body {
        padding-left: 1rem;
    }
}

@media (max-width: 575.98px) {
    .sgkfaq-item__btn {
        padding: .75rem .875rem;
        gap: .5rem;
    }

    .sgkfaq-item__answer-body {
        padding: .25rem .875rem .875rem;
    }

    /* Cap the merchant font size on small screens without discarding the
       configured value: min() keeps whichever is smaller. */
    .sgkfaq-item__question {
        font-size: min(var(--sgkfaq-q-size, .9375rem), 1rem);
    }

    .sgkfaq-item__answer-body {
        font-size: min(var(--sgkfaq-a-size, .9375rem), 1rem);
    }

    .sgkfaq-group__title {
        font-size: .9375rem;
    }

    .sgkfaq-home-link {
        font-size: .8125rem;
        padding: 7px 14px 7px 11px;
    }

    .sgkfaq-home-link-wrap {
        margin-top: 1.25rem;
        padding-top: .875rem;
    }

    .sgkfaq-contact {
        padding: 1rem 1rem 1.25rem;
    }

    .sgkfaq-contact__btn {
        width: 100%;
    }
}

/* Stack the side-by-side layouts on small screens */
@media (max-width: 900px) {
    .sgkfaq-layout--has-form.sgkfaq-layout--left,
    .sgkfaq-layout--has-form.sgkfaq-layout--right {
        display: block;
    }

    .sgkfaq-layout--has-form.sgkfaq-layout--left > .sgkfaq-wrapper,
    .sgkfaq-layout--has-form.sgkfaq-layout--right > .sgkfaq-wrapper {
        margin-bottom: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sgkfaq-item__btn,
    .sgkfaq-item__icon,
    .sgkfaq-item__chevron svg,
    .sgkfaq-home-link,
    .sgkfaq-contact__btn,
    .sgkfaq-contact__input,
    .sgkfaq-contact__textarea {
        transition: none;
    }
}
