/* app-mobile-category.css — SOLO categoría (body.page-category) y SOLO móvil (<=768px). */
@media (max-width: 768px) {

  body.page-category #header,
  body.page-category .header-nav,
  body.page-category #left-column.sidebar {
    display: none !important;
  }

  /* El footer NO se oculta con display:none: el widget del chat vive
     dentro de él en el DOM y display:none apaga sus descendientes
     position:fixed. Se oculta solo visualmente. */
  #footer.footer-container {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  body.page-category {
    padding-top: 56px;
    padding-bottom: 64px;
  }

  body.page-category #content-wrapper,
  body.page-category #left-column + #content-wrapper,
  body.page-category .col-lg-12.col-xs-12 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
  }

  /* ---------- Subcategorías: grid premium ---------- */
  body.page-category #subcategories .row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    padding: 0 12px;
    margin: 0 !important;
  }
  body.page-category .subcategory-block {
    width: 100% !important; max-width: 100% !important; flex: none !important; padding: 0 !important;
  }
  body.page-category .subcategory-image {
    border-radius: 16px; overflow: hidden; background: #f1f5f9; aspect-ratio: 1/1;
  }
  body.page-category .subcategory-image img { width: 100%; height: 100%; object-fit: cover; }
  body.page-category .subcategory-meta { text-align: center; padding-top: 6px; }
  body.page-category .subcategory-name { font-size: 11px; font-weight: 700; color: #16324a; margin: 0; }
  body.page-category .subcategory-description { display: none !important; }

  /* ---------- Grid de productos: restyle en el sitio (sin mover DOM) ---------- */
  body.page-category .product_list.grid > .row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 0 12px;
    margin: 0 !important;
  }
  body.page-category .ajax_block_product {
    width: 100% !important; max-width: 100% !important; flex: none !important; padding: 0 !important;
  }
  body.page-category .thumbnail-container {
    background: #fff; border: 1px solid #eef1f4; border-radius: 14px; padding: 8px;
  }
  body.page-category .product-image { border-radius: 10px; overflow: hidden; aspect-ratio: 1/1; background: #f7f9fb; }
  body.page-category .product-image img { width: 100%; height: 100%; object-fit: contain; }
  body.page-category .quickview,
  body.page-category .functional-buttons,
  body.page-category .product-description-short,
  body.page-category .leo-list-product-reviews,
  body.page-category .box-label:empty {
    display: none !important;
  }
  body.page-category h2.product-title,
  body.page-category .product-title {
    font-size: 12px !important; line-height: 1.3 !important; margin: 6px 0 2px !important;
    height: auto !important; max-height: 31px; overflow: hidden;
    display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  body.page-category .product-title a {
    color: #16324a !important; text-decoration: none !important; line-height: 1.3 !important;
  }
  body.page-category .product-price-and-shipping,
  body.page-category .price {
    font-size: 14px !important; font-weight: 700; color: #0f3f66;
  }

  /* ---------- Cabecera compacta (idéntica a home) ---------- */
  #app-mobile-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1200;
    display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px;
    background: linear-gradient(135deg, #0a1a33 0%, #0f2a52 55%, #163a6b 100%);
    box-shadow: 0 2px 10px rgba(10,26,51,.35);
  }
  #app-mobile-header .amh-logo { display: flex; align-items: center; height: 34px; }
  #app-mobile-header .amh-logo img { height: 34px; width: auto; }
  #app-mobile-header .amh-spacer { flex: 1; }
  #app-mobile-header .amh-icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff;
    border: 0; position: relative; font-size: 18px;
  }
  #app-mobile-header .amh-badge {
    position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 3px;
    border-radius: 8px; background: #ff5a3c; color: #fff; font-size: 10px; line-height: 16px;
    text-align: center; font-weight: 700;
  }
  #app-mobile-header .amh-badge.is-empty { display: none; }

  /* ---------- Barra inferior (idéntica a home) ---------- */
  #app-mobile-bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200;
    display: flex; background: #fff; border-top: 1px solid #eef1f4; box-shadow: 0 -2px 8px rgba(0,0,0,.06);
  }
  #app-mobile-bottomnav .amb-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 8px 0 6px; color: #7c93a8; text-decoration: none; font-size: 10px; font-weight: 600;
    border: 0; background: none; position: relative;
  }
  #app-mobile-bottomnav .amb-item.is-active { color: #0f3f66; }
  #app-mobile-bottomnav .amb-icon { font-size: 19px; line-height: 1; }
  #app-mobile-bottomnav .amb-badge {
    position: absolute; top: 2px; right: calc(50% - 20px); min-width: 15px; height: 15px; padding: 0 3px;
    border-radius: 8px; background: #ff5a3c; color: #fff; font-size: 9px; line-height: 15px; text-align: center; font-weight: 700;
  }
  #app-mobile-bottomnav .amb-badge.is-empty { display: none; }

  /* ---------- Footer minimal (idéntico a home) ---------- */
  .amh-footer-minimal {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 18px 0 12px; margin: 12px 0 0; border-top: 1px solid #eef1f4;
  }
  .amh-footer-minimal img { height: 20px; width: auto; opacity: .85; }
  .amh-footer-minimal .amh-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
  .amh-footer-minimal a { font-size: 10px; color: #9aa8b5; text-decoration: none; }
  .amh-footer-minimal .amh-footer-copy { font-size: 9px; color: #c2cbd3; }

  /* El tamaño/posición del botón del chat se controla globalmente desde footer.tpl */
  .panteraai-grip__card--wa,
  a[href*="wa.me"],
  a[href*="api.whatsapp.com"],
  a[href^="whatsapp://"] {
    display: none !important;
  }
}

@media (min-width: 769px) {
  #app-mobile-header, #app-mobile-bottomnav { display: none !important; }
}
