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

:root {
  --desktop-col-width: 500px;
  --desktop-col-height: 680px;
  --tablet-gallery-height: 600px;
  --mobile-gallery-height: 450px;

  /* 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;
  font-family: 'Open Sans', sans-serif;
}

/* Contenedor principal de la página */
.page-wrapper {
  /* Por defecto, usa el padding para el header móvil */
  padding-top: var(--header-height-mobile);
}

.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 {
  height: var(--mobile-gallery-height);
}

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

/* === VISTA TABLET (>= 768px) === */
@media (min-width: 768px) {
  .page-wrapper {
    padding-top: var(--header-height-desktop);
  }

  .product-layout {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
  }

  #swiper-col {
    width: 60%;
    max-width: 700px;
    height: var(--tablet-gallery-height);
  }

  #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);
    height: var(--desktop-col-height);
  }

  #swiper-col {
    width: var(--desktop-col-width);
    height: var(--desktop-col-height);
  }

  #details-col {
    width: var(--desktop-col-width);
    height: var(--desktop-col-height);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    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,
.media-wrapper iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.31);
  border: 0;
  pointer-events: none;
}

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

.swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: #f8f8f8;
}

.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  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;
}

.btn-atributo {
  padding: 4px 8px;
  margin: 4px;
  border: 1px solid #111;
  background-color: #fff;
  color: #111;
  cursor: pointer;
  font-size: 0.85rem;
}

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

.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;
}