/* MJAF · Responsive (mobile first: móvil → tablet → escritorio) */

/* Móviles pequeños */
@media (max-width: 380px) {
  .theme-toggle { width: 56px; padding: 0 6px; }
  :root[data-theme="dark"] .theme-toggle__thumb { transform: translateX(24px); }
  .header__inner { gap: 6px; }
  .header__actions { gap: 2px; }
  .line--lg { grid-template-columns: 72px 1fr; gap: 12px; }
  .line__bottom { flex-wrap: wrap; row-gap: 8px; }
  .checkout-steps { gap: 8px 12px; font-size: 0.68rem; letter-spacing: 0.06em; }
  .checkout-steps span { width: 22px; height: 22px; }
}

/* Móvil: la portada usa la imagen vertical y la tarjeta destacada compacta */
@media (max-width: 767px) {
  /* Barra de anuncios en dos líneas equilibradas, sin cortar el texto */
  :root { --announce-h: 46px; }
  .announce { padding: 0 12px; font-size: 0.68rem; letter-spacing: 0.08em; line-height: 1.35; }
  .announce p { white-space: normal; text-wrap: balance; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; }
  .hero { align-items: flex-end; padding-bottom: 64px; }
  /* Botones principales a todo el ancho: más cómodos con el pulgar */
  .hero__actions .btn { flex: 1 1 100%; }
  .campaign__actions { flex-direction: column; align-items: stretch; text-align: center; }
  .campaign__actions .btn { width: 100%; }
  .campaign__actions .link-arrow { justify-content: center; }
  .wa-float { width: 52px; height: 52px; }
  .wa-float svg { width: 26px; height: 26px; }
  .sticky-buy { padding-right: 80px; }
  .table th, .table td { padding: 11px 8px; }
  .table th:first-child, .table td:first-child { padding-left: 12px; }
  /* En el carrito el pedido ya se envía por WhatsApp; el botón flotante taparía el total */
  .page-cart .wa-float { display: none; }
  .hero__shade { background: var(--s-shade), linear-gradient(180deg, transparent 20%, color-mix(in srgb, var(--s-base) 70%, transparent) 100%); }
  .hero__feature { grid-template-columns: 64px 1fr auto; gap: 12px; max-width: none; }
  .hero__feature-name { font-size: 1.2rem; }
  .decor-lights { top: calc(var(--header-h) + var(--announce-h) - 14px); }
  .decor-lights__bulb:nth-child(even) { display: none; }
  .search-bar input { font-size: 1rem; }
  .sticky-buy .btn { min-height: 42px; }
  .cart-actions { flex-direction: column-reverse; align-items: flex-start; }
}

@media (min-width: 560px) {
  .cats { grid-template-columns: repeat(2, 1fr); }
  .cats .cat:first-child { grid-column: 1 / -1; min-height: 440px; }
  .trust__grid { grid-template-columns: repeat(2, 1fr); }
  .card__foot { grid-template-columns: auto 1fr; }
}

/* Tablet */
@media (min-width: 768px) {
  :root { --header-h: 76px; }
  .hero__bg { background-image: var(--hero-img, var(--hero-img-m, none)); }
  .hero__scroll { display: block; }
  .header__wa { display: inline-flex; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { gap: 40px 22px; }
  .trust__item { padding: 24px 12px; }
  .hero__inner { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); }
  .hero--has-feature .hero__feature { justify-self: end; align-self: end; grid-template-columns: 1fr; padding: 14px; max-width: 360px; }
  .hero--has-feature .hero__feature-frame { aspect-ratio: 1; }
  .hero--has-feature .hero__feature-caption { padding: 8px 6px 4px; }
  .hero--has-feature .hero__feature-go { position: absolute; right: 22px; bottom: 26px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .soon { grid-template-columns: 1.05fr 1fr; }
  .soon__media { aspect-ratio: auto; min-height: 380px; }
  .band__inner { grid-template-columns: 1fr auto; }
  .footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; max-width: 520px; }
  .product { grid-template-columns: 1.1fr 1fr; gap: 48px; }
  .gallery__stage { aspect-ratio: 4 / 5; }
  .page-product .gallery__stage { aspect-ratio: 1; }
  .buy__actions { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr 1.1fr; align-items: start; gap: 32px; }
  .info-grid { grid-template-columns: 1fr 1.2fr; gap: 56px; }
  .sticky-buy { display: none; }
  .wa-float { width: 60px; height: 60px; }
}

