/* ════════════════════════════════════════
   RESPONSIVE — empodericatalogo
   Breakpoints: 1024 · 700 · 600 · 580 · 480 · 380
   ════════════════════════════════════════ */

/* ── Feature: hover real (no táctil) ── */
@media (hover: hover) {
  .cat-product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
}

/* ── 1024px — tablet ── */
@media (max-width: 1024px) {
  .hero { padding: 60px 28px 48px; }
  .hero-text { padding-right: 32px; }
  .features-strip { flex-wrap: wrap; }
  .feature-item { padding: 18px 20px; }
  .dash-body { max-width: 100%; padding: 32px 24px; }
  .catalog-products-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── 700px — móvil grande ── */
@media (max-width: 700px) {
  /* Vista lista */
  .catalog-products-grid.list-view .cat-product-img { width: 84px; height: 84px; }

  /* Landing nav */
  .nav { padding: 12px 16px; gap: 8px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { padding: 7px 10px; font-size: .78rem; white-space: nowrap; }

  /* Hero landing */
  .hero { grid-template-columns: 1fr; padding: 28px 16px 36px; }
  .hero-text   { padding-right: 0; order: 1; }
  .hero > .store-spotlight { order: 2; grid-column: auto; padding: 20px 0 8px; }
  .hero-visual { order: 3; }
  .hero-visual { aspect-ratio: 16/9; margin-top: 24px; animation: none; }
  .mock-grid { grid-template-columns: 1fr 1fr; }
  .mock-chip { font-size: 0.65rem; padding: 6px 9px; top: 10px; right: 10px; }
  .hero-proof { margin-top: 20px; padding-top: 18px; }

  /* Features */
  .features-strip { flex-direction: column; overflow-x: visible; }
  .feature-item { border-right: none; border-bottom: 1px solid rgba(15,14,12,.08); padding: 16px 20px; }
  .feature-item:last-child { border-bottom: none; }

  /* Plan chips: ocultos en todo el rango móvil */
  #dash-plan-chip, #dash-plan-pending, #dash-plan-expires { display: none !important; }

  /* ── Dashboard nav → barra inferior fija ── */
  #dashboard .dash-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0; top: auto;
    z-index: 200;
    padding: 0 0 env(safe-area-inset-bottom, 0px);
    height: auto;
    min-height: 62px;
    gap: 0;
    box-shadow: 0 -2px 14px rgba(0,0,0,.22);
    justify-content: stretch;
  }
  /* Ocultar logo en el bottom nav */
  #dashboard .dash-nav .dash-nav-brand,
  #dashboard .dash-nav .dash-logo-desktop { display: none; }
  /* Acciones llenan todo el ancho */
  #dashboard .dash-nav .dash-nav-actions {
    width: 100%;
    flex-shrink: unset;
    justify-content: space-around;
    gap: 0;
    align-items: stretch;
  }
  /* Cada botón = pestaña */
  #dashboard .dash-nav .dash-view-btn,
  #dashboard .dash-nav .app-status-btn {
    flex: 1;
    min-height: 62px;
    height: auto;
    padding: 8px 4px 6px;
    border-radius: 0;
    border: none;
    background: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,.72);
    font-size: .58rem;
    white-space: normal;
    min-width: 0;
  }
  #dashboard .dash-nav .dash-view-btn:active,
  #dashboard .dash-nav .app-status-btn:active { background: rgba(255,255,255,.1); color: white; }
  #dashboard .dash-nav .dash-view-btn svg,
  #dashboard .dash-nav .app-status-btn svg { width: 21px; height: 21px; flex-shrink: 0; }
  /* Etiquetas bajo el ícono */
  #dashboard .dash-nav .dash-view-label,
  #dashboard .dash-nav .dash-bnav-label { display: block; font-size: .58rem; font-weight: 500; line-height: 1; }
  /* [+] wrap ocupa su pestaña centrada */
  #dashboard .dash-nav .dash-add-wrap { flex: 1; display: flex; align-items: center; justify-content: center; }
  /* dash-more-wrap ocupa su pestaña */
  #dashboard .dash-nav .dash-more-wrap { flex: 1; display: flex; align-items: stretch; }
  #dashboard .dash-nav .dash-more-btn {
    flex: 1;
    width: auto;
    min-height: 62px;
    height: auto;
    padding: 8px 4px 6px;
    border-radius: 0;
    border: none;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255,255,255,.72);
    cursor: pointer;
  }
  #dashboard .dash-nav .dash-more-btn:active { background: rgba(255,255,255,.1); color: white; }
  #dashboard .dash-nav .dash-more-btn span:not(.dash-bnav-label) { width: 18px; height: 2px; border-radius: 2px; gap: 0; }
  /* Menú abre hacia ARRIBA */
  #dashboard .dash-nav .dash-more-menu {
    top: auto;
    bottom: calc(100% + 8px);
    right: 0;
    left: auto;
    max-height: calc(100dvh - 80px);
    overflow-y: auto;
  }
  /* Cuerpo: espacio para el nav inferior */
  #dashboard .dash-body { padding: 16px 14px calc(74px + env(safe-area-inset-bottom, 0px)); }
  /* Ocultar barra "Productos + botones" redundante en móvil */
  #dashboard .section-header { display: none; }
  /* FABs suben por encima del nav inferior */
  .support-fab { bottom: calc(74px + env(safe-area-inset-bottom, 0px) + 14px); }
  .wa-seller-fab { bottom: calc(74px + env(safe-area-inset-bottom, 0px) + 14px); }
  .cart-fab { bottom: calc(74px + env(safe-area-inset-bottom, 0px) + 14px); }
  .dash-title { font-size: 1.05rem; }
  .dash-sub   { font-size: .75rem; margin-top: 1px; }

  /* Ajustes móvil share-bar */
  .dash-top-row { gap: 8px; margin-bottom: 12px; }
  .dash-top-row .share-bar { padding: 8px 10px; gap: 6px; }
  .share-url { font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .share-actions { gap: 4px; flex-shrink: 0; }
  .copy-btn { padding: 5px 8px; font-size: .7rem; white-space: nowrap; }
  #btn-add-product { font-size: .8rem; padding: 7px 13px; }
  .product-actions { gap: 2px; }
  .product-actions .btn { padding: 3px 5px; font-size: 0.68rem; border-radius: 5px; }

  /* Nav dashboard — mostrar/ocultar por breakpoint */
  .dash-mob-only { display: flex; }
  .dash-desk-only { display: none !important; }
  .dash-logo-desktop { display: none; }

  /* Verify strip móvil */
  .verify-strip { padding: 7px 14px; gap: 8px; font-size: .78rem; }

  /* Modal */
  .modal-overlay { padding: 10px; }
  .modal { padding: 20px 16px; border-radius: var(--radius); max-height: 92vh; overflow-y: auto; }
  .modal--product { padding: 0; max-height: 92vh; }
  .product-layout { overflow-y: auto; }
  .emoji-picker { grid-template-columns: repeat(6, 1fr); gap: 6px; }

  /* Catalog hero — redes al fondo */
  .catalog-hero { padding: 20px 16px 12px; min-height: 160px; }
  .catalog-hero-inner { flex-direction: column; align-items: center; text-align: center; gap: 8px; }
  .catalog-seller-name { font-size: 1.3rem; }
  .cat-meta-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    justify-content: center;
    overflow: hidden;
    margin-top: 20px;
  }
  .cat-meta-row .cat-social-links { margin-top: 0; flex-wrap: nowrap; gap: 6px; }
  .cat-meta-row .cat-social-link { font-size: .68rem; gap: 3px; }
  .cat-meta-row .cat-social-link svg { width: 11px; height: 11px; }
  .cat-meta-row .cat-horario { margin-top: 0; white-space: nowrap; font-size: .68rem; }

  /* Catalog body */
  .catalog-body { padding: 20px 14px; }
  .catalog-products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

  /* Barra de resultados */
  .cat-results-row { flex-wrap: nowrap; gap: 6px; }
  .cat-sort-select { flex: 1; min-width: 0; max-width: 160px; }
  .view-toggle { flex-shrink: 0; }
  .view-btn { width: 34px; height: 34px; border-radius: 7px; }

  /* Store spotlight */
  .store-spotlight { padding: 28px 16px 40px; }
  .spotlight-store-header { padding: 16px 18px; gap: 12px; }
  .spotlight-products-wrap { grid-template-columns: repeat(2, 1fr); }
  .spotlight-footer { padding: 14px 18px; }
  .spotlight-store-name { font-size: 1rem; }

  /* Sellers demo */
  .sellers-demo { padding: 32px 16px; }

  /* WA FAB — dashboard: sobre nav inferior del dash */
  .wa-seller-fab { bottom: calc(74px + env(safe-area-inset-bottom, 0px) + 68px); right: 16px; width: 52px; height: 52px; }
  .wa-seller-fab svg { width: 22px; height: 22px; }

  /* Cart FAB — dashboard */
  .cart-fab { bottom: calc(74px + env(safe-area-inset-bottom, 0px) + 14px); right: 16px; width: 52px; height: 52px; }
  .cart-fab-icon { width: 22px; height: 22px; }

  /* FABs en catálogo público — WA sobre nav inferior */
  #catalog-view .wa-seller-fab { right: 16px; bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 14px); }
  #catalog-view .cart-fab      { right: 16px; bottom: calc(90px + env(safe-area-inset-bottom, 0px) + 62px); }
  .support-fab.fab--catalog    { left: unset !important; right: 16px !important; bottom: calc(90px + env(safe-area-inset-bottom, 0px) + 62px) !important; width: 52px !important; height: 52px !important; }
}

