/**
 * Snippet 08 — Responsive / Media Queries

 *
 * PROPÓSITO:
 * Centraliza TODOS los breakpoints responsive del tema.
 * Organizado de mayor a menor (desktop-first).
 *
 * DEPENDENCIAS: 00-variables.css + todos los snippets anteriores
 *
 * BREAKPOINTS ACTIVOS:
 *   1599px — pantallas grandes (no full HD)
 *   1366px — laptops estándar
 *   1199px — tablets landscape
 *   1024px — tablets portrait
 *    767px — móvil landscape / tablet pequeño
 *    520px — móvil mediano
 *    479px — móvil estándar
 *    374px — móvil pequeño (iPhone SE, Galaxy S)
 *    320px — móvil muy pequeño (reservado, vacío)
 *
 * RESTRICCIÓN FUNCIONAL:
 * Los cambios de order en flex dentro de breakpoints afectan
 * la secuencia visual de las acciones de compra en móvil.
 * Validar flujo de compra en cada breakpoint al modificar.
 */

/* ===================================================
 * 1599px — Pantallas grandes (no full HD)
 * =================================================== */
@media only screen and (max-width: 1599px) {
  .product_info h2 {
    font-size: 70px;
  }

  .product-tabs-container h3 {
    font-size: 45px;
  }

  .product-price {
    font-size: 55px;
    padding-bottom: 20px;
  }

  .price-per-gram {
    font-size: 32px;
  }

  p.product-description {
    padding-top: var(--spacing-sm);
  }

  .product_image {
    width: 80%;
  }

  .product_image_side {
    flex: 0 0 40%;
    display: flex;
    justify-content: center;
  }

  .product-tabs {
    gap: var(--spacing-md);
  }

  .main-category-section .subcategory-section:not(:first-child) {
    margin-top: 28px;
  }
}

/* ===================================================
 * 1366px — Laptops estándar
 * =================================================== */
@media only screen and (max-width: 1366px) {
  .product_info h2 {
    font-size: 60px;
  }

  .product-tabs-container h3 {
    font-size: 40px;
  }

  .product-price {
    font-size: 48px;
  }

  .price-per-gram {
    font-size: 30px;
  }

  .product_image_side {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  a.view-detail {
    bottom: -5%;
    left: 45%;
  }

  .main-category-section:not(:first-child) {
    margin-top: 80px;
  }
}

/* ===================================================
 * 1199px — Tablets landscape
 * =================================================== */
@media only screen and (max-width: 1199px) {
  .product_info h2 {
    font-size: 50px;
  }

  .product-tabs-container h3 {
    font-size: 35px;
  }

  button.add-to-cart-btn {
    padding: 13px 20px;
  }

  a.view-detail {
    bottom: -5%;
    left: 45%;
  }

  .main-category-section:not(:first-child) {
    margin-top: 70px;
  }
}

/* ===================================================
 * 1024px — Tablets portrait
 * =================================================== */
@media only screen and (max-width: 1024px) {
  /* Layout: columna única en tablet */
  .product_info_container {
    flex-direction: column;
    gap: 60px;
  }

  .price-per-gram {
    font-size: 25px;
  }

  .product-tabs-container h3 {
    font-size: 30px;
  }

  .product-price {
    font-size: 40px;
  }

  .attribute-group.attribute-peso label {
    font-size: 16px;
    padding: 6px 10px;
  }

  .product_image img {
    width: 100%;
  }

  .product_image_side {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
  }

  a.view-detail {
    bottom: -12%;
    left: 46%;
  }

  /* Centrado en tablet */
  .product_info {
    text-align: center;
  }

  .product-actions {
    justify-content: center;
  }

  .main-category-section:not(:first-child) {
    margin-top: var(--spacing-xl);
  }

  /* Popup en tablet — columna izquierda sin borde */
  .product-left {
    border-left: 0;
    max-width: 100%;
  }

  .product-right {
    display: flex;
    flex-direction: column;
  }

  /* Imagen de encabezado — visible en tablet */
  .heading_product_image {
    display: inline-block;
    text-align: left;
    width: 100%;
  }

  .heading_product_image h3.subcategory-name {
    display: inline-block;
    margin: 0 0 20px 0;
    stroke-width: 2px;
    -webkit-text-stroke-width: 1.5px;
  }

  .heading_product_image h2 {
    color: var(--color-white);
    margin: 0 0 20px 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.79);
    font-size: 3.5em;
  }

  /* Ocultar heading duplicado en info panel */
  .product_info h2 {
    display: none;
  }
}

