/* =====================================================
   Axe Arena – Public / Front-End Stylesheet
   Dark ember theme matching the admin aesthetic
   ===================================================== */

:root {
  --aa-pub-bg:       #0f1117;
  --aa-pub-surface:  #1a1d27;
  --aa-pub-border:   #2e3248;
  --aa-pub-primary:  #FF6B35;
  --aa-pub-accent:   #FFB347;
  --aa-pub-purple:   #8B5CF6;
  --aa-pub-green:    #10B981;
  --aa-pub-red:      #EF4444;
  --aa-pub-pink:     #EC4899;
  --aa-pub-text:     #E8EAF0;
  --aa-pub-muted:    #7B8099;
  --aa-pub-radius:   12px;
}

.axearena-wrap {
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--aa-pub-text);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Section headings ─────────────────────────────── */
.axearena-section-title {
  text-align: center;
  margin-bottom: 48px;
}

.axearena-section-title h2 {
  font-family: 'Bebas Neue', 'Impact', sans-serif;
  font-size: 2.8rem;
  letter-spacing: 3px;
  color: var(--aa-pub-text);
  margin: 0 0 10px;
  line-height: 1;
}

.axearena-section-title p {
  color: var(--aa-pub-muted);
  font-size: 1.05rem;
  margin: 0;
}

.axearena-section-title .aa-divider {
  width: 60px;
  height: 4px;
  background: var(--aa-pub-primary);
  border-radius: 2px;
  margin: 14px auto 0;
}

/* ── Services grid ────────────────────────────────── */
.axearena-services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
  margin-bottom: 60px;
}

.aa-service-card {
  background: var(--aa-pub-surface);
  border: 1px solid var(--aa-pub-border);
  border-radius: var(--aa-pub-radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
}

.aa-service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,.55);
}

.aa-service-card-top {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.aa-service-card-top::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.25);
}

.aa-service-card-icon {
  font-size: 2.8rem;
  color: #fff;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}

.aa-service-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: var(--aa-pub-accent);
  color: #000;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.aa-service-card-body {
  padding: 20px;
}

.aa-service-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--aa-pub-text);
  margin: 0 0 8px;
}

.aa-service-card-body p {
  color: var(--aa-pub-muted);
  font-size: .88rem;
  line-height: 1.55;
  margin: 0 0 16px;
}

.aa-service-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--aa-pub-border);
  background: rgba(0,0,0,.15);
}

.aa-price-tag {
  display: flex;
  flex-direction: column;
}

.aa-price-tag .aa-price-amount {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.9rem;
  color: var(--aa-pub-accent);
  line-height: 1;
}

.aa-price-tag .aa-price-label {
  font-size: .72rem;
  color: var(--aa-pub-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.aa-persons-badge {
  font-size: .78rem;
  color: var(--aa-pub-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── Packages grid ────────────────────────────────── */
.axearena-packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.aa-package-card {
  background: var(--aa-pub-surface);
  border: 1px solid var(--aa-pub-border);
  border-radius: var(--aa-pub-radius);
  overflow: hidden;
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease;
}

.aa-package-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(0,0,0,.55);
}

.aa-package-card.featured {
  border-color: var(--aa-pub-primary);
  box-shadow: 0 0 0 1px var(--aa-pub-primary);
}

.aa-package-card-header {
  padding: 22px 22px 18px;
  position: relative;
}

.aa-package-card-header::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .07;
  background: linear-gradient(135deg, var(--pkg-color, #8B5CF6), transparent);
}

.aa-package-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.aa-package-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--aa-pub-primary);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: .5px;
  text-transform: uppercase;
  z-index: 1;
}

.aa-package-card-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--aa-pub-text);
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
}

.aa-package-card-header p {
  color: var(--aa-pub-muted);
  font-size: .87rem;
  line-height: 1.5;
  margin: 0;
  position: relative;
  z-index: 1;
}

.aa-package-services-list {
  padding: 14px 22px;
  border-top: 1px solid var(--aa-pub-border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.aa-pkg-svc-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,107,53,.1);
  border: 1px solid rgba(255,107,53,.2);
  color: var(--aa-pub-primary);
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

.aa-package-card-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--aa-pub-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,.12);
}

.aa-pkg-price {
  display: flex;
  flex-direction: column;
}

.aa-pkg-price .amount {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  color: var(--aa-pub-accent);
  line-height: 1;
}

