/* ============================================================
   Pixel Apocalypse — Tebex Webstore Theme
   Dark-mode, high-tech aesthetic with cyan & purple accents.
   Full layout + visual rework to match the PA company website.
   ============================================================ */

/* ===================
   1. DESIGN TOKENS
   =================== */
:root {
  /* Tebex variable overrides → PA palette */
  --color-text: #f0f0f5;
  --color-text-darker: #f0f0f5;
  --color-text-secondary: #a0a0b8;
  --color-text-dark: #0a0a0f;
  --color-bg: #0a0a0f;
  --color-brighter-bg: #111118;
  --color-primary: #00f0ff;
  --color-primary-hover: #33f5ff;
  --color-primary-text: #0a0a0f;
  --color-primary-text-hover: #0a0a0f;
  --color-secondary: #1e1e2e;
  --color-secondary-hover: #2a2a3e;
  --color-secondary-text: #f0f0f5;
  --color-secondary-text-hover: #00f0ff;
  --color-tertiary: transparent;
  --color-tertiary-hover: rgba(255, 255, 255, 0.06);
  --color-tertiary-text: #f0f0f5;
  --color-tertiary-text-hover: #00f0ff;
  --color-removed: #ef4444;
  --color-sale-banner-bg: #7b2fff;
  --color-sale-banner-text: #f0f0f5;
  --content-inner-width: 1200px;
  --bg-image: none;

  /* PA custom tokens */
  --pa-nav-height: 72px;
  --pa-bg-card: #14141e;
  --pa-bg-card-hover: #1c1c2a;
  --pa-bg-elevated: #1e1e2e;
  --pa-accent-cyan: #00f0ff;
  --pa-accent-purple: #7b2fff;
  --pa-gradient-primary: linear-gradient(135deg, #00f0ff, #7b2fff);
  --pa-gradient-card: linear-gradient(135deg, rgba(0, 240, 255, 0.03), rgba(123, 47, 255, 0.03));
  --pa-border-subtle: rgba(255, 255, 255, 0.06);
  --pa-border-light: rgba(255, 255, 255, 0.1);
  --pa-border-accent: rgba(0, 240, 255, 0.2);
  --pa-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --pa-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --pa-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  --pa-shadow-glow-cyan: 0 0 20px rgba(0, 240, 255, 0.15);
  --pa-radius-sm: 6px;
  --pa-radius-md: 10px;
  --pa-radius-lg: 16px;
  --pa-radius-xl: 24px;

  /* Tebex legal footer theming */
  --tebex-legal-footer-background-color: #0a0a0f;
  --tebex-legal-footer-border-color: rgba(255, 255, 255, 0.06);
  --tebex-legal-footer-text-color: #6b6b80;
}


/* ===================
   2. TYPOGRAPHY
   =================== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
}

.text-content {
  line-height: 1.7;
}


/* ===================
   3. BACKGROUND GLOW
   =================== */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 600px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(0, 240, 255, 0.1) 0%, rgba(123, 47, 255, 0.05) 40%, transparent 70%);
  mask-image: linear-gradient(rgba(0, 0, 0, 0.8) 40%, transparent 100%);
}


/* ===================
   4. SCROLLBAR & SELECTION
   =================== */
html {
  scrollbar-color: rgba(0, 240, 255, 0.15) #0a0a0f;
}

::selection {
  background-color: rgba(0, 240, 255, 0.3);
}


/* ===================
   5. BUTTONS
   =================== */
.btn-primary,
.btn-secondary,
.btn-tertiary {
  border-radius: var(--pa-radius-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: all 250ms ease;
}

.btn-primary:hover,
.btn-primary:focus {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.btn-secondary {
  border: 1px solid var(--pa-border-light);
}

.btn-secondary:hover,
.btn-secondary:focus {
  border-color: var(--pa-border-accent);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.08);
}

.quantity-field {
  border-radius: var(--pa-radius-sm);
  border-color: var(--pa-border-light);
}


/* ============================================================
   6. HEADER — SLIM FIXED NAVBAR
   Overrides shared.css's 355px absolute-positioned hero header
   to match the PA website's compact blurred navbar.
   ============================================================ */

/* --- Fixed navbar bar --- */
.site-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--pa-border-subtle);
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* --- Inner: horizontal flex row, fixed height --- */
.site-header-inner {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  height: var(--pa-nav-height) !important;
  max-width: var(--content-inner-width);
  margin: 0 auto;
  padding: 0 var(--content-padding) !important;
  flex-wrap: nowrap;
}

