/* ── IRANSansX FaNum Font Faces ── */
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansXFaNum_Thin-s.p.3izmzrs8lfx2r.woff') format('woff');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansXFaNum_UltraLight-s.p.1wsutrqkpu_8o.woff') format('woff');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansXFaNum_Light-s.p.23pjbg4oboeg9.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansXFaNum-regular.woff2') format('woff2'),
       url('../fonts/IRANSansXFaNum_Regular-s.p.0hq8rayr2t4ay.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansXFaNum-medium.woff2') format('woff2'),
       url('../fonts/IRANSansXFaNum_Medium-s.p.1cvit1dxp67ye.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansXFaNum_DemiBold-s.p.0_iwk5lhvarir.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansXFaNum-bold.woff2') format('woff2'),
       url('../fonts/IRANSansXFaNum_Bold-s.p.159jv3zlioqg6.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansXFaNum_Heavy-s.p.2s60kgzt8_vzf.woff') format('woff');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANSansX';
  src: url('../fonts/IRANSansXFaNum_Black-s.p.0ogeu9xw2r6bc.woff') format('woff');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ═══════════════════════════════════════════
   CSS VARIABLES
═══════════════════════════════════════════ */
:root {
  --nf-red: #E50914;
  --nf-red-hover: #F40612;
  --nf-dark: #141414;
  --nf-card: #181818;
  --nf-gray: #808080;
  --nf-light: #E5E5E5;
  --nf-header-bg: rgba(20, 20, 20, 0.98);
  --font-en: 'IRANSansX', sans-serif;
  --font-fa: 'IRANSansX', sans-serif;
  --transition: 0.3s ease;
  --header-h: 64px;
  --filter-h: 56px;
  /* FIX: cart bar height variable for safe-area calculations */
  --cart-bar-h: 72px;
}

/* ═══════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  overflow-x: hidden;
  /* FIX: only account for header in scroll-padding; filter can be collapsed */
  scroll-padding-top: calc(var(--header-h) + var(--filter-h) + 1rem);
}

body {
  min-height: 100dvh;
  background: var(--nf-dark);
  color: #fff;
  font-family: var(--font-fa), var(--font-en);
  overflow-x: hidden;
  /* FIX: add bottom padding to prevent content hiding under cart bar */
  padding-bottom: calc(var(--cart-bar-h) + 1.5rem);
  line-height: 1.6;
  /* FIX: safe-area insets for devices with notch/home indicator */
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
body.drawer-open { overflow: hidden; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--nf-gray); border-radius: 999px; }
::selection { background: var(--nf-red); color: #fff; }

@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;
  }
}

/* ── Keyboard accessibility ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.movie-card:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--nf-red);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.nf-header {
  position: sticky;
  top: 0; left: 0; right: 0;
  z-index: 1100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 3.5rem);
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 60%, transparent 100%);
  transition: background 0.4s ease, box-shadow 0.4s ease;
  /* FIX: safe area for sticky header on notched devices */
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
}
.nf-header.scrolled {
  background: var(--nf-header-bg);
  box-shadow: 0 2px 40px rgba(0,0,0,0.7);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  /* FIX: removed overflow:hidden which was clipping the scrollable nav */
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.nf-logo {
  font-family: var(--font-en);
  font-weight: 900;
  font-size: 1.75rem;
  color: var(--nf-red);
  letter-spacing: -1.5px;
  text-decoration: none;
  text-transform: uppercase;
  line-height: 1;
  flex-shrink: 0;
}

/* FIX: nav gets its own scroll container, not clipped by parent */
.nf-nav {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-width: 0;
}
.nf-nav::-webkit-scrollbar { display: none; }
.nf-nav li { flex-shrink: 0; }

.nf-nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-fa);
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
  padding: 0.2rem 0;
  cursor: pointer;
  white-space: nowrap;
}
.nf-nav a:hover { color: #fff; }
.nf-nav a.active { color: #fff; font-weight: 700; }
.nf-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--nf-red);
  border-radius: 2px;
}

.header-left { display: flex; align-items: center; gap: 0.8rem; flex-shrink: 0; }

.mode-pill-header {
  font-family: var(--font-en);
  font-size: 0.68rem;
  padding: 0.28rem 0.7rem;
  border-radius: 4px;
  background: rgba(229,9,20,0.15);
  border: 1px solid rgba(229,9,20,0.3);
  color: #ff6b6b;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-icon-btn {
  background: transparent;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1.2rem;
  /* FIX: minimum 44×44px touch target */
  min-width: 44px;
  min-height: 44px;
  padding: 0.45rem;
  border-radius: 6px;
  transition: all var(--transition);
  position: relative;
  display: grid;
  place-items: center;
}
.header-icon-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.header-icon-btn .notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--nf-red);
  border-radius: 50%;
  border: 2px solid var(--nf-dark);
}

