.main {
  padding-top: 10vh;
}

.product_detail_container {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  gap: 2rem;
  width: 100%;
  /* height: 70vh; */
}

/* 📸 Sección de imágenes */
.product_images_section {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  height: 70vh;
  flex-direction: column;
  width: 100%;
  max-height: 450px;
}

/* MAIN siempre cuadrada */
.main_image {
  aspect-ratio: 1 / 1;
  width: unset;
  height: 85%;
  overflow: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.main_image img {
  width: unset;
  height: 100%;
  object-fit: cover; /* rellena y recorta */
}

/* Columna de thumbnails escalable */
.thumbnails {
  --gap: 0.75rem;
  --thumbs-count: 3; /* será actualizado por JS */
  height: unset; /* igual a la altura de MAIN */
  display: flex;
  flex-direction: row;
  justify-content: center;
  width: 100%;
  justify-content: space-between;
  max-width: 300px;
  margin: 0 auto;
}

/* Thumbs cuadradas */
.thumbnails img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
  width: calc((95% / var(--thumbs-count)));
  height: unset;
}

/* 📄 Sección de info del producto */
.product_info_section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: fit-content;
}

.product_title {
  font-size: clamp(1.3rem, 2vw + 0.25rem, 1.75rem);
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.product_characteristics {
  list-style: none;
  padding: 0;
  margin: 0;
}

.product_characteristics li {
  margin-bottom: 0.5rem;
}

.product_codes p {
  margin: 0.3rem 0;
}

.product_codes .product_price {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2.5rem;
}

.product_id {
  user-select: text;
}

/* 🛒 Agregar al pedido */
.add_to_order {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}

.quantity_control {
  display: flex;
  align-items: center;
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
  margin: 0;
  justify-content: space-between;
}
/* Evitar zoom por doble-tap en controles de cantidad */
.quantity_control,
.quantity_control .qty_btn,
.add_btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; /* feedback más limpio en iOS */
  user-select: none;
}
.qty_btn {
  padding: 0.4rem 1.2rem;
  background-color: #f5f5f5;
  border: none;
  cursor: pointer;
  font-size: 2rem;
}
.qty_btn.plus {
  height: 100%;
}
.qty_input {
  width: 40px;
  text-align: center;
  border: none;
  outline: none;
  background-color: white;
  font-size: 1.25rem;
}
.add_btn {
  width: 100%;
  max-width: 160px;
  /* margin: 0 auto; */
  padding: 6px 10px;
  border: 1px solid #000;
  background: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  border-radius: 5px;
  white-space: nowrap;
}

/* 📱 Mobile - Thumbs debajo */
.category_section {
  /* width: 80%;product_id */
  max-width: 1200px;
  margin: 6rem auto;
  padding: 2rem 1rem;
}
.section_title {
  padding-bottom: 0;
  margin-bottom: 0;
  text-align: start;
  padding-left: 2rem;
}
.ver_mas_wrapper {
  display: none;
}
.product_codes .product_price {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2.5rem;
}
.product_id {
  user-select: text;
}
/* PARA EL BOTON DE SACAR DE ORDEN */
.btn-remove-order {
  appearance: none;
  background: transparent;
  color: #dc2626; /* rojo */
  border: 1px solid #fca5a5; /* rojo claro */
  border-radius: 5px;
  padding: 10px 14px;
  font: 600 13px/1 system-ui, -apple-system, Segoe UI, Roboto, Arial;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease,
    color 0.2s ease, opacity 0.2s ease;
}
.btn-remove-order:hover {
  background: #fee2e2; /* rosado suave */
  border-color: #ef4444; /* rojo */
}
.btn-remove-order:active {
  background: #fecaca;
  border-color: #dc2626;
}
.btn-remove-order:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-remove-order:focus {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
  border-radius: 999px;
}

/* Desktop */
@media (min-width: 768px) {
  /* OUTER GRID: [ IMAGES | INFO ] */
  .product_detail_container {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    column-gap: 2rem;
    height: unset;
  }

  /* IMAGES ocupa la 1ª columna del outer grid */
  .product_images_section {
    width: 65%;
    height: 60vh;
    flex-direction: row;
    justify-content: center;
  }
  .product_info_section {
    width: 35%;
  }

  /* MAIN SIEMPRE CUADRADA */
  .main_image {
    width: unset;
    height: 100%;
  }
  .main_image img {
    height: 100%;
    width: unset;
    object-fit: cover;
  }

  /* THUMBS columna que nunca excede la altura de MAIN */
  .thumbnails {
    width: unset;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    gap: unset;
    max-width: unset;
    margin: unset;
  }
  .thumbnails img {
    height: calc((95% / var(--thumbs-count)));
    width: unset;
    cursor: pointer;
  }
  .thumbnails img:hover {
    opacity: 0.7;
  }
  /* INFO va en la 2ª columna del outer grid, alineada arriba */

  .category_section {
    margin: 10rem auto;
  }
  .scroll_arrow.left {
    left: -2.5%;
  }
  .scroll_arrow.right {
    right: -2.5%;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .product_images_section {
    height: 80vh;
  }
}