/* Reset all the absolute positioning from shared.css */
.site-header-inner .actions,
.site-header-inner .log-in,
.site-header-inner .user-actions,
.site-header-inner .site-title,
.site-header-inner .info {
  position: static !important;
  inset: auto !important;
  margin: 0;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
}

/* Brand / title — left side */
.site-header-inner .site-title {
  font-size: 1.25rem !important;
  font-weight: 700;
  line-height: 1.3 !important;
  text-align: left !important;
  white-space: nowrap;
  order: 0;
  flex-shrink: 0;
}

.site-header-inner .site-title img {
  margin: 0 !important;
  max-height: 40px !important;
  max-width: 180px;
  object-fit: contain;
}

.site-header-inner .site-title .brand-text {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Hamburger — leftmost on mobile */
.site-header-inner .actions {
  display: flex;
  gap: 6px;
  order: -1;
  flex-shrink: 0;
}

/* Info group (server/discord) — center area, desktop only */
.header-info-group {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

.header-info-group .info {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  line-height: 1.3;
  font-size: 13px;
}

.header-info-group .info .image {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--pa-radius-sm);
}

.header-info-group .info .title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.header-info-group .info .action {
  font-size: 12px;
  color: var(--pa-accent-cyan);
  cursor: pointer;
  transition: color 150ms ease;
}

.header-info-group .info:hover .action {
  color: var(--color-primary-hover);
}

/* Mobile info bar below header */
.header-info-group.mobile-only {
  justify-content: center;
  background: var(--color-brighter-bg);
  border-bottom: 1px solid var(--pa-border-subtle);
  padding: 8px var(--content-padding);
  margin: 0;
  max-width: 100%;
  width: 100%;
}

/* User actions — right side */
.site-header-inner .user-actions {
  display: flex !important;
  align-items: center;
  gap: 12px;
  order: 10;
  flex-shrink: 0;
}

.site-header-inner .user-name {
  display: flex !important;
}

.site-header-inner .log-in {
  order: 10;
  flex-shrink: 0;
}

.site-header-inner .open-basket {
  --btn-icon: url("https://template-assets.tebex.io/images/checkout.svg");
}

.site-header-inner .user-name {
  --btn-icon: url("https://template-assets.tebex.io/images/user.svg");
}

/* Hide toggle on desktop */
@media (width > 960px) {
  .site-header-inner .toggle-navigation {
    display: none;
  }
}

/* --- Mobile header adjustments --- */
@media (width <= 960px) {
  .site-header-inner {
    height: 56px !important;
    padding: 0 12px !important;
    gap: 8px;
  }

  .site-header-inner .toggle-navigation {
    --btn-icon: url("https://template-assets.tebex.io/images/burger.svg");
    --btn-size: 40px;
  }

  .site-header-inner .user-name {
    display: none !important;
  }

  .site-header-inner .site-title {
    font-size: 1rem !important;
  }

  .site-header-inner .site-title img {
    max-height: 32px !important;
    max-width: 140px;
  }

  /* Hide the desktop info group inside header-inner */
  .site-header-inner .header-info-group {
    display: none !important;
  }
}

@media (width > 960px) {
  .header-info-group.mobile-only {
    display: none !important;
  }
}


/* --- Content offset for fixed navbar + sticky footer ---
   The header is position:fixed so it leaves the grid flow.
   shared.css grid-auto-rows: auto 1fr auto assumed 3 in-flow
   children (header, content, footer). With only 2 (content,
   footer), we override to 1fr auto so content expands and
   footer stays at the bottom.
   -------------------------------------------------------- */
.pa-theme .site {
  padding-top: var(--pa-nav-height);
  min-height: calc(100vh - var(--tebex-footer-height, 35px));
  grid-auto-rows: 1fr auto;
}

.pa-theme.page-index.home-categories-enabled .site {
  grid-auto-rows: auto 1fr auto;
}

@media (width <= 960px) {
  .pa-theme .site {
    padding-top: 56px;
  }
  .pa-theme .site:has(.header-info-group.mobile-only .info) {
    padding-top: calc(56px + 42px);
  }
}


/* --- Sale banner under navbar context --- */
.site-sale-banner {
  border-radius: var(--pa-radius-md);
  font-weight: 600;
}


/* ============================================================
   7. NAVIGATION
   ============================================================ */

/* Horizontal nav (desktop) — below the fixed header */
@media (width > 960px) {
  .navigation-horizontal {
    max-width: var(--content-inner-width);
    margin: 0 auto;
    padding: 0 var(--content-padding);
  }

  .navigation-horizontal .menu {
    border-radius: var(--pa-radius-md);
    background: var(--pa-bg-card);
    border: 1px solid var(--pa-border-subtle);
  }

  .navigation-horizontal .has-children > ul {
    border-radius: var(--pa-radius-md);
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--pa-border-subtle);
    box-shadow: var(--pa-shadow-lg);
  }

  .navigation-horizontal li li a:hover,
  .navigation-horizontal li li a.link-active {
    border-radius: var(--pa-radius-sm);
  }
}