/* Escritorio */
@media (min-width: 1024px) {
  .nav { display: block; }
  .header__burger { display: none; }
  .mobile-menu { display: none; }
  .trust__grid { grid-template-columns: repeat(4, 1fr); }
  .trust__item { padding: 26px 12px; }
  .trust__item + .trust__item { border-left: 1px solid var(--line); padding-left: 24px; }
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; }
  .footer__brand { grid-column: auto; max-width: none; }
  .cats { grid-template-columns: 1.25fr 1fr 1fr; }
  .cats .cat:first-child { grid-column: auto; }
  .cat { min-height: 560px; }
  .cats .cat:first-child { min-height: 560px; }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog__layout { grid-template-columns: 250px 1fr; gap: 48px; }
  .toolbar__filters { display: none; }
  .filters { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
  .cart-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 48px; }
  .cart-layout.is-review { grid-template-columns: minmax(0, 760px); justify-content: center; }
  .summary { position: sticky; top: calc(var(--header-h) + 24px); }
  .pinfo { position: sticky; top: calc(var(--header-h) + 24px); }
}

/* Catálogo: filtros como panel lateral deslizable en móvil y tablet */
@media (max-width: 1023px) {
  .filters {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 95;
    width: min(360px, 88vw);
    display: flex;
    flex-direction: column;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.45s var(--ease), visibility 0s linear 0.45s;
  }
  .filters.is-open { transform: none; visibility: visible; transition-delay: 0s; }
  .filters__head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
  .filters__head h2 { font-size: 1.1rem; font-weight: 600; }
  .filters__body { flex: 1; overflow-y: auto; padding: 20px; }
  .filters__foot { padding: 16px 20px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .filters__apply { display: inline-flex; }
  .filters-overlay { display: block; position: fixed; inset: 0; z-index: 94; background: var(--overlay); opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0s linear 0.35s; }
  .filters.is-open + .filters-overlay { opacity: 1; visibility: visible; transition-delay: 0s; }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .header__inner { gap: 12px; }
  .nav a { padding: 8px 10px; letter-spacing: 0.06em; }
  .header__actions { gap: 4px; }
}

@media (min-width: 1280px) {
  .hero__title { font-size: 6.6rem; }
}

/* Pantallas táctiles (móvil y tablet): áreas de toque de al menos 44 px */
@media (max-width: 1023px) {
  .btn--sm { min-height: 44px; }
  .select--sm select { height: 44px; }
  .stepper--sm { height: 42px; }
  .stepper--sm button { width: 42px; }
  .chip--btn { min-height: 40px; }
  .trust__item a { display: inline-block; padding-block: 12px; margin-block: -12px; }
  .line__remove { width: 40px; height: 40px; margin: -8px -6px 0 0; }
  .theme-toggle, .logo, .hero__scroll { position: relative; }
  .theme-toggle::after, .logo::after, .hero__scroll::after { content: ""; position: absolute; inset: -8px -4px; }
  .link-arrow, .link-muted, .link-inline { padding-block: 12px; margin-block: -12px; }
}

/* Pantallas bajas en horizontal (móviles girados) */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { min-height: auto; padding-top: calc(var(--header-h) + var(--announce-h) + 32px); }
  .hero__feature, .hero__scroll { display: none; }
}

@media print {
  .site-header, .announce, .wa-float, .site-footer, .drawer, .drawer-overlay, .toasts { display: none !important; }
}
