/* ==========================================================================
   Critères de sélection - Cards avec effet tiroir
   ========================================================================== */

.criteres-section {
    padding-bottom: 0;
}

.criteres-header {
    text-align: center;
    margin-bottom: 3rem;
}

.criteres-intro {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-navy);
    margin-bottom: 0.5rem;
}

.criteres-sub {
    color: var(--color-text-light);
    font-size: 1rem;
}

.criteres-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 960px;
    margin: 0 auto;
}

.critere-card {
    position: relative;
    padding: 3rem 2rem 3.5rem;
    background: var(--color-white);
    border-radius: var(--radius-md);
    text-align: center;
    overflow: hidden;
    min-height: 240px;
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
    cursor: default;
    transition: box-shadow 0.4s ease;
}

.critere-card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1);
}

/* Tiroir navy qui monte du bas */
.critere-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    background: var(--color-navy);
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.critere-card:hover::before {
    height: 50%;
}

.critere-num {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--color-terracotta);
    opacity: 0.15;
    line-height: 1;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 2;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.45s ease;
}

.critere-card:hover .critere-num {
    transform: translateY(-10px);
    opacity: 0.3;
}

.critere-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-navy);
    margin: 0;
    position: relative;
    z-index: 2;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.critere-card:hover h3 {
    transform: translateY(-10px);
}

/* Accent terracotta sous le titre */
.critere-card h3::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-terracotta);
    margin: 0.85rem auto 0;
    transition: width 0.35s ease, opacity 0.3s ease;
}

.critere-card:hover h3::after {
    width: 0;
    opacity: 0;
}

/* Texte descriptif - apparaît sur le tiroir navy */
.critere-card p {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.75rem 1.75rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.65;
    z-index: 2;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.critere-card:hover p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.12s;
}

/* ==========================================================================
   Section Carte Producteurs
   ========================================================================== */

