/* =============================================================
   TELMIN & ENEIDA PRIVATE COLLECTION
   styles_mobile.css — Estilos exclusivos para MOBILE (≤ 768px)

   ATENÇÃO: altere SOMENTE aqui para ajustar layout mobile.
   Desktop → styles_desktop.css
   Tablet  → styles_tablet.css
   ============================================================= */

@media (max-width: 768px) {

  /* ── Hero ─────────────────────────────────────────────────── */
  .hero {
    height: 18vh;
    min-height: 152px;
  }

  .hero-content {
    gap: 6px;
    padding: 0 16px;
  }

  .logo-te {
    width: 58px;
    height: 58px;
  }

  /* ── Controles ────────────────────────────────────────────── */
  .controls-container {
    padding: 6px 12px 0;
  }

  .stats-bar { padding: 1px 0; }

  /* Busca acima, centralizada; menus abaixo */
  .controls-top {
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    margin-top: 2px;
  }

  .search-box {
    width: 100%;
    flex: 0 0 auto;
  }

  /* Menus: centralizados, quebram linha se necessário */
  .combined-menu {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    row-gap: 0;
  }

  .menu-item {
    font-size: 0.78em;
    padding: 4px 8px 12px 8px;
  }

  /* Submenus: respeitam a viewport */
  .submenu {
    max-width: calc(100vw - 24px);
    overflow-x: hidden;
  }

  .submenu > div {
    max-height: min(60vh, 320px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* LOCALIZAÇÃO e ORDENAR: abrem ancorados à direita para não vazar */
  #submenu-local,
  .menu-item[data-menu="ordenar"] .submenu {
    left: auto;
    right: 0;
    transform: none;
  }

  /* LANÇAMENTO: 3 colunas no mobile, TODOS span all */
  #submenu-anos {
    columns: 3;
    column-gap: 0;
    width: 210px;
  }

  #submenu-anos > div { break-inside: avoid; }
  #submenu-anos > div:first-child { column-span: all; }

  /* Modo grid/lista: oculto no mobile */
  .view-mode { display: flex; gap: 6px; }

  /* Shuffle: mesmo tamanho dos outros botões */
  .shuffle-btn, .shuffle-history-btn { font-size: 0.85em; }

  /* ── Prevenção de zoom em inputs no iOS ───────────────────── */
  input, select, textarea { font-size: 16px; }
  .search-input, .filter-select { font-size: 16px; }

  /* ── Botão X de limpar busca ──────────────────────────────── */
  .search-clear { font-size: 16px; }

  /* ── Controles sticky + Linha Dourada 3 ─────────────────────
     Igual ao desktop: controles grudam abaixo do header ao rolar.
     gallery-section::before desativado — border-bottom dos controles assume. */
  .controls {
    position: sticky;
    top: var(--header-height);
    z-index: var(--z-controls);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--gold-primary);
  }

  .gallery-section::before { display: none; }

  /* ── Galeria ─────────────────────────────────────────────── */
  .gallery-section { padding: 10px 8px 24px; }

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

  .pen-image { height: auto; min-height: 130px; }
  .pen-title { font-size: 0.95em; }
  .pen-card .pen-details { display: none; }
  .pen-card .pen-description { display: none; }

  .pen-card .pen-year {
    display: block;
    margin-top: 4px;
    margin-bottom: 6px;
  }

  .pen-badge { font-size: 0.65em; padding: 3px 7px; top: 8px; right: 8px; }
  .pen-content { padding: 10px; }

  .gallery-list .pen-card { flex-direction: column; }
  .gallery-list .pen-image { width: 100%; min-height: 200px; }

  /* ── Modal: bottom sheet ──────────────────────────────────── */
  .modal { align-items: flex-end; padding: 0; }

  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 95vh;
    box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.90);
    animation: sheetSlideUp 0.32s ease-out;
  }

  @keyframes sheetSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  .modal-header { padding: 14px 16px; }
  .modal-header-actions { padding-right: 12px; gap: 2px; }

  .modal-body { padding: 16px; }
  .modal-image { max-height: 55vh; }

  .lightbox-nav { display: none; }
  .lightbox-counter { font-size: 0.9em; }

  /* ── Chips de filtros ativos: mobile — centralizados ────── */
  .active-filters-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: center;
    padding-left: 12px;
    padding-right: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    min-height: 1.8em;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .active-filters-bar::-webkit-scrollbar { display: none; }
  .filter-chip { flex-shrink: 0; font-size: 0.68rem; padding: 2px 7px 2px 9px; }
  .filter-chip-label { max-width: 120px; }

  /* ── Lista de Desejos: mobile ────────────────────────────── */

  /* No mobile o painel sobe como bottom sheet */
  .wishlist-panel {
    width: 100%;
    max-width: 100%;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: translateY(40px);
    border-radius: 18px 18px 0 0;
    max-height: 88vh;
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.22s ease;
  }

  .wishlist-panel.open {
    transform: translateY(0);
    opacity: 1;
    top: auto !important;
    left: 0 !important;
  }

  /* Oculta ícone do botão Exportar no mobile */
  .wl-export-icon { display: none; }

  /* Previne zoom no iOS ao focar inputs */
  .wishlist-input { font-size: 16px; }


  /* ── Histórico: bottom sheet no mobile ───────────────────── */
  .view-hist-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-left: none;
    border-top: 1px solid var(--border-primary);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
  }

  .view-hist-panel.open { transform: translateY(0); }

  /* ── Comparação: full-width no mobile ────────────────────── */
  .compare-overlay { padding: 0; align-items: flex-end; }
  .compare-panel {
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  /* ── Barra de comparação: mais compacta no mobile ────────── */
  .compare-bar { bottom: 16px; padding: 6px 6px 6px 12px; gap: 8px; }
  .compare-bar-count { font-size: 0.72rem; }

  /* ── Botão Exportar PDF no combined-menu ─────────────────── */
  #btnExportPDF {
    font-size: 0.85em;
    padding: 4px 8px 12px 8px;
  }

} /* fim @media mobile portrait */


/* ── Landscape mobile ─────────────────────────────────────── */
@media (max-width: 768px) and (orientation: landscape) {

  /* header permanece sticky — necessário para o sticky dos controles funcionar */
  .hero { height: auto; min-height: 120px; padding-top: 10px; padding-bottom: 10px; }
  .logo-te { width: 44px; height: 44px; }
  .gallery-section { padding-top: 8px; }
  .lightbox-close { top: calc(env(safe-area-inset-top, 0px) + 4px); }

} /* fim @media landscape mobile */