/* ===================================================
 * 767px — Móvil landscape / Tablet pequeño
 * =================================================== */
@media only screen and (max-width: 767px) {
  .product-tabs-container h3 {
    font-size: 25px;
  }

  .product-price {
    font-size: 32px;
  }

  .price-per-gram {
    margin-top: var(--spacing-sm);
  }

  .attribute-group.attribute-peso label {
    font-size: 16px;
    padding: 6px 10px;
  }

  span.regular-price {
    font-size: 12px;
  }

  /* Popup en móvil — columna única */
  .product-left,
  .product-right {
    max-width: 100%;
  }

  .product-left {
    border-right: 0;
  }

  .product-row {
    flex-direction: column;
  }

  .pop_up_body {
    padding: var(--spacing-md);
  }

  /* Footer popup en móvil — apilado */
  .pop-up-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .pop-up-footer .product-actions {
    justify-content: flex-start;
    margin-top: var(--spacing-md);
    display: none;
  }

  .sj-inline-card .sj-card-body {
    gap: var(--spacing-sm);
  }

  /* Hover box en móvil — reducido */
  .product-hover-box h3.hover-product-name {
    font-size: 1rem;
    margin: 0;
    padding-bottom: var(--spacing-sm);
    font-weight: 200;
  }

  .product-hover-box {
    min-width: 300px;
    padding: var(--spacing-sm);
  }

  .product-hover-box p.hover-variety {
    margin: 0;
  }

  .product-hover-box .eye-btn a.hover-see-more img {
    width: 20%;
  }

  .product-hover-box .eye-btn a.hover-see-more span.details-view {
    font-size: smaller;
  }

  a.view-detail {
    bottom: 5%;
    left: 50%;
    transform: translate(-50%, 0%);
  }

  .product-container {
    padding: 10px var(--spacing-md);
  }

  .product-hover-box .eye-btn a.hover-see-more {
    transform: translate(0, 0);
  }


  .product-right .pop-up-bottom {
    padding-top: var(--spacing-sm);
  }

  /* Ajuste de botones de cantidad en móvil */
  .product-right .quantity-selector button.quantity-decrease,
  .quantity-selector button.quantity-decrease {
    margin-left: -16px;
  }

  .product-right .quantity-selector button.quantity-increase,
  .quantity-selector button.quantity-increase {
    margin-right: -16px;
  }

  /* Acciones en columna derecha del popup — visible en móvil */
  .product-right .pro-popup.product-actions {
    display: flex;
    padding-bottom: var(--spacing-sm);
    justify-content: flex-start;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
  }

  .product-right button.add-to-cart-btn {
    white-space: nowrap;
    display: block;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-top: 0;
  }

  .product-popup-image img {
    max-width: 250px;
  }

  .product-right .add-to-cart-btn::before {
    margin-right: var(--spacing-sm);
  }

  .pop_up_heading .product-name {
    font-size: 18px;
  }

  .product_image img {
    max-width: 332px;
  }
}

/* ===================================================
 * 520px — Móvil mediano
 * =================================================== */
@media only screen and (max-width: 520px) {
  .attribute-group.attribute-peso label {
    font-size: 14px;
  }

  .product-price {
    font-size: 28px;
  }

  .price-per-gram {
    font-size: 18px;
    padding-left: var(--spacing-xs);
  }

  .product-actions {
    gap: var(--spacing-sm);
  }

  .quantity-selector {
    width: auto;
  }

  button.add-to-cart-btn {
    margin-left: 0;
  }

  .category-item img {
    width: 50px;
  }

  .main-category-section:not(:first-child) {
    margin-top: var(--spacing-lg);
  }

  .tab-link {
    word-break: break-all;
    white-space: normal;
    overflow-wrap: break-word;
  }

  .pro-popup.product-actions .quantity-selector {
    width: 32%;
  }

  .product_image img {
    max-width: 234px;
  }
}

