/**
 * CaniGuide - Comparateur de Races
 * Styles pour page-comparateur.php
 */

/* ============================================================
   BREADCRUMB
============================================================ */
.breadcrumb-wrapper {
    width: 100%;
    background: #fff;
    padding: 15px 0;
}

.breadcrumb-wrapper > * {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

body.page-template-page-comparateur .cg-breadcrumb {
    max-width: 1200px;
    margin: 16px auto 24px;
    padding: 0 16px;
}

/* ============================================================
   CONTENEUR PRINCIPAL
============================================================ */
.comparator-container {
    max-width: 1400px;
	padding: 0 20px;
    margin: 0 auto;
    width: 100%;
}

.comparator-wrapper {
    padding: 40px 0px 60px;
    background: #f9f9f9;
    width: 100%;
}

.comparator-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #452D16;
    text-align: center;
    margin-bottom: 20px;
}

.comparator-intro {
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
    font-size: 1.05rem;
    color: #666;
    line-height: 1.6;
}

@media (max-width: 1023px) {
    .comparator-intro.cg-readmore {
        margin-bottom: 6px;
    }
}

/* ============================================================
   FORMULAIRE DE SÉLECTION
============================================================ */
.comparator-form {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.comparator-selects {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    align-items: end;
    margin-bottom: 30px;
}

.select-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.select-wrapper label {
    font-weight: 600;
    color: #452D16;
    font-size: 1.05rem;
}

.comparator-input {
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1.05rem;
    background: white;
    cursor: text;
    min-height: 50px;
    width: 100%;
}

.comparator-input:focus {
    outline: none;
    border-color: #EA7D1F;
}

.race-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f3f3f3;
}

.vs-separator {
    font-size: 2rem;
    font-weight: 700;
    color: #EA7D1F;
    padding-bottom: 8px;
}

.btn-compare {
    width: 100%;
    padding: 14px;
    background: #EA7D1F;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s;
}

.btn-compare:hover {
    background: #2e1e12;
}

/* ============================================================
   BOUTON RETOUR
============================================================ */
.btn-back {
    display: inline-block;
    padding: 10px 20px;
    background: white;
    border: 1px solid #452D16;
    border-radius: 8px;
    color: #452D16;
    text-decoration: none;
    margin-bottom: 30px;
    transition: background 0.25s;
}

.btn-back:hover {
    background: #f4f4f4;
    text-decoration: none;
}

/* ============================================================
   HEADER COMPARATEUR
============================================================ */
.compare-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.compare-col {
    text-align: center;
}

.race-image-compact {
    width: 100%;
    max-width: 280px;
    margin: 0 auto 20px;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 10px;
}

.race-image-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compare-col h2 {
    font-size: 1.6rem;
    color: #452D16;
    margin-bottom: 16px;
}

.btn-view-race {
    display: inline-block;
    padding: 12px 28px;
    background: #EA7D1F;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: background 0.25s;
}

.btn-view-race:hover {
    background: #d06d1a;
    text-decoration: none;
}

.btn-view-race.disabled {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

/* ============================================================
   BARRE STICKY
   —
   Structure en 3 colonnes pour s'aligner avec .compare-row :
     [sticky-spacer 200px] [sticky-left 1fr] [sticky-right 1fr]
   Caché par défaut, affiché via classe .visible ajoutée en JS.
============================================================ */
.mobile-compare-sticky {
    position: fixed;
    top: 0;

    padding: 8px 20px;
    box-sizing: border-box;

    display: grid;
    grid-template-columns: 200px 1fr 1fr;

    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);

    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-compare-sticky.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.sticky-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 8px;
}

.sticky-item.sticky-left  { background: #f9ecdf; }
.sticky-item.sticky-right { background: #ece9e5; }

.mobile-compare-sticky img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.sticky-item span {
    font-size: 0.95rem;
    font-weight: 600;
    color: #452D16;
}

/* ============================================================
   SECTIONS DE COMPARAISON
============================================================ */
.compare-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #452D16;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* ============================================================
   TABLEAU DE COMPARAISON
============================================================ */
.compare-table {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    gap: 1px;
    background: #e0e0e0;
}

.compare-row {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    background: #ffffff;
}

.compare-label {
    padding: 16px 20px;
    font-weight: 600;
    color: #452D16;
    background: #f8f8f8;
    border-right: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.compare-value {
    padding: 16px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-weight: 600;
}

.compare-value.dogleft  { background: rgba(234, 125, 31, 0.12); }
.compare-value.dogright { background: rgba(69,  45,  22, 0.10); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
    .comparator-wrapper {
        padding-top: 40px !important;
    }
}

@media (max-width: 968px) {
    .comparator-selects {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .vs-separator {
        text-align: center;
        padding: 10px 0;
    }

    .compare-header {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {

    /* Sticky : 2 colonnes, sans spacer */
    .mobile-compare-sticky {
        grid-template-columns: 1fr 1fr;
        padding: 6px 16px;
    }

    .sticky-spacer {
        display: none;
    }

    .sticky-item {
        flex-direction: column;
        text-align: center;
        gap: 6px;
        padding: 10px 8px;
    }

    .mobile-compare-sticky img {
        width: 52px;
        height: 52px;
    }

    .sticky-item span {
        font-size: 0.82rem;
        line-height: 1.2;
    }

    /* Tableau : label en haut, valeurs côte à côte */
    .compare-row {
        grid-template-areas:
            "label label label"
            "left  gap   right";
        grid-template-columns: 1fr 12px 1fr;
        padding: 12px 0;
    }

    .compare-label {
        grid-area: label;
        background: transparent;
        border: none;
        padding: 6px 12px;
        font-weight: 700;
        width: 100%;
    }

    .compare-value:nth-of-type(2) { grid-area: left;  }
    .compare-value:nth-of-type(3) { grid-area: right; }

    .compare-value {
        padding: 8px 6px;
    }
}