/**
 * Module ProductRecommend - CSS
 *
 * Structure : 3 pages (profil / forme / besoin), chacune contenant plusieurs blocs de questions.
 * Esprit : moderne, sobre, aligne sur l'identite La Croquetterie.
 * Charte : gris fonce #414142 (sidebar) + vert #a7bc44 (accent) + blanc/gris clair (main).
 */

.lc-recommend-wrap,
.lc-recommend-wrap * {
    box-sizing: border-box;
}

.lc-recommend-wrap {
    /* Couleurs primaires */
    --lc-vert: #a7bc44;
    --lc-vert-hover: #8fa336;
    --lc-vert-light: #f0f5dc;
    --lc-vert-soft: rgba(167, 188, 68, 0.12);

    /* Gris */
    --lc-gris: #414142;
    --lc-gris-clair: #6a6a6b;
    --lc-gris-tres-clair: #b8b8b9;

    /* Fonds (refonte v0.19 : remplacement des kraft par neutres) */
    --lc-fond: #f7f7f8;          /* fond principal main (presque blanc) */
    --lc-fond-card: #ffffff;     /* cards et zones de question */
    --lc-sidebar-bg: #414142;    /* sidebar = gris fonce */
    --lc-sidebar-border: #a7bc44;/* liseret vert vertical */
    --lc-border-subtle: #e8e8ea; /* bordures discretes sur main */
    --lc-blanc: #ffffff;

    /* Alias retro-compat pour ne pas casser les regles existantes */
    --lc-kraft: var(--lc-border-subtle);
    --lc-kraft-light: var(--lc-fond);
    --lc-kraft-tres-light: var(--lc-fond);

    /* Ombres et formes */
    --lc-shadow-sm: 0 1px 3px rgba(65, 65, 66, 0.06);
    --lc-shadow-md: 0 4px 14px rgba(65, 65, 66, 0.08);
    --lc-shadow-lg: 0 10px 32px rgba(65, 65, 66, 0.12);
    --lc-radius: 14px;
    --lc-radius-sm: 8px;
    --lc-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--lc-gris);
    display: grid;
    grid-template-columns: 320px 1fr;
    background: var(--lc-fond);
}

/* v0.19.4 : la sidebar et le main doivent s'etendre sur toute la hauteur
   disponible de l'ecran SANS forcer de scroll global a cause du header/footer
   Prestashop. On utilise une variable --lc-avail-h calculee en JS au load
   et au resize (cf. recommend.js, fonction syncAvailableHeight).
   Fallback : 100vh si le JS n'a pas encore tourne. */
.lc-recommend-wrap {
    --lc-avail-h: 100vh;
}
.lc-rec-sidebar,
.lc-rec-main {
    min-height: var(--lc-avail-h);
}

/* ===== Sidebar - gris fonce avec liseret vert vertical ===== */
.lc-rec-sidebar {
    background: var(--lc-sidebar-bg);
    padding: 80px 40px 50px;
    display: flex;
    flex-direction: column;
    border-right: 4px solid var(--lc-sidebar-border);
    color: var(--lc-blanc);
}
.lc-rec-sidebar-logo { margin-bottom: 60px; }
.lc-rec-sidebar-logo img {
    max-width: 160px;
    height: auto;
    display: block;
    /* Si le logo est sombre, on peut l'eclaircir : decommenter au besoin */
    /* filter: brightness(0) invert(1); */
}
.lc-rec-stepper {
    display: flex;
    flex-direction: column;
    gap: 28px;
    flex: 1;
}
.lc-rec-step {
    position: relative;
    transition: var(--lc-transition);
    opacity: 0.55;
    padding: 4px 0;
}
.lc-rec-step.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--lc-vert);
    border-radius: 0 var(--lc-radius-sm) var(--lc-radius-sm) 0;
    padding: 18px 22px;
    margin: -18px -22px -18px -22px;
    box-shadow: none;
}
.lc-rec-step.done { opacity: 0.85; }
.lc-rec-step-num {
    font-size: 0.75em;
    font-weight: 700;
    color: var(--lc-vert);
    margin: 0 0 4px 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.lc-rec-step-title {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--lc-blanc);
    margin: 0 0 4px 0;
    letter-spacing: -0.2px;
}
.lc-rec-step-subtitle {
    font-size: 0.78em;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
}
.lc-rec-step.done .lc-rec-step-num::before {
    content: '\2713 ';
    color: var(--lc-vert);
}
.lc-rec-sidebar-footer {
    margin-top: auto;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.lc-rec-sidebar-footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color var(--lc-transition);
}
.lc-rec-sidebar-footer a:hover { color: var(--lc-vert); }
.lc-rec-sidebar-footer svg { width: 14px; height: 14px; }

