/**
 * Configurateur Menuiserie - Main Stylesheet
 *
 * @package ConfigurateurMenuiserie
 * @author Monsieur Menuiserie
 */

/* ========================================
   Preview Image Styles
   ======================================== */

#preview_image {
  position: relative;
  width: 100%;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1/1;
  pointer-events: none;
}

.image_environment,
.image_highlight,
.image_shadow,
#dynamic-color-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image_environment,
.image_highlight,
.image_shadow {
  opacity: 1;
  transition: opacity 0.18s ease;
}

#dynamic-color-bg {
  z-index: 1;
  background-color: transparent;
  opacity: 1;
  transition: opacity 0.18s ease, background-color 0.18s ease;
}

.image_shadow {
  z-index: 2;
  mix-blend-mode: multiply;
}

.image_highlight {
  z-index: 3;
  mix-blend-mode: screen;
}

.image_environment {
  z-index: 4;
}

/* ========================================
   Label Subtext Styles
   ======================================== */

.label-subtext {
  display: block;
  font-size: var(--e-global-typography-89f8961-font-size);
  font-weight: 400;
  opacity: 0.8;
  margin-top: 0.25rem;
}

/* ========================================
   Help Section Styles
   ======================================== */

/* Help content carries a `section-aide-<id>` class. Hidden until a linked
   trigger (`pour-section-aide-<id>`) opens it. The selectors match any class
   starting with `section-aide-` while excluding the `pour-section-aide-`
   triggers (whose token is never preceded by a space before `section-aide-`). */
[class^="section-aide-"],
[class*=" section-aide-"] {
  display: none !important;
}

[class^="section-aide-"].is-active,
[class*=" section-aide-"].is-active {
  display: block !important;
  background-color: #ecf8ff;
  border: 2px dashed var(--e-global-color-primary);
  margin-bottom: 40px;
  border-radius: 8px;
}

/* The label of a `pour-section-aide-<id>` trigger becomes clickable. The
   toggle button is a `::after` pseudo-element pushed to the far right of the
   label, so its text never becomes part of the label's text content. */
.mm-help-trigger {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.mm-help-trigger::after {
  content: "Afficher de l'aide";
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  color: var(--e-global-color-primary);
  border-radius: 4px;
  padding: 4px 8px;
  font-weight: bold;
  font-family: sans-serif;
  font-size: 1rem;
  margin-left: 10px;
  border: 1px solid var(--e-global-color-primary);
}

@media (max-width: 768px) {
  .mm-help-trigger::after {
    font-size: 0.875rem;
  }
}

.mm-help-trigger.is-active::after {
  content: "Masquer l'aide";
  background-color: var(--e-global-color-primary);
  text-decoration: underline;
  color: #ffffff;
}

.wapf-field-label:not(.mm-help-section .wapf-field-img .wapf-field-label) {
  margin-bottom: 16px !important;
  background-color: var(--e-global-color-primary);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
}

.wapf-field-label label:not(.mm-help-section .wapf-field-img .wapf-field-label label) {
  font-size: 1.2rem;
}

/* ========================================
   Details Summary Styles
   ======================================== */

#details-summary {
  /* Summary styles */
}

#details-summary p {
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0.5rem;
  border-radius: 4px;
}

#details-summary p:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

#details-summary-price {
  /* Price display styles */
}

#ht-price {
  font-weight: 500;
}

/* ========================================
   Dimensions Help Display Styles
   ======================================== */

#dimensions-help {
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  display: none;
  margin-bottom: 2rem;
}

.dimension-info {
  margin-top: 8px;
}

.dimension-info strong {
  font-weight: 600;
  color: #333;
  font-size: 1rem;
}

.dimension-range {
  color: #666;
  font-size: 0.95rem;
  font-weight: 500;
}

.dimension-current {
  color: #0066cc;
  font-size: 0.9rem;
  font-style: italic;
}

.dimension-capped {
  display: block;
  margin-top: 2px;
  color: #b45309;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ========================================
   Dimension Inputs Styles
   ======================================== */

.largeur,
.hauteur {
  /* Default input styles */
}

.largeur:disabled,
.hauteur:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  opacity: 0.6;
}

.largeur:not(:disabled),
.hauteur:not(:disabled) {
  background-color: #fff;
  cursor: text;
}

/* ========================================
   Utility Classes
   ======================================== */
.hide-label .wapf-field-label {
  display: none;
}

.hidepricehint .wapf-pricing-hint {
  display: none !important;
}

