/* ==========================================================================
   ASTRAL SMP — Tebex Webstore Theme
   A burning-red, ember-dark identity for a small, fair-play SMP.
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Russo+One&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  /* ---- Astral palette ---- */
  --color-text: #F2E9E4;
  --color-text-darker: #D8C9C2;
  --color-text-secondary: #B8A39B;
  --color-text-dark: #1A0A08;

  --color-bg: #0A0504;
  --color-brighter-bg: #160A08;

  --color-primary: #E1281C;
  --color-primary-hover: #FF4730;
  --color-primary-text: #FFFFFF;
  --color-primary-text-hover: #FFFFFF;

  --color-secondary: #3A1A14;
  --color-secondary-hover: #4F231B;
  --color-secondary-text: var(--color-text);
  --color-secondary-text-hover: var(--color-text);

  --color-tertiary: transparent;
  --color-tertiary-hover: rgba(225, 40, 28, 0.12);
  --color-tertiary-text: var(--color-text);
  --color-tertiary-text-hover: var(--color-primary-hover);

  --color-removed: #8a3b3b;
  --color-sale-banner-bg: linear-gradient(90deg, #FF0000, #9B0000);
  --color-sale-banner-text: #fff;

  --ember-1: #FF6B3D;
  --ember-2: #9B0000;
  --ember-glow: rgba(225, 40, 28, 0.35);

  --bg-image: url("https://template-assets.tebex.io/images/page-bg.jpg");

  --font-display: "Russo One", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, sans-serif;
}

body {
  font-family: var(--font-body);
  letter-spacing: 0.1px;
  position: relative;
  isolation: isolate;
}

/* Replace the default top fade-photo with a deep gradient + ember canvas mount */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(225, 40, 28, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 85% 100%, rgba(155, 0, 0, 0.12), transparent 60%),
    linear-gradient(180deg, #0A0504 0%, #0A0504 100%);
  pointer-events: none;
}

#astral-embers {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ---- Headline / display type ---- */
h1, h2, h3,
.widget-title,
.site-title,
.product-title,
.basket-title,
.category-description h1,
.category-description h2 {
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Site title gets the signature gradient burn */
.site-header-inner .site-title,
.site-header-inner .site-title a {
  background: linear-gradient(90deg, #FF0000 0%, #9B0000 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 18px rgba(225, 40, 28, 0.45));
}

/* ---- Buttons ---- */
.btn-primary,
.btn-secondary,
.btn-tertiary {
  border-radius: 4px;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.3px;
  position: relative;
  transition: all 0.2s ease-out, box-shadow 0.25s ease-out;
}

.btn-primary {
  background: linear-gradient(90deg, #FF0000, #9B0000);
  border: 1px solid rgba(255, 90, 60, 0.4);
}
.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(90deg, #FF3A26, #C40000);
  box-shadow: 0 0 0 1px rgba(255, 120, 90, 0.5), 0 6px 24px -4px var(--ember-glow);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--color-secondary);
  border: 1px solid rgba(225, 40, 28, 0.25);
}
.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--color-secondary-hover);
  box-shadow: 0 0 16px -4px var(--ember-glow);
}

.btn-tertiary:hover,
.btn-tertiary:focus {
  box-shadow: inset 0 0 0 1px rgba(225, 40, 28, 0.3);
}

.quantity-field {
  border-radius: 4px;
  border-color: rgba(225, 40, 28, 0.3);
  background: var(--color-brighter-bg);
}

/* ---- Header info pills (server / discord) ---- */
.site-header-inner .info .image {
  border-radius: 4px;
  filter: drop-shadow(0 0 6px rgba(225, 40, 28, 0.3));
}
.site-header-inner .info .value {
  border-color: rgba(225, 40, 28, 0.3);
  background: rgba(225, 40, 28, 0.1);
}

.site-sale-banner {
  background: var(--color-sale-banner-bg);
  border-radius: 6px;
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  box-shadow: 0 4px 20px -4px var(--ember-glow);
}

/* ---- Home categories ---- */
.site-home-categories .category {
  border-radius: 8px;
  padding: 24px var(--widget-padding);
  background: linear-gradient(160deg, var(--color-brighter-bg), rgba(40, 12, 10, 0.6));
  border: 1px solid rgba(225, 40, 28, 0.12);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, color 0.15s ease-in-out;
}
.site-home-categories .category:hover {
  color: var(--color-primary-hover);
  border-color: rgba(225, 40, 28, 0.45);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px -8px var(--ember-glow);
}
.site-home-categories .category .image-default::before {
  filter: drop-shadow(0 0 8px var(--ember-glow));
}