/* ===== Contenu principal ===== */
.lc-rec-main {
    padding: 60px 80px;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}
.lc-rec-back {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--lc-gris-clair);
    font-size: 0.95em;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 12px;
    margin: 0 0 24px -12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--lc-radius-sm);
    transition: var(--lc-transition);
}
.lc-rec-back:hover {
    color: var(--lc-vert);
    background: var(--lc-vert-light);
}
.lc-rec-back svg { width: 18px; height: 18px; }
.lc-rec-back.hidden { visibility: hidden; }

/* ===== Ecrans (pages) ===== */
.lc-rec-screen {
    display: none;
    animation: lcFadeUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.lc-rec-screen.active {
    display: flex;
    flex-direction: column;
}
@keyframes lcFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Titre principal de page */
.lc-rec-question {
    color: var(--lc-gris);
    font-size: 1.9em;
    font-weight: 800;
    margin: 0 0 8px 0;
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.lc-rec-helper {
    color: var(--lc-gris-clair);
    font-size: 1em;
    margin: 0 0 36px 0;
    line-height: 1.5;
}

/* ===== Bloc de question (sous-section dans une page) ===== */
.lc-rec-question-block {
    margin-bottom: 32px;
    animation: lcFadeUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.lc-rec-question-block.lc-rec-q-hidden {
    display: none;
}
.lc-rec-q-label {
    font-size: 1.05em;
    font-weight: 700;
    color: var(--lc-gris);
    margin: 0 0 14px 0;
}
.lc-rec-q-helper {
    font-size: 0.88em;
    color: var(--lc-gris-clair);
    margin: -8px 0 14px 0;
}

/* ===== Cartes de choix ===== */
.lc-rec-choices {
    display: grid;
    gap: 12px;
}
.lc-rec-choices-2 { grid-template-columns: repeat(2, 1fr); }
.lc-rec-choices-3 { grid-template-columns: repeat(3, 1fr); }
.lc-rec-choices-4 { grid-template-columns: repeat(4, 1fr); }
.lc-rec-choices-5 { grid-template-columns: repeat(5, 1fr); }
.lc-rec-choices-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.lc-rec-choice {
    background: var(--lc-fond-card);
    border: 1px solid var(--lc-border-subtle);
    border-radius: var(--lc-radius);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--lc-transition);
    font-family: inherit;
    color: var(--lc-gris);
    text-align: center;
    position: relative;
    min-height: 80px;
    box-shadow: var(--lc-shadow-sm);
}
.lc-rec-choice:hover {
    border-color: var(--lc-vert);
    transform: translateY(-2px);
    box-shadow: var(--lc-shadow-md);
}
.lc-rec-choice.selected {
    border-color: var(--lc-vert);
    background: var(--lc-vert-soft);
    box-shadow: var(--lc-shadow-md);
}
.lc-rec-choice.selected::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--lc-vert);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}
.lc-rec-choice-icon {
    width: 36px;
    height: 36px;
    color: var(--lc-gris);
    transition: color var(--lc-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.lc-rec-choice:hover .lc-rec-choice-icon,
.lc-rec-choice.selected .lc-rec-choice-icon {
    color: var(--lc-vert);
}
.lc-rec-choice-icon svg { width: 100%; height: 100%; }
.lc-rec-choice-label {
    font-weight: 700;
    font-size: 1em;
    color: var(--lc-gris);
    line-height: 1.25;
}
.lc-rec-choice-sub {
    font-size: 0.8em;
    color: var(--lc-gris-clair);
    font-weight: 400;
    line-height: 1.3;
    margin-top: 2px;
}

/* Choix simple (besoin sans icone) */
.lc-rec-choice-simple {
    min-height: auto;
    padding: 14px 18px;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    gap: 0;
}

/* ===== Boutons ===== */
.lc-rec-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--lc-kraft);
}
.lc-rec-btn {
    padding: 14px 32px;
    border-radius: 100px;
    font-family: inherit;
    font-size: 0.92em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--lc-transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.lc-rec-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.lc-rec-btn-primary {
    background: var(--lc-vert);
    color: var(--lc-blanc);
}
.lc-rec-btn-primary:hover:not(:disabled) {
    background: var(--lc-vert-hover);
    transform: translateY(-1px);
    box-shadow: var(--lc-shadow-md);
}
.lc-rec-btn-secondary {
    background: var(--lc-blanc);
    color: var(--lc-gris);
    border-color: var(--lc-kraft);
}
.lc-rec-btn-secondary:hover {
    border-color: var(--lc-vert);
    color: var(--lc-vert);
}
.lc-rec-btn svg { width: 16px; height: 16px; }

/* ===== Loader ===== */
.lc-rec-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    gap: 24px;
    text-align: center;
}
.lc-rec-spinner {
    width: 56px;
    height: 56px;
    border: 3px solid var(--lc-kraft);
    border-top-color: var(--lc-vert);
    border-radius: 50%;
    animation: lcSpin 0.8s linear infinite;
}
@keyframes lcSpin { to { transform: rotate(360deg); } }
.lc-rec-loader p { color: var(--lc-gris-clair); font-size: 1.05em; margin: 0; }

