/* Zajil.Pro — global mobile polish (all pages) */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100%;
}

html[data-home-design="premium"] {
  background: #080d14;
}

body.zp-site,
body.bb-home {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

/* ─── Desktop: hamburger hidden ─── */
@media (min-width: 768px) {
  .irpa-mobile-menu-btn {
    display: none !important;
  }
}

@media (max-width: 767px) {
  /* ─── Touch & inputs (iOS zoom) ─── */
  input,
  select,
  textarea,
  .zp-field,
  .zp-select {
    font-size: 16px !important;
  }

  /* ─── Hamburger visible ─── */
  .irpa-mobile-menu-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 44px;
    min-width: 44px;
    padding: 0.35rem 0.55rem;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.35);
    background: rgba(212, 175, 55, 0.08);
    color: #b8942e;
    flex-shrink: 0;
    cursor: pointer;
    font-family: inherit;
  }

  .irpa-mobile-menu-label {
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .irpa-mobile-menu-icon {
    display: block;
    width: 1.1rem;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
  }

  /* ─── Hide desktop nav (prevents vertical letter stacking) ─── */
  .bb-header .bb-nav,
  header.bb-header nav.bb-nav {
    display: none !important;
  }

  /* ─── Compact header row ─── */
  .bb-header-top {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    grid-template-columns: unset !important;
    width: 100%;
    max-width: 100% !important;
    height: auto !important;
    min-height: 58px;
    padding: 8px 12px !important;
    gap: 8px !important;
    direction: rtl;
  }

  .bb-inner-brand-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }

  .bb-logo,
  .zp-premium-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
  }

  .bb-logo img,
  .zp-site-logo,
  .zp-premium-logo img {
    height: 52px !important;
    max-width: 138px !important;
    width: auto !important;
    margin: 0 auto;
  }

  .bb-search,
  .zp-hide-mobile {
    display: none !important;
  }

  .zp-header-auth,
  .bb-header-actions,
  .zp-premium-header-actions {
    display: flex;
    align-items: center;
    gap: 6px !important;
    flex-shrink: 0;
    flex-wrap: nowrap !important;
  }

  /* Premium home — no horizontal bleed on small screens */
  html[data-home-design="premium"] .zp-premium {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .zp-premium-header,
  .zp-premium-header-inner {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .zp-premium-header-inner {
    direction: rtl;
  }

  .zp-premium-hero-inner,
  .zp-premium-services,
  .zp-premium-stats,
  .zp-premium-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .zp-header-auth .zp-btn-outline span,
  .zp-btn-outline .zp-auth-label,
  .zp-premium-hide-mobile {
    display: none !important;
  }

  .zp-btn-outline,
  .zp-btn-gold,
  .zp-premium-btn-outline,
  .zp-premium-btn-gold {
    min-height: 40px;
    padding: 0 12px !important;
    font-size: 11px !important;
    white-space: nowrap;
  }

  /* ─── Main content ─── */
  .zp-page-main,
  main.zp-page-main {
    padding: 1rem 1rem 5.5rem !important;
    max-width: 100% !important;
  }

  .section-title {
    font-size: clamp(1.35rem, 6.5vw, 1.85rem) !important;
    line-height: 1.25;
  }

  /* ─── Design switcher safe area ─── */
  .zp-design-switcher {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
    max-width: calc(100vw - 20px);
    z-index: 9999;
  }

  body.bb-home {
    padding-bottom: 72px;
  }

  body.zp-site {
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0));
  }

  /* ─── Footer ─── */
  .irpa-site-footer .grid,
  .irpa-site-footer > .max-w-7xl,
  .irpa-site-footer > div {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .irpa-site-footer {
    margin-top: 2.5rem !important;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom)) !important;
  }

  .zp-slogan {
    font-size: 15px !important;
    padding: 1.25rem 1rem !important;
  }

  /* ─── Grids & flex layouts ─── */
  .zp-features-inner {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .zp-stats-inner {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 1rem !important;
  }

  .bb-category-strip {
    grid-template-columns: 1fr !important;
    padding-inline: 12px !important;
  }

  .bb-content-grid {
    grid-template-columns: 1fr !important;
    padding-inline: 12px !important;
  }

  .bb-product-grid,
  .bb-auction-grid {
    grid-template-columns: 1fr !important;
  }

  .bb-hero-inner {
    padding: 1.5rem 1rem 2.5rem !important;
    min-height: auto !important;
  }

  .bb-hero-copy h1 {
    font-size: clamp(1.6rem, 7.5vw, 2.4rem) !important;
  }

  .bb-hero-lead {
    font-size: 1.1rem !important;
  }

  .bb-hero-actions {
    width: 100%;
  }

  .bb-hero-actions .bb-btn {
    width: 100%;
    justify-content: center;
  }

  .cinema-hero {
    min-height: auto !important;
  }

  .cinema-stats {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .cinema-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .cinema-actions .btn-irpa-solid:first-child {
    grid-column: 1 / -1;
  }

  .cinema-actions .btn-irpa,
  .cinema-actions .btn-irpa-solid {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Tailwind-style grids on inner pages */
  .grid.sm\:grid-cols-2,
  .grid.sm\:grid-cols-3,
  .grid.md\:grid-cols-2,
  .grid.md\:grid-cols-3,
  .grid.md\:grid-cols-4,
  .grid.lg\:grid-cols-2,
  .grid.lg\:grid-cols-3,
  .grid.lg\:grid-cols-4 {
    grid-template-columns: 1fr !important;
  }

  .flex.flex-col.lg\:flex-row,
  .flex.lg\:flex-row {
    flex-direction: column !important;
  }

  .premium-section-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  /* ─── Cards & panels ─── */
  .auction-card,
  .store-card,
  .news-card,
  .irpa-glass {
    max-width: 100%;
  }

  #auction-grid,
  #live-auctions,
  #home-collections,
  #collections-grid,
  #p-grid,
  #olr-grid,
  #news-grid,
  #market-grid,
  #clubs-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  /* ─── Tables horizontal scroll ─── */
  .zp-page-main table,
  main table,
  .increments-table,
  .loft-table-wrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ─── Auction page mobile bar ─── */
  .mobile-bid-bar {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  /* ─── Auth / register ─── */
  .reg-section .grid.sm\:grid-cols-2,
  .reg-section .grid.sm\:grid-cols-3,
  .quick-auth-box .grid.sm\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  .phone-field-row {
    flex-direction: column !important;
  }

  .phone-dial-select {
    width: 100% !important;
  }

  /* ─── Dashboard tabs scroll ─── */
  .dashboard-tabs,
  .auth-tabs {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .dashboard-tabs::-webkit-scrollbar,
  .auth-tabs::-webkit-scrollbar {
    display: none;
  }

  .dashboard-tabs button,
  .auth-tabs .auth-tab {
    flex-shrink: 0;
  }

  /* ─── Buttons touch size ─── */
  .btn-irpa,
  .btn-irpa-solid,
  .tab-auction {
    min-height: 44px;
  }

  /* ─── Hot auctions ticker ─── */
  .hot-auctions-track,
  .bid-ticker-wrap {
    touch-action: pan-x;
  }

  .max-w-7xl,
  .max-w-6xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* ─── Mobile drawer (classic / inner light theme) ─── */
.irpa-mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
}

.irpa-mobile-nav-backdrop.hidden {
  display: none !important;
}

.irpa-mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 210;
  width: min(300px, 88vw);
  height: 100%;
  max-height: 100dvh;
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid #dde3ea;
  box-shadow: -10px 0 36px rgba(10, 27, 46, 0.18);
  display: flex;
  flex-direction: column;
}

.irpa-mobile-nav.hidden {
  display: none !important;
}

body.irpa-mobile-nav-open,
body.zp-mobile-nav-open {
  overflow: hidden;
}

.irpa-mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #dde3ea;
  color: #0a1b2e;
  font-weight: 800;
}

.irpa-mobile-nav-close {
  width: 36px;
  height: 36px;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  background: #fff;
  color: #0a1b2e;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.irpa-mobile-nav-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.irpa-mobile-nav-link {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: #0a1b2e;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: right;
  cursor: pointer;
  font-family: inherit;
}

.irpa-mobile-nav-link:hover,
.irpa-mobile-nav-link.active {
  background: #f1f3f6;
  color: #b8942e;
}

.irpa-mobile-nav-sublink {
  display: block;
  padding: 10px 14px 10px 20px;
  font-size: 13px;
  color: #3a4a5a;
  text-decoration: none;
  border-radius: 8px;
}

.irpa-mobile-nav-sublink:hover {
  color: #b8942e;
  background: #f1f3f6;
}

.irpa-mobile-nav-group {
  margin-top: 4px;
}

.irpa-mobile-eco-toggle {
  width: 100%;
  text-align: right;
}

.irpa-mobile-eco-panel {
  padding: 4px 0 8px;
}

.irpa-mobile-eco-panel.hidden {
  display: none !important;
}

.irpa-mobile-nav-foot {
  padding: 14px;
  border-top: 1px solid #dde3ea;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.irpa-mobile-nav-foot .zp-btn-outline,
.irpa-mobile-nav-foot .zp-btn-gold {
  width: 100%;
  justify-content: center;
}

/* Premium dark drawer overrides */
html[data-home-design="premium"] .irpa-mobile-nav {
  background: #111c2e;
  border-left-color: rgba(212, 175, 55, 0.2);
}

html[data-home-design="premium"] .irpa-mobile-nav-head {
  color: #fff;
  border-bottom-color: rgba(212, 175, 55, 0.15);
}

html[data-home-design="premium"] .irpa-mobile-nav-close {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.2);
  color: #e8c547;
}

html[data-home-design="premium"] .irpa-mobile-nav-link {
  color: #dce4ec;
}

html[data-home-design="premium"] .irpa-mobile-nav-link:hover,
html[data-home-design="premium"] .irpa-mobile-nav-link.active {
  background: rgba(212, 175, 55, 0.1);
  color: #e8c547;
}

html[data-home-design="premium"] .irpa-mobile-nav-sublink {
  color: #8fa0b3;
}

html[data-home-design="premium"] .irpa-mobile-nav-foot {
  border-top-color: rgba(212, 175, 55, 0.15);
}

html[data-home-design="premium"] .irpa-mobile-menu-btn {
  border-color: rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.08);
  color: #e8c547;
}
