.container {
  /* width: 90%; */
  /* max-width: 1200px; */
  margin: 0 auto;
  /* padding: 20px; */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.empty-col {
  flex: 0.7;
}

button.dropdown-button {
  flex: 1;
  width: 100%;
  text-align: center;
  background: black;
  color: white;
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  text-wrap: auto;
}

.main-content-charm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}
img.control-icon {
  width: 34px;
  margin-bottom: 0px;
  margin-right: 0.625rem;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-icon-wrapper:hover img.control-icon,
.control-icon-wrapper:hover svg.control-icon {
  transform: scale(1.08);
}

img.preview-image {
  width: 100%;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100% !important;
  object-fit: contain;
}

/* Contenedor para animaciones de previsualización */
.preview-container {
  position: relative;
  width: 100%;
  height: 20vh;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#cadena-layer {
  position: absolute;
}

/* Animaciones para imágenes de previsualización */
.preview-image {
  /* opacity: 0; */
  transform: scale(1);
  /* position: absolute; */
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-image.active {
  opacity: 1 !important;
  transform: scale(1.05) !important;
}

.preview-image.fade-out {
  opacity: 0 !important;
  transform: scale(1.05) !important;
}

/* Animación elegante para SVG iconos */
svg.control-icon {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.4s ease;
}

.control-icon-wrapper:hover svg.control-icon {
  filter: drop-shadow(0px 0px 3px rgba(206, 175, 71, 0.5));
}

/* Animación para el botón de añadir al carrito */
.add-to-cart-button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.add-to-cart-button::after {
  content: "";

  width: 0.7em;
  height: 1em;

  background-image: url("data:image/svg+xml,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5078 4.37305V6.07227H0.761719V4.37305H10.5078ZM6.54297 0.222656V10.5742H4.73633V0.222656H6.54297Z' fill='black'/%3E%3C/svg%3E%0A");
  background-repeat: no-repeat no-repeat;
  background-position: center center;
  background-size: contain;
}
.add-to-cart-button:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.add-to-cart-button:focus:not(:active):before {
  animation: ripple-gold 1s ease-out;
}

@keyframes ripple-gold {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
    background: rgba(206, 175, 71, 0.3);
  }
  100% {
    transform: scale(20, 20);
    opacity: 0;
    background: rgba(206, 175, 71, 0);
  }
}

/* Estado de carga */
.add-to-cart-button.loading {
  background-color: #333 !important;
  position: relative;
}

.add-to-cart-button.loading:before {
  content: "";
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  right: 0.9375rem;
  top: calc(50% - 0.625rem);
  animation: elegant-spin 0.8s linear infinite;
}

@keyframes elegant-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Estado de éxito */
.add-to-cart-button.success {
  background-color: #4a6741 !important;
  transition: background-color 0.3s ease;
}

/* Estado de error */
.add-to-cart-button.error {
  background-color: #8c4a41 !important;
  animation: subtle-shake 0.5s ease-in-out;
}
.add-to-cart-button:hover {
  background-color: #b18d59 !important;
  color: black !important;
}

@keyframes subtle-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}
@media (min-width: 768px) {
  .main-content-charm {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}

.text-content {
  flex: 1;
  max-width: 450px;
  text-align: left;
}

.text-content h1 {
  font-size: 2.25rem;
  font-weight: bold;
  margin-bottom: 0.625rem;
  color: #000000;
}

.text-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: #000000;
}

.text-content p {
  font-size: 20px;
  line-height: 1.6;
  color: #000000;
}

.image-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 500px;
  /* width: 33.33%; */
}

.image-container .wp-post-image {
  width: 100%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  object-fit: contain;
}
.image-container {
  position: relative;
  height: 0px;
  padding-bottom: 140%;
  width: 100%;
}
.preview-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.image-container img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.customization-bar {
  width: 100%;
  /* background-color: #ffffff; */
  /* border-top: 1px solid #e0e0e0; */
  padding: 1.25rem 0;
  /* box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05); */
}

.customization-controls {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  /* max-width: 1200px; */
  margin: 0 auto;
  /* padding: 0 20px; */
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  /* flex-grow: 1; */
  position: relative;
  margin-right: 0.75rem;
  margin-bottom: 24px;
}
/* .control-group.quantity-group {
  flex: 1;
} */

.control-group:hover .dropdown-button::after {
  transform: rotate(180deg);
}

.control-group .material-icons {
  font-size: 1.75rem;
  color: #333333;
}

.dropdown-button {
  background-color: #000000;
  color: #ffffff;
  border: none;
  padding: 0.625rem 0.9375rem;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3125rem;
  transition: background-color 0.3s ease;
  min-width: 7.5rem;
  justify-content: space-between;
}

.dropdown-button:hover {
  background-color: #333333;
}

.dropdown-button .material-icons {
  font-size: 1.125rem;
  color: #ffffff;
}

.add-button {
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #000000;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease, color 0.3s ease;
  align-self: flex-end;
  margin-bottom: 0.0625rem;
}

.add-button:hover {
  background-color: #f0f0f0;
}

