/* ==========================================================================
   Carousel Produits – styles mécaniques uniquement.
   Le thème Woostify gère déjà le style de .product-loop-wrapper et enfants.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wrapper + titre de section
   -------------------------------------------------------------------------- */
.cp-carousel-wrapper {
    position: relative;
    margin: 2em 0;
}

.cp-carousel-heading {
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: .75em;
    color: inherit;
}

/* --------------------------------------------------------------------------
   Conteneur flèches + fenêtre
   -------------------------------------------------------------------------- */
.cp-carousel-container {
    display: flex;
    align-items: center;
}

/* --------------------------------------------------------------------------
   Fenêtre (masque le débordement)
   -------------------------------------------------------------------------- */
.cp-carousel-track-wrap {
    overflow: hidden;
    flex: 1 1 0%;
    min-width: 0;
    /* Autorise le scroll vertical natif, bloque le scroll horizontal
       (le swipe horizontal est géré par le JS) */
    touch-action: pan-y;
    /* Empêche la sélection de texte pendant le drag */
    user-select: none;
    -webkit-user-select: none;
    cursor: grab;
}

.cp-carousel-track-wrap:active {
    cursor: grabbing;
}

/* --------------------------------------------------------------------------
   Rail (flex horizontal, animé)
   align-items: stretch → toutes les slides à la même hauteur
   -------------------------------------------------------------------------- */
.cp-carousel-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important; /* hauteur égale entre les slides */
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: transform .4s cubic-bezier(.25, .46, .45, .94);
    will-change: transform;
}

/* --------------------------------------------------------------------------
   Slide – largeur calculée par JS, hauteur égale (stretch)
   -------------------------------------------------------------------------- */
.cp-carousel-item {
    flex: 0 0 auto !important;
    width: auto;
    box-sizing: border-box;
    padding: 0 8px;
    float: none !important;
    clear: none !important;
    display: flex !important;
    flex-direction: column;
}

/* La carte occupe toute la hauteur disponible */
.cp-carousel-item .product-loop-wrapper {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
}

/* Zone image : ratio portrait 3/4 fixe (600×800 comme le thème)
   → toutes les zones image ont exactement la même hauteur */
.cp-carousel-item .product-loop-image-wrapper {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    flex-shrink: 0;
}

/* L'image remplit tout le conteneur sans déformer */
.cp-carousel-item .product-loop-image-wrapper img,
.cp-carousel-item .product-loop-image-wrapper .product-loop-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* La vidéo WVC remplit aussi tout le conteneur */
.cp-carousel-item .wvc-loop-video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

/* Le span hover-image couvre toute la zone image */
.cp-carousel-item .product-loop-hover-image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

/* Zone contenu s'étire pour aligner les titres/boutons en bas */
.cp-carousel-item .product-loop-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* Titre + icône wishlist sur la même ligne */
.cp-carousel-item .cp-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
}

/* Le titre prend tout l'espace disponible, le bouton reste à droite */
.cp-carousel-item .cp-title-row .woocommerce-loop-product__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bouton wishlist aligné à droite, taille fixe */
.cp-carousel-item .cp-title-row .ict-wishlist-btn {
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   Reset des marges WooCommerce sur les items produit dans le carousel
   -------------------------------------------------------------------------- */
.cp-carousel-track.products .product,
.cp-carousel-track .product {
    margin-right: 0 !important;
    margin-bottom: 0 !important;
}

/* --------------------------------------------------------------------------
   Flèches de navigation
   -------------------------------------------------------------------------- */
.cp-arrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
}

.cp-arrow:hover:not(:disabled) {
    background: #333;
    border-color: #333;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
}

.cp-arrow:disabled {
    opacity: .3;
    cursor: default;
}

.cp-arrow-prev { margin-right: 8px; }
.cp-arrow-next { margin-left:  8px; }

@media (max-width: 768px) {
    .cp-arrow          { width: 32px; height: 32px; }
    .cp-arrow svg      { width: 16px; height: 16px; }
    .cp-arrow-prev     { margin-right: 4px; }
    .cp-arrow-next     { margin-left:  4px; }
}

/* --------------------------------------------------------------------------
   Dots
   -------------------------------------------------------------------------- */
.cp-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.cp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.cp-dot.is-active {
    background: #333;
    transform: scale(1.4);
}
