/*****************************! Styles généraux *****************************/
#main .container_wrap .container {
  max-width: 1800px !important;
}

.product-card {
  width: calc(50% - 10px);
  background-color: white;
  margin-bottom: 20px;
  color: black !important;
  border-radius: 5px;
}

/* Responsive : une seule colonne mobile */
@media (max-width: 1024px) {
  .product-card {
    width: 100% !important;
  }

  .product-cards-container {
    display: flex;
    flex-direction: column;
  }
}

.product-card-header {
  background-color: var(--background-tertiary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  text-decoration-color: var(--color-primary);
}

.product-card .product-card-header h1,
.product-card .product-card-header h2 {
  color: black !important;
  font-size: 1.2rem;
  margin: 0;
}

.product-card-header h1::selection,
.product-card-header h2::selection {
  background-color: var(--background-primary);
  color: var(--color-secondary);
}

.product-card-body:not(.product-table) {
  padding: 0 20px;
}

.product-table {
  color: black;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.product-table-row {
  display: flex;
  border-bottom: 1px solid var(--color-border-dark) !important;
}

.product-table-row:nth-child(odd) {
  background-color: var(--color-border);
}

.product-table-row:last-child {
  border-bottom: none;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.product-table-key {
  width: 30%;
  font-weight: 900 !important;
  border-right: 1px solid var(--color-border-dark) !important;
  padding: 5px 12px;
  font-size: 0.9rem;
}

.product-table-value {
  width: 70%;
  padding: 5px 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/*****************************! Card - Images *****************************/
.product-gallery {
  padding: 20px;
  position: relative;
}

.woocommerce-product-gallery_with_brand {
  display: flex;
  justify-content: space-between;
  margin: 20px 0;
  gap: 20px;
}

.woocommerce-product-gallery__main {
  display: flex;
  justify-content: flex-start;
  position: relative;
  overflow: visible;
  flex-shrink: 1;
}

.woocommerce-product-gallery__main img {
  aspect-ratio: 1/1;
  object-fit: contain;
  width: 100%;
  max-width: 300px;
  max-height: 300px;
  height: auto;
  border: none !important;
  transition: transform 0.1s ease-out;
}

.product-brand-image {
  flex-shrink: 2;
}

.product-brand-image img {
  max-width: 200px;
  width: 100%;
  border: none !important;
}

.woocommerce-product-gallery__thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.gallery-thumbnail img {
  aspect-ratio: 1/1;
  object-fit: contain;
  width: 100%;
  max-width: 100px;
  height: auto;
  cursor: pointer;
  border: none !important;
}

.gallery-thumbnail img:hover {
  border: 1px solid var(--color-primary) !important;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
  transition: all 0.3s ease;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
  opacity: 1;
}

.lightbox-close {
  position: absolute;
  top: 45px;
  right: 25px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

.zoomable-image {
  cursor: pointer;
}

/* Zoom */
.zoom-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background-color: #fff;
  transition: all 0.3s ease;
}

.zoom-wrapper:hover {
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.zoom-wrapper img {
  max-width: none;
}

.zoomImg {
  background-color: #fff;
  cursor: zoom-in;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.zoomImg:hover {
  opacity: 1;
}

/* Style pour la fenêtre de zoom */
.zoomWindow {
  border: 1px solid #ddd;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  background-color: #fff;
  z-index: 1002;
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 20px;
  width: 400px;
  height: 400px;
  overflow: hidden;
  display: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.zoomWindow.active {
  display: block !important;
}

/* Responsive */
@media (max-width: 1200px) {
  .zoomWindow {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .zoom-container,
  .zoomWindow {
    display: none !important;
  }

  .zoom-indicator {
    display: none;
  }

  .zoom-hint {
    display: none;
  }

  .zoom-wrapper {
    pointer-events: none;
  }

  .product-gallery {
    padding: 10px;
  }

  .woocommerce-product-gallery__main {
    margin: 10px 0;
  }

  .woocommerce-product-gallery__thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 5px;
  }

  .gallery-thumbnail img {
    max-width: 80px;
  }
}

/*****************************! Card - Spécifications *****************************/
.product-card.card-spec .product-card-body-spec {
  background-color: var(--color-semi-border) !important;
  padding: 10px !important;
  margin: 10px !important;
  border-radius: 5px !important;
}

.product-card.card-spec .product-card-body-spec strong,
.product-card.card-spec .product-card-body-spec h1,
.product-card.card-spec .product-card-body-spec h2,
.product-card.card-spec .product-card-body-spec h3,
.product-card.card-spec .product-card-body-spec h4,
.product-card.card-spec .product-card-body-spec h5,
.product-card.card-spec .product-card-body-spec h6 {
  color: black;
}

.product-card.card-spec .product-card-body-spec a {
  color: var(--color-tertiary);
}

/*****************************! Card - Actions *****************************/
.card-actions .product-card-body {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 20px;
}

.card-actions .action-row {
  margin: 0;
  height: 100%;
}

/* Style commun pour tous les boutons */
.card-actions button,
.card-actions .cart-button,
.card-actions .add-to-cart-wrapper,
.card-actions .woo-favorites-button,
.card-actions .woo-document-button {
  width: 100% !important;
  height: 89px !important;
  min-width: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
  border: 1px solid #ddd !important;
  background: #f5f5f5 !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  font-size: 14px !important;
  text-transform: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  text-decoration: none !important;
  color: black !important;
  gap: 8px;
}

@media (min-width: 1025px) and (max-width: 1257px) {
  .card-actions button,
  .card-actions .cart-button,
  .card-actions .add-to-cart-wrapper,
  .card-actions .woo-favorites-button,
  .card-actions .woo-document-button {
    height: 103px !important;
  }
}

/* Style spécifique pour le bouton panier */
.card-actions.product-card .add-to-cart-wrapper {
  position: relative;
  padding: 0 !important;
  border: none !important;
}

.card-actions .add-to-cart-wrapper a {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  text-decoration: none !important;
  color: black !important;
  padding: 10px !important;
  background: transparent !important;
}

.card-actions .add-to-cart-wrapper .added_to_cart {
  display: none !important;
}

/* Badge quantité */
.card-actions .cart-quantity-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: red;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* Style pour les icônes */
.button-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.button-text {
  font-size: 12px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

/* Hover effects */
.card-actions button:not(:disabled):hover,
.card-actions .add-to-cart-wrapper:hover,
.card-actions .woo-favorites-button:hover,
.card-actions .woo-document-button:hover {
  background: #e5e5e5 !important;
}

/* Responsive */
@media (max-width: 768px) {
  .card-actions .product-card-body {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .card-actions .product-card-body {
    grid-template-columns: 1fr;
  }
}

/* Bouton favoris */
.favorite-button {
  gap: 5px;
}

.favorite-button .favorite-icon {
  font-size: 20px;
}

/* Bouton d'ajout de gamme */
.add-range-button {
}

/*! --------  Succès -------- */
.woocommerce-message {
  border: none !important;
  border-radius: 5px !important;
  padding: 10px 20px !important;
}

/*! --------  Erreur -------- */
.woocommerce-error {
  border: none !important;
  border-radius: 5px !important;
  padding: 10px 20px !important;
  color: red !important;
}

.woocommerce-error li {
  margin: 0 !important;
}

.woocommerce-error li strong {
  color: red !important;
}

.woocommerce-error a {
  color: red !important;
  text-decoration: underline !important;
}

/*****************************! Card - Déchets *****************************/
.waste-table-header,
.waste-table-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--color-border-dark) !important;
}

.waste-table-header {
  background-color: var(--color-border);
  font-weight: 900 !important;
}

.waste-table-row:nth-child(odd) {
  background-color: var(--color-border);
}

.waste-table-row:last-child {
  border-bottom: none;
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.waste-table-cell {
  padding: 5px 12px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--color-border-dark) !important;
}

.waste-table-cell:last-child {
  border-right: none !important;
}
