/* ================================================================ */
/* CSS UNIFICADO Y FINAL                                            */
/* Basado en la estructura que funciona y con las correcciones.     */
/* ================================================================ */

:root {
  --desktop-col-width: 420px;

  /* AJUSTA ESTOS VALORES A LA ALTURA REAL DE TU HEADER */
  --header-height-desktop: 80px;
  --header-height-mobile: 60px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

/* Contenedor principal de la página */
.page-wrapper {
  padding-top: 0;
}

.product-layout {
  max-width: calc(var(--desktop-col-width) * 3 + 4rem);
  margin: 0 auto;
  padding: 1rem;
}

/* === ESTILOS BASE (Móvil) === */
.product-layout {
  display: flex;
  flex-direction: column;
}

/* La primera columna (imagen principal fija) está oculta en móvil */
#col1-placeholder {
  display: none;
}

#swiper-col {
  width: 100%;
  aspect-ratio: 3 / 4;
}

#details-col {
  padding-top: 2rem;
}

/* === VISTA TABLET (>= 768px) === */
@media (min-width: 768px) {
  .product-layout {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
  }

  #swiper-col {
    width: 60%;
    max-width: 500px;
    aspect-ratio: 3 / 4;
  }

  #details-col {
    width: 40%;
    max-width: 450px;
    padding: 0 1rem;
  }
}

/* === VISTA ESCRITORIO (>= 1200px) === */
@media (min-width: 1200px) {
  .product-layout {
    flex-wrap: nowrap;
  }

  /* Se muestra la columna de imagen principal */
  #col1-placeholder {
    display: block;
    width: var(--desktop-col-width);
    aspect-ratio: 3 / 4;
  }

  #swiper-col {
    width: var(--desktop-col-width);
    aspect-ratio: 3 / 4;
  }

  #details-col {
    width: var(--desktop-col-width);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
  }
}

/* === ESTILOS DE COMPONENTES (sin cambios mayores) === */
.media-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f8f8f8;
  cursor: pointer;
}

.media-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%) scale(1.5);
  border: 0;
  pointer-events: none;
  object-fit: cover;
}

.swiper {
  width: 100% !important;
  height: 100% !important;
}

.swiper-wrapper {
  height: 100% !important;
}

.swiper-slide {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden;
  background-color: #f8f8f8;
}

.swiper-slide img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  cursor: pointer;
}

.swiper-pagination-bullet {
  background: #ccc !important;
  opacity: 1 !important;
}

.swiper-pagination-bullet-active {
  background: #000 !important;
}

.product-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.product-price {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.accordion-header {
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  margin-bottom: 1rem;
  color: #555;
  font-size: 0.8rem;
  line-height: 1.4;
}

.accordion-content.open {
  max-height: 300px;
}

.toggle-sign {
  font-weight: 700;
}

.product-attributes {
  margin-bottom: 1.5rem;
}

.atributo-block {
  margin-bottom: 1rem;
}

.atributo-label {
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* === MODO BOTONES (flex wrap) === */
.atributo-botones {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.btn-atributo {
  padding: 6px 10px;
  border: 1px solid #111;
  background-color: #fff;
  color: #111;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: center;
  transition: all 0.15s ease;
}

.btn-atributo:hover {
  background-color: #f5f5f5;
  border-color: #000;
}

.btn-atributo.selected {
  background-color: #111;
  color: #fff;
}

/* === MODO DROPDOWN (para muchos valores) === */
.atributo-dropdown-wrapper {
  position: relative;
  width: 100%;
  max-width: 300px;
}

.atributo-dropdown {
  position: relative;
}

.dropdown-trigger {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #111;
  background-color: #fff;
  color: #111;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.15s ease;
}

.dropdown-trigger:hover {
  background-color: #f5f5f5;
}

.dropdown-trigger.open {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.dropdown-text {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  margin-left: 10px;
  transition: transform 0.3s ease-in-out;
  font-size: 0.75rem;
}

.dropdown-trigger.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu-custom {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #111;
  border-top: none;
  max-height: 280px;
  z-index: 100;
  /* Transición suave estilo sidebar */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.3s ease-in-out,
              transform 0.3s ease-in-out,
              visibility 0.3s ease-in-out;
}

.dropdown-menu-custom.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-search {
  padding: 8px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: #fff;
}

.dropdown-search-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  font-size: 0.85rem;
  outline: none;
}

.dropdown-search-input:focus {
  border-color: #111;
}

.dropdown-options {
  max-height: 220px;
  overflow-y: auto;
}

.dropdown-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background-color 0.2s ease-in-out,
              color 0.2s ease-in-out;
  border-bottom: 1px solid #f5f5f5;
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover {
  background-color: #111;
  color: #fff;
}

.dropdown-option.selected {
  background-color: #111;
  color: #fff;
}

.dropdown-option.hidden {
  display: none;
}

.stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.quantity-wrapper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #000;
  padding: 4px 12px;
  gap: 8px;
}

.quantity-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

#cantidad {
  width: 40px;
  text-align: center;
  border: none;
  font-size: 1rem;
  outline: none;
  -moz-appearance: textfield;
}

#cantidad::-webkit-inner-spin-button,
#cantidad::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.btn-primario {
  margin-top: auto;
  border: 1px solid #000;
  background-color: transparent;
  color: #000;
  padding: 10px 24px;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

.btn-primario:hover {
  background-color: #000;
  color: #fff;
}

.modal-dialog {
  max-width: 90vw;
}

.modal-body {
  padding: 0;
}

.zoom-container {
  width: 100%;
  height: 80vh;
  overflow: hidden;
  position: relative;
}

#modalImg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* === BOTONES DE NAVEGACIÓN SWIPER === */
.swiper-button-next,
.swiper-button-prev {
  color: #000 !important;
  background: rgba(255, 255, 255, 0.7);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Ocultar por defecto en todas las vistas */
  display: none;
}

/* Mostrar solo en móvil y tablet (horizontal) */
@media (max-width: 1199px) {
  .swiper-button-next,
  .swiper-button-prev {
    display: flex;
  }
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 20px !important;
  font-weight: bold;
}

/* Posicionamiento vertical (desktop) - ahora ocultos */
.swiper-vertical .swiper-button-next,
.swiper-vertical .swiper-button-prev {
  left: 50%;
  transform: translateX(-50%);
}

.swiper-vertical .swiper-button-next {
  top: 10px;
  bottom: auto;
}

.swiper-vertical .swiper-button-prev {
  top: auto;
  bottom: 10px;
}

/* Posicionamiento horizontal (mobile/tablet) */
.swiper-horizontal .swiper-button-next {
  right: 10px;
}

.swiper-horizontal .swiper-button-prev {
  left: 10px;
}
