/* Navegação Mobile PWA Nativo — Fabinho Prime */
@media (min-width: 768px) {
  #pwa-bottom-nav,
  #pwa-more-backdrop,
  #pwa-more-sheet {
    display: none !important;
  }
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 10px)) !important;
  }

  #pwa-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: calc(58px + env(safe-area-inset-bottom, 10px));
    padding-bottom: env(safe-area-inset-bottom, 10px);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  .pwa-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.1s ease;
    position: relative;
    font-family: inherit;
  }

  .pwa-nav-btn:active {
    transform: scale(0.92);
  }

  .pwa-nav-icon {
    position: relative;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
  }

  .pwa-nav-icon svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    transition: transform 0.15s ease, stroke 0.15s ease;
  }

  .pwa-nav-btn.active {
    color: #00afcd;
    font-weight: 600;
  }

  .pwa-nav-btn.active .pwa-nav-icon svg {
    transform: scale(1.1);
    stroke: #00afcd;
  }

  .pwa-nav-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    height: 16px;
    min-width: 16px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
    line-height: 1;
  }

  /* Sheet Drawer "Mais" */
  #pwa-more-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  #pwa-more-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  #pwa-more-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    padding: 12px 18px calc(24px + env(safe-area-inset-bottom, 14px));
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
    max-height: 85vh;
    overflow-y: auto;
    color: #1e293b;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
  }

  #pwa-more-sheet.open {
    transform: translateY(0);
  }

  .pwa-sheet-handle {
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 999px;
    margin: 4px auto 14px;
  }

  .pwa-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 12px;
  }

  .pwa-sheet-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
  }

  .pwa-sheet-close {
    background: #f1f5f9;
    border: none;
    border-radius: 999px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
  }

  .pwa-sheet-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .pwa-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    transition: background 0.15s ease, transform 0.1s ease;
  }

  .pwa-sheet-item:active {
    background: #e2e8f0;
    transform: scale(0.98);
  }

  .pwa-sheet-item svg.icon {
    width: 20px;
    height: 20px;
    stroke: #00afcd;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
  }

  .pwa-sheet-item .pwa-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .pwa-sheet-item .pwa-item-label {
    font-weight: 600;
    color: #0f172a;
  }

  .pwa-sheet-item .pwa-item-desc {
    font-size: 11px;
    color: #64748b;
  }

  .pwa-sheet-item svg.chevron {
    width: 16px;
    height: 16px;
    stroke: #94a3b8;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
  }

  .pwa-sheet-highlight {
    background: linear-gradient(135deg, rgba(0, 175, 205, 0.08), rgba(255, 175, 0, 0.08));
    border-color: rgba(0, 175, 205, 0.2);
  }

  /* Card flutuante de instalação do App acima da barra de navegação PWA */
  .pwa-install-dialog,
  .fixed.inset-x-3.bottom-4,
  .fixed.inset-x-3.z-\[1000\],
  div[class*="fixed inset-x-3"][class*="max-w-sm"] {
    bottom: calc(72px + env(safe-area-inset-bottom, 10px)) !important;
    z-index: 9995 !important;
  }

  /* 1. Remove botão hambúrguer no mobile */
  header button.md\:hidden,
  header button[class*="md:hidden"] {
    display: none !important;
  }

  /* 2. Remove faixa fixa do topo (banner de cupom antigo) */
  header > div.text-center,
  header > div[style*="linear-gradient"] {
    display: none !important;
  }

  /* 3. Nas rotas internas (/carrinho, /checkout, /meus-pedidos, /wishlist, /login):
     oculta a barra de busca e o carrossel de categorias redundantes do header */
  body.pwa-focused-page header .md\:hidden.px-4.pb-3,
  body.pwa-focused-page header > div.border-t.bg-white {
    display: none !important;
  }

  /* 4. Em /carrinho e /checkout, oculta o header de vitrine do site no mobile
     para dar lugar ao cabeçalho nativo da tela com botão voltar */
  body[data-pwa-route="/carrinho"] header,
  body[data-pwa-route="/checkout"] header {
    display: none !important;
  }

  /* Cabeçalho nativo do carrinho fixo no topo com sombra suave estilo app */
  body[data-pwa-route="/carrinho"] main > div > div:first-child {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  }

  /* Respiro inferior nas páginas para os botões ficarem livres da barra inferior */
  body[data-pwa-route="/carrinho"] main,
  body[data-pwa-route="/checkout"] main,
  body[data-pwa-route="/meus-pedidos"] main,
  body[data-pwa-route="/wishlist"] main {
    padding-bottom: 30px;
  }
}

/* 5. Estilos do Pop-up / Comunicado Notícia */
#pwa-noticia-modal {
  position: fixed;
  inset: 0;
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: pwaFadeIn 0.2s ease-out;
}

#pwa-noticia-modal.closing {
  animation: pwaFadeOut 0.2s ease-in forwards;
}

