/* Catálogo e detalhe do produto — mobile premium. Reaproveita home-mobile-premium.css (busca, barra inferior, cards, títulos).
   Tudo dentro de media query ≤768px; desktop intacto. */
@media (max-width: 768px) {
  /* ── Catálogo ── */
  body.catalog-page .top-toolbar-search-wrap { display: none !important; }       /* busca única: a do cabeçalho */
  body.catalog-page .catalog-header-title { font-size: 1.5rem; font-weight: 800; color: #071d34; }
  body.catalog-page .products-catalog-header { padding: .75rem 1rem .25rem; }
  body.catalog-page .catalog-toolbar-row { padding: 0 !important; border: none !important; box-shadow: none !important; background: none !important; margin-top: .5rem; }
  body.catalog-page .catalog-toolbar-row #catalogShowingText { grid-column: 1 / -1; text-align: left !important; background: none; padding: 0; color: #6b7280; font-size: .8rem; order: -1; margin: 0 0 .2rem !important; }

  body.catalog-page .products-grid { gap: 10px !important; padding: 0 .75rem; }
  .products-grid .product-card {
    position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; background: #fff;
    border: 1px solid rgba(16,48,112,.12); border-radius: 16px; box-shadow: 0 6px 16px -12px rgba(7,29,52,.3);
  }
  .products-grid .product-card .product-image { position: relative; height: 150px; padding: .5rem .5rem 0; display: flex; align-items: center; justify-content: center; }
  .products-grid .product-card .product-image img { max-height: 100%; width: 100%; object-fit: contain; }
  .products-grid .product-card .product-info { display: flex; flex-direction: column; flex: 1 1 auto; padding: .5rem .7rem .7rem; gap: 0; min-height: 0; }
  .products-grid .product-card .product-name { font-size: .88rem; line-height: 1.3; min-height: 2.4em; margin: 0 0 .35rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .products-grid .product-card .product-meta-row { display: none; }
  .products-grid .product-card .product-prices { margin-top: auto; min-height: 2.6rem; display: flex; flex-direction: column; justify-content: flex-end; text-align: left; }
  .products-grid .product-card .price-original { font-size: .74rem; line-height: 1.2; color: #8b93a1; }
  .products-grid .product-card .price-value { font-size: 1.02rem; line-height: 1.25; font-weight: 800; color: #071d34; }
  .products-grid .product-card .price-row .discount-badge { display: none; }
  .products-grid .product-card .btn-favorite { top: 8px; right: 8px; }
  .products-grid .card-discount-flag {
    display: inline-flex; position: absolute; top: 8px; left: 8px; z-index: 3; padding: .12rem .38rem; border-radius: 5px;
    background: #ef4444; color: #fff; font-size: .66rem; font-weight: 800;
  }
  .products-grid .btn-card-cart-m {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 38px; margin-top: .55rem; padding: 0 .6rem; gap: .45rem;
    border: none; border-radius: 10px; background: #071d34; color: #fff; font-size: .8rem; font-weight: 700; cursor: pointer;
  }
  .products-grid .btn-card-cart-m i { font-size: .85rem; }
  .products-grid .btn-card-cart-m:active { background: #0d2c52; transform: scale(.98); }

  /* ── Detalhe do produto ── */
  .main-image-container { height: 320px !important; max-height: 320px !important; background: #fff; border-radius: 0; }
  .product-main-image { height: 320px !important; max-height: 320px !important; }
  .product-header .product-thumbnails-wrap {
    order: -1; display: flex !important; align-items: center; width: 100%; padding: .5rem 1rem .25rem; box-sizing: border-box; background: #fff;
  }
  .product-header .thumb-nav-btn { display: none !important; }
  .product-header .product-thumbnails {
    display: flex !important; flex-direction: row; gap: .5rem; overflow-x: auto; overflow-y: hidden; width: 100%; max-height: none;
    scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .product-header .product-thumbnails::-webkit-scrollbar { display: none; }
  .product-header .product-thumbnail {
    flex: 0 0 56px; width: 56px; height: 56px; object-fit: contain; border-radius: 12px; background: #fff; scroll-snap-align: start;
    border: 1px solid rgba(16,48,112,.14); padding: 3px; box-sizing: border-box;
  }
  .product-header .product-thumbnail.active { border: 2px solid #e3b565; padding: 2px; }

  .product-summary-card .product-title { font-size: 1.2rem; font-weight: 800; line-height: 1.3; color: #071d34; }
  .product-summary-card .product-prices .price-value, .product-summary-card .product-prices .price-main { color: #071d34; font-weight: 800; }

  /* ações: primário navy / secundário contornado, coladas ao preço */
  .product-summary-card .product-actions { gap: .6rem; margin-top: .75rem; }
  .btn-buy-now, .product-summary-card .btn-buy-now {
    height: 52px !important; border-radius: 14px !important; background: #071d34 !important; color: #fff !important; font-size: 0 !important; letter-spacing: 0 !important; gap: .6rem;
  }
  .btn-buy-now span { display: none; }
  .btn-buy-now::after { content: "Comprar agora"; font-size: 1rem; font-weight: 800; text-transform: none; color: #fff; }
  .btn-buy-now i { font-size: 1.05rem; }
  .btn-add-cart, .add-cart-inline-row .btn-add-cart {
    height: 50px; border-radius: 14px !important; border: 1.5px solid #071d34 !important; background: #fff !important; color: #071d34 !important;
    font-size: .95rem; font-weight: 800; text-transform: none; letter-spacing: 0;
  }
  .ml-shipping-calc { border-radius: 16px; border: 1px solid rgba(16,48,112,.12); padding: .9rem; margin-top: 1rem; background: #fff; }
  .ml-shipping-button { background: #071d34 !important; color: #fff !important; border-radius: 12px !important; font-weight: 800; }
  .ml-shipping-input { border-radius: 12px !important; }

  /* WhatsApp/chat: menor e fora do caminho do conteúdo (a página ganha respiro no fim) */
  .zdmix-chat-bubble:not(.zdmix-chat-bubble--in-header) { width: 44px !important; height: 44px !important; right: 10px !important; opacity: .92; }
}

/* reforço de especificidade (regras antigas com !important vencem as de cima) */
@media (max-width: 768px) {
  body .product-header .main-image-container { height: 340px !important; min-height: 0 !important; max-height: 340px !important; padding: 0 !important; margin: 0 !important; }
  body .product-header .main-image-container .product-main-image { height: 340px !important; max-height: 340px !important; }
  body .product-header .product-thumbnails-wrap { order: -1 !important; display: flex !important; margin: 0 !important; }
  body .product-header .product-thumbnails { display: flex !important; flex-direction: row !important; }
  body .product-header .image-counter { position: absolute; top: auto; bottom: 10px; right: 14px; left: auto; transform: none; font-size: .75rem; padding: .2rem .55rem; }
  body .btn-add-cart span, body .btn-add-cart { text-transform: none !important; }
  body .btn-add-cart span { font-size: .95rem; font-weight: 800; letter-spacing: 0; }
}

/* ── "Veja também" (produtos relacionados): mesmo padrão dos cards da home, alturas iguais ── */
@media (max-width: 768px) {
  body .related-products-section .category-section-head { padding: 0 1rem; margin: 0 0 .9rem; }
  body .related-products-section .category-section-title { text-transform: none !important; letter-spacing: -.01em; font-size: 1.2rem; font-weight: 800; color: #071d34; }
  body .related-products-section .category-section-title .highlight { color: #3483fa; }
  body .related-products-section .products-carousel { display: flex; align-items: stretch !important; gap: .75rem; padding: .25rem 1rem 1rem; }
  body .related-products-section .products-carousel .product-card {
    align-self: stretch !important; height: auto !important; display: flex; flex-direction: column; overflow: hidden; position: relative;
    border: 1px solid rgba(16,48,112,.12); border-radius: 16px; background: #fff; box-shadow: 0 6px 16px -12px rgba(7,29,52,.3);
  }
  body .related-products-section .products-carousel .product-card .product-image {
    height: 150px !important; min-height: 0 !important; max-height: 150px !important; padding: .5rem .5rem 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
  }
  body .related-products-section .products-carousel .product-card .product-image img {
    width: 100% !important; height: 100% !important; max-height: 100% !important; object-fit: contain !important; object-position: center; padding: 0 !important;
  }
  body .related-products-section .products-carousel .product-card .product-info { flex: 1 1 auto; display: flex; flex-direction: column; }
  body .related-products-section .products-carousel .product-card .product-name { min-height: 2.4em; }
  body .related-products-section .products-carousel .product-card .product-prices { margin-top: auto; }
}

/* ── Metadados do produto: uma linha compacta acima do título (marca · avaliação · vendidos) ── */
@media (max-width: 768px) {
  .product-summary-card .product-meta-row {
    display: flex !important; flex-wrap: wrap !important; align-items: center; justify-content: flex-start !important; gap: .15rem .45rem;
    margin: 0 0 .35rem; padding: 0; font-size: .8rem; color: #6b7280; line-height: 1.35;
  }
  /* marca: sem cápsula, texto compacto navy */
  .product-summary-card .product-brand-line {
    display: inline-flex !important; align-items: center; gap: 0; padding: 0 !important; margin: 0 !important; width: auto !important;
    border: none !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; text-decoration: none;
    font-size: .82rem; font-weight: 800; color: #071d34; order: 0;
  }
  .product-summary-card .product-brand-line .product-brand-label { display: none; }
  .product-summary-card .product-brand-line .product-brand-name { color: #071d34; font-weight: 800; text-transform: none; letter-spacing: 0; }
  .product-summary-card .product-brand-line::after { content: "·"; margin-left: .45rem; color: #b8bfcc; font-weight: 700; }
  .product-summary-card .product-rating-badge { order: 1; display: inline-flex; align-items: center; gap: .25rem; padding: 0; margin: 0; background: none; border: none; font-size: .8rem; }
  .product-summary-card .product-rating-badge .product-rating-score { color: #071d34; font-weight: 800; }
  .product-summary-card .product-rating-badge .product-rating-stars i { color: #e3b565; font-size: .72rem; }
  .product-summary-card .product-rating-badge .product-rating-count { color: #6b7280; }
  .product-summary-card .product-sku { order: 2; padding: 0; margin: 0; background: none; border: none; font-size: .8rem; color: #6b7280; font-weight: 500; flex-shrink: 1; white-space: normal; }
  .product-summary-card .product-sku::before { content: "·"; margin-right: .45rem; color: #b8bfcc; font-weight: 700; }
  .product-summary-card .product-title { margin-top: .1rem; }
}