/* ===================================================
 * 479px — Móvil estándar
 * =================================================== */
@media only screen and (max-width: 479px) {
  .all-product-categories {
    gap: var(--spacing-xl);
  }

  .sj-inline-card::before {
    background-size: 320px;
    background-position: top right;
    margin-top: -30px;
  }

  .product_info h2 {
    font-size: 35px;
    display: none;
  }

  .sj-inline-card .sj-card-image img {
    margin-top: 0px;
  }

  /* Precio en móvil — fila con alineación superior */
  .product-price {
    gap: var(--spacing-xs);
    align-items: flex-start;
    padding: 0px;
    width: 100%;
  }

  .product-tabs-container h3 {
    margin: 15px 0 25px;
    display: none;
  }

  .product-hover-box p.hover-short-description {
    font-size: 14px;
  }

  .product-hover-box {
    min-width: 280px;
    padding: var(--spacing-sm);
  }

  .product-hover-box .eye-btn a.hover-see-more {
    width: fit-content;
    padding: var(--spacing-xs) 12px;
  }

  .product-hover-box h3.hover-product-name {
    font-size: 20px;
  }

  /* Footer popup en móvil pequeño */
  .pop-up-footer {
    flex-direction: column;
    padding-top: var(--spacing-sm);
    align-items: flex-start;
  }

  .pop-up-footer .product-actions {
    margin-top: var(--spacing-md);
  }

  .product-action-block {
    padding-top: var(--spacing-md);
    grid-template-columns: repeat(1, 1fr);
  }

  /* Alineación izquierda en móvil pequeño */
  .sj-inline-card .sj-card-body {
    gap: var(--spacing-sm);
    text-align: start;
  }

  .product-actions {
    justify-content: start;
  }

  /* Tab links compactos */
  .tab-link {
    padding: 12px 6px;
    display: inline-block;
    font-size: 14px;
    width: fit-content;
  }

  .product_info_container {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  span.discount-percentage {
    left: auto;
    right: 0;
    font-size: 7px;
  }

  .product-container {
    padding: 0px;
  }

  /* Labels de peso más compactos */
  .attribute-group.attribute-peso label {
    font-size: 12px;
  }

  .sj-label,
  .sj-inline-card .sj-card-category {
    font-size: 12px;
  }

  /* Botones de cantidad — tamaño reducido */
  .quantity-decrease {
    left: 22px;
    padding: 0 9px 4px;
  }

  button.quantity-increase {
    right: 22px;
    padding: 2px 8px;
  }

  .quantity-increase,
  .quantity-decrease {
    font-size: 24px;
    line-height: 82%;
  }

  input.quantity-input {
    padding: 15px 0;
  }

  /* Botones cantidad en columna derecha — sin padding */
  .product-right .quantity-selector button {
    padding: 0;
    background-color: transparent;
  }

  /* Selector de cantidad en popup móvil — tamaño fijo */
  .pro-popup.product-actions .quantity-selector {
    min-width: 72px;
    max-width: 70px;
    width: 70px;
  }
}

/* ===================================================
 * 374px — Móvil pequeño (iPhone SE, Galaxy S mini)
 * =================================================== */
@media only screen and (max-width: 374px) {
  .product_info h2 {
    font-size: 30px;
  }

  .product-tabs-container h3 {
    font-size: 20px;
    padding-bottom: var(--spacing-sm);
  }

  .product-price {
    padding-bottom: 0;
    font-size: 26px;
  }

  .attribute-group.attribute-peso {
    margin-top: 15px;
  }

  .price-per-gram {
    margin-top: 0;
  }
}

/* ===================================================
 * 320px — Móvil muy pequeño (reservado para futuro uso)
 * =================================================== */
@media only screen and (max-width: 320px) {
  /* Sin reglas activas — breakpoint reservado */
}