/* ── 600px — modal detalle producto (pantalla completa) ── */
@media (max-width: 600px) {
  #prod-detail-modal {
    align-items: flex-end;
    padding: 0;
  }
  .modal--prod-detail {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 16px 16px 0 0;
    margin: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .pd-layout {
    display: block !important;
    max-height: none;
    overflow: visible;
  }
  .pd-img-col,
  .pd-img-col--square,
  .pd-img-col--portrait {
    width: 100% !important;
    margin: 0 !important;
    display: block !important;
    position: relative;
    height: auto;
    aspect-ratio: 1 / 1;
    max-height: 56vh;
    border-radius: 10px;
    border: 1px solid rgba(15,14,12,.07);
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    overflow: hidden;
  }
  .pd-img-col--portrait { aspect-ratio: 3 / 4; max-height: 62vh; }
  .pd-img-col .pd-carousel { position: absolute; inset: 0; width: 100%; height: 100%; }
  .pd-img-col img,
  .pd-img-col .pd-carousel-img { object-fit: cover; object-position: center; width: 100%; height: 100%; border-radius: 9px; }
  .pd-info-col {
    overflow: visible;
    padding: 10px 13px 18px;
    gap: 7px;
  }
  .pd-name { font-size: 1.25rem; }
  .pd-price { font-size: 1.4rem; }
  .modal--prod-detail .modal-close-btn { top: 10px; right: 12px; width: 30px; height: 30px; font-size: 1rem; }
}