.category-description,
.store-text {
  border-radius: 8px;
  background: linear-gradient(160deg, var(--color-brighter-bg), rgba(30, 10, 9, 0.5));
  border: 1px solid rgba(225, 40, 28, 0.1);
}
.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(--color-brighter-bg);
  border-radius: 8px;
  border: 1px dashed rgba(225, 40, 28, 0.25);
}

/* ---- Rank / package cards — the signature element ---- */
.store-products-list .store-product,
.store-products-images .store-product {
  position: relative;
  border-radius: 10px;
  background: linear-gradient(165deg, #170B09 0%, #0F0706 100%);
  border: 1px solid rgba(225, 40, 28, 0.14);
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1), border-color 0.28s ease, box-shadow 0.28s ease;
}

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

/* ember glow sweep on hover, signature interaction */
.store-products-list .store-product::before,
.store-products-images .store-product::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto -40%;
  height: 140%;
  background: radial-gradient(circle, var(--ember-glow), transparent 70%);
  opacity: 0;
  transform: translateY(20%) scale(0.85);
  transition: opacity 0.35s ease, transform 0.5s ease;
  pointer-events: none;
  z-index: 0;
}

.store-products-list .store-product:hover,
.store-products-images .store-product:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 90, 60, 0.5);
  box-shadow: 0 16px 40px -12px rgba(225, 40, 28, 0.4), 0 0 0 1px rgba(255, 90, 60, 0.15);
}
.store-products-list .store-product:hover::before,
.store-products-images .store-product:hover::before {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.store-product > * {
  position: relative;
  z-index: 1;
}

.widget-title {
  text-align: center;
  font-size: 18px;
  color: var(--color-text-darker);
}

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

.store-product-full {
  border-radius: 10px;
  background: linear-gradient(165deg, #170B09 0%, #0F0706 100%);
  border: 1px solid rgba(225, 40, 28, 0.16);
}

.store-product .quantity-field {
  border-radius: 6px;
  background: var(--color-brighter-bg);
}
.store-product .quantity-field input[type=number] {
  border: none;
  color: var(--color-text);
}

.store-product .descr {
  color: var(--color-text-secondary);
}

.store-product .price strong {
  color: var(--color-text);
}

/* Featured package gets a slightly stronger ember outline since it's the "best" rank */
.widget-featured .store-product {
  border-color: rgba(255, 90, 60, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 90, 60, 0.12), 0 0 32px -10px var(--ember-glow);
}

/* ---- Navigation ---- */
@media (width > 960px) {
  .navigation-horizontal > ul {
    border-radius: 8px;
  }
}
.navigation-horizontal .has-children > ul {
  border-radius: 8px;
  border: 1px solid rgba(225, 40, 28, 0.15);
}
.navigation-horizontal .menu {
  background: var(--color-brighter-bg);
  border-bottom: 1px solid rgba(225, 40, 28, 0.12);
}
.navigation-horizontal a:hover,
.navigation-horizontal a.link-active {
  color: var(--color-primary-hover);
}
.navigation-vertical a:hover,
.navigation-vertical a.link-active {
  color: var(--color-primary-hover);
}
.site-navigation a.active {
  color: var(--color-primary-hover);
}

.widget {
  border-radius: 10px;
  background: linear-gradient(165deg, var(--color-brighter-bg), rgba(20, 8, 7, 0.6));
  border: 1px solid rgba(225, 40, 28, 0.1);
}
@media (width <= 960px) {
  .widget.site-navigation {
    border-radius: 0;
    background: transparent;
    border: none;
  }
}

.widget-gift-card .gift-card-input {
  border-radius: 4px;
  border: 1px solid rgba(225, 40, 28, 0.25);
}

.widget-top-donator .avatar {
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(225, 40, 28, 0.4);
}

.widget-community-goal .progress,
.widget-goal .progress {
  border-radius: 4px;
  background: var(--color-bg);
}
.widget-community-goal .progress-bar,
.widget-goal .progress-bar {
  border-radius: 4px;
  background: linear-gradient(90deg, #FF0000, #9B0000);
}

/* ---- Popups / basket ---- */
.popup-content {
  border-radius: 10px;
  background: #120907;
  border: 1px solid rgba(225, 40, 28, 0.15);
}

.popup-close {
  border-radius: 0 10px 0 10px;
}

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

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

.basket-item {
  border-radius: 8px;
  background: var(--color-brighter-bg);
  border: 1px solid rgba(225, 40, 28, 0.1);
}
.basket-item .quantity {
  border-radius: 4px;
}

.basket .basket-header {
  background: linear-gradient(90deg, rgba(225,40,28,0.18), rgba(20,8,7,0.4));
}

.toast {
  border-radius: 8px;
}

.toast-close {
  border-radius: 4px;
}

.store-category-tiered {
  border-radius: 10px;
  background: var(--color-brighter-bg);
}

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

.store-product-tiered {
  border-radius: 10px;
  background: rgb(from var(--color-bg) r g b/0.5);
  border: 1px solid rgba(225, 40, 28, 0.12);
}

.media-slider .slider,
.media-slider .thumb {
  border-radius: 8px;
}
.media-slider .open-lightbox {
  border-radius: 4px;
}

.popup.popup-media-slider .thumb {
  border-radius: 8px;
}
.popup.popup-media-slider .popup-close {
  border-radius: 8px;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--color-brighter-bg);
  border-top: 1px solid rgba(225, 40, 28, 0.1);
}
.site-footer-credit {
  background: #0D0605;
}
.site-footer-inner .site-footer-nav a:hover {
  color: var(--color-primary-hover);
}
.site-footer-credit .legal a:hover {
  color: var(--color-primary-hover);
}

/* ==========================================================================
   Marquee discount bar
   ========================================================================== */
.astral-marquee {
  position: relative;
  z-index: 50;
  width: 100%;
  overflow: hidden;
  background: linear-gradient(90deg, #9B0000, #E1281C, #9B0000);
  border-bottom: 1px solid rgba(255, 120, 90, 0.3);
  box-shadow: 0 2px 16px -4px var(--ember-glow);
}

.astral-marquee-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: astral-marquee-scroll 18s linear infinite;
}

.astral-marquee-track span {
  display: inline-block;
  padding: 9px 48px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.2px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

@keyframes astral-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .astral-marquee-track {
    animation: none;
  }
}

/* ==========================================================================
   Header layout: logo + action pills (IP / Discord / Login / Basket)
   FIX: previously .astral-header-actions used position: absolute, which
   pulled it out of the normal flow and let it overlap the logo. Now the
   header uses flexbox so the logo and the pill group sit side by side.
   ========================================================================== */
.site-header-inner {
  position: relative;
}

.astral-header-actions {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 10px;
  position: absolute !important;
  top: 16px;
  right: var(--widget-padding);
}

.astral-header-actions > * {
  position: static !important;
}

/* Visual order: Basket, Login, Discord, IP */
.astral-header-actions .open-basket {
  order: 1;
}
.astral-header-actions .log-in,
.astral-header-actions .user-name {
  order: 2;
}
.astral-header-actions a[href*="discord"] {
  order: 3;
}
.astral-header-actions button:not(.open-basket) {
  order: 4;
}

@media (width <= 960px) {
  .astral-header-actions {
    gap: 6px;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .astral-header-actions::-webkit-scrollbar {
    display: none;
  }
  .astral-header-actions .astral-pill {
    flex: none;
    height: 38px;
    padding: 0 12px;
    font-size: 13px;
  }
}

@media (width > 960px) {
  .astral-header-actions .astral-pill {
    flex: none;
  }
}

.astral-pill {
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}

.astral-pill.btn-primary {
  background: linear-gradient(90deg, #FF0000, #9B0000);
}

/* ==========================================================================
   Shell layout: left "recent purchases" rail + main content
   ========================================================================== */
.astral-shell {
  display: flex;
  flex-direction: column;
  gap: var(--widget-padding);
  width: 100%;
}
@media (width > 960px) {
  .astral-shell {
    gap: calc(var(--widget-padding) * 1.5);
  }
}

.astral-main {
  flex: 1 1 auto;
  min-width: 0;
}

.astral-recent-sidebar {
  display: none;
}

@media (width > 960px) {
  .astral-recent-sidebar {
    display: block;
    flex: none;
    width: 100%;
  }

  .astral-recent-sidebar .widget {
    border-radius: 24px;
    background: linear-gradient(180deg, #170B09 0%, #0F0706 100%);
    border: 1px solid rgba(225, 40, 28, 0.16);
  }
}

/* sidebar.twig wraps its widgets in a container - lay the 3 cards out horizontally */
.astral-recent-sidebar {
  display: flex !important;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--widget-padding);
  width: 100%;
}

.astral-recent-sidebar > * {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--widget-padding);
  width: 100%;
}

.astral-recent-sidebar .widget {
  flex: 1 1 260px;
  min-width: 0;
  margin-top: 0 !important;
}

/* Category / rank listing area styled as the big rounded "ranks" container */
.store-products {
  border-radius: 28px;
  padding: var(--widget-padding);
  background: linear-gradient(165deg, #150A08 0%, #0D0605 100%);
  border: 1px solid rgba(225, 40, 28, 0.14);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .site-home-categories .category,
  .store-products-list .store-product,
  .store-products-images .store-product,
  .btn-primary {
    transition: none !important;
  }
  #astral-embers {
    display: none;
  }
}