/* ==========================================
   QUICKVIEW - NOVA IP
   Version: 2.0 - 27 novembre 2025
   ========================================== */

/* ------------------------------------------
   BOUTON QUICKVIEW SUR CARDS
   ------------------------------------------ */

.mx-quick-view {
  opacity: 0;
}

@media (pointer: fine) {
  .mx-quick-view {
    opacity: 0;
    transition: opacity var(--transition-fast);
  }

  .mx-card:hover .mx-quick-view {
    opacity: 1;
  }
}

@media (pointer: coarse) {
  .mx-quick-view {
    opacity: 1 !important;
  }
}

@media (max-width: 768px) {
  .mx-quick-view {
    opacity: .85 !important;
  }
}

/* ------------------------------------------
   STRUCTURE MODALE
   ------------------------------------------ */


/* Backdrop blur déplacé dans components.css */

.quickview .modal-dialog {
  max-width: 900px;
}

.quickview .modal-content {
  background: var(--mx-bg-main, #fff);
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.quickview .modal-body {
  padding: 0;
}

/* Colonne gauche - Galerie */
.quickview .modal-body > .row > .col-md-6:first-child {
  padding-right: 0;
  display: flex;
}

.quickview .mx-quickview-gallery {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.quickview .mx-quickview-main {
  flex: 1;
}

.quickview .modal-body > .row {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  min-height: 28.13rem;
}

/* ------------------------------------------
   LAYOUT COLONNES
   ------------------------------------------ */

.quickview .modal-body > .row {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
}

.quickview .modal-body .col-md-6,
.quickview .modal-body .col-sm-6 {
  padding: 0;
  float: none;
}

/* Colonne gauche - Galerie */
.quickview .modal-body > .row > .col-md-6:first-child {
  padding-right: 0;
  display: flex;
}

/* Colonne droite - Infos */
.quickview .modal-body > .row > .col-md-6:last-child {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------
   BOUTON CLOSE
   ------------------------------------------ */

.quickview .mx-quickview-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 10;
  background: white;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-fast);
}

.quickview .mx-quickview-close svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--mx-gray-900);
  transition: transform var(--transition-fast);
}

.quickview .mx-quickview-close:hover {
  background: var(--mx-gray-50);
}

.quickview .mx-quickview-close:hover svg {
  transform: rotate(90deg);
}

/* ------------------------------------------
   GALERIE IMAGES
   ------------------------------------------ */

.quickview .mx-quickview-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  margin-bottom: 0;
}

.quickview .mx-quickview-main {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  background-color: var(--mx-gray-50);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  overflow: hidden;
}

.quickview .mx-quickview-slider-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.quickview .mx-quickview-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.quickview .mx-quickview-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.quickview .mx-quickview-slide picture {
  display: block;
  width: 100%;
  height: 100%;
}

.quickview .mx-quickview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Badges produit */
.quickview .mx-quickview-main .product-flags {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Masquer dots */
.quickview .mx-quickview-dots {
  display: none;
}

/* Flèches navigation */
.quickview .mx-quickview-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.quickview .mx-quickview-arrow:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.05);
}

.quickview .mx-quickview-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

.quickview .mx-quickview-arrow-prev {
  left: var(--space-4);
}

.quickview .mx-quickview-arrow-next {
  right: var(--space-4);
}

.quickview .mx-quickview-arrow svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
  display: block;
}

/* ------------------------------------------
   INFOS PRODUIT
   ------------------------------------------ */