.pwa-noticia-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.pwa-noticia-card {
  position: relative;
  background: #ffffff;
  border-radius: 20px;
  max-width: 400px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 1;
  animation: pwaScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-noticia-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s ease;
}

.pwa-noticia-close:hover {
  background: rgba(0, 0, 0, 0.45);
}

.pwa-noticia-img-wrap {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  background: #f1f5f9;
}

.pwa-noticia-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pwa-noticia-body {
  padding: 20px;
  text-align: center;
}

.pwa-noticia-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}

.pwa-noticia-desc {
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 20px;
}

.pwa-noticia-actions {
  display: flex;
  gap: 10px;
}

.pwa-noticia-btn-cta {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #00afcd, #0092ab);
  color: #ffffff;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 175, 205, 0.25);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.pwa-noticia-btn-cta:hover {
  filter: brightness(1.05);
}

.pwa-noticia-btn-cta:active {
  transform: scale(0.98);
}

@keyframes pwaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pwaFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes pwaScaleUp {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   RODAPÉ MOBILE MODERNO & BENCHMARK E-COMMERCE (MERCADO LIVRE / SHOPEE / AMAZON)
   ========================================================================== */

footer {
  background: linear-gradient(180deg, #0f172a 0%, #090d16 100%) !important;
  color: #94a3b8 !important;
  position: relative;
  border-top: 1px solid #1e293b;
}

/* Botão suave Voltar ao Início no topo do Footer */
.pwa-back-to-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.pwa-back-to-top:hover {
  background: #273549;
  color: #ffffff;
}

.pwa-back-to-top:active {
  background: #0f172a;
}

/* Faixa de Confiança (Trust Strip / Pilares da Compra) */
.pwa-trust-strip {
  border-bottom: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.6);
  padding: 20px 16px;
}

.pwa-trust-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .pwa-trust-container {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 16px;
  }
}

.pwa-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
}

.pwa-trust-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 175, 205, 0.12);
  color: #00afcd;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-trust-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pwa-trust-text strong {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-trust-text span {
  font-size: 10px;
  color: #94a3b8;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Seção de Pagamentos & Segurança no Footer */
.pwa-footer-payments {
  margin: 24px 0;
  padding: 20px 0;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

@media (min-width: 768px) {
  .pwa-footer-payments {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    flex-wrap: wrap;
  }
}

.pwa-payments-wrap,
.pwa-security-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

@media (min-width: 768px) {
  .pwa-payments-wrap,
  .pwa-security-wrap {
    align-items: flex-start;
  }
}

.pwa-payments-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #cbd5e1;
}

.pwa-payment-badges,
.pwa-security-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pwa-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.pwa-badge-pix {
  background: rgba(0, 175, 205, 0.15);
  border-color: rgba(0, 175, 205, 0.4);
  color: #38bdf8;
}

.pwa-badge-ssl {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.pwa-badge-secure {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #60a5fa;
}

.pwa-cnpj-info {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: #64748b;
  padding-top: 8px;
}

/* Ajustes finos do conteúdo padrão do rodapé */
footer h4 {
  color: #f8fafc !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  margin-bottom: 12px !important;
  letter-spacing: 0.02em;
}

footer a {
  color: #94a3b8 !important;
  transition: color 0.15s ease, opacity 0.15s ease;
}

footer a:hover {
  color: #38bdf8 !important;
  opacity: 1 !important;
}

footer ul {
  line-height: 1.8;
}

/* Espaçamento Mobile Safe Area para não conflitar com a barra PWA */
@media (max-width: 767px) {
  footer {
    padding-top: 0 !important;
    padding-bottom: calc(85px + env(safe-area-inset-bottom, 15px)) !important;
  }

  footer .max-w-7xl {
    padding-top: 24px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  footer .grid {
    gap: 20px 12px !important;
  }

  footer ul li {
    font-size: 13px !important;
  }
}

/* ==========================================================================
   CARROSSEL DE CATEGORIAS DO HEADER — ESTILO APP NATIVO & ANIMAÇÃO
   ========================================================================== */

.pwa-category-carousel {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px !important;
}

.pwa-cat-tab {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 6px 14px !important;
  border-radius: 9999px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  color: #475569 !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
}

.pwa-cat-tab:hover {
  color: #00afcd !important;
  background: rgba(0, 175, 205, 0.08) !important;
  border-color: rgba(0, 175, 205, 0.3) !important;
  transform: translateY(-1px) !important;
}

.pwa-cat-tab:active {
  transform: scale(0.92) !important;
}

/* Categoria Selecionada / Ativa: Brilho Máximo! */
.pwa-cat-tab.active {
  background: linear-gradient(135deg, #00afcd 0%, #0092ab 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: transparent !important;
  box-shadow: 0 3px 12px rgba(0, 175, 205, 0.35) !important;
  transform: scale(1.04) !important;
  animation: pwaCatPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@keyframes pwaCatPop {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1.04); }
}