.header-avatar-wrap {
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  /* FIX: minimum touch target */
  min-height: 44px;
}
.nf-avatar {
  width: 34px; height: 34px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--nf-red), #b20710);
  display: grid;
  place-items: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 0.85rem;
  transition: outline var(--transition);
  background-size: cover;
  background-position: center;
}
.header-avatar-wrap:hover .nf-avatar { outline: 1.5px solid #fff; outline-offset: 2px; }
.avatar-arrow {
  font-size: 0.7rem;
  color: #ccc;
  transition: transform var(--transition);
}
.header-avatar-wrap:hover .avatar-arrow { transform: rotate(180deg); }

/* FIX: avatar dropdown positioned correctly for RTL */
.avatar-dropdown {
  position: fixed;
  top: var(--header-h);
  /* RTL: align to right side where avatar is */
  right: clamp(1rem, 3vw, 3.5rem);
  left: auto;
  width: 180px;
  background: rgba(20,20,20,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: all 0.25s ease;
  overflow: hidden;
  z-index: 1200;
}
.avatar-dropdown.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.avatar-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  color: #ccc;
  text-decoration: none;
  font-size: 0.82rem;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.avatar-dropdown a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.avatar-dropdown a:last-child { border-bottom: none; }

/* ═══════════════════════════════════════════
   FILTER BAR — sticky below header
═══════════════════════════════════════════ */
.filter-bar {
  position: sticky;
  top: var(--header-h);
  left: 0; right: 0;
  z-index: 1050;
  background: rgba(20,20,20,0.96);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  /* No transition — filter bar is always visible, never animated */
  /* FIX: allow dropdown children to overflow visually */
  overflow: visible;
}
/* collapsed class is a no-op: filter bar must NEVER hide */
.filter-bar.collapsed {
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  display: block !important;
  visibility: visible !important;
}



.filter-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem clamp(1rem, 3vw, 2rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.filter-search-pro {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  transition: all var(--transition);
}
.filter-search-pro:focus-within {
  border-color: rgba(229,9,20,0.5);
  background: rgba(255,255,255,0.1);
}
.filter-search-pro i { color: var(--nf-red); font-size: 0.9rem; flex-shrink: 0; }
.filter-search-pro input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.85rem;
  font-family: var(--font-fa);
  min-width: 0;
  /* FIX: prevent iOS zoom on focus (font-size >= 16px) */
  font-size: max(0.85rem, 16px);
}
/* Restore visual size while keeping iOS from zooming */
@supports (font-size: max(1rem, 1px)) {
  .filter-search-pro input { font-size: 0.85rem; }
}
.filter-search-pro input::placeholder { color: var(--nf-gray); }

.filter-select-pro {
  padding: 0.5rem 0.9rem;
  padding-inline-start: 1.8rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #ccc;
  font-size: 0.82rem;
  font-family: var(--font-fa);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-width: 120px;
  white-space: nowrap;
  transition: all var(--transition);
}
.filter-select-pro:hover, .filter-select-pro:focus {
  border-color: rgba(229,9,20,0.5);
  background-color: rgba(255,255,255,0.08);
}
.filter-select-pro option { background: #1a1a1a; color: #fff; }

.filter-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--nf-gray);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-fa);
  white-space: nowrap;
}
.filter-reset-btn:hover { border-color: var(--nf-red); color: var(--nf-red); }
/* text label hidden on mobile — icon only */
.filter-reset-btn .reset-label { /* controlled via media query below */ }

.filter-close-btn {
  display: none;
}

.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 0.88rem;
  font-family: var(--font-fa);
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  /* FIX: minimum touch target */
  min-height: 44px;
  border-radius: 6px;
  transition: all var(--transition);
  font-weight: 500;
  white-space: nowrap;
}
.filter-toggle-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.filter-toggle-btn.active { color: var(--nf-red); }
.filter-toggle-btn .badge-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--nf-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font-en);
}

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
.hero-section {
  position: relative;
  height: 82vh;
  min-height: 480px;
  max-height: 800px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transition: opacity 1.5s ease;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, var(--nf-dark) 0%, transparent 45%),
    linear-gradient(90deg, rgba(20,20,20,0.8) 0%, transparent 40%),
    linear-gradient(0deg, rgba(20,20,20,0.4) 0%, transparent 25%);
}
/* FIX: RTL gradient direction */
[dir="rtl"] .hero-bg::after {
  background:
    linear-gradient(0deg, var(--nf-dark) 0%, transparent 45%),
    linear-gradient(270deg, rgba(20,20,20,0.8) 0%, transparent 40%),
    linear-gradient(0deg, rgba(20,20,20,0.4) 0%, transparent 25%);
}
.hero-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 40%, transparent 50%, rgba(0,0,0,0.4) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 5;
  padding: 0 clamp(1.5rem, 4vw, 4rem) 5rem;
  max-width: 650px;
}