/* Mobile drawer */
@media (width <= 960px) {
  .site-navigation .menu {
    background: var(--color-bg);
    border-right: 1px solid var(--pa-border-subtle);
  }
}


/* ============================================================
   8. STORE CONTENT PANELS
   ============================================================ */

.category-description {
  border-radius: var(--pa-radius-lg);
  background: var(--pa-bg-card);
  border: 1px solid var(--pa-border-subtle);
}

.store-text {
  border-radius: var(--pa-radius-lg);
  background: var(--pa-bg-card);
  border: 1px solid var(--pa-border-subtle);
}

.store-text h1,
.store-text h2,
.store-text h3,
.store-text h4,
.store-text h5,
.store-text h6 {
  text-align: center;
}

.no-products {
  color: var(--color-text-secondary);
  background: var(--pa-bg-card);
  border-radius: var(--pa-radius-lg);
  border: 1px solid var(--pa-border-subtle);
}


/* ============================================================
   9. PRODUCT CARDS
   ============================================================ */

.store-products-list .store-product,
.store-products-images .store-product {
  border-radius: var(--pa-radius-lg);
  background-color: var(--pa-bg-card);
  background-image: var(--pa-gradient-card);
  border: 1px solid var(--pa-border-subtle);
  transition: all 250ms ease;
}

.store-products-list .store-product:hover,
.store-products-images .store-product:hover {
  background-color: var(--pa-bg-card-hover);
  border-color: var(--pa-border-accent);
  box-shadow: var(--pa-shadow-md);
}

.store-products-images .store-product {
  text-align: center;
}

.store-product .product-title a:hover {
  color: var(--pa-accent-cyan);
}


/* ============================================================
   10. TIERED PRODUCTS (Subscription Tiers)
   ============================================================ */

.store-category-tiered {
  border-radius: var(--pa-radius-lg);
  background: var(--pa-bg-card);
  border: 1px solid var(--pa-border-subtle);
}

.store-category-tiered-header h1,
.store-category-tiered-header h2,
.store-category-tiered-header h3,
.store-category-tiered-header h4,
.store-category-tiered-header h5,
.store-category-tiered-header h6 {
  text-align: center;
}

.store-product-tiered {
  border-radius: var(--pa-radius-lg);
  background-color: rgba(10, 10, 15, 0.5);
  background-image: var(--pa-gradient-card);
  border: 1px solid var(--pa-border-subtle);
  transition: all 250ms ease;
}

.store-product-tiered:hover {
  background-color: var(--pa-bg-card-hover);
  border-color: var(--pa-border-accent);
  box-shadow: var(--pa-shadow-md);
}

.store-product-tiered.subscribed {
  border-color: rgba(0, 240, 255, 0.3);
  box-shadow: var(--pa-shadow-glow-cyan);
}


/* ============================================================
   11. FULL PRODUCT PAGE
   ============================================================ */

