/* ============================================================
   Farouche — Guide des Tailles
   Tous les sélecteurs sont préfixés farouche-sg- ou sg-
   pour éviter tout conflit avec Flatsome / WooCommerce.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;900&display=swap');

/* ---------- Variables ---------- */
.farouche-sg-wrap {
    --sg-violet:    #5B3FD9;
    --sg-vert:      #00C896;
    --sg-jaune:     #F5A623;
    --sg-noir:      #1A1A2E;
    --sg-gris:      #F7F7FB;
    --sg-bord:      #E4E4EF;
    --sg-blanc:     #ffffff;
    --sg-text:      #3D3D5C;
    font-family: 'Outfit', sans-serif;
}

/* ---------- Trigger link ---------- */
a.farouche-sg-trigger,
button.farouche-sg-trigger {
    color: #5B3FD9;
    font-weight: 700;
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
a.farouche-sg-trigger:hover,
button.farouche-sg-trigger:hover {
    color: #4a2fc0;
}

/* ---------- Overlay ---------- */
.farouche-sg-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.farouche-sg-overlay.sg-open {
    display: flex;
}

/* ---------- Modal ---------- */
.farouche-sg-modal {
    background: var(--sg-blanc, #fff);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: sgFadeIn 0.2s ease;
}
@keyframes sgFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.farouche-sg-close {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    background: none;
    border: none;
    z-index: 10;
    transition: color 0.15s;
}
.farouche-sg-close:hover { color: #fff; }

/* ---------- Wrap ---------- */
.farouche-sg-wrap {
    border-radius: 20px;
    overflow: hidden;
}

/* ---------- Header ---------- */
.sg-header {
    background: #5B3FD9;
    padding: 28px 32px 22px;
    color: #fff;
}
.sg-header-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-bottom: 6px;
}
.sg-header-title {
    font-size: 26px;
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
    margin: 0 0 8px;
}
.sg-header-title span { color: #00C896; }
.sg-header-sub {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

/* ---------- Steps bar ---------- */
.sg-steps-bar {
    display: flex;
    background: #F7F7FB;
    border-bottom: 1px solid #E4E4EF;
}
.sg-step-dot {
    flex: 1;
    height: 4px;
    background: #E4E4EF;
    transition: background 0.3s;
}
.sg-step-dot.active { background: #00C896; }
.sg-step-dot.done   { background: #5B3FD9; }

/* ---------- Body ---------- */
.sg-body { padding: 28px 32px; }

.sg-step { display: none; }
.sg-step.active { display: block; }

.sg-step-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #5B3FD9;
    margin-bottom: 6px;
}
.sg-step-title {
    font-size: 18px;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 20px;
}

/* ---------- Breed search ---------- */
.sg-selected-breed {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(91,63,217,0.06);
    border: 2px solid #5B3FD9;
    border-radius: 12px;
    margin-bottom: 12px;
}
.sg-selected-breed.sg-show { display: flex; }
.sg-breed-name { font-weight: 700; color: #1A1A2E; flex: 1; }
.sg-change-btn {
    font-size: 12px;
    color: #5B3FD9;
    cursor: pointer;
    text-decoration: underline;
    background: none;
    border: none;
    font-family: 'Outfit', sans-serif;
}

.sg-search-wrap {
    position: relative;
    margin-bottom: 12px;
}
.sg-search-wrap input {
    width: 100%;
    padding: 13px 16px 13px 42px;
    border: 2px solid #E4E4EF;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    color: #1A1A2E;
    background: #F7F7FB;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}
.sg-search-wrap input:focus {
    border-color: #5B3FD9;
    background: #fff;
}
.sg-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #aaa;
}

.sg-breed-list {
    display: none;
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #E4E4EF;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 12px;
}
.sg-breed-list.sg-open { display: block; }
.sg-breed-item {
    padding: 11px 16px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #E4E4EF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
}
.sg-breed-item:last-child { border-bottom: none; }
.sg-breed-item:hover { background: #F7F7FB; }
.sg-breed-size-tag {
    font-size: 11px;
    font-weight: 700;
    color: #5B3FD9;
    background: rgba(91,63,217,0.08);
    padding: 2px 8px;
    border-radius: 20px;
}

/* ---------- Slider ---------- */
.sg-slider-value {
    text-align: center;
    font-size: 40px;
    font-weight: 900;
    color: #1A1A2E;
    margin-bottom: 16px;
    line-height: 1;
}
.sg-slider-value em {
    font-size: 16px;
    font-weight: 500;
    color: #aaa;
    font-style: normal;
}
.sg-slider-wrap { margin-bottom: 8px; }
.sg-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #aaa;
    margin-top: 6px;
}
input[type=range].sg-range,
#sg-weight-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #E4E4EF;
    outline: none;
    cursor: pointer;
}
#sg-weight-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #5B3FD9;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(91,63,217,0.3);
}

/* ---------- Mensuration ---------- */
.sg-optional-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #F5A623;
    background: rgba(245,166,35,0.12);
    padding: 3px 8px;
    border-radius: 20px;
    margin-bottom: 16px;
}
.sg-mensuration-wrap { margin-bottom: 16px; }
.sg-mensuration-input { position: relative; max-width: 160px; }
.sg-mensuration-input input {
    width: 100%;
    padding: 13px 40px 13px 16px;
    border: 2px solid #E4E4EF;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #1A1A2E;
    background: #F7F7FB;
    outline: none;
    text-align: center;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.sg-mensuration-input input:focus {
    border-color: #5B3FD9;
    background: #fff;
}
.sg-unit {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #aaa;
    font-weight: 600;
}

/* ---------- Hint ---------- */
.sg-hint {
    font-size: 12px;
    color: #aaa;
    margin-top: 10px;
    font-style: italic;
    line-height: 1.5;
}

/* ---------- Buttons ---------- */
.sg-btn-primary {
    width: 100%;
    padding: 16px;
    background: #5B3FD9;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s, transform 0.1s;
    display: block;
}
.sg-btn-primary:hover:not(:disabled) {
    background: #4a2fc0;
    transform: translateY(-1px);
}
.sg-btn-primary:disabled {
    background: #E4E4EF;
    color: #aaa;
    cursor: not-allowed;
}
.sg-btn-secondary {
    width: 100%;
    padding: 13px;
    background: transparent;
    color: #5B3FD9;
    border: 2px solid #E4E4EF;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: border-color 0.2s;
    display: block;
}
.sg-btn-secondary:hover { border-color: #5B3FD9; }

/* ---------- Result ---------- */
.sg-result-center { text-align: center; padding: 20px 0 16px; }
.sg-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 900;
    color: #fff;
    background: #5B3FD9;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    margin-bottom: 16px;
    line-height: 1;
}
.sg-result-title {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A2E;
    margin-bottom: 6px;
}
.sg-result-sub {
    font-size: 14px;
    color: #aaa;
}

.sg-confidence {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #aaa;
    margin: 16px 0;
    justify-content: center;
}
.sg-confidence-bar {
    flex: 1;
    max-width: 120px;
    height: 4px;
    background: #E4E4EF;
    border-radius: 2px;
    overflow: hidden;
}
.sg-confidence-fill {
    height: 100%;
    background: #00C896;
    border-radius: 2px;
    transition: width 0.5s;
}

.sg-result-details {
    background: #F7F7FB;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.sg-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 14px;
    border-bottom: 1px solid #E4E4EF;
}
.sg-result-row:last-child { border-bottom: none; }
.sg-rl { color: #aaa; }
.sg-rv { font-weight: 700; color: #1A1A2E; }
.sg-rv.sg-match { color: #00C896; }

.sg-btn-choose {
    width: 100%;
    padding: 18px;
    background: #00C896;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: block;
}
.sg-btn-choose:hover {
    background: #00b384;
    transform: translateY(-1px);
}

.sg-restart {
    text-align: center;
    margin-top: 14px;
    font-size: 13px;
    color: #aaa;
    cursor: pointer;
}
.sg-restart:hover { color: #5B3FD9; }

/* ---------- Scrollbar ---------- */
.sg-breed-list::-webkit-scrollbar,
.farouche-sg-modal::-webkit-scrollbar { width: 4px; }
.sg-breed-list::-webkit-scrollbar-thumb,
.farouche-sg-modal::-webkit-scrollbar-thumb {
    background: #E4E4EF;
    border-radius: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .sg-header { padding: 22px 20px 18px; }
    .sg-body   { padding: 22px 20px; }
    .sg-header-title { font-size: 22px; }
}

/* ============================================================
   Ajouts v2 — Morphologie & Médaille
   ============================================================ */

/* Morpho cards */
.sg-morpho-choices {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.sg-morpho-card {
    flex: 1;
    border: 2px solid #E4E4EF;
    border-radius: 14px;
    padding: 16px 12px;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    background: #F7F7FB;
}
.sg-morpho-card:hover { border-color: #5B3FD9; background: #fff; }
.sg-morpho-card.sg-morpho-selected {
    border-color: #5B3FD9;
    background: rgba(91,63,217,0.06);
}
.sg-morpho-icon  { font-size: 28px; margin-bottom: 8px; }
.sg-morpho-label { font-weight: 700; font-size: 14px; color: #1A1A2E; margin-bottom: 4px; }
.sg-morpho-sub   { font-size: 11px; color: #aaa; margin-bottom: 8px; line-height: 1.4; }
.sg-morpho-size  {
    font-size: 12px;
    font-weight: 700;
    color: #5B3FD9;
    background: rgba(91,63,217,0.1);
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
}

/* Alerte largeur M */
.sg-morpho-alert {
    background: rgba(245,166,35,0.10);
    border: 1.5px solid #F5A623;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 13px;
    color: #3D3D5C;
    margin-bottom: 16px;
    line-height: 1.5;
}