/* ===== Resultats ===== */
.lc-rec-result-intro {
    text-align: center;
    margin-bottom: 32px;
}
.lc-rec-result-intro h2 {
    font-size: 2.2em;
    font-weight: 800;
    color: var(--lc-gris);
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
}
.lc-rec-result-intro .lc-rec-helper { margin: 0; }
.lc-rec-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.lc-rec-result-card {
    background: var(--lc-fond-card);
    border: 1px solid var(--lc-border-subtle);
    border-radius: var(--lc-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--lc-transition);
    box-shadow: var(--lc-shadow-sm);
}
.lc-rec-result-card:hover {
    box-shadow: var(--lc-shadow-lg);
    transform: translateY(-3px);
    border-color: var(--lc-vert);
}
.lc-rec-result-badge {
    background: var(--lc-vert);
    color: var(--lc-blanc);
    padding: 10px 18px;
    font-size: 0.72em;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-align: center;
    text-transform: uppercase;
}
.lc-rec-result-image {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(180deg, #fafafb 0%, #f3f3f5 100%);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--lc-border-subtle);
}
.lc-rec-result-image img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
}
.lc-rec-result-image-empty {
    width: 60px;
    height: 60px;
    color: var(--lc-gris-tres-clair);
    opacity: 0.5;
}
.lc-rec-result-image-empty svg { width: 100%; height: 100%; }
.lc-rec-result-body {
    padding: 24px 22px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.lc-rec-result-name {
    color: var(--lc-gris);
    font-size: 1.1em;
    font-weight: 700;
    margin: 0 0 12px 0;
    min-height: 2.6em;
    line-height: 1.3em;
}
.lc-rec-result-price {
    color: var(--lc-vert);
    font-size: 1.6em;
    font-weight: 800;
    margin: 0 0 20px 0;
}
.lc-rec-result-cta {
    display: inline-block;
    padding: 12px 24px;
    background: var(--lc-gris);
    color: var(--lc-blanc) !important;
    text-decoration: none !important;
    border-radius: 100px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: auto;
    transition: var(--lc-transition);
}
.lc-rec-result-cta:hover {
    background: var(--lc-vert);
    color: var(--lc-blanc) !important;
}
.lc-rec-result-empty {
    padding: 30px;
    text-align: center;
    color: var(--lc-gris-clair);
    font-style: italic;
}
.lc-rec-result-veto-badge {
    display: inline-block;
    align-self: center;
    background: var(--lc-gris);
    color: var(--lc-blanc);
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.65em;
    font-weight: 800;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.lc-rec-result-note {
    font-size: 0.85em;
    color: var(--lc-vert);
    font-style: italic;
    margin: 0 0 10px 0;
    padding: 6px 10px;
    background: var(--lc-vert-light);
    border-radius: 6px;
    line-height: 1.4;
}

/* ===== Erreur ===== */
.lc-rec-error {
    text-align: center;
    padding: 60px 20px;
}
.lc-rec-error h2 {
    color: var(--lc-gris);
    font-size: 1.8em;
    margin-bottom: 12px;
}
.lc-rec-error p {
    color: var(--lc-gris-clair);
    margin-bottom: 28px;
}

/* ===== Mobile ===== */
@media (max-width: 900px) {
    .lc-recommend-wrap {
        grid-template-columns: 1fr;
    }
    /* v0.20.1 : neutraliser le min-height: var(--lc-avail-h) sur mobile.
       Sur mobile la sidebar passe en bandeau horizontal en haut, le main
       prend toute la largeur sous elle. */
    .lc-rec-sidebar,
    .lc-rec-main {
        min-height: 0;
    }
    .lc-rec-sidebar {
        position: static;
        height: auto;
        padding: 18px 16px 0;
        border-right: none;
        border-bottom: 1px solid rgba(167, 188, 68, 0.4);
    }
    .lc-rec-sidebar-logo { margin-bottom: 20px; }
    .lc-rec-sidebar-logo img { max-width: 110px; }
    .lc-rec-stepper {
        flex-direction: row;
        gap: 4px;
        overflow-x: auto;
        padding: 0;
        margin-bottom: 0;
    }
    .lc-rec-step {
        min-width: 80px;
        flex: 1;
        text-align: center;
        padding: 8px 4px 10px;
        opacity: 0.5;
    }
    .lc-rec-step.done { opacity: 0.7; }
    .lc-rec-step-subtitle { display: none; }
    .lc-rec-step-title {
        font-size: 0.8em;
        line-height: 1.2;
    }
    .lc-rec-step-num {
        font-size: 0.65em;
        margin-bottom: 2px;
    }
    .lc-rec-step.active {
        margin: 0;
        padding: 8px 4px 6px;
        background: transparent;
        border-left: none;
        border-bottom: 2px solid var(--lc-vert);
        border-radius: 0;
        opacity: 1;
    }
    .lc-rec-sidebar-footer { display: none; }
    .lc-rec-main { padding: 28px 18px; }
    .lc-rec-question { font-size: 1.4em; }
    .lc-rec-helper { font-size: 0.92em; margin-bottom: 24px; }
    .lc-rec-choices-3, .lc-rec-choices-4, .lc-rec-choices-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    .lc-rec-actions { justify-content: center; }
    .lc-rec-btn { width: 100%; justify-content: center; }
}

/* ============================================================
   v0.13 / v0.14 - Styles complementaires
   ============================================================ */

/* Bloc info chiot (page Forme physique) */
.lc-rec-info-block {
    background: var(--lc-vert-soft);
    border-left: 4px solid var(--lc-vert);
    padding: 14px 18px;
    border-radius: var(--lc-radius-sm);
    margin-bottom: 24px;
    color: var(--lc-gris);
    font-size: 0.95em;
    line-height: 1.5;
}
.lc-rec-info-block p { margin: 0; }

/* Bouton categorie "veto redirect" : visuellement distinct (orange) */
.lc-rec-choice-veto-cat {
    border-color: #d49a3a !important;
}
.lc-rec-choice-veto-cat:hover {
    background: #fff7e8;
    border-color: #b8821f !important;
}
.lc-rec-choice-veto-cat .lc-rec-choice-label::after {
    content: ' ⚠';
    color: #d49a3a;
    margin-left: 4px;
}

/* Bloc resultat veto (page Resultat) */
.lc-rec-veto-block {
    background: #fff7e8;
    border: 2px solid #d49a3a;
    border-radius: 8px;
    padding: 28px;
    margin: 24px 0;
    text-align: center;
}
.lc-rec-veto-block h2 {
    color: #b8821f;
    margin: 0 0 12px;
    font-size: 1.4em;
}
.lc-rec-veto-icon {
    font-size: 2.4em;
    color: #d49a3a;
    margin-bottom: 8px;
    line-height: 1;
}
.lc-rec-veto-block p {
    color: #5a4a2a;
    line-height: 1.6;
    margin: 0;
    font-size: 1em;
}

/* Badge confiance sur carte produit */
.lc-rec-confidence {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.lc-rec-confidence-perfect { background: #d8e7c2; color: #4a6b1f; }
.lc-rec-confidence-good    { background: #e7efd5; color: #5a7a2f; }
.lc-rec-confidence-neutral { background: #ecedf0; color: #555; }
.lc-rec-confidence-partial { background: #f0e8d0; color: #8a6a2a; }
.lc-rec-confidence-low     { background: #f5d8c2; color: #8a4a2a; }