.store-product-full {
  border-radius: var(--pa-radius-lg);
  background: var(--color-brighter-bg);
}

.store-product-full .actions {
  border-top: 1px solid var(--pa-border-subtle);
  border-radius: 0 0 var(--pa-radius-lg) var(--pa-radius-lg);
}

.store-product .quantity-field {
  border-radius: var(--pa-radius-sm);
  background: var(--color-brighter-bg);
}

.store-product .quantity-field input[type=number] {
  border: none;
}


/* ============================================================
   12. MEDIA SLIDER
   ============================================================ */

.media-slider .slider {
  border-radius: var(--pa-radius-md);
}

.media-slider .thumb {
  border-radius: var(--pa-radius-sm);
  background-color: var(--pa-bg-card);
}

.media-slider .slide-video {
  border-radius: var(--pa-radius-md);
}

.media-slider .open-lightbox {
  border-radius: var(--pa-radius-sm);
}

.popup.popup-media-slider .thumb {
  border-radius: var(--pa-radius-sm);
}

.popup.popup-media-slider .popup-close {
  border-radius: var(--pa-radius-sm);
}


/* ============================================================
   13. FORMS
   ============================================================ */

.store-form input[type=text],
.store-form input[type=password],
.store-form input[type=email],
.store-form input[type=number],
.store-form input[type=search],
.store-form input[type=url],
.store-form input[type=tel],
.store-form input[type=date],
.store-form input[type=time],
.store-form input[type=datetime-local],
.store-form input[type=file],
.store-form input[type=month],
.store-form input[type=week],
.store-form select,
.store-form textarea {
  border-radius: var(--pa-radius-sm);
  border: 1px solid var(--pa-border-light);
  transition: border-color 250ms ease, box-shadow 250ms ease;
}

.store-form input:focus,
.store-form select:focus,
.store-form textarea:focus {
  border-color: var(--pa-accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

.popup .store-form input[type=text],
.popup .store-form input[type=password],
.popup .store-form input[type=email],
.popup .store-form input[type=number],
.popup .store-form input[type=search],
.popup .store-form input[type=url],
.popup .store-form input[type=tel],
.popup .store-form input[type=date],
.popup .store-form input[type=time],
.popup .store-form input[type=datetime-local],
.popup .store-form input[type=file],
.popup .store-form input[type=month],
.popup .store-form input[type=week],
.popup .store-form select,
.popup .store-form textarea {
  background: #1a1a24;
}


/* ============================================================
   14. SIDEBAR & WIDGETS
   ============================================================ */

.widget {
  border-radius: var(--pa-radius-lg);
  background: var(--pa-bg-card);
  border: 1px solid var(--pa-border-subtle);
}

@media (width <= 960px) {
  .widget.site-navigation {
    border-radius: 0;
    background: transparent;
    border: none;
  }
}

.widget-title {
  text-align: center;
  letter-spacing: -0.02em;
}

.widget .store-product {
  text-align: center;
}

.navigation-vertical.widget {
  background: var(--pa-bg-card);
}

/* Progress bars */
.widget-community-goal .progress,
.widget-goal .progress {
  border-radius: var(--pa-radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.widget-community-goal .progress-bar,
.widget-goal .progress-bar {
  border-radius: var(--pa-radius-sm);
}

/* Gift card */
.widget-gift-card .gift-card-input {
  border-radius: var(--pa-radius-sm);
  border: 1px solid var(--pa-border-light);
}

.popup .widget-gift-card .gift-card-input {
  background: #1a1a24;
}

.widget-gift-card .check {
  border-radius: var(--pa-radius-md);
}

/* Avatars */
.widget-recent .avatar {
  border-radius: var(--pa-radius-sm);
}

.widget-top-donator .avatar {
  border-radius: 50%;
}

/* Server status badges */
.widget-server-status .badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--pa-radius-sm);
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

.widget-server-status .badge-success {
  background: rgba(74, 222, 128, 0.15);
  color: #4ade80;
}

.widget-server-status .badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}


/* ============================================================
   15. POPUPS & MODALS
   ============================================================ */

.popup-content {
  border-radius: var(--pa-radius-lg);
  border: 1px solid var(--pa-border-subtle);
  box-shadow: var(--pa-shadow-lg);
}

.popup-close {
  border-radius: 0 var(--pa-radius-lg) 0 var(--pa-radius-sm);
}


/* ============================================================
   16. BASKET & CHECKOUT
   ============================================================ */

.basket .basket-header {
  background: rgba(17, 17, 24, 0.8);
}

.basket .basket-item {
  border-radius: var(--pa-radius-md);
  background: var(--pa-bg-card);
  border: 1px solid var(--pa-border-subtle);
}

.basket .basket-item .quantity {
  border-radius: var(--pa-radius-sm);
}

.basket-items {
  padding: var(--widget-padding) calc(var(--content-padding) - var(--widget-padding));
}

.basket-popup-content {
  border-left: 1px solid var(--pa-border-subtle);
}

.basket-popup-content,
.basket-popup-content .popup-close {
  border-radius: 0;
}


/* ============================================================
   17. TOASTS
   ============================================================ */

.toast {
  border-radius: var(--pa-radius-md);
  border: 1px solid var(--pa-border-subtle);
}

.toast-close {
  border-radius: var(--pa-radius-sm);
}

.toast.toast-success {
  background: rgba(74, 222, 128, 0.9);
  border-color: rgba(74, 222, 128, 0.3);
  color: #0a0a0f;
}

.toast.toast-error {
  background: rgba(239, 68, 68, 0.9);
  border-color: rgba(239, 68, 68, 0.3);
}

.toast.toast-warning {
  background: rgba(234, 179, 8, 0.9);
  border-color: rgba(234, 179, 8, 0.3);
  color: #0a0a0f;
}


/* ============================================================
   18. FOOTER — Multi-column grid matching PA website
   ============================================================ */

.site-footer {
  background: var(--color-brighter-bg);
  border-top: 1px solid var(--pa-border-subtle);
  padding: 0;
}

.site-footer-inner {
  padding-top: 48px !important;
  padding-bottom: 24px !important;
}

/* Grid layout matching main website footer */
.pa-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

/* Brand column */
.pa-footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pa-footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.pa-footer-logo {
  max-height: 36px;
  max-width: 180px;
  object-fit: contain;
}

.pa-footer-brand-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.pa-footer-desc {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: 300px;
}

/* Footer columns */
.pa-footer-col {
  display: flex;
  flex-direction: column;
}

.pa-footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  margin-bottom: 16px;
}

.pa-footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
}

