/* =========================================================
   هم‌تاب (HamTab) — Global Base Styles
   ========================================================= */

@font-face {
  font-family: "Vazirmatn";
  src: local("Vazirmatn");
  font-display: swap;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--color-background);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

img, svg {
  max-width: 100%;
  display: block;
}

img[loading="lazy"] {
  background: var(--color-surface-alt);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

p {
  margin: 0;
}

/* ---- Focus states ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  right: var(--space-4);
  top: -60px;
  background: var(--color-primary);
  color: var(--text-on-primary);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  z-index: 999;
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: var(--space-8);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--space-6);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-cta);
  font-weight: 600;
  font-size: var(--fs-sm);
  margin-bottom: var(--space-3);
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--color-cta);
  border-radius: var(--radius-pill);
}

.section-title {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-3);
}

.section-desc {
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
}

.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--color-accent); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Grid utilities ---- */
.grid {
  display: grid;
  gap: var(--space-5);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex {
  display: flex;
  align-items: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

main {
  min-height: 60vh;
  padding-top: var(--header-height);
}

/* Auth visibility: hide private UI until body classes are set by navigation.js */
[data-auth-only],
[data-admin-only] {
  display: none !important;
}
body.is-logged-in [data-auth-only] {
  display: revert !important;
}
body.is-admin [data-admin-only] {
  display: revert !important;
}
body.is-logged-in [data-guest-only] {
  display: none !important;
}
/* flex/header items need explicit display when shown */
body.is-logged-in .header-actions > [data-auth-only],
body.is-logged-in .main-nav__list > [data-auth-only],
body.is-logged-in .mobile-nav [data-auth-only] {
  display: revert !important;
}
body.is-admin .header-actions > [data-admin-only],
body.is-admin .main-nav__list > [data-admin-only],
body.is-admin .mobile-nav [data-admin-only],
body.is-admin .dash-sidebar [data-admin-only] {
  display: revert !important;
}

/* Dashboard admin sections: only one visible at a time */
body.is-admin .dash-section[data-admin-only] {
  display: none !important;
}
body.is-admin .dash-section[data-admin-only].is-active {
  display: block !important;
}
body.is-admin .dash-admin-block {
  display: block !important;
}
body.is-admin .dash-admin-block a {
  display: block !important;
}
body.is-admin .dash-sidebar a[data-admin-only] {
  display: flex !important;
}



/* Soft elevation for cards/boxes */
.card,
.table-card,
.dash-sidebar,
.pkg-card,
.nb-card,
.admin-table-wrap,
.filters-bar,
.stat-card {
  box-shadow: 0 1px 2px rgba(15, 39, 68, 0.04), 0 8px 24px rgba(15, 39, 68, 0.06) !important;
}
.card:hover,
.pkg-card:hover,
.nb-card:hover {
  box-shadow: 0 4px 12px rgba(15, 39, 68, 0.08), 0 16px 40px rgba(15, 39, 68, 0.08) !important;
}

/* =========================================================
   Exhibition / Booth mode
   ========================================================= */
.booth-chrome {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 9000;
  background: linear-gradient(180deg, rgba(16, 26, 46, 0.92), rgba(16, 26, 46, 0.98));
  color: #fff;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.25);
}
.booth-chrome__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.booth-chrome__badge {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 999px;
  background: #AD5623;
  color: #fff;
}
.booth-chrome__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.booth-chrome__nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}
.booth-chrome__nav a:hover {
  background: rgba(255, 255, 255, 0.2);
}
.booth-chrome__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.booth-chrome__actions .btn {
  min-height: 40px;
}
.booth-chrome__actions .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}
.booth-chrome__actions .btn-ghost {
  color: rgba(255, 255, 255, 0.85);
  background: transparent;
  border: none;
}
body.booth-mode {
  padding-bottom: 72px;
}
/* Larger touch targets in booth — but NEVER break the compact header CTA */
body.booth-mode main .btn,
body.booth-mode main .slot-chip,
body.booth-mode .nav-toggle {
  min-height: 44px;
}
body.booth-mode main .btn-cta:not(.btn-sm),
body.booth-mode main .btn-lg {
  min-height: 52px;
  font-size: 1.05rem;
}
/* Header actions must stay compact and single-line */
.site-header .header-actions .btn {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: var(--fs-xs) !important;
  padding: 9px 16px !important;
  min-height: 36px !important;
  line-height: 1.2;
  max-width: none;
}
.site-header .header-actions .btn-cta {
  font-size: var(--fs-xs) !important;
}
.demo-data-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(173, 86, 35, 0.12);
  color: #AD5623;
  border: 1px solid rgba(173, 86, 35, 0.25);
  margin-bottom: 8px;
}
.has-demo-tag {
  position: relative;
}
@media (max-width: 768px) {
  .booth-chrome__nav {
    width: 100%;
    order: 3;
  }
  .booth-chrome__nav a {
    flex: 1 1 auto;
    justify-content: center;
  }
}