.quickview .mx-product-reference {
  font-size: var(--fs-xs);
  color: var(--mx-gray-600);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quickview .h1 {
  font-size: var(--fs-base);
  margin-bottom: var(--space-4);
  max-width: 90%;
}

/* Prix */
.quickview .product-prices {
  margin: var(--space-1) 0 !important;
}

.quickview .mx-price-current {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  color: var(--mx-gray-900);
  line-height: 1;
}

.quickview .mx-price-tax {
  font-size: var(--fs-sm);
  color: var(--mx-gray-600);
}

/* ------------------------------------------
   VARIANTES & AJOUT PANIER
   ------------------------------------------ */

.quickview .product-actions {
  display: flex;
  width: 100%;
}

.quickview .product-actions form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quickview .product-variants {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.quickview .product-customization .product-customization-item, .quickview .product-variants>.product-variants-item {
  margin: 0;
}

.quickview .product-add-to-cart {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quickview .product-add-to-cart .product-quantity {
  width: 100%;
  margin: var(--space-6) 0;
  gap: 0
}

.quickview .product-add-to-cart .mx-add {
  width: fit-content;
  align-self: flex-start;
}

.quickview .mx-add .mx-btn {
  padding: var(--space-3) var(--space-6);
  font-size: var(--fs-base);
}

/* Masquer quantité et bouton fast checkout */
.quickview .mx-qty,
.quickview .product-add-to-cart .control-label,
.quickview .mx-add .mx-btn-checkout {
  display: none;
}

/* ------------------------------------------
   LIEN VOIR DÉTAILS
   ------------------------------------------ */

.quickview .mx-quickview-details-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  padding: var(--space-3) 0;
  width: fit-content;
  color: var(--mx-gray-900);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.quickview .mx-quickview-details-link:hover {
  color: var(--mx-orange-500);
}

.quickview .mx-quickview-details-link svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ------------------------------------------
   RESPONSIVE TABLET PORTRAIT
   ------------------------------------------ */

@media (min-width: 768px) and (max-width: 991px) {
  /* Reset du grid-column pour que le bouton reste à gauche */
  .quickview .product-quantity .mx-add > button:last-child {
    grid-column: auto !important;
  }

  /* Bouton plus grand sur tablet */
  .quickview .mx-add .mx-btn {
    padding: var(--space-3) var(--space-6) !important;
    font-size: var(--fs-xl) !important;
  }
}

/* ------------------------------------------
   RESPONSIVE MOBILE
   ------------------------------------------ */

@media (max-width: 767px) {
  .quickview .modal-dialog {
    margin: var(--space-4);
    max-width: calc(100% - var(--space-8));
  }

  .quickview .modal-body > .row {
    flex-direction: column;
  }

  .quickview .modal-body > .row > .col-md-6:first-child {
    margin-bottom: 0;
  }

  .quickview .modal-body > .row > .col-md-6:last-child {
    padding: var(--space-4);
  }

  .quickview .mx-quickview-main {
    height: 200px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .quickview .mx-quickview-close {
    top: var(--space-2);
    right: var(--space-2);
  }

  .quickview .mx-quickview-gallery {
    height: 200px;
    flex: none;
  }
  .quickview .mx-quickview-arrow {
    width: 40px;
    height: 40px;
  }

  .quickview .mx-quickview-arrow-prev {
    left: var(--space-2);
  }

  .quickview .mx-quickview-arrow-next {
    right: var(--space-2);
  }

  .quickview .h1 {
    font-size: var(--fs-lg);
  }

  .quickview .mx-price-current {
    font-size: var(--fs-xl);
  }

  /* Variantes mobile - alignement horizontal */
  .quickview .product-customization .product-customization-item, .quickview .product-variants>.product-variants-item  {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    margin: var(--space-2) 0;
  }

  .quickview .product-variants-item .control-label {
    flex: 0 0 40%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--fs-xs);
    text-align: left;
  }

  .quickview .product-variants-item select {
    flex: 1;
    min-width: 0;
  }

  .quickview .product-add-to-cart .product-quantity {
    width: 100%;
    margin-bottom: var(--space-3);
  }

  /* Bouton plus grand sur mobile */
  .quickview .mx-add .mx-btn {
    padding: var(--space-3) var(--space-6) !important;
    font-size: var(--fs-lg) !important;
  }
}
