/* ==========================================================================
   Onda 7 — Mobile First
   Header mobile, drawer, cards 2 col, PDP mobile, checkout mobile.
   ========================================================================== */

@media (max-width: 768px) {

  /* ---------- Header Mobile ---------- */
  .lobo-header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    padding: 0.6rem 0.5rem;
    column-gap: var(--lobo-space-1);
    row-gap: var(--lobo-space-2);
  }

  /* Logo centralizado */
  .lobo-logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin: 0;
  }

  .lobo-logo-image {
    display: block;
    box-sizing: border-box;
    width: auto;
    height: 44px;
    max-width: 108px;
    object-fit: contain;
    background: #ffffff;
    padding: 0.2rem 0.4rem;
    border-radius: var(--lobo-radius-sm);
  }

  .lobo-logo-mark {
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
  }

  .lobo-logo-name {
    font-size: 0.95rem;
  }

  .lobo-logo-name span {
    font-size: 0.7rem;
  }

  /* Busca: apenas icone que expande */
  .lobo-search {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
    margin-top: 0;
  }

  .lobo-search input[type="search"],
  .lobo-search .search-field {
    height: 44px;
    font-size: var(--lobo-text-base);
  }

  .lobo-search button,
  .lobo-search button[type="submit"],
  .lobo-search .wp-element-button {
    height: 44px;
    padding: 0 var(--lobo-space-4);
  }

  /* Acoes compactas */
  .lobo-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    gap: var(--lobo-space-1);
    margin-left: 0;
  }

  .lobo-action {
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .lobo-action svg {
    width: 20px;
    height: 20px;
  }

  /* Nav toggle */
  .lobo-nav-toggle {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    margin-left: 0;
    min-width: 44px;
    min-height: 44px;
    padding: var(--lobo-space-2) var(--lobo-space-3);
    font-size: var(--lobo-text-xs);
    border-color: #3a3a3a;
  }

  .lobo-js .lobo-nav-toggle:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ---------- Nav Drawer ---------- */
  .lobo-nav {
    position: relative;
    z-index: 95;
  }

  .lobo-nav-inner {
    display: flex;
    flex-direction: column;
    padding: var(--lobo-space-2) 1rem var(--lobo-space-4);
    background: #111111;
  }

  .lobo-js .lobo-nav-inner {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: var(--lobo-space-2) 1rem var(--lobo-space-4);
    background: #111111;
    box-shadow: var(--lobo-shadow-lg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transform-origin: top center;
    transition:
      opacity var(--lobo-motion-drawer) var(--lobo-motion-ease-drawer),
      transform var(--lobo-motion-drawer) var(--lobo-motion-ease-drawer),
      visibility 0s linear var(--lobo-motion-drawer);
  }

  .lobo-js .lobo-nav-inner.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .lobo-nav-list,
  .lobo-nav-inner ul {
    flex-direction: column;
    gap: 0;
  }

  .lobo-nav-list li,
  .lobo-nav-inner li {
    border-bottom: 1px solid #232323;
  }

  .lobo-nav a {
    display: block;
    padding: var(--lobo-space-3) var(--lobo-space-2);
    font-size: var(--lobo-text-base);
  }

  /* Dropdown vira lista aberta e recuada dentro do painel do menu */
  .lobo-nav-list .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border-top: 0;
    min-width: 0;
    padding: 0 0 0 1rem;
  }

  .lobo-nav-list .sub-menu li {
    border-bottom: 0;
  }

  /* ---------- Cards de Produto 2 colunas ---------- */
  ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--lobo-space-2) !important;
  }

  ul.products li.product {
    padding: var(--lobo-space-2) !important;
    width: 100% !important;
    margin: 0 !important;
    float: none !important;
  }

  ul.products li.product .woocommerce-loop-product__title {
    font-size: var(--lobo-text-sm);
    min-height: 2.4em;
  }

  ul.products li.product .price ins {
    font-size: var(--lobo-text-lg);
  }

  ul.products li.product .button {
    padding: var(--lobo-space-2) 0 !important;
    font-size: var(--lobo-text-xs);
  }

  /* ---------- PDP Mobile ---------- */
  .single-product div.product .product_title {
    font-size: var(--lobo-text-xl);
  }

  .single-product div.product .price ins {
    font-size: var(--lobo-text-2xl);
  }

  .single-product form.cart {
    position: static;
    display: block;
    background: transparent;
    padding: 0;
    box-shadow: none;
  }

  .single-product form.cart .quantity {
    display: inline-flex;
    vertical-align: middle;
  }

  .single-product form.cart .single_add_to_cart_button {
    min-height: 48px;
    font-size: var(--lobo-text-base) !important;
  }

  .single-product .variations,
  .single-product .variations tbody,
  .single-product .variations tr,
  .single-product .variations th,
  .single-product .variations td {
    display: block;
    width: 100%;
  }

  .single-product .variations select {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  /* Galeria mobile */
  .single-product .woocommerce-product-gallery .flex-control-thumbs li {
    width: 56px !important;
  }

  /* ---------- Checkout Mobile ---------- */
  .woocommerce-checkout .form-row input.input-text,
  .woocommerce-checkout .form-row select,
  .woocommerce-checkout .form-row textarea {
    font-size: 16px; /* Previne zoom no iOS */
    padding: var(--lobo-space-3);
    height: 48px;
  }

  .woocommerce-checkout #place_order {
    font-size: var(--lobo-text-base) !important;
    padding: var(--lobo-space-4) !important;
  }

  /* ---------- Trust Badges mobile ---------- */
  .wp-block-columns.has-4-columns {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: var(--lobo-space-2);
  }

  /* ---------- Footer mobile ---------- */
  .ct-footer .ct-footer-cols {
    flex-direction: column;
    text-align: center;
  }

  /* ---------- Topbar mobile ---------- */
  .lobo-topbar {
    font-size: 0.65rem;
    padding: 0.3rem 0.5rem;
  }
}

/* ---------- Telas muito pequenas (360px) ---------- */
@media (max-width: 380px) {
  ul.products {
    grid-template-columns: 1fr !important;
  }

  .lobo-logo-name {
    font-size: 0.85rem;
  }
}

/* ---------- S01: header compacto ao rolar (só no mobile) ---------- */
/* Medido em 30/08/2026: o header fixo ocupava 117px, ~14% da tela, o tempo
   todo. Rolando para baixo sobra a linha de logo e ícones; ao rolar para
   cima a busca volta, que é quando o cliente costuma querê-la. A classe é
   posta pelo JS (`initHeaderCompacto`) e só tem efeito nesta faixa. */
@media (max-width: 768px) {
  .lobo-header {
    transition: padding 0.18s ease;
  }

  .lobo-header.is-compacto .lobo-header-inner {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    row-gap: 0;
  }

  .lobo-header.is-compacto .lobo-search {
    display: none;
  }

  .lobo-header.is-compacto .lobo-logo-image {
    height: 34px;
    max-width: 88px;
  }
}

/* Quem prefere menos movimento não ganha o encolhimento animado. */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .lobo-header {
    transition: none;
  }
}