.sublabel-color .wapf-field-label,
.sublabel-color .apf-plusmin button {
  background-color: #6d7d87 !important;
}

.sublabel-color .wapf-field-label label {
  font-size: 1rem !important;
}

/* ========================================
   Color Show More
   ======================================== */

/* Couleurs masquées au-delà des 8 premières (repli). */
.model_color .wapf-swatch.mm-color-hidden {
  display: none !important;
}

/* Bouton « Afficher plus de couleurs », centré sous la grille de couleurs.
   Scopé `.model_color` + !important pour passer devant les styles de bouton
   du thème / d'Elementor (même approche que les overrides de label plus haut). */
.model_color .mm-color-toggle {
  display: flex !important;
  width: fit-content !important;
  margin-top: 20px !important;
  padding: 8px 16px !important;
  background-color: #ededed !important;
  color: #333333 !important;
  border: 1px solid #e1e1e1 !important;
  border-radius: 4px !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  transition: background-color 0.18s ease, color 0.18s ease !important;
}

.model_color .mm-color-toggle:hover,
.model_color.mm-color-expanded .mm-color-toggle {
  background-color: #dcdcdc !important;
  color: #1a1a1a !important;
}

/* ========================================
   Inputs
   ======================================== */

.wapf-card-inner {
  align-items: center;
  gap: 16px !important;
}

.wapf-card-img img {
  width: 100% !important;
  height: 100% !important;
  max-width: 130px !important;
  max-height: revert !important;
}

#details-summary p {
  padding: 10px 20px;
  cursor: pointer;
  transition: 300ms;
}

#details-summary p:hover {
  background-color: #F1F1F1;
}

#details-summary p:not(:last-child) {
  border-bottom: 1px solid var(--e-global-color-920d357);
}

.wapf-field-label .required {
  display: none;
}

.wapf-swatch-label .wapf-pricing-hint {
  display: block;
  margin-top: 8px;
}

.wapf-swatch-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wapf-field-label,
.wapf-swatch-label {
  line-height: 20px;
}

.wapf-single-select,
.wapf-card {
  border: 2px solid #ededed !important;
  border-radius: 6px;
  overflow: hidden;
  transition: 300ms;
}

.wapf-checked,
.wapf-single-select:hover,
.wapf-card:hover {
  border-color: var(--e-global-color-primary) !important;
}

.wapf-checked {
  border-width: 3px !important;
}

/* Options Labels WAPF */
.wapf-single-select > label {
  display: flex !important;
  flex-direction: column;
}

/* Sélectionner tous les labels sous les options, mais pas le label principal de la section */
:not([class*="section-aide"]) > [class^="wapf-"][class$="-label"]:not(.wapf-field-label) {
  margin: 0 !important;
  font-size: 14px;
  font-weight: 600;
  background-color: #f1f1f1;
  padding-top: 16px;
  padding-bottom: 16px;
  height: 100%;
  justify-content: center;
}

[class*="section-aide"] .wapf-field-container {
  padding: 20px !important;
}

.wapf-field-description {
  --padding: 10px;
  margin-top: 16px !important;
  display: flex;
  align-items: center;
  background-color: #fdfbe3;
  border: 2px solid #f9d96c;
  padding: var(--padding) !important;
  border-radius: 4px;
}

.wapf-field-description::before {
  content: 'i';
  font-size: 20px;
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  background-color: #f9d96c;
  padding: 8px;
  color: #ffffff;
  font-weight: bold;
  font-style: italic;
  width: 10%;
  margin: calc(var(--padding) * -1) 15px calc(var(--padding) * -1) calc(var(--padding) * -1);
}

/* swatch color WAPF */
.wapf-swatch-wrapper {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  width: 100%;
  gap: 16px;
}

.wapf-swatch-wrapper > div {
  width: auto !important;
  margin: 0 !important;
}

.wapf-swatch--color .wapf-color {
  height: auto !important;
  width: 100% !important;
  aspect-ratio: 1 / 1;
}

.wapf-field-calc {
  display: none !important;
}

.apf-plusmin svg {
  fill: #ffffff;
}

.apf-plusmin button {
  --apf-ns-bg: var(--e-global-color-accent);
}

.wapf-swatch--qty {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.qty-swatch-img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
}

.qty-swatch-img,
.qty-swatch-img img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
}

.qty-swatch-inner {
  margin-top: auto;
}

.wapf-image-swatch-wrapper {
  align-items: stretch;
}

.wapf-swatch--qty .wapf-swatch-label {
  height: revert !important;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}