.add-button .material-icons {
  font-size: 1.125rem;
}

.dropdown-menu {
  position: absolute;
  bottom: 3.1875rem;
  left: 0;
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  width: 100%;
  padding: 0;
  margin: 0;
  max-height: 60vh; /* o la altura que prefieras */
  overflow-y: auto;
  overflow-x: hidden;
}

.dropdown-menu li {
  list-style-type: none;
  padding: 0.375rem 10px;
  cursor: pointer;
  text-align: start;
  background-color: #808080;
  color: white;
  border-bottom: 1px solid #404040;
  position: relative;
}

span.charm-remove {
  margin-left: auto;
  background: #404040;
  display: flex;
  flex-direction: row;
  align-content: center;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 2em;
  position: absolute;
  top: 0;
  right: 0;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
  transform: translateX(100%);
  z-index: 5;
}
.dropdown-menu .charm-option.selected:hover span.charm-remove {
  opacity: 1;
  transform: translateX(0%);
}
span.charm-remove:hover {
  width: 2.2em;
  background: #b18d59;
}

@media screen and (max-width: 767px) {
  .charm-option.selected span.charm-remove {
    transform: translateX(0%);
    opacity: 1;
  }
}

.dropdown-menu .main-item svg {
  fill: transparent;
  margin-right: 0.625rem;
  width: 1.4rem;
  height: 1.4rem;
}

.dropdown-menu .main-item {
  background-color: #b78a64;
  display: flex;
  align-content: center;
  align-items: center;
  font-weight: bold;
  cursor: default;
  position: relative;
}
.dropdown-button::after,
.dropdown-menu .main-item::after {
  content: "";
  width: 1rem;
  height: 1rem;
  background-image: url('data:image/svg+xml,<svg width="9" height="9" viewBox="0 0 9 9" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4.06208 6.18945L5.82083 3.14321H2.30333L4.06208 6.18945Z" fill="white"/><path d="M7.14551 2.37793H0.977539L4.06152 7.7207L7.14551 2.37793Z" stroke="white" stroke-width="0.5"/></svg>');
  background-repeat: no-repeat;
  background-size: contain;
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}
.dropdown-button::after {
  position: static;
  transform: translateY(0%);
}

.dropdown-menu li.active,
.dropdown-menu li.sub-item.active {
  font-weight: bold;
  background-color: #606060;
  position: relative;
}

.dropdown-menu li.active::after,
.dropdown-menu li.sub-item.active::after {
  content: "✓";
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  color: white;
}

.dropdown-menu li:hover {
  background-color: #404040;
}
.control-group .dropdown-menu {
  display: none;
}
@media (hover: hover) and (min-width: 1024px) {
  .control-group:hover .dropdown-menu {
    display: block;
  }
}

.dropdown-menu.show {
  display: block;
}

@media (max-width: 768px) {
  .customization-controls {
    flex-wrap: wrap;
    gap: 0.9375rem;
    justify-content: center;
  }

  .control-group {
    flex-basis: calc(50% - 10px);
    margin-right: 0;
  }

  .add-button-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.9375rem;
  }
  .dropdown-menu li {
    font-size: 16px;
  }
  .charm-option img {
    width: 24px;
    height: 24px;
  }
  .dropdown-menu {
    min-height: auto;
    max-height: 45vh;
  }

  /* .main-content-charm {
    margin-bottom: 200px;
  } */
}

/* @media (max-width: 480px) {
  .control-group {
    flex-basis: 100%;
  }
} */

/* ----------------------------------------- */
/* Hereda todos los estilos base de .cinta-section y sus hijos */
.cinta-section {
  transform: rotate(1.5deg) translate(-25%, 80%);
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 200vw !important;
}

.cinta-section ul {
  display: flex;
  flex-wrap: nowrap;
  flex: 1;
  margin: 0 -33.33vw !important;
}

.cinta-section li {
  display: flex;
  flex-wrap: nowrap;
}

/* Media queries base */
@media screen and (min-width: 1600px) {
  .cinta-section {
    transform: rotate(1deg) translate(-25%, 80%);
  }
}

/* --- Clases Modificadoras --- */

/* Muestra un solo elemento li */
.cinta-section--show-1 li {
  display: none !important; /* Oculta todos por defecto */
}

.cinta-section--show-1 li:nth-child(1) {
  display: flex !important; /* Muestra solo el primero */
}

/* Muestra dos elementos li */
.cinta-section--show-2 li {
  display: none !important;
}

.cinta-section--show-2 li:nth-child(-n + 2) {
  display: flex !important;
}

/* Muestra tres elementos li (similar a tu ejemplo original para 768px) */
.cinta-section--show-3 li {
  display: none !important;
}

.cinta-section--show-3 li:nth-child(-n + 3) {
  display: flex !important;
}

/* Muestra seis elementos li (similar a tu ejemplo original para 1024px) */
.cinta-section--show-6 li {
  display: none !important;
}

.cinta-section--show-6 li:nth-child(-n + 6) {
  display: flex !important;
}

