/* ============================================================
 * PT Mobile Tweaks — override CSS solo mobile (<= 520px)
 * Selettori specifici e !important per battere lo stylesheet del tema.
 * ============================================================ */

@media (max-width: 520px) {

  /* 1) Container principali al 100% con padding 10px */
  body .hero-inner,
  body .page-title,
  body .content-band,
  body .category-layout,
  body .detail-hero,
  body .detail-layout,
  body .site-footer {
    width: 100% !important;
    max-width: 100% !important;
    padding-inline: 10px !important;
    box-sizing: border-box !important;
  }

  /* 2) Search panel stessa larghezza dei box bianchi */
  body .search-panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 3) Banner: 100% larghezza, altezza auto, niente aspect-ratio fisso */
  body .ad-band {
    width: 100% !important;
    padding-inline: 10px !important;
    gap: 10px !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }
  body .ad-banner {
    width: 100% !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    height: auto !important;
  }
  body .ad-banner img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* 4) Breadcrumbs font-size 10px */
  body .breadcrumbs,
  body .breadcrumbs a,
  body .breadcrumbs span,
  body .breadcrumbs strong {
    font-size: 10px !important;
  }

  /* 5) Pagina categorie: margine ridotto fra titolo e griglia */
  body .categories-page .category-card-grid {
    margin-top: 6px !important;
  }
  body .categories-page {
    padding-top: 18px !important;
  }
}

/* ============================================================
 * Header sticky (sempre, desktop + mobile)
 * ============================================================ */
body .site-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
}

/* ============================================================
 * Mobile bar (fissa in basso, solo mobile)
 * ============================================================ */
.ptmt-mobilebar { display: none; }

@media (max-width: 520px) {
  .ptmt-mobilebar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    width: 100%;
    max-width: 100vw;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(2, 136, 209, 0.18);
    box-shadow: 0 -6px 18px rgba(2, 136, 209, 0.08);
    box-sizing: border-box;
  }
  .ptmt-mb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    min-height: 52px;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff, #eef9ff);
    border: 1px solid rgba(2, 136, 209, 0.18);
    color: #0288d1;
    text-decoration: none;
    transition: transform 0.12s ease, background 0.12s ease;
  }
  .ptmt-mb-btn:active {
    transform: scale(0.97);
    background: linear-gradient(180deg, #dff2ff, #c5e8fb);
  }
  .ptmt-mb-ico { width: 20px; height: 20px; display: block; color: inherit; }
  .ptmt-mb-ico svg { width: 100%; height: 100%; display: block; }
  .ptmt-mb-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    color: #0288d1;
    text-align: center;
  }

  /* spazio sotto il contenuto per non finire dietro la barra */
  body { padding-bottom: 72px !important; }
}