/* ── 580px — modal producto (padding interno) ── */
@media (max-width: 580px) {
  .modal-header { padding: 18px 20px; }
  .product-img-col { padding: 16px 20px 0; }
  .product-fields-col { padding: 16px 20px 8px; }
  .modal--product .modal-footer { padding: 14px 20px; }
}

/* ── 480px — móvil mediano ── */
@media (max-width: 480px) {
  /* Error */
  .error-actions { flex-direction: column; width: 100%; max-width: 280px; }
  .error-actions .btn { width: 100%; text-align: center; }

/* Landing nav — logo arriba, botones abajo */
  .nav { flex-wrap: wrap; padding: 10px 14px; }
  .nav-actions { width: 100%; gap: 8px; }
  .nav-actions .btn { flex: 1; text-align: center; }

  /* Dashboard plan badges — ya ocultos en 700px */
  #dash-plan-chip, #dash-plan-pending, #dash-plan-expires { display: none !important; }

  /* Modal producto */
  .modal-header { padding: 16px 18px; }
  .product-img-col { padding: 14px 18px 0; }
  .product-img-col .img-upload-area { aspect-ratio: 1/1; }
  .product-fields-col { padding: 14px 18px; }
  .modal--product .modal-footer { padding: 12px 18px; }
}

/* ── 380px — móvil pequeño ── */
@media (max-width: 380px) {
  .dash-view-label  { display: none; }
  /* Bottom nav: mantener etiquetas visibles aunque la pantalla sea pequeña */
  #dashboard .dash-nav .dash-view-label,
  #dashboard .dash-nav .dash-bnav-label { display: block; font-size: .52rem; }
  .mock-chip        { display: none; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; text-align: center; }
  .emoji-picker { grid-template-columns: repeat(5, 1fr); }
  .products-grid { grid-template-columns: 1fr; }
  .catalog-products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cat-product-body { padding: 10px; }
  .cat-product-name { font-size: .82rem; }
  .cat-product-desc { font-size: .75rem; -webkit-line-clamp: 2; line-clamp: 2; }
  .cat-product-price { font-size: .9rem; }
  .cat-search-input { font-size: .82rem; }

  /* Nav catálogo público — móvil */
  .cat-top-nav            { padding: 0; }
  .cat-top-nav-row        { padding: 0 10px; height: 42px; }
  .cat-top-nav-logo       { font-size: .58rem; letter-spacing: .03em; }
  .cat-top-nav-actions    { gap: 5px; }
  .cat-nav-btn            { padding: 5px 9px; font-size: .73rem; }
  .cat-top-nav .cat-chips,
  .cat-top-nav .cat-tag-chips { padding: 0 10px; }

  /* Spotlight footer — móvil */
  .spotlight-footer       { padding: 10px 14px; gap: 8px; }
  .spotlight-nav-btn      { width: 34px; height: 34px; font-size: 1.2rem; }
  .spotlight-dots         { gap: 4px; }
  .spotlight-dot          { width: 5px; height: 5px; }
  #spotlight-cta.btn-sm   { padding: 4px 8px; font-size: .66rem; max-width: 90px; line-height: 1.3; white-space: normal; text-align: center; }
}