.aa-pkg-price .original {
  font-size: .78rem;
  color: var(--aa-pub-muted);
  text-decoration: line-through;
}

.aa-pkg-price .label {
  font-size: .72rem;
  color: var(--aa-pub-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.aa-savings-badge {
  background: rgba(16,185,129,.15);
  color: var(--aa-pub-green);
  font-size: .78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(16,185,129,.3);
}

/* ── Pricing section divider ──────────────────────── */
.axearena-pricing-section {
  margin-bottom: 70px;
}

/* ── Responsive ────────────────────────────────────────
   IMPORTANT: rules must go from largest breakpoint to
   smallest so that narrower overrides always win in the
   CSS cascade (last matching rule takes effect).
────────────────────────────────────────────────────── */

/* Tablet portrait (641–768px): 2-column grid */
@media (max-width: 768px) {
  .axearena-services-grid,
  .axearena-packages-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  .axearena-section-title h2 { font-size: 1.8rem; }
}

/* Large phone (481–640px): 1 column, still some spacing */
@media (max-width: 640px) {
  .axearena-section-title h2 { font-size: 2rem; }
  .axearena-services-grid,
  .axearena-packages-grid { grid-template-columns: 1fr; }
}

/* Small phone portrait (≤480px) */
@media (max-width: 480px) {
  .axearena-services-grid,
  .axearena-packages-grid { grid-template-columns: 1fr; gap: 12px; }

  .axearena-section-title h2 { font-size: 1.5rem; }

  .axearena-service-card,
  .axearena-package-card { border-radius: 12px; }
}

/* Touch-device tap feedback */
@media (hover: none) and (pointer: coarse) {
  .axearena-service-card:hover,
  .axearena-package-card:hover { transform: none; box-shadow: none; }

  .axearena-service-card:active,
  .axearena-package-card:active { transform: scale(.97); }

  .axearena-btn { -webkit-tap-highlight-color: transparent; }
  .axearena-btn:active { opacity: .85; }
}

/* iOS Safari safe-area */
@supports (padding: max(0px)) {
  .axearena-page-wrap {
    padding-left:  max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* ══════════════════════════════════════════════════════════════════
   FULLSCREEN PAGE TAKEOVER
   Applied when any Axe Arena shortcode is present on the page.
   Forces the page background + plugin overlay to match the plugin's
   dark theme on every device and browser.
   ══════════════════════════════════════════════════════════════════ */

/* 1. Lock html + body background — overrides any theme colour */
html.axearena-plugin-page,
body.axearena-plugin-page {
  background:       var(--aa-pub-bg, #0f1117) !important;
  background-color: var(--aa-pub-bg, #0f1117) !important;
  margin:  0 !important;
  padding: 0 !important;
  /*
   * FIX (portrait freeze): Do NOT set overscroll-behavior or
   * -webkit-overflow-scrolling on body/html. Body has overflow:hidden so
   * these properties conflict with the overlay's own scroll context and
   * cause iOS Safari to freeze touch input in portrait mode.
   */
}

/* 2. Full-screen fixed overlay that covers the entire viewport.
      Works on Chrome, Safari (iOS/macOS), Firefox, Edge, Brave,
      and legacy Android WebView.
      -webkit-fill-available handles iOS Safari's dynamic toolbar. */
body.axearena-plugin-page .axwiz-outer,
body.axearena-plugin-page .aac-outer,
body.axearena-plugin-page .axpkg-outer,
body.axearena-plugin-page .axearena-checkout-wrap,
body.axearena-plugin-page .axpkgwiz-outer,
body.axearena-plugin-page .sp,
body.axearena-plugin-page .sp-lo {
  position:   fixed;
  top:    0; right:  0; bottom: 0; left: 0; /* fallback: no inset shorthand */
  inset:  0;
  z-index:    99998;
  background: var(--aa-pub-bg, #0f1117);
  overflow-y: auto;
  overflow-x: hidden;

  /* iOS Safari momentum scroll — ONLY on this element, not on body.
     Applying -webkit-overflow-scrolling:touch to a fixed element while body
     also has it creates two competing scroll contexts and freezes portrait. */
  -webkit-overflow-scrolling: touch;

  /* Contain over-scroll within the overlay only */
  overscroll-behavior-y: contain;

  /* No padding / margin so nothing bleeds at edges */
  padding:  0 !important;
  margin:   0 !important;
  box-sizing: border-box;

  /*
   * FIX (portrait freeze): REMOVED translateZ(0) + will-change:transform.
   *
   * translateZ(0) / will-change:transform on a position:fixed overflow:auto
   * element is the primary iOS Safari portrait scroll-freeze trigger.
   * These properties promote the element to its own GPU compositing layer.
   * On iOS, a fixed compositing layer with overflow-y:auto cannot receive
   * touch scroll events properly — the layer captures touches for GPU
   * rasterisation instead of passing them to the scroll engine, freezing
   * the page. Use isolation:isolate for stacking context instead;
   * it achieves the same z-index isolation without GPU promotion.
   */
  isolation: isolate;
}

/* 3. Inner wrapper fills the overlay completely */
body.axearena-plugin-page .axwiz-wrap,
body.axearena-plugin-page .aac-wrap,
body.axearena-plugin-page .axpkg-wrap,
body.axearena-plugin-page .axpkgwiz-wrap {
  width:      100%;
  max-width:  100% !important;    /* remove default 1040 px cap */
  min-height: 100vh;
  min-height: -webkit-fill-available; /* iOS Safari dynamic toolbar */
  min-height: 100dvh;             /* modern browsers — dynamic viewport */
  border-radius: 0 !important;
  border:    none !important;
  box-shadow: none !important;
  margin:    0 !important;
}

/* 4. Ensure the axearena-wrap (services/packages pages) also fills */
body.axearena-plugin-page .axearena-wrap {
  max-width: 100% !important;
  padding:   0 clamp(12px, 4vw, 48px) !important;
  min-height: 100vh;
  min-height: 100dvh;
}

/* 5. Scroll-lock on <body> itself so only the overlay scrolls */
body.axearena-plugin-page {
  overflow: hidden !important;
  height: 100% !important;
}
html.axearena-plugin-page { height: 100% !important; }

/* ══════════════════════════════════════════════════════════════════
   CROSS-BROWSER & CROSS-DEVICE RESPONSIVENESS
   ══════════════════════════════════════════════════════════════════ */

/* Universal box-sizing reset scoped to plugin elements */
body.axearena-plugin-page *,
body.axearena-plugin-page *::before,
body.axearena-plugin-page *::after {
  box-sizing: border-box;
}

/* iOS safe-area insets (notch / dynamic island / home indicator) */
@supports (padding: env(safe-area-inset-left)) {
  body.axearena-plugin-page .axwiz-outer,
  body.axearena-plugin-page .aac-outer,
  body.axearena-plugin-page .axpkg-outer,
  body.axearena-plugin-page .axearena-checkout-wrap,
  body.axearena-plugin-page .axpkgwiz-outer,
  body.axearena-plugin-page .sp,
  body.axearena-plugin-page .sp-lo {
    /* Add inset padding so content clears the notch and home bar */
    padding-left:   env(safe-area-inset-left, 0px)  !important;
    padding-right:  env(safe-area-inset-right, 0px) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
  }
}

/* Prevent horizontal scroll on every viewport size */
body.axearena-plugin-page {
  max-width: 100vw;
}

/* Touch targets — WCAG AA minimum 44 × 44 px; improves usability
   on all touch screens (iOS, Android, Windows Touch) */
body.axearena-plugin-page button,
body.axearena-plugin-page [role="button"],
body.axearena-plugin-page .axwiz-btn,
body.axearena-plugin-page .aac-btn {
  min-height: 44px;
  /* Remove the default tap highlight on Android / Chrome */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Safari: remove default button / input appearance */
body.axearena-plugin-page button,
body.axearena-plugin-page input,
body.axearena-plugin-page select,
body.axearena-plugin-page textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Edge legacy / Firefox: smooth font rendering */
body.axearena-plugin-page {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Forced-colors / high-contrast mode (Windows / Edge) */
@media (forced-colors: active) {
  body.axearena-plugin-page .axwiz-outer,
  body.axearena-plugin-page .aac-outer {
    forced-color-adjust: none;
    background: Canvas;
  }
}

/* Prefers-reduced-motion — disable transitions site-wide for plugin pages */
@media (prefers-reduced-motion: reduce) {
  body.axearena-plugin-page *,
  body.axearena-plugin-page *::before,
  body.axearena-plugin-page *::after {
    animation-duration:   0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration:  0.01ms !important;
    scroll-behavior:      auto !important;
  }
}