.pa-footer-links a {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 150ms ease;
}

.pa-footer-links a:hover {
  color: var(--pa-accent-cyan);
}

/* Payment icons in footer column */
.pa-footer-col .we-accept {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: static !important;
}

.pa-footer-col .we-accept img {
  opacity: 0.7;
  transition: opacity 250ms ease;
  max-width: 48px;
  max-height: 24px;
}

.pa-footer-col .we-accept img:hover {
  opacity: 1;
}

/* Footer bottom divider */
.pa-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--pa-border-subtle);
}

.pa-footer-bottom .copyright {
  font-size: 0.85rem;
  color: #6b6b80;
}

/* Responsive footer */
@media (max-width: 960px) {
  .pa-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .pa-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .pa-footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .pa-footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}


/* Override hardcoded footer credit bg from shared.css */
.site-footer-credit {
  background: #0a0a0f;
}


/* ============================================================
   19. HOME CATEGORIES
   ============================================================ */

.site-home-categories .category {
  border-radius: var(--pa-radius-lg);
  padding: 20px var(--widget-padding);
  background: var(--pa-bg-card);
  border: 1px solid var(--pa-border-subtle);
  transition: all 250ms ease;
}

.site-home-categories .category:hover {
  color: var(--pa-accent-cyan);
  background: var(--pa-bg-card-hover);
  border-color: var(--pa-border-accent);
  box-shadow: var(--pa-shadow-glow-cyan);
}


/* ============================================================
   20. LINKS
   ============================================================ */

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

.link-text:hover {
  color: var(--pa-accent-cyan);
}

.site-header-inner .info .value {
  border: 1px solid var(--pa-border-light);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-secondary);
  border-radius: var(--pa-radius-sm);
}
