/* ============================================================
   BoiZap — Central de Ajuda PWA V1
   Camada visual independente das regras de negócio.
   ============================================================ */

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 360;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(44, 31, 16, .48);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.help-overlay.open {
  display: flex;
}

.help-sheet {
  width: min(100%, 430px);
  max-height: min(88vh, 760px);
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -16px 50px rgba(61, 38, 24, .22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: helpSlideUp .22s ease-out;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

@keyframes helpSlideUp {
  from { transform: translateY(22px); opacity: .75; }
  to { transform: translateY(0); opacity: 1; }
}

.help-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--muted);
  margin: 10px auto 4px;
  flex-shrink: 0;
}

.help-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.help-back,
.help-close {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--secondary);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  font-size: 20px;
  flex-shrink: 0;
}

.help-back[hidden] {
  visibility: hidden;
  display: flex !important;
}

.help-title-wrap {
  flex: 1;
  min-width: 0;
}

.help-kicker {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: 2px;
}

.help-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  line-height: 1.2;
  color: var(--fg);
  margin: 0;
}

.help-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 18px 22px;
  scrollbar-width: none;
}

.help-body::-webkit-scrollbar {
  display: none;
}

.help-intro {
  background: linear-gradient(145deg, #3D2618, #4E311D);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.help-intro::after {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  right: -42px;
  top: -42px;
  background: rgba(228, 176, 60, .16);
  filter: blur(6px);
}

.help-intro strong {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 16px;
  position: relative;
  z-index: 1;
}

.help-intro p {
  margin: 5px 0 0;
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.help-category {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: left;
  cursor: pointer;
  min-height: 108px;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(61, 38, 24, .04);
  transition: transform .14s, box-shadow .14s, border-color .14s;
}

.help-category:active {
  transform: scale(.985);
}

.help-category-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 8px;
}

.help-category-title {
  display: block;
  color: var(--fg);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 800;
}

.help-category-sub {
  display: block;
  color: var(--muted-fg);
  font-size: 10px;
  line-height: 1.35;
  margin-top: 4px;
}

.help-section-intro {
  color: var(--muted-fg);
  font-size: 12px;
  line-height: 1.55;
  margin: 0 2px 13px;
}

.help-item-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.help-item {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 15px;
  overflow: hidden;
}

.help-item-main {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 13px 14px;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  font-family: inherit;
}

.help-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(228,176,60,.14);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 17px;
}

.help-item-copy {
  flex: 1;
  min-width: 0;
}

.help-item-title {
  color: var(--fg);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.help-item-desc {
  color: var(--muted-fg);
  font-size: 11px;
  line-height: 1.45;
  margin-top: 2px;
}

.help-detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.help-detail-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--fg);
  margin-bottom: 9px;
}

.help-detail-text {
  color: var(--muted-fg);
  font-size: 13px;
  line-height: 1.6;
}

.help-example {
  margin-top: 14px;
  border-radius: 14px;
  padding: 13px 14px;
  background: rgba(228, 176, 60, .12);
  border: 1px solid rgba(228, 176, 60, .32);
}

.help-example-label {
  color: var(--muted-fg);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 5px;
}

.help-example-text {
  color: var(--fg);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.help-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.help-primary,
.help-secondary {
  width: 100%;
  border-radius: 13px;
  padding: 13px 14px;
  border: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.help-primary {
  background: var(--primary);
  color: var(--primary-fg);
}

.help-secondary {
  background: var(--secondary);
  color: var(--fg);
}

.help-note {
  color: var(--muted-fg);
  font-size: 10px;
  line-height: 1.5;
  margin-top: 12px;
  text-align: center;
}

@media (min-width: 768px) {
  .help-overlay {
    align-items: center;
  }

  .help-sheet {
    width: 520px;
    max-height: 82vh;
    border-radius: 24px;
    padding-bottom: 0;
  }

  .help-handle {
    display: none;
  }
}

@media (max-width: 360px) {
  .help-grid {
    grid-template-columns: 1fr;
  }

  .help-category {
    min-height: auto;
  }
}
