/* =========================================================
   STREAM BY YURI — responsive.css
   All @media rules: mobile background swap, header collapse,
   grid reflow, touch targets, overflow guards.
   ========================================================= */

/* Mobile background image swap.
   Se usa un ::before con position:fixed (en vez de aplicar el fondo
   directo al body) para que el tamaño se calcule contra el viewport
   (pantalla) y no contra el alto total de la página — eso era lo que
   causaba que se viera "estirado"/pixelado al hacer scroll. */
@media (max-width: 768px) {
  body {
    background-image: none;
  }

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
      linear-gradient(180deg, rgba(5, 3, 8, 0.35) 0%, rgba(5, 3, 8, 0.65) 45%, rgba(5, 3, 8, 0.92) 100%),
      url("../assets/background-vertical-mobile.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
  }
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

/* ---------- Large tablets ---------- */
@media (max-width: 1024px) {
  .reviews-layout {
    grid-template-columns: 1fr;
  }

  .trust-box {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Mobile nav drawer ---------- */
@media (max-width: 860px) {
  .site-header {
    top: 12px;
    width: 92%;
    padding: 10px 16px;
  }

  .hamburger {
    display: flex;
    position: relative;
    z-index: 960;
  }

  /* Mientras el drawer está abierto, la barra flotante del header
     (logo, carrito, login) se oculta — solo el botón hamburguesa
     (convertido en X) queda visible por encima del panel. */
  body.nav-open .site-header {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
  }

  body.nav-open .site-header .logo,
  body.nav-open .header-actions .cart-link,
  body.nav-open .header-actions .auth-btn {
    opacity: 0;
    pointer-events: none;
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 940;
    background: rgba(5, 3, 8, 0.72);
    backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
  }

  .nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    z-index: 950;
    transform: translateX(100%);
    visibility: hidden;
    opacity: 0;
    width: 78%;
    max-width: 300px;
    height: 100vh;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 10px;
    background: var(--color-black-soft);
    border: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.65);
    transition: transform var(--transition), opacity var(--transition), visibility 0s linear 0.3s;
    padding: 70px 22px 40px;
  }

  .main-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    transition: transform var(--transition), opacity var(--transition), visibility 0s linear 0s;
  }

  .main-nav a {
    display: block;
    text-align: left;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    width: 100%;
  }

  .main-nav a::after {
    display: none;
  }

  .main-nav a:hover,
  .main-nav a.is-active {
    background: rgba(255, 45, 149, 0.14);
    color: var(--color-pink-light);
  }

  .header-actions .btn-outline {
    padding: 10px 16px;
    font-size: 0.8rem;
  }
}

/* ---------- Small tablets / large phones ---------- */
@media (max-width: 700px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }

  .cart-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 14px;
  }

  .cart-item img {
    flex: 0 0 56px;
    height: 56px;
  }

  .cart-item-info {
    flex: 1 1 160px;
    min-width: 0;
  }

  .qty-control {
    flex: 0 0 auto;
  }

  .cart-item-price {
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-left: auto;
  }

  .cuenta-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .profile-card {
    padding: 22px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 22px;
  }

  .stat-box {
    padding: 14px 8px;
  }

  .stat-box .stat-value {
    font-size: 1.3rem;
  }

  .orders-list.orders-carousel .order-card {
    flex: 0 0 82%;
  }

  .stat-box .stat-label {
    font-size: 0.65rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .product-card {
    padding: 14px;
    min-width: 0;
    overflow: hidden;
  }

  .product-card .btn {
    white-space: normal;
    text-align: center;
    font-size: 0.8rem;
    padding: 11px 10px;
    line-height: 1.2;
  }

  .product-card img,
  .product-img-wrap {
    height: auto;
  }

  .why-section .section-banner--wide {
    max-width: none;
    width: calc(100% + 48px);
    margin-left: -24px;
    margin-right: -24px;
  }

  .services-section {
    padding-top: 4px;
    padding-bottom: 12px;
  }

  .why-section {
    padding-top: 8px;
    padding-bottom: 16px;
  }

  .precios-section {
    padding-top: 8px;
  }

  .cart-summary {
    text-align: center;
  }

  .summary-row {
    text-align: left;
  }

  .services-grid {
    gap: 10px;
  }
  .service-tile {
    flex: 0 0 calc(25% - 8px);
    max-width: 160px;
  }

  .service-tile img {
    border-radius: var(--radius-sm);
  }

  .service-tile-btn {
    left: 12%;
    right: 12%;
    bottom: 6%;
    font-size: 0.62rem;
    padding: 5px 4px;
  }

  .reviews-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand img {
    margin: 0 auto 14px;
  }

  .footer-social {
    justify-content: center;
  }

  .payments-bar {
    border-radius: var(--radius-lg);
  }
}

/* ---------- Phones ---------- */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .qty-row {
    font-size: 0.75rem;
  }

  .qty-stepper {
    gap: 8px;
    padding: 3px 5px;
  }

  .qty-btn {
    width: 22px;
    height: 22px;
    font-size: 0.85rem;
  }

  .qty-value {
    min-width: 12px;
    font-size: 0.85rem;
  }

  .stats-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stat-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    text-align: left;
  }

  .stat-box .stat-label {
    margin-top: 0;
  }

  .site-header {
    width: 94%;
    padding: 8px 12px;
  }

  .site-header .logo img {
    height: 44px;
  }

  .header-actions span.hide-mobile {
    display: none;
  }

  .btn {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
  }

  .section {
    padding: 60px 0;
  }

  .product-grid {
    gap: 10px;
  }

  .product-card {
    padding: 10px;
  }

  .product-card h3 {
    font-size: 0.95rem;
  }

  .product-card p {
    font-size: 0.8rem;
  }

  .services-section {
    padding-top: 4px;
    padding-bottom: 12px;
  }

  .why-section {
    padding-top: 8px;
    padding-bottom: 16px;
  }

  .precios-section {
    padding-top: 8px;
  }

  .section-banner {
    max-width: 250px;
  }

  .service-tile {
    max-width: 130px;
  }

  .service-tile img {
    border-radius: 6px;
  }

  .service-tile-btn {
    left: 10%;
    right: 10%;
    bottom: 6%;
    font-size: 0.54rem;
    padding: 4px 2px;
    gap: 2px;
  }

  .section-banner--wide {
    max-width: 100%;
  }

  .why-section .section-banner--wide {
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
  }

  .payment-badge {
    font-size: 0.75rem;
    padding: 9px 16px;
  }

  .plan-pills {
    gap: 5px;
  }

  .plan-pill {
    padding: 4px 16px;
    font-size: 0.68rem;
  }

  .stock-line {
    font-size: 0.68rem;
    margin-bottom: 10px;
  }

  .stock-dot {
    width: 6px;
    height: 6px;
  }
}

/* ---------- Touch-friendly tap targets everywhere ---------- */
@media (pointer: coarse) {
  .btn,
  .main-nav a,
  .cart-link,
  .hamburger,
  select,
  input,
  button {
    min-height: 44px;
  }

  /* Los botones +/- de cantidad y los de plan son un caso aparte: se
     quedan chicos a propósito (ver .qty-btn/.plan-pill más abajo), no
     queremos que la regla general de arriba los infle a 44px. */
  .qty-btn,
  .plan-pill {
    min-height: 20px;
  }
}
