/* ===== Axé de Quitéria — Loja: Mobile PWA Styles ===== */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tab-h: 58px;
}

/* ─── Bottom Tab Bar ─── */
.lj-bottom-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: none;
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(44,30,20,.08);
}

/* Tab item button */
.lj-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .1s;
}
.lj-tab-item:active { opacity: .6; }

.lj-tab-label {
  font-family: 'Mulish', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
  transition: color .15s;
}
.lj-tab-item.active .lj-tab-label { color: var(--clay); }
.lj-tab-item.active svg { color: var(--clay) !important; }
.lj-tab-icon { color: var(--muted); transition: color .15s; }

/* Cart badge on tab */
.lj-tab-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

/* ─── Mobile Header ─── */
.lj-mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245,237,225,.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  height: 54px;
  align-items: center;
  gap: 10px;
  padding-top: var(--safe-top);
  box-sizing: content-box;
}
.lj-mobile-header-title {
  flex: 1;
  font-family: 'Marcellus', serif;
  font-size: 18px;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lj-mobile-back-btn {
  background: none;
  border: none;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--clay);
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: 'Mulish', sans-serif;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  min-width: 48px;
}
.lj-mobile-header-action {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  min-width: 40px;
  justify-content: center;
}

/* ─── Content padding on mobile (space for bottom tabs) ─── */
@media (max-width: 768px) {
  .lj-content {
    padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 8px);
  }
}

/* ─── Show mobile elements on small screens ─── */
@media (max-width: 768px) {
  .lj-bottom-tabs { display: flex; }
  .lj-mobile-header { display: flex; }
  .lj-desktop-header { display: none !important; }
  .lj-announce-bar { display: none !important; }
  .lj-footer { display: none !important; }
}

/* ─── WhatsApp button above tab bar on mobile ─── */
@media (max-width: 768px) {
  .lj-wa-btn {
    bottom: calc(var(--tab-h) + var(--safe-bottom) + 14px) !important;
  }
  .lj-toast {
    bottom: calc(var(--tab-h) + var(--safe-bottom) + 20px) !important;
  }
}

/* ─── Side Menu Drawer (left slide-in) ─── */
.lj-side-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
}
.lj-side-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44,30,20,.52);
}
.lj-side-drawer {
  position: relative;
  width: min(310px, 85vw);
  height: 100%;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 40px rgba(0,0,0,.18);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: lj-slide-in-left .25s cubic-bezier(.2,.9,.3,1);
}
@keyframes lj-slide-in-left {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
.lj-drawer-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  padding: 17px 20px;
  text-align: left;
  font-family: 'Mulish', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.lj-drawer-nav-btn:active { background: var(--cream-2); }

/* ─── Mobile hamburger button ─── */
.lj-mobile-menu-btn {
  background: none;
  border: none;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  min-width: 40px;
}

/* ─── Home: hide desktop hero, show mobile card hero ─── */
.lj-m-hero { display: none; }
@media (max-width: 768px) {
  .hero-grid  { display: none !important; }
  .lj-m-hero  { display: block; padding: 12px 16px 4px; }
}
.lj-m-hero-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.lj-m-hero-img {
  aspect-ratio: 3/4;
  background: repeating-linear-gradient(135deg, var(--cream-2) 0 14px, var(--cream-3) 14px 28px);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  position: relative;
}
.lj-m-hero-img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.lj-m-hero-text {
  background: var(--clay);
  color: var(--cream);
  padding: 20px 20px 24px;
}
.lj-m-hero-eyebrow {
  font-family: 'Marcellus SC', serif;
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--gold-soft);
}
.lj-m-hero-title {
  font-family: 'Marcellus', serif;
  font-size: 24px;
  line-height: 1.12;
  font-weight: 400;
  margin: 10px 0 16px;
}
.lj-m-hero-cta {
  background: var(--cream);
  color: var(--clay-deep);
  border: none;
  border-radius: 999px;
  padding: 13px 24px;
  font-family: 'Mulish', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Trust strip: ticker animado no mobile ─── */
.lj-m-trust {
  display: none;
  overflow: hidden;
  padding: 12px 0 4px;
}
.lj-m-trust-track {
  display: flex;
  width: max-content;
  animation: lj-trust-ticker 20s linear infinite;
}
@keyframes lj-trust-ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.lj-m-trust-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  font-family: 'Mulish', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--clay);
  white-space: nowrap;
  letter-spacing: .02em;
}
.lj-m-trust-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-soft);
  flex-shrink: 0;
}
.lj-trust-desktop { display: flex; }
@media (max-width: 768px) {
  .lj-trust-desktop { display: none !important; }
  .lj-m-trust { display: block; }
}