/* ── Modal Ajustes — móvil bottom-sheet ── */
@media (max-width: 520px) {
  #settings-modal {
    align-items: flex-end;
    padding: 0;
  }
  #settings-modal .modal--settings {
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }
  .settings-body { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .settings-section { padding: 0 18px; }
  .settings-section + .settings-section { padding-top: 14px; margin-top: 6px; }
  .settings-section-title { font-size: .68rem; margin-bottom: 10px; }
  .settings-row { padding: 12px 0; gap: 10px; }
  .settings-row-label { font-size: .87rem; }
  .settings-row-sub   { font-size: .74rem; }
  .settings-select { font-size: .84rem; min-width: 80px; }
  .settings-wa-no-number { font-size: .75rem; padding: 7px 10px; }
}

/* ── Soporte chat — móvil (vendedor) ── */
@media (max-width: 600px) {
  .support-drawer {
    max-height: 92dvh;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }
  .support-drawer-header { padding: 13px 16px; }
  .support-messages      { padding: 10px 10px 4px; gap: 8px; }
  .support-welcome       { padding: 10px 12px; gap: 7px; }
  .support-welcome-icon  { font-size: 1.1rem; }
  .support-welcome-text  { font-size: .8rem; }
  .support-bubble        { font-size: .84rem; padding: 8px 11px; max-width: 88%; }
  .support-bubble-meta   { font-size: .6rem; }
  .support-input-row     { padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 7px; }
  .support-input         { font-size: .88rem; padding: 9px 11px; }
  .support-send-btn      { width: 38px; height: 38px; }
}

/* ── Tarjetas de producto horizontales — móvil ── */
@media (max-width: 520px) {
  .pc-left-col  { width: 130px; }
  .pc-img-col   { height: 100px; }
  .pc-img--emoji { font-size: 2rem; }

  .pc-details-col { padding: 8px 9px; gap: 3px; }
  .pc-name    { font-size: .8rem; }
  .pc-price   { font-size: .88rem; }
  .pc-desc    { -webkit-line-clamp: 1; line-clamp: 1; }
  .pc-code, .pc-cat-chip { font-size: .62rem; }

  .pc-state-col { padding: 8px 8px; gap: 1px; }
  .pc-state-label { font-size: .57rem; }
  .pc-t-label  { font-size: .62rem; }
  .pc-t-icon   { width: 22px; height: 22px; }
  .pc-tag-icon { width: 20px; height: 20px; }

  /* Reducir padding en móvil */
  .pc-vis-block  { padding-right: 6px; }
  .pc-tags-block { padding-left: 6px; }
  .pc-block-foot {
    padding-top: 4px;
    flex-direction: row;
    gap: 4px;
  }
  .pc-block-foot .pc-act-btn {
    flex: 1;
    width: auto;
    height: 28px;
    padding: 0 4px;
    justify-content: center;
    gap: 3px;
    font-size: .66rem;
  }
  .pc-block-foot .prod-menu-wrap { flex: 1; display: flex; }
  .pc-block-foot .prod-menu-wrap .pc-act-btn { width: 100%; }
  .pc-act-label { flex: unset; }
  .pc-tags-grid {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .prod-mini-toggle { width: 28px; height: 16px; }
  .prod-mini-track::before { width: 10px; height: 10px; }
  .prod-mini-toggle input:checked + .prod-mini-track::before { transform: translateX(12px); }

  .pc-act-btn { width: 26px; height: 24px; font-size: .76rem; border-radius: 6px; }
  .pc-sep     { margin: 3px 0; }

  .prod-menu-dropdown { right: auto; left: 0; min-width: 200px; }
}