/* FIX: hero dots — enlarged touch target via pseudo-element */
.hero-indicators {
  position: absolute;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 0.5rem;
}
.hero-dot {
  position: relative;
  width: 12px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: all 0.4s ease;
  border: none;
}
/* FIX: invisible touch-area enlargement — 44×44px minimum */
.hero-dot::before {
  content: '';
  position: absolute;
  inset: -20px -16px;
}
.hero-dot.active {
  width: 24px;
  background: var(--nf-red);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  background: rgba(229,9,20,0.2);
  border: 1px solid rgba(229,9,20,0.45);
  color: #ff7b7b;
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.hero-title {
  font-family: var(--font-en);
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 1rem;
  text-shadow: 0 4px 40px rgba(0,0,0,0.6);
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.hero-match {
  font-family: var(--font-en);
  color: #46d369;
  font-weight: 700;
  font-size: 0.95rem;
}
.hero-year {
  color: #ccc;
  font-size: 0.88rem;
}
.hero-rating-badge {
  padding: 0.15rem 0.45rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 3px;
  font-family: var(--font-en);
  font-size: 0.7rem;
  font-weight: 700;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--nf-light);
  line-height: 1.75;
  margin-bottom: 1.8rem;
  text-shadow: 0 2px 16px rgba(0,0,0,0.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.8rem;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-fa);
  /* FIX: minimum touch target height */
  min-height: 48px;
}
.btn-hero-play { background: #fff; color: #000; }
.btn-hero-play:hover { background: #ddd; transform: scale(1.03); }
.btn-hero-info { background: rgba(109,109,110,0.55); color: #fff; }
.btn-hero-info:hover { background: rgba(109,109,110,0.35); }

/* ═══════════════════════════════════════════
   MOVIE ROWS
═══════════════════════════════════════════ */
.nf-section { padding: 2rem 0 0.5rem; }
.section-header {
  padding: 0 clamp(1.5rem, 4vw, 4rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.section-title {
  font-family: var(--font-en);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title .accent-bar {
  width: 3px;
  height: 18px;
  background: var(--nf-red);
  border-radius: 2px;
}
.see-all {
  color: var(--nf-gray);
  font-size: 0.8rem;
  text-decoration: none;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
  /* FIX: touch target */
  padding: 0.4rem 0;
}
.see-all:hover { color: #fff; }

.movie-row-wrap {
  position: relative;
  padding: 0;
}
.movie-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 1rem clamp(1.5rem, 4vw, 4rem) 2rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.movie-row::-webkit-scrollbar { display: none; }

/* FIX: scroll fade indicator on right edge (RTL = left edge) to hint scrollability */
.movie-row-wrap::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  /* RTL: fade on the left side (beginning) */
  left: 0;
  width: 40px;
  background: linear-gradient(to right, var(--nf-dark), transparent);
  pointer-events: none;
  z-index: 5;
}

.row-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 100%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #fff;
  background: rgba(20,20,20,0.6);
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 10;
}
.movie-row-wrap:hover .row-scroll-btn { opacity: 1; }
/* FIX: RTL-aware positioning — left/right labels corrected for RTL */
.row-scroll-btn.left { left: 0; border-radius: 0 6px 6px 0; }
.row-scroll-btn.right { right: 0; border-radius: 6px 0 0 6px; }
.row-scroll-btn:hover { background: rgba(20,20,20,0.85); }

/* ═══════════════════════════════════════════
   MOVIE CARD
═══════════════════════════════════════════ */
.movie-card {
  flex: 0 0 185px;
  scroll-snap-align: start;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  background: var(--nf-card);
}
.movie-card:hover {
  transform: scale(1.12);
  z-index: 20;
  box-shadow: 0 16px 48px rgba(0,0,0,0.75);
}
.movie-card:active {
  transform: scale(0.97);
  transition: transform 0.12s ease;
}

.card-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: #1a1a1a;
}

/* FIX: overlay always visible on mobile (touch devices have no hover) */
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.3) 40%, transparent 65%);
  /* Desktop: hidden until hover */
  opacity: 0;
  transition: opacity var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* FIX: z-index above card-price-tag (z-index:3) to prevent button overlap */
  z-index: 4;
  padding: 0.8rem;
}
.movie-card:hover .card-overlay { opacity: 1; }

.card-title {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--nf-light);
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.card-meta .match { color: #46d369; font-weight: 600; font-family: var(--font-en); }
.card-actions {
  display: flex;
  gap: 0.4rem;
}
.card-btn {
  /* FIX: minimum 44×44px touch target */
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  background: rgba(42,42,42,0.5);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.card-btn:hover { border-color: #fff; background: rgba(255,255,255,0.12); }
.card-btn:active { transform: scale(0.9); }
.card-btn.added { border-color: var(--nf-red); background: rgba(229,9,20,0.25); color: var(--nf-red); }
.card-btn.play-btn { background: #fff; border-color: #fff; color: #000; }
.card-btn.play-btn:hover { background: #ddd; }

.card-badge-top { display: none; }

/* FIX: use logical property for RTL correctness */
.card-year-badge {
  position: absolute;
  top: 10px;
  /* FIX: inset-inline-start works correctly in both RTL and LTR */
  inset-inline-start: 10px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  /* FIX: z-index below card-overlay so overlay buttons stay tappable */
  z-index: 3;
  font-family: var(--font-fa);
  letter-spacing: 0.3px;
}

/* عنوان فارسی روی پوستر - چسبیده به راست، به اندازه‌ی عنوان، گوشه‌ها تیز، سفید */
.card-price-tag {
  position: absolute;
  bottom: 14px;
  right: 0;
  left: auto;
  background: rgba(255, 255, 255, 0.94);
  color: #1a1a1a;
  border-radius: 0;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-fa);
  line-height: 1.35;
  max-width: 94%;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  /* FIX: z-index 2 — below overlay (4) so overlay buttons are tappable */
  z-index: 2;
  pointer-events: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

/* ═══════════════════════════════════════════
   GRID VIEW
═══════════════════════════════════════════ */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1rem;
  padding: 0.5rem clamp(1.5rem, 4vw, 4rem) 2rem;
  justify-items: center;
}

/* ═══════════════════════════════════════════
   DETAIL MODAL
═══════════════════════════════════════════ */
.detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  /* FIX: prevent scroll bleed through modal */
  overscroll-behavior: contain;
}
.detail-backdrop.show { display: flex; }

.detail-panel {
  width: min(92vw, 680px);
  /* FIX: use dvh instead of vh to handle Safari's dynamic toolbar */
  max-height: 88dvh;
  overflow-y: auto;
  border-radius: 10px;
  background: #181818;
  box-shadow: 0 24px 80px rgba(0,0,0,0.7);
  animation: slideUp 0.35s ease;
  /* FIX: momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-hero {
  position: relative;
  height: 300px;
  overflow: hidden;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #181818 0%, transparent 60%);
}

/* FIX: close button uses logical property for RTL */
.detail-close {
  position: absolute;
  top: 12px;
  /* FIX: inset-inline-start = right in RTL */
  inset-inline-start: 12px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(20,20,20,0.7);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 5;
  transition: background var(--transition);
}
.detail-close:hover { background: rgba(20,20,20,0.95); }

.detail-body {
  padding: 0 1.8rem 1.8rem;
  margin-top: -4rem;
  position: relative;
  z-index: 2;
}
.detail-title {
  font-family: var(--font-en);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
}
.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
  font-size: 0.88rem;
}
.detail-meta-row .match { color: #46d369; font-weight: 700; font-family: var(--font-en); }
.detail-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--nf-light);
  margin-bottom: 1.4rem;
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}
.detail-grid .label { color: var(--nf-gray); font-size: 0.78rem; }
.detail-grid .value { color: #fff; font-size: 0.88rem; }

/* ═══════════════════════════════════════════
   SERIES — NEW EPISODE BANNERS
   FIX: merged all 3 infinite animations into one shared keyframe
═══════════════════════════════════════════ */
.new-episode-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  margin-bottom: 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--nf-red), #ff5c5c);
  box-shadow: 0 0 14px rgba(229, 9, 20, 0.55);
  animation: redGlow 2.2s ease-in-out infinite;
}

@keyframes redGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(229, 9, 20, 0.45); }
  50% { box-shadow: 0 0 20px rgba(229, 9, 20, 0.85); }
}

.detail-episodes { margin-bottom: 1.4rem; }
.episodes-block-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.9rem;
}
.episodes-season { margin-bottom: 1.1rem; }
.episodes-season-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--nf-gray);
  margin-bottom: 0.5rem;
  padding-inline-start: 0.2rem;
}
.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.episode-row {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  transition: background var(--transition), border-color var(--transition);
}
.episode-row-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.episode-number {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}
.episode-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.3rem;
  font-size: 0.76rem;
  color: var(--nf-gray);
}
.episode-row-meta i { margin-inline-end: 0.15rem; }
.episode-status {
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: var(--nf-light);
}
.episode-status.is-new { background: rgba(229,9,20,0.18); color: #ff8a8a; }
.episode-row-desc {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--nf-light);
}

