/*! Styles pour le pattern Advanced Dropdown Section */

/* Conteneur principal */
.advanced-dropdown-section {
  padding: var(--wp--custom--spacer-xl-fluid) var(--wp--custom--spacer-fluid);
}

.advanced-dropdown-section h2 {
  width: 45%;
}

/* Conteneur des dropdowns */
.advanced-dropdown-container {
  display: flex;
  align-items: flex-start;
  margin-top: var(--wp--custom--spacer-m);
}

/* Colonne de contenu des dropdowns */
.dropdown-content-column {
  width: 50%;
  display: flex;
  flex-direction: column;
}

/* Composant dropdown */
.dropdown-component {
  margin: var(--wp--custom--spacer-m) auto;
  max-width: 800px;
  overflow: hidden;
  border-bottom: 1px solid var(--wp--custom--border-color);
  padding-bottom: var(--wp--custom--spacer-m);
}

/* Styles pour les dropdowns dans la colonne de contenu */
.dropdown-content-column .dropdown-component {
  margin-bottom: var(--wp--custom--spacer-s);
  border-bottom: 1px solid var(--wp--preset--color--gray-300, #D4D4D4);
  overflow: hidden;
  position: relative;
}

/* En-tête du dropdown */
.dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  cursor: pointer;
  padding: var(--wp--custom--spacer-s, 15px);
}

.dropdown-header h3 {
  margin: 0;
}

/* Bouton toggle du dropdown */
.dropdown-toggle {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-toggle img {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

/* État ouvert du dropdown */
.dropdown-component.is-open .dropdown-toggle img {
  transform: rotate(180deg);
}

.dropdown-component.is-open .dropdown-toggle svg {
  transform: rotate(180deg);
}

/* Contenu du dropdown */
.dropdown-content {
  display: none;
  padding: var(--wp--custom--spacer-s, 15px);
  transition: all 0.3s ease;
}

.dropdown-component.is-open .dropdown-content {
  display: block;
}

/* Description dans le dropdown */
.dropdown-description {
  margin-bottom: 0;
  font-size: var(--wp--preset--font-size--m);
  margin-bottom: var(--wp--custom--spacer-s);
}

/* Colonne d'image */
.dropdown-image-column {
  width: 50%;
  position: sticky;
  top: var(--wp--custom--spacer-l);
}

.dropdown-image-wrapper {
  position: relative;
  width: 100%;
  height: 500px;
}

.dropdown-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.dropdown-image.is-active {
  opacity: 1;
  visibility: visible;
}

.dropdown-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--wp--custom--radius);
}

/* Bordure dégradée pour le dropdown actif */
.dropdown-component.is-active-border {
  position: relative;
}

.dropdown-component.is-active-border::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--wp--custom--primary-500), var(--wp--custom--secondary-500));
}

/* Bouton du dropdown */
.is-dropdown-button {
  width: fit-content;
  margin-top: var(--wp--custom--spacer-m);
}

.is-dropdown-button a {
  display: flex;
  align-items: center;
  gap: var(--wp--custom--spacer-s);
}

.is-dropdown-button img {
  width: 16px;
  height: 16px;
}

/* Conteneur de section pour les dropdowns simples */
.dropdown-section-container {
  padding: var(--wp--custom--spacer-l-fluid) var(--wp--custom--spacer-fluid);
}

/* Styles responsives */

/* Tablettes (max-width: 1024px) */
@media (max-width: 1024px) {
  .advanced-dropdown-section {
    padding: var(--wp--custom--spacer-l-fluid) var(--wp--custom--spacer-s-fluid);
  }

  .advanced-dropdown-section h2 {
    width: 0%;
  }

  .dropdown-content-column {
    width: 100% !important;
    padding: 0 var(--wp--custom--spacer-l-fluid);
  }
  
  .dropdown-image-column {
    display: none !important;
  }
  
  .dropdown-header {
    padding: var(--wp--custom--spacer-xs, 10px);
  }
  
  .dropdown-content {
    padding: var(--wp--custom--spacer-xs, 10px);
  }
}

/* Tablettes portrait (max-width: 768px) */
@media (max-width: 768px) {
  .advanced-dropdown-container {
    flex-direction: column;
  }
  
  .dropdown-content-column {
    width: 100% !important;
    padding: var(--wp--custom--spacer-s-fluid);
  }
  
  .dropdown-image-wrapper {
    height: 400px;
  }
  
  .dropdown-component {
    max-width: 100%;
  }
}

/* Mobiles (max-width: 480px) */
@media (max-width: 480px) {
  .advanced-dropdown-section {
    padding: var(--wp--custom--spacer-m-fluid) var(--wp--custom--spacer-xs-fluid);
  }

  .advanced-dropdown-section h2 {
    width: 100%;
  }
  
  .dropdown-image-wrapper {
    height: 300px;
  }
  
  .dropdown-header h3 {
    font-size: 1.25rem;
  }
  
  .dropdown-description {
    font-size: var(--wp--preset--font-size--s);
  }
  
  .dropdown-toggle img {
    width: 14px;
    height: 14px;
  }
}