.carte-section {
    padding: 6rem 1.5rem 4rem;
    background-color: var(--color-cream, #faf8f5);
    overflow-x: clip;
}

.carte-section > .container {
    max-width: 1000px;
}

.carte-header {
    text-align: center;
    margin-bottom: 3rem;
}

.carte-surtitle {
    display: block;
    font-family: 'Charter', Georgia, serif;
    font-style: italic;
    font-size: 1.25rem;
    color: #c45a3c;
    margin-bottom: 0.5rem;
}

.carte-title {
    font-family: 'Tanker', 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: #1b2c4e;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin: 0;
}

/* ==========================================================================
   Conteneur carte + tiroir
   Le tiroir coulisse depuis le bord gauche, par-dessus la carte.
   Plus de décalage du wrapper.
   ========================================================================== */

.carte-wrapper {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    background: #e8e4dc url('../images/carte/fond-de-carte-bg.jpeg') center / cover no-repeat;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Texture papier subtile par-dessus le fond */
.carte-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   Tiroir descriptif - coulisse depuis la gauche par-dessus la carte
   ========================================================================== */

.carte-drawer {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    z-index: 10;
    overflow-y: auto;
    display: flex;
    align-items: center;
    pointer-events: none;
    transform: translateX(-100%);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.carte-drawer.open {
    transform: translateX(0);
    pointer-events: auto;
}

.carte-drawer-inner {
    padding: 2rem 1.75rem;
    width: 100%;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.15s ease,
                transform 0.15s ease;
}

.carte-drawer.open .carte-drawer-inner {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease 0.15s,
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.15s;
}

/* Illustration dans le tiroir */
.carte-drawer-illu-wrap {
    margin-bottom: 1.25rem;
    text-align: center;
}

.carte-drawer-illu {
    max-width: 140px;
    max-height: 100px;
    width: auto;
    height: auto;
    display: inline-block;
}

.carte-drawer-title {
    font-family: 'Tanker', 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-size: 1.25rem;
    color: #1b2c4e;
    text-transform: uppercase;
    line-height: 1.3;
    margin: 0 0 0.5rem;
}

.carte-drawer-subtitle {
    font-family: 'Charter', Georgia, serif;
    font-style: italic;
    font-size: 0.9375rem;
    color: #c45a3c;
    margin: 0 0 1rem;
}

.carte-drawer-text {
    font-family: 'Charter', Georgia, serif;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #1b2c4e;
    margin: 0;
}

/* Bouton CTA dans le tiroir */
.carte-drawer-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.65rem 1.5rem;
    background: #c45a3c;
    color: #ffffff;
    font-family: 'Tanker', 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-size: 1.1rem;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.02em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.carte-drawer-btn:hover {
    background: #a8482f;
    color: #ffffff;
}

.carte-drawer-btn span {
    font-size: 1.3rem;
    line-height: 1;
}

/* ==========================================================================
   Carte (zone avec les illustrations)
   ========================================================================== */

.carte-map {
    position: relative;
    min-height: 500px;
    padding: 1.5rem;
    z-index: 2;
    transition: filter 0.4s ease;
}

.carte-fond {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.6;
}

/* ==========================================================================
   Illustrations sur la carte
   ========================================================================== */

.carte-illu {
    position: absolute;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 70px;
}

.carte-illu img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    pointer-events: none;
}

.carte-illu:hover {
    transform: scale(1.15);
    z-index: 3;
}

.carte-illu.active {
    transform: scale(1.15);
    z-index: 3;
}

/* Quand un producteur est actif, les autres sont plus discrets */
.carte-map.has-active .carte-illu:not(.active) {
    opacity: 0.4;
    transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

.carte-map.has-active .carte-illu.active {
    opacity: 1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
    .criteres-grid {
        gap: 1rem;
    }

    .critere-card {
        padding: 2.5rem 1.5rem 3rem;
        min-height: 220px;
    }

    .carte-illu {
        width: 70px;
        height: 55px;
    }

    .carte-drawer {
        width: 260px;
    }

    .carte-drawer-inner {
        padding: 1.5rem 1.25rem;
    }
}

@media (max-width: 768px) {
    .criteres-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 400px;
    }

    .critere-card {
        min-height: auto;
        padding: 2rem 1.5rem;
    }

    /* Sur mobile, pas d'effet tiroir - afficher tout directement */
    .critere-card::before {
        display: none;
    }

    .critere-card h3::after {
        margin: 0.5rem auto 0;
    }

    .critere-card:hover h3::after {
        width: 24px;
        opacity: 1;
    }

    .critere-card:hover .critere-num,
    .critere-card:hover h3 {
        transform: none;
    }

    .critere-card p {
        position: static;
        opacity: 1;
        transform: none;
        color: var(--color-text-light);
        padding: 0.75rem 0 0;
        transition: none;
    }
}

@media (max-width: 600px) {
    .carte-section {
        padding: 3rem 1rem 2rem;
    }

    .carte-wrapper {
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .carte-map {
        padding: 1rem;
        min-height: 300px;
    }

    .carte-illu {
        width: 50px;
        height: 40px;
    }

    /* Tiroir sous la carte au lieu de à gauche */
    .carte-drawer {
        position: relative;
        top: auto;
        left: auto;
        bottom: auto;
        width: 100%;
        transform: none;
        max-height: 0;
        opacity: 0;
        pointer-events: none;
        display: block;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-right: none;
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
        border-radius: 0 0 8px 8px;
        transition: max-height 0.4s ease, opacity 0.3s ease;
    }

    .carte-drawer.open {
        transform: none;
        opacity: 1;
        max-height: 600px;
        pointer-events: auto;
    }

    .carte-drawer-inner {
        padding: 1.5rem;
    }

    .carte-drawer-title {
        font-size: 1.1rem;
    }

    .carte-drawer-text {
        font-size: 0.85rem;
    }

    .carte-drawer-illu {
        max-width: 80px;
        max-height: 60px;
    }

    .carte-drawer-btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        width: 100%;
        justify-content: center;
    }
}