/* FIX: reuse the same redGlow animation — no separate episodeGlow needed */
.episode-row--new {
  background: linear-gradient(135deg, rgba(229,9,20,0.14), rgba(255,255,255,0.04));
  border-color: rgba(229,9,20,0.45);
  box-shadow: 0 0 16px rgba(229,9,20,0.25);
  animation: redGlow 2.6s ease-in-out infinite;
}

.episode-badge-new {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.55rem;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--nf-red);
  /* FIX: simple pulse — no infinite scale animation for battery savings */
}

/* FIX: single rule for all animation disabling */
@media (prefers-reduced-motion: reduce) {
  .new-episode-banner,
  .episode-row--new,
  .episode-badge-new {
    animation: none;
  }
}

.detail-add-btn {
  width: 100%;
  padding: 0.85rem;
  border-radius: 6px;
  border: none;
  background: var(--nf-red);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-fa);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
}
.detail-add-btn:hover { background: var(--nf-red-hover); }
.detail-add-btn:disabled { background: rgba(70,211,105,0.15); color: #46d369; cursor: not-allowed; }

/* ═══════════════════════════════════════════
   CART DRAWER
   FIX: RTL — drawer opens from RIGHT side
═══════════════════════════════════════════ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed;
  top: 0;
  /* FIX: RTL layout — drawer comes from the right */
  right: 0;
  left: auto;
  width: min(92vw, 440px);
  height: 100dvh;
  z-index: 2600;
  background: #1a1a1a;
  /* FIX: border on the left side (away from edge) for RTL */
  border-left: 1px solid rgba(255,255,255,0.06);
  border-right: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  /* FIX: translate from right */
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  /* FIX: safe area for bottom home indicator */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cart-drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.3rem 1.4rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.drawer-title { font-family: var(--font-en); font-size: 1.15rem; font-weight: 700; }

.close-drawer {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition);
}
.close-drawer:hover { background: rgba(229,9,20,0.2); color: var(--nf-red); }