/* ─── "Escolha pela sua linha": circles on mobile ─── */
.lj-m-lines { display: none; padding: 14px 0 6px; }
.lj-lines-desktop { display: block; }
.lj-m-lines-arrow { display: none; }
@media (max-width: 768px) {
  .lj-lines-desktop { display: none !important; }
  .lj-m-lines { display: block; }
  .lj-m-lines-scroll {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 0 36px 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .lj-m-lines-scroll::-webkit-scrollbar { display: none; }
  .lj-m-lines-arrow {
    display: flex;
    position: absolute;
    top: 28px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--line);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    color: var(--clay);
    z-index: 3;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
  }
  .lj-m-lines-arrow-l { left: 4px; }
  .lj-m-lines-arrow-r { right: 4px; }
}
.lj-m-line-item {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 72px;
  -webkit-tap-highlight-color: transparent;
}
.lj-m-line-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--line);
  flex: none;
}
.lj-m-line-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
  font-family: 'Mulish', sans-serif;
}

/* ─── Listing: zeroing double-padding, grid 2 colunas ─── */
@media (max-width: 768px) {
  /* Remove padding inline do <main> — cada filho controla o seu */
  .lj-listing-main {
    padding: 0 !important;
  }
  .lj-listing-header {
    padding: 20px 16px 0 !important;
  }
  .lj-listing-header h1 { font-size: 26px !important; }

  /* Chips: scroll horizontal */
  .lj-listing-chips {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 14px 16px 6px !important;
    gap: 8px !important;
    margin: 0 !important;
  }
  .lj-listing-chips::-webkit-scrollbar { display: none; }
  .lj-listing-chips > button { flex-shrink: 0; }

  /* Parágrafo "N peças" e filtro de linha */
  .lj-listing-main > p,
  .lj-listing-filter { padding-left: 16px; padding-right: 16px; }

  /* Grid 2 colunas — sem duplo padding */
  .lj-listing-grid {
    grid-template-columns: repeat(2,1fr) !important;
    gap: 12px !important;
    padding: 0 16px 24px !important;
  }
  /* Evita grid blowout: itens podem encolher abaixo do conteúdo */
  .lj-listing-grid > * {
    min-width: 0;
    overflow: hidden;
  }
}

/* ─── Product screen: single-column + fixed CTA on mobile ─── */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
  }
  .lj-prod-back { display: none !important; }
  .lj-prod-desktop-cta { display: none !important; }
  .lj-prod-cta-fixed { display: flex !important; }
  .lj-prod-image-wrap {
    margin: 0 0 16px;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
  }
  .lj-prod-info { padding: 0 16px; }
  .lj-prod-thumbs { padding: 0 16px !important; }
  .lj-prod-related { padding: 0 16px !important; }
}

/* ─── Product: fixed CTA bar (acima da tab bar) ─── */
.lj-prod-cta-fixed {
  display: none;
  position: fixed;
  bottom: calc(var(--tab-h) + var(--safe-bottom));
  left: 0;
  right: 0;
  z-index: 45;
  background: rgba(251,246,238,.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  gap: 10px;
  align-items: center;
}

/* ─── Product content padding for fixed CTA ─── */
@media (max-width: 768px) {
  .lj-prod-content-pad {
    padding-bottom: calc(80px + var(--safe-bottom));
  }
}

/* ─── Checkout: single column on mobile ─── */
@media (max-width: 768px) {
  .checkout-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .checkout-aside { position: static !important; }
  main[style*="padding:'40px 24px"] { padding: 20px 16px 24px !important; }
  .lj-checkout-title { font-size: 26px !important; }
  .lj-checkout-grid-2 { grid-template-columns: 1fr !important; gap: 10px !important; }
}

/* ─── Account screen: mobile layout ─── */
.lj-account-mobile { display: none; }
.lj-account-desktop { display: block; }
@media (max-width: 768px) {
  .lj-account-desktop { display: none !important; }
  .lj-account-mobile  { display: block; }
  .account-grid { grid-template-columns: 1fr !important; }
  .account-sidebar { display: none !important; }
}

/* ─── Cart screen on mobile: full page ─── */
@media (max-width: 768px) {
  .lj-cart-page {
    min-height: 100dvh;
    padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 16px);
  }
}

/* ─── Product grid: 2 columns on mobile ─── */
@media (max-width: 768px) {
  .lj-prod-grid {
    grid-template-columns: repeat(2,1fr) !important;
    gap: 14px !important;
    padding: 12px 16px !important;
  }
  .lj-prod-grid > * { min-width: 0; overflow: hidden; }
}

/* ─── Featured section tighter on mobile ─── */
@media (max-width: 768px) {
  .lj-featured-section { padding: 16px 16px !important; }
  .lj-featured-section h2 { font-size: 22px !important; }
}

/* ─── Product: heart overlay on image (mobile) ─── */
.lj-prod-img-fav { display: none; }
@media (max-width: 768px) {
  .lj-prod-img-fav {
    display: flex;
    position: absolute;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 10px rgba(0,0,0,.14);
    -webkit-tap-highlight-color: transparent;
  }
}

/* ─── Sobre: desktop vs mobile ─── */
.lj-sobre-desktop { display: block; }
.lj-m-sobre { display: none; }
@media (max-width: 768px) {
  .lj-sobre-desktop { display: none !important; }
  .lj-m-sobre { display: block; }
}

/* ─── Prevent pull-to-refresh bounce on iOS ─── */
body.lj-pwa {
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