#charm-slots-container {
  position: absolute;
  bottom: -15%;
  left: 0;
  width: 100%;
  height: 29%;
  pointer-events: none;
}

.charm-slot {
  position: absolute;
  width: 15%; /* Ancho del slot, puede ser ajustado */
  height: 0;
  padding-bottom: 14%; /* Mantiene el aspect ratio 1:1 */
  pointer-events: all;
  cursor: grab;
  transition: left 0.4s ease, top 0.4s ease; /* Transición suave de posición */
  z-index: 10;
  border: 1px solid transparent;
  border-radius: 50%;
}

.charm-slot.hidden-slot {
  display: none;
}

.charm-sortable-placeholder {
  background-color: rgba(206, 175, 71, 0.3);
  border: 1px dashed #ceaf47;
  visibility: visible !important;
  border-radius: 8px;
  position: absolute; /* Asegura que el placeholder ocupe espacio */
  z-index: 5;
}

.charm-sortable-helper {
  width: 6vw !important;
  height: 6vw !important;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  background-color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  opacity: 0.7;
}

.ui-draggable-dragging {
  opacity: 0.5;
  z-index: 9999;
  pointer-events: none;
}

.charm-slot .charm-image {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  height: 87%;
  object-fit: contain;
  /* background: red; */
}

/* .charm-slot:nth-child(1) .charm-image,
.charm-slot:nth-last-child(1) .charm-image {
  transform: translateY(-20%); 
}

.charm-slot:nth-child(2) .charm-image,
.charm-slot:nth-last-child(2) .charm-image {
  transform: translateY(-40%);
} */

button.remove-charm {
  position: absolute;
  top: -12px;
  right: 50%;
  transform: translateX(50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5rem;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;

  padding: 0;
  font-size: 26px;
  height: 1em;
  width: 1em;
  display: flex;
  flex-direction: row;
  align-content: center;
  justify-content: center;
  align-items: center;
}

.charm-slot:hover {
  border-color: #ceaf47;
}
.charm-slot:hover button.remove-charm {
  opacity: 1;
  visibility: visible;
}

button.remove-charm:hover {
  background-color: #000000;
  transform: scale(1.2) translateX(50%);
}

.charm-option img {
  width: 1.875rem;
  margin: 0 10px 0px 0px;
  object-fit: contain;
}
.charm-option {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-content: center;
  align-items: center;
}
.charm-option:hover {
  background-color: #f0f0f0;
}

/* En el CSS */
.charm-option.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.charm-selection-feedback {
  font-size: 0.9em;
  color: #666;
  margin-top: 0.3125rem;
  display: block;
}

/* Media queries específicos para tus clases (opcional, si quieres comportamientos diferentes por tamaño de pantalla) */
@media screen and (max-width: 768px) {
  /* Si la clase .cinta-section--show-1 se usa, siempre mostrará 1, sin importar la media query base de .cinta-section */
  .cinta-section--show-1 li {
    display: none !important;
  }
  .cinta-section--show-1 li:nth-child(1) {
    display: flex !important;
  }
  .charm-sortable-helper {
    width: 15vw !important;
    height: 15vw !important;
  }
}

@media screen and (max-width: 1280px) {
  .control-group {
    /* flex: none; */
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: auto;
  }
  .image-content {
    min-width: auto;
  }
}
@media screen and (max-width: 1024px) {
  /* Si la clase .cinta-section--show-2 se usa, siempre mostrará 2, sin importar la media query base de .cinta-section */
  .cinta-section--show-2 li {
    display: none !important;
  }
  .cinta-section--show-2 li:nth-child(-n + 2) {
    display: flex !important;
  }
  .empty-col {
    display: none !important;
  }
}

.quantity-group {
  flex-direction: row !important;
  align-items: center;
  gap: 0.3125rem !important;
  justify-content: center;
  flex-wrap: wrap;
}
.quantity-group p {
  width: 100%;
  text-align: center;
}

.quantity-button {
  background-color: #eee;
  border: 1px solid #ddd;
  width: 1.875rem;
  height: 100%;
  cursor: pointer;
  font-size: 1.125rem;
  border-radius: 50%;
  line-height: 1.75rem;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-content: center;
  justify-content: center;
  align-items: center;
}

.quantity-button:hover {
  background-color: #ddd;
}

#charm-quantity {
  width: 3.125rem;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 5px;
  /* width: 50%; */
  flex: 1;
}

.multi-select-dropdown .main-item {
  background-color: #b78a64;
  display: flex;
  align-content: center;
  align-items: center;
  font-weight: bold;
  cursor: default;
  position: relative;
  color: white;
  position: sticky;
  z-index: 100;
  top: 0px;
  cursor: pointer;
}

.multi-select-dropdown .main-item span {
  margin-left: 0.625rem;
}

.multi-select-dropdown .charm-option {
  background-color: #808080;
  color: white;
  border-bottom: 1px solid #404040;
}

.multi-select-dropdown .charm-option:hover {
  background-color: #606060;
}

.multi-select-dropdown .charm-option.selected {
  background-color: #606060;
  font-weight: bold;
}