.drawer-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overscroll-behavior: contain;
}

.cart-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.7rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}
.cart-item img { width: 48px; height: 68px; object-fit: cover; border-radius: 5px; }
.cart-item-info { min-width: 0; }
.cart-item-title { font-size: 0.85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 0.78rem; color: var(--nf-red); margin-top: 0.15rem; font-weight: 600; }

.cart-remove {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(239,68,68,0.1);
  border: none;
  color: #ef4444;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.cart-remove:hover { background: rgba(239,68,68,0.2); }

.drawer-form {
  padding: 1.2rem 1.4rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: grid;
  gap: 0.6rem;
  background: rgba(0,0,0,0.15);
}

.drawer-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  /* FIX: 16px prevents iOS auto-zoom on focus */
  font-size: 16px;
  font-family: var(--font-fa);
  outline: none;
  transition: border-color var(--transition);
}
.drawer-input:focus { border-color: rgba(229,9,20,0.5); }
.drawer-input::placeholder { color: var(--nf-gray); }
.drawer-input option { background: #1a1a1a; }

textarea.drawer-input {
  resize: vertical;
  min-height: 64px;
  max-height: 160px;
  line-height: 1.6;
  font-family: var(--font-fa);
}

.note-char-count {
  font-size: 0.68rem;
  color: var(--nf-gray);
  text-align: start;
  margin-top: -0.35rem;
}

.drawer-total {
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  background: rgba(229,9,20,0.08);
  border: 1px solid rgba(229,9,20,0.2);
  font-weight: 700;
  font-size: 0.95rem;
}
.drawer-total span:last-child { color: var(--nf-red); font-family: var(--font-en); }

.drawer-submit {
  width: 100%;
  padding: 0.9rem;
  min-height: 48px;
  border-radius: 6px;
  border: none;
  background: var(--nf-red);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-fa);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.drawer-submit:hover { background: var(--nf-red-hover); }
.drawer-submit:active:not(:disabled) { transform: scale(0.98); }
.drawer-submit:disabled { background: rgba(255,255,255,0.08); color: var(--nf-gray); cursor: not-allowed; }

.vip-chips { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.4rem; }
.vip-chip {
  padding: 0.45rem;
  border-radius: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
  font-size: 0.68rem;
  color: var(--nf-light);
}
.vip-chip b { color: #fff; font-weight: 700; }

.order-error {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.08);
  color: #ff8a92;
  font-size: 0.82rem;
  display: none;
  align-items: center;
  gap: 0.4rem;
}
.order-error.show { display: flex; animation: shakeX 0.4s ease; }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ═══════════════════════════════════════════
   CUSTOM DROPDOWN (kdrop)
   FIX: use position:fixed to escape overflow:hidden containers
═══════════════════════════════════════════ */
.kdrop { position: relative; }
.kdrop select { display: none; }

.kdrop-display {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
}
.kdrop-display:after {
  content: '';
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--nf-gray);
  border-bottom: 1.5px solid var(--nf-gray);
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform var(--transition);
  flex-shrink: 0;
}
.kdrop.open .kdrop-display:after { transform: rotate(225deg); margin-top: 4px; }
.kdrop.open .kdrop-display { border-color: rgba(229,9,20,0.5) !important; }
.kdrop-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* FIX: use position:fixed so list escapes any overflow:hidden parent */
.kdrop-list {
  position: fixed;
  z-index: 9999;
  min-width: 160px;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #1a1a1a;
  border: 1px solid rgba(229,9,20,0.3);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  /* position set dynamically via JS */
}
.kdrop.open .kdrop-list { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.kdrop-item {
  padding: 0.65rem 0.9rem;
  font-size: 0.85rem;
  color: #ccc;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  /* FIX: minimum touch target */
  min-height: 44px;
  display: flex;
  align-items: center;
}
.kdrop-item:last-child { border-bottom: none; }
.kdrop-item:hover, .kdrop-item.active {
  background: rgba(229,9,20,0.15);
  color: #fff;
}
.kdrop-item.active { font-weight: 700; }

/* ═══════════════════════════════════════════
   CUSTOM CONFIRM DIALOG
═══════════════════════════════════════════ */
.k-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.k-confirm-backdrop.show { display: flex; }
.k-confirm-card {
  width: min(92vw, 380px);
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 1.6rem;
  text-align: center;
  animation: slideUp 0.3s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.k-confirm-icon {
  width: 52px; height: 52px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: rgba(229,9,20,0.12);
  color: var(--nf-red);
}
.k-confirm-card h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; color: #fff; }
.k-confirm-card p { font-size: 0.85rem; color: var(--nf-gray); line-height: 1.6; margin-bottom: 1.4rem; }
.k-confirm-actions { display: flex; gap: 0.6rem; }
.k-confirm-actions button {
  flex: 1;
  padding: 0.65rem;
  min-height: 48px;
  border-radius: 8px;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-fa);
  cursor: pointer;
  transition: all var(--transition);
}
.k-confirm-cancel { background: rgba(255,255,255,0.08); color: #fff; }
.k-confirm-cancel:hover { background: rgba(255,255,255,0.15); }
.k-confirm-ok { background: var(--nf-red); color: #fff; }
.k-confirm-ok:hover { background: var(--nf-red-hover); }
.k-confirm-ok.danger { background: #ef4444; }
.k-confirm-ok.danger:hover { background: #dc2626; }

/* ═══════════════════════════════════════════
   BOTTOM CART BAR
═══════════════════════════════════════════ */
.cart-bar {
  position: fixed;
  bottom: 1.2rem;
  /* FIX: safe area for home indicator */
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: min(calc(100% - 2.4rem), 580px);
  padding: 0.75rem 1.4rem;
  border-radius: 14px;
  background: rgba(26,26,26,0.96);
  border: 1px solid rgba(229,9,20,0.25);
  box-shadow: 0 14px 48px rgba(0,0,0,0.55);
  transition: transform 0.4s ease, opacity 0.4s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.cart-bar.hidden { transform: translateX(-50%) translateY(200px); opacity: 0; pointer-events: none; }

.cart-summary { display: flex; align-items: center; gap: 0.8rem; }
.cart-badge-nf {
  width: 2.8rem; height: 2.8rem;
  border-radius: 10px;
  background: var(--nf-red);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  font-family: var(--font-en);
  flex-shrink: 0;
}
.cart-text { display: grid; gap: 0.08rem; }
.cart-count { font-size: 0.88rem; font-weight: 700; }
.cart-total-nf { font-size: 0.76rem; color: var(--nf-red); font-weight: 700; }
.cart-actions-bar { display: flex; gap: 0.5rem; }
.cart-btn-bar {
  padding: 0.55rem 1.1rem;
  min-height: 44px;
  border-radius: 6px;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-fa);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.cart-btn-bar.primary { background: var(--nf-red); color: #fff; }
.cart-btn-bar.primary:hover { background: var(--nf-red-hover); }
.cart-btn-bar.secondary { background: rgba(255,255,255,0.08); color: #fff; }
.cart-btn-bar.secondary:hover { background: rgba(255,255,255,0.15); }

/* ═══════════════════════════════════════════
   TOAST
   FIX: positioned above cart bar even when cart bar is taller on mobile
═══════════════════════════════════════════ */
.toast-note {
  position: fixed;
  /* FIX: default bottom clears the standard cart bar */
  bottom: calc(var(--cart-bar-h) + 1.8rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translate(-50%, 1.2rem);
  z-index: 3000;
  max-width: min(calc(100% - 2rem), 460px);
  padding: 0.8rem 1.3rem;
  border-radius: 8px;
  background: rgba(26,26,26,0.96);
  border: 1px solid rgba(229,9,20,0.25);
  color: #fff;
  font-size: 0.88rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition);
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.toast-note.show { opacity: 1; transform: translate(-50%, 0); }
.toast-note.error { border-color: rgba(239,68,68,0.35); }

/* ═══════════════════════════════════════════
   LOADING / EMPTY STATES
═══════════════════════════════════════════ */
.loading-state { grid-column: 1/-1; min-height: 40vh; display: grid; place-items: center; text-align: center; }
.nf-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(229,9,20,0.15);
  border-top-color: var(--nf-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { grid-column: 1/-1; min-height: 30vh; display: grid; place-items: center; text-align: center; color: var(--nf-gray); }
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; }

/* ── Skeleton loading ── */
.skeleton-card {
  border-radius: 8px;
  aspect-ratio: 2/3;
  background: linear-gradient(100deg, var(--nf-card) 30%, #232323 50%, var(--nf-card) 70%);
  background-size: 250% 100%;
  animation: skeletonShine 1.6s ease-in-out infinite;
}
@keyframes skeletonShine {
  0% { background-position: 200% 0; }
  100% { background-position: -50% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton-card { animation: none; background: var(--nf-card); }
}

/* ═══════════════════════════════════════════
   STATUS ROW
═══════════════════════════════════════════ */
.status-row {
  padding: 0 clamp(1.5rem, 4vw, 4rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.76rem;
  color: var(--nf-light);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.load-more-wrap { text-align: center; padding: 1rem; }
.load-more-btn {
  padding: 0.7rem 2.2rem;
  min-height: 48px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: #ccc;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-fa);
  cursor: pointer;
  transition: all var(--transition);
}
.load-more-btn:hover { border-color: var(--nf-red); color: var(--nf-red); }

/* ═══════════════════════════════════════════
   CUSTOMER MODAL
═══════════════════════════════════════════ */
.customer-modal {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  overscroll-behavior: contain;
}
.customer-modal.show { display: flex; }
.customer-modal-card {
  width: min(92vw, 440px);
  border-radius: 12px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 1.8rem;
  animation: slideUp 0.35s ease;
  /* FIX: constrain height on small screens */
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.customer-modal-card h5 { font-family: var(--font-en); font-weight: 700; margin-bottom: 0.3rem; font-size: 1.2rem; }
.customer-modal-card p { color: var(--nf-gray); font-size: 0.84rem; margin-bottom: 1.2rem; line-height: 1.6; }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }
.modal-actions button { flex: 1; }

/* ═══════════════════════════════════════════
   RESPONSIVE — TABLET (≤900px)
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .nf-nav { gap: 0.8rem; }
  .nf-nav li { flex-shrink: 0; }
  .nf-nav a { white-space: nowrap; font-size: 0.8rem; padding: 0.3rem 0.6rem; }
  .nf-logo { font-size: 1.3rem; }
  .header-right { gap: 0.8rem; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤768px)
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --header-h: 60px;
    --filter-h: 52px;
    /* FIX: cart bar is taller on mobile (column layout) */
    --cart-bar-h: 128px;
  }

  /* ── Header ── */
  /* FIX: constrain header-right so it doesn't push header-left off screen */
  .header-right {
    gap: 0.6rem;
    max-width: calc(100% - 148px); /* reserve space for header-left */
  }

  /* ── Filter bar: single horizontal scroll row ── */
  .filter-bar-inner {
    padding: 0.5rem 0.8rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.5rem;
    /* FIX: allow dropdowns to escape vertically */
    overflow-y: visible;
  }
  .filter-bar-inner::-webkit-scrollbar { display: none; }

  /* FIX: reset button stays visible on mobile — icon only, no text label */
  .filter-reset-btn .reset-label { display: none; }
  .filter-reset-btn { padding: 0.4rem 0.6rem; min-width: 44px; justify-content: center; }

  /* FIX: close button remains hidden — reset is enough */
  .filter-close-btn { display: none; }

  /* Compact search input */
  .filter-search-pro {
    min-width: 130px;
    flex: 0 0 130px;
    max-width: 160px;
    padding: 0.4rem 0.8rem;
  }
  .filter-search-pro input { font-size: 0.78rem; }

  /* Compact filter pills */
  .filter-select-pro {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.76rem;
    padding: 0.4rem 0.7rem;
    padding-inline-start: 1.5rem;
    min-width: 100px;
  }

  /* Show filter toggle button */
  .filter-toggle-btn { display: inline-flex; }

  /* ── Hero ── */
  /* FIX: reduced height so content is visible without scrolling */
  .hero-section { height: 42vh; min-height: 260px; }
  .hero-content { padding-bottom: calc(var(--cart-bar-h) + 2rem); }
  .hero-title { font-size: 1.6rem; }
  /* FIX: hide description on mobile to reduce hero height */
  .hero-desc { display: none; }
  .hero-indicators { bottom: 2rem; }

  /* ── Cards ── */
  .movie-card {
    flex: 0 0 140px;
    transition: transform 0.2s ease !important;
  }
  /* FIX: subtle hover scale only */
  .movie-card:hover { transform: scale(1.04) !important; }

  /* ── Grid ── */
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.7rem;
    padding: 0.5rem 0.8rem 2rem;
  }

  /* ── Detail modal ── */
  .detail-panel {
    width: 100vw;
    max-height: 95dvh;
    border-radius: 16px 16px 0 0;
    /* FIX: align to bottom of screen like a bottom sheet */
    align-self: flex-end;
    margin-top: auto;
  }
  .detail-backdrop { align-items: flex-end; }
  /* FIX: smaller hero image so "Add to cart" button is visible without scrolling */
  .detail-hero { height: 220px; }
  .detail-body { padding: 0 1.2rem 1.4rem; margin-top: -2.5rem; }
  .detail-title { font-size: 1.4rem; }
  .detail-grid { grid-template-columns: 1fr; }

  /* ── Cart bar: full width stacked ── */
  .cart-bar {
    flex-direction: column;
    gap: 0.6rem;
    left: 0.8rem;
    right: 0.8rem;
    width: auto;
    transform: none;
    bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
  }
  .cart-bar.hidden { transform: translateY(200px); opacity: 0; pointer-events: none; }
  .cart-actions-bar { width: 100%; }
  .cart-actions-bar .cart-btn-bar { flex: 1; justify-content: center; }

  /* ── Toast: above taller mobile cart bar ── */
  .toast-note {
    bottom: calc(var(--cart-bar-h) + 2rem + env(safe-area-inset-bottom, 0px));
  }

  /* ── Modal backgrounds: more opaque on mobile ── */
  .detail-backdrop { background: rgba(0, 0, 0, 0.88); }
  .customer-modal { background: rgba(0, 0, 0, 0.88); }

  /* ── Row scroll ── */
  .movie-row { scroll-behavior: auto; }
}

/* ═══════════════════════════════════════════
   RESPONSIVE — SMALL PHONES (≤480px)
═══════════════════════════════════════════ */
@media (max-width: 480px) {
  :root { --cart-bar-h: 136px; }

  .hero-section { height: 36vh; min-height: 230px; }
  .hero-actions { flex-direction: column; }
  .btn-hero { justify-content: center; width: 100%; }
  .header-right { gap: 0.5rem; }
  /* FIX: hide pill on very small screens to save space */
  .mode-pill-header { display: none; }
  .nf-logo { font-size: 1.1rem; }

  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    padding: 0.5rem 0.6rem 2rem;
  }
  .movie-card { flex: 0 0 120px; }

  .detail-hero { height: 180px; }
  .detail-title { font-size: 1.2rem; }

  /* Drawer full width on tiny phones */
  .cart-drawer { width: 100vw; border-radius: 0; border-left: none; }

  .customer-modal-card { padding: 1.2rem; }
}

/* ═══════════════════════════════════════════
   LARGE KIOSK / TOUCH DISPLAYS (≥1600px)
═══════════════════════════════════════════ */
@media (min-width: 1600px) {
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.4rem; }
  .movie-card { flex: 0 0 220px; }
  .hero-content { max-width: 760px; }
}
