/* ============================================================
   AllGlass - Carrousels de produits
   Tout est scopé sous .agc-carousel pour éviter les conflits.
   ============================================================ */

.agc-carousel {
    --agc-desktop: 5;
    --agc-tablet: 3;
    --agc-mobile: 1;
    --agc-gap: 18px;
    --agc-accent: #cfe0d3;         /* vert doux du bouton "Commander" */
    --agc-accent-text: #1c3f5f;    /* bleu du texte */
    --agc-name: #1c3f5f;
    box-sizing: border-box;
    width: 100%;
    margin: 24px 0;
    position: relative;
    font-family: inherit;
}
.agc-carousel *,
.agc-carousel *::before,
.agc-carousel *::after { box-sizing: border-box; }

.agc-carousel__title {
    text-align: center;
    font-size: 1.6rem;
    margin: 0 0 22px;
    color: var(--agc-name);
    font-weight: 600;
}

.agc-carousel__viewport {
    position: relative;
    overflow: hidden;
    /* padding vertical : laisse respirer l'ombre des cartes sans la rogner */
    padding: 14px 0;
}

/* Piste (marquee) */
.agc-carousel__track {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--agc-gap);
    will-change: transform;
    /* défilement produit par produit : translation pilotée en JS, transition CSS */
    transition: transform .55s cubic-bezier(.25, .1, .25, 1);
}
.agc-carousel__track.agc-no-anim { transition: none !important; }

/* Un item = 1/desktop de la largeur (moins le gap) */
.agc-carousel__item {
    flex: 0 0 calc((100% - (var(--agc-desktop) - 1) * var(--agc-gap)) / var(--agc-desktop));
    max-width: calc((100% - (var(--agc-desktop) - 1) * var(--agc-gap)) / var(--agc-desktop));
    min-width: 0;
    margin: 0;
    list-style: none;
}

.agc-item__inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;                          /* jolie carte blanche par produit */
    border-radius: 16px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .07);
    overflow: hidden;
    transition: box-shadow .3s ease, transform .3s ease;
}
/* Pas d'ombre / de mouvement supplémentaire au survol */
.agc-carousel__item:hover .agc-item__inner {
    box-shadow: 0 3px 14px rgba(0, 0, 0, .07);
    transform: none;
}

/* Vignette + effet de survol 2e image.
   Dimensionnement INTRINSÈQUE (max-height + height:auto) : l'image garde ses
   proportions, ne remplit jamais de force la vignette et ne peut donc pas être
   rognée. Le !important neutralise les règles "img" du thème de la boutique. */
.agc-item__thumb {
    display: flex;                 /* centre l'image dans la vignette */
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 285px;                 /* hauteur fixe : toutes les vignettes alignées (images ~1,5x plus grandes) */
    background: #fff;
    text-decoration: none;
    padding: 16px;
    box-sizing: border-box;
}
.agc-item__img--main {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    margin: 0 !important;
    z-index: 1;
}

/* 2e image : superposée, centrée, fondu au survol */
.agc-item__img--hover {
    position: absolute;
    top: 16px; left: 16px; right: 16px; bottom: 16px;
    margin: auto !important;
    width: auto !important;
    height: auto !important;
    max-width: calc(100% - 32px) !important;
    max-height: calc(100% - 32px) !important;
    object-fit: contain !important;
    z-index: 2;
    opacity: 0;
    transition: opacity .45s ease;
}
.agc-carousel__item:hover .agc-item__img--hover { opacity: 1; }

/* Corps de la fiche : prix au-dessus du nom, aligné à gauche, fond transparent */
.agc-item__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 18px 20px;   /* espace net entre l'image et le prix */
    text-align: left;
    flex: 1 1 auto;
}
.agc-item__price {
    color: var(--agc-name);
    font-size: 1rem;
    margin: 0;
}
.agc-item__price strong { font-weight: 700; }
.agc-item__name {
    color: var(--agc-name);
    font-weight: 700;
    font-size: 1.02rem;
    line-height: 1.3;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.agc-item__name:hover { text-decoration: underline; }

/* Flèches */
.agc-carousel__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--agc-name);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .14);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: .92;
    transition: opacity .2s ease, transform .2s ease, background .2s ease;
    padding: 0;
}
.agc-carousel__arrow:hover { opacity: 1; background: #f4f7f4; }
.agc-carousel__arrow:active { transform: translateY(-50%) scale(.94); }
.agc-carousel__arrow--prev { left: 4px; }
.agc-carousel__arrow--next { right: 4px; }

/* Responsive : tablette */
@media (max-width: 1024px) {
    .agc-carousel__item {
        flex: 0 0 calc((100% - (var(--agc-tablet) - 1) * var(--agc-gap)) / var(--agc-tablet));
        max-width: calc((100% - (var(--agc-tablet) - 1) * var(--agc-gap)) / var(--agc-tablet));
    }
}

/* Responsive : mobile (1 par ligne par défaut) */
@media (max-width: 640px) {
    .agc-carousel { --agc-gap: 12px; }
    .agc-carousel__item {
        flex: 0 0 calc((100% - (var(--agc-mobile) - 1) * var(--agc-gap)) / var(--agc-mobile));
        max-width: calc((100% - (var(--agc-mobile) - 1) * var(--agc-gap)) / var(--agc-mobile));
    }
    .agc-carousel__title { font-size: 1.3rem; }
    .agc-carousel__arrow { width: 36px; height: 36px; }
}

/* Accessibilité : si l'utilisateur réduit les animations */
@media (prefers-reduced-motion: reduce) {
    .agc-carousel__track { transition: none !important; }
}
