/*
  Tribal UI utility + components layer
  This project uses Tailwind CDN, but many templates rely on semantic classes
  like .card, .btn, .text-yellow, etc. This file provides those building blocks.
*/

:root{
  --tribal-blue: #183a67;
  --tribal-blue-light: #8b9cb3;
  --tribal-dark: #07111e;
  --tribal-text: #e7ebef;
  --tribal-yellow: #c4ff00;
  --tribal-green: #27ae60;
  --tribal-red: #E7352C;
}

/* Alpine: prevent x-show flashes before Alpine initializes */
[x-cloak] { display: none !important; }

/* Global typography defaults (body text, paragraphs, descriptions) */
html, body{
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  font-weight: 400;
  line-height: 1.6;
}

input, textarea, select, button{
  font-family: inherit;
  line-height: inherit;
}

/* =========================================================
   Mobile overflow fixes (newsletter + consent popups)
   ========================================================= */
/* Newsletter form: prevent button/input overflowing on small screens (flex min-width quirk). */
form[data-newsletter-subscribe-form]{
  width: 100%;
  max-width: 100%;
}
form[data-newsletter-subscribe-form] input[type="email"]{
  min-width: 0; /* critical for flex children on mobile */
}

/* Consent banner / privacy notice: inline width calc + padding needs border-box to avoid overflow. */
#tribal-consent-banner,
#tribal-privacy-notice{
  box-sizing: border-box;
}
#tribal-consent-banner *,
#tribal-privacy-notice *{
  box-sizing: border-box;
}

body.tribal-mobile-menu-open #tribal-consent-banner,
body.tribal-mobile-menu-open #tribal-privacy-notice{
  opacity: 0;
  pointer-events: none;
}

/* Type helpers */
.font-ui { font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji"; }
.text-muted { color: rgba(231,235,239,0.70); }
.text-yellow { color: var(--tribal-yellow); }
.text-blue-light { color: var(--tribal-blue-light); }
.text-red { color: var(--tribal-red); }

/* =========================================================
   SECTION TITLE (Canonical TEXT title system)
   Single source of truth for all section titles (except HERO)
   ========================================================= */
.section-title{
  font-family: 'Tribal Bold', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 2rem;
  margin: 0 0 2rem 0;
}
.section-title--left{ text-align: left; }
.section-title--center{ text-align: center; }
.section-title--right{ text-align: right; }

/* Fade/gradient active only when fade_intensity !== none (renderer adds class + --section-title-gradient) */
.section-title--fade{
  color: transparent !important;
  background: var(--section-title-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Legacy utility classes used in templates */
.bg-green { background: var(--tribal-green); color: var(--tribal-dark); }
.bg-red { background: var(--tribal-red); color: #fff; }
.bg-yellow { background: var(--tribal-yellow); color: var(--tribal-dark); }
.bg-blue-light { background: var(--tribal-blue-light); color: var(--tribal-dark); }

/* Tailwind-like slashed utilities used in markup */
.bg-yellow\/20 { background: rgba(196,255,0,0.20); }
.bg-blue-light\/20 { background: rgba(139,156,179,0.20); }
.bg-red\/20 { background: rgba(231,53,44,0.20); }
.bg-green\/20 { background: rgba(39,174,96,0.20); }

.hover\:bg-blue-light\/20:hover { background: rgba(139,156,179,0.20); }
.hover\:bg-red\/20:hover { background: rgba(231,53,44,0.20); }
.hover\:underline:hover { text-decoration: underline; }

/* Card */
.card{
  background: linear-gradient(180deg, rgba(7,17,30,0.70) 0%, rgba(7,17,30,0.55) 100%);
  border: 1px solid rgba(139,156,179,0.22);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 18px 45px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
  line-height: 1;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  user-select:none;
}
.btn:active{ transform: translateY(1px); }
.btn-primary{
  background: var(--tribal-yellow);
  color: var(--tribal-dark);
  box-shadow: 0 10px 24px rgba(196,255,0,0.22);
}
.btn-primary:hover{
  background: rgba(196,255,0,0.92);
  box-shadow: 0 12px 30px rgba(196,255,0,0.28);
}
.btn-secondary{
  background: rgba(196,255,0,0.08);
  color: var(--tribal-yellow);
  border: 1px solid rgba(196,255,0,0.28);
}
.btn-secondary:hover{
  background: rgba(196,255,0,0.12);
  border-color: rgba(196,255,0,0.42);
}
.btn[disabled], .btn:disabled{
  opacity: .55;
  cursor: not-allowed;
}

/* Inputs */
input[type="text"], input[type="email"], input[type="password"], input[type="url"], textarea, select{
  background: rgba(7,17,30,0.55);
  border: 1px solid rgba(139,156,179,0.25);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--tribal-text);
  outline: none;
}
input:focus, textarea:focus, select:focus{
  border-color: rgba(196,255,0,0.55);
  box-shadow: 0 0 0 3px rgba(196,255,0,0.14);
}
label{ color: rgba(231,235,239,0.85); }

/* Badges */
.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 0.72rem;
  line-height: 1.2;
}

/* Tables */
table{ border-collapse: collapse; }
thead th{
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .72rem;
  color: rgba(231,235,239,0.65);
}

/* =========================================================
   Account: "My Pre-Orders" (feature-flagged)
   - No hard-coded texts here; only layout + CSS animations.
   ========================================================= */

.tribal-preorders__header { margin-bottom: 16px; }
.tribal-preorders__filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-width: 360px;
}
.tribal-preorders__filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(139,156,179,0.86);
}
.tribal-preorders__filter-select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(231,235,239,0.16);
  background: rgba(7,17,30,0.45);
  color: var(--tribal-text);
  padding: 12px 42px 12px 14px;
  box-sizing: border-box;
  min-height: 46px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(231,235,239,0.72) 50%),
    linear-gradient(135deg, rgba(231,235,239,0.72) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.tribal-preorders__filter-select:focus {
  outline: none;
  border-color: rgba(196,255,0,0.45);
  box-shadow: 0 0 0 1px rgba(196,255,0,0.18);
}
.tribal-preorders__filter-select option {
  background: #0b1930;
  color: #e7ebef;
}
.preorder-empty-state {
  border: 1px dashed rgba(231,235,239,0.16);
  border-radius: 16px;
  padding: 18px;
  color: rgba(231,235,239,0.72);
  text-align: center;
}
.tribal-preorders__cards { display: grid; grid-template-columns: 1fr; gap: 14px; width: 100%; }
@media (min-width: 768px) { .tribal-preorders__cards { grid-template-columns: 1fr 1fr; } }

.preorder-card{
  border: 1px solid rgba(231,235,239,0.16);
  background: rgba(7,17,30,0.35);
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}
.preorder-card-title{ font-weight: 900; color: var(--tribal-text); overflow-wrap: anywhere; }
.preorder-card-variant{ margin-top: 4px; font-size: 0.85rem; color: rgba(231,235,239,0.70); overflow-wrap: anywhere; }
.preorder-card-eta{ margin-top: 8px; font-size: 0.85rem; color: rgba(231,235,239,0.80); overflow-wrap: anywhere; }

.preorder-disclaimer{
  margin-top: 10px;
  font-size: 0.82rem;
  color: rgba(231,235,239,0.70);
}

.preorder-timeline{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 10px;
  min-width: 0;
}
.preorder-step{ display:flex; flex-direction:column; align-items:center; gap:6px; min-width: 66px; flex: 0 1 66px; }
.preorder-step-label{ font-size: 0.72rem; text-align:center; color: rgba(231,235,239,0.72); overflow-wrap:anywhere; }
.preorder-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(139,156,179,0.55);
  border: 1px solid rgba(231,235,239,0.22);
}
.preorder-line{
  flex: 1 1 auto;
  height: 2px;
  background: rgba(139,156,179,0.35);
  border-radius: 999px;
}

.preorder-step.is-complete .preorder-dot{ background: rgba(196,255,0,0.85); border-color: rgba(196,255,0,0.55); }
.preorder-line.is-complete{ background: rgba(196,255,0,0.55); }

@keyframes preorderPulse {
  0% { box-shadow: 0 0 0 0 rgba(196,255,0,0.22); transform: scale(1); }
  70% { box-shadow: 0 0 0 10px rgba(196,255,0,0.0); transform: scale(1.08); }
  100% { box-shadow: 0 0 0 0 rgba(196,255,0,0.0); transform: scale(1); }
}
.preorder-step.is-active .preorder-dot{
  background: rgba(196,255,0,1);
  border-color: rgba(196,255,0,0.70);
  animation: preorderPulse 1.6s ease-in-out infinite;
}
.preorder-step.is-active .preorder-step-label{ color: rgba(231,235,239,0.92); }

@media (max-width: 640px) {
  .tribal-preorders__filters{
    max-width: 100%;
  }
  .preorder-card{
    padding: 12px;
  }

  .preorder-timeline{
    gap: 6px;
  }

  .preorder-step{
    min-width: 0;
    flex: 1 1 0;
  }

  .preorder-step-label{
    font-size: 0.65rem;
    line-height: 1.2;
  }
}

@keyframes preorderFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.preorder-fade-in{ animation: preorderFadeIn 220ms ease-out both; }

.preorder-explanation{ margin-top: 8px; }
.preorder-explanation-title{ font-size: 0.86rem; font-weight: 800; color: rgba(231,235,239,0.92); }
.preorder-explanation-desc{ margin-top: 2px; font-size: 0.84rem; color: rgba(231,235,239,0.70); }

.preorder-cancelled .preorder-dot{ background: rgba(231,53,44,0.85); border-color: rgba(231,53,44,0.55); }

/* =========================================================
   Make Your Offer (MAKE YOUR MOVE)
   ========================================================= */
.tribal-offer-box {
  /* Match spacing between Size block and Add to Cart row (.product-actions margin-top: 1.5rem) */
  margin-top: 1.5rem;
  padding: 16px 16px;
  border-radius: 12px;
  background: #f3f4f6;
}

.tribal-offer-title {
  font-family: 'Tribal Bold', 'tribal-bold_2', sans-serif;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b9cb3;
  font-size: 26px;
  line-height: 1.05;
  margin: 0 0 10px 0;
}

.tribal-offer-subtitle {
  color: #6b7280;
  font-weight: 600;
  font-size: 13px;
  margin: 0 0 14px 0;
}

.tribal-offer-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tribal-offer-input {
  flex: 0 0 160px;
  width: 160px;
  max-width: 100%;
  padding: 14px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font-weight: 700;
}

.tribal-offer-input::placeholder{
  color: rgba(17,24,39,0.45);
}

.tribal-offer-btn {
  flex: 1 1 auto;
  padding: 14px 24px;
  border-radius: 12px;
  border: 1px solid rgba(196,255,0,0.55);
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 1rem;
  background: var(--tribal-yellow);
  color: var(--tribal-dark);
  box-shadow: 0 10px 24px rgba(196,255,0,0.22);
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.tribal-offer-btn:hover:not(:disabled){
  background: rgba(196,255,0,0.92);
  border-color: rgba(196,255,0,0.72);
  box-shadow: 0 12px 30px rgba(196,255,0,0.28);
  transform: translateY(-1px);
}

.tribal-offer-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tribal-offer-note {
  margin-top: 10px;
  color: #6b7280;
  font-style: italic;
  font-size: 12px;
}

.tribal-offer-result {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
}

.tribal-offer-result.is-error { color: #b91c1c; }
.tribal-offer-result.is-ok { color: #065f46; }

.tribal-offer-slider-label{
  margin-top: 10px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.tribal-offer-slider{
  width: 100%;
  margin-top: 8px;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to right,
    rgba(24,58,103,0.45) 0%,
    rgba(24,58,103,0.45) var(--offer-slider-pct, 0%),
    rgba(139,156,179,0.35) var(--offer-slider-pct, 0%),
    rgba(139,156,179,0.35) 100%
  );
  outline: none;
}

.tribal-offer-slider::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--tribal-yellow);
  border: 2px solid rgba(24,58,103,0.25);
  box-shadow: 0 6px 16px rgba(24,58,103,0.18);
  cursor: pointer;
}

.tribal-offer-slider::-moz-range-thumb{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--tribal-yellow);
  border: 2px solid rgba(24,58,103,0.25);
  box-shadow: 0 6px 16px rgba(24,58,103,0.18);
  cursor: pointer;
}

.tribal-offer-slider::-moz-range-track{
  height: 8px;
  border-radius: 999px;
  background: transparent;
}

.tribal-offer-status{
  margin-top: 8px;
  color: #b45309;
  font-weight: 800;
  font-size: 13px;
}

/* =========================================================
   Make Your Offer: Login modal (embed)
   ========================================================= */
.tribal-login-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.tribal-login-modal{
  width: min(560px, 96vw);
  height: min(720px, 92vh);
  background: #07111e;
  border: 1px solid rgba(139,156,179,0.25);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
}
.tribal-login-modal-close{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(231,235,239,0.18);
  background: rgba(7,17,30,0.55);
  color: rgba(231,235,239,0.9);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.tribal-login-modal-close:hover{
  border-color: rgba(196,255,0,0.45);
}
.tribal-login-modal-frame{
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

/* =========================================================
   TRIBAL REVIEWS SYSTEM
   - Homepage floating widget
   - Reviews modal
   - Review cards
   - Star rating
   - Product reviews section (page builder)
   ========================================================= */

/* Star colors */
.tribal-reviews-widget__star{
  color: rgba(139,156,179,0.35);
  transition: color .15s ease;
}
.tribal-reviews-widget__star--full{
  color: var(--tribal-yellow);
}
.tribal-reviews-widget__star--half{
  color: var(--tribal-yellow);
  opacity: 0.6;
}

/* Floating widget (right middle) */
.tribal-reviews-root{
  position: fixed;
  inset: 0;
  isolation: isolate;
  z-index: 2147482980;
  pointer-events: none;
}
.tribal-reviews-widget{
  position: fixed;
  right: 0;
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  min-height: 92px;
  max-width: none;
  padding: 8px 4px;
  background: linear-gradient(135deg, rgba(7,17,30,0.92) 0%, rgba(24,58,103,0.92) 100%);
  border: 1px solid rgba(196,255,0,0.25);
  border-right: none;
  border-radius: 12px 0 0 12px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.42);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, opacity .2s ease;
  white-space: normal;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  touch-action: manipulation;
}
.tribal-reviews-widget:hover{
  transform: translate(-3px, -50%);
  box-shadow: 0 12px 40px rgba(0,0,0,0.55);
  border-color: rgba(196,255,0,0.45);
}
.cart-sidebar-open .tribal-reviews-widget{
  opacity: 0;
  pointer-events: none;
  transform: translate(12px, -50%);
}
body.tribal-mobile-menu-open .tribal-reviews-widget{
  opacity: 0;
  pointer-events: none;
  transform: translate(12px, -50%);
}
.tribal-reviews-widget__stars{
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-size: 0.58rem;
  line-height: 1;
  flex-shrink: 0;
}
/* In review blocks (page builder block + modal popup): stars horizontal */
.tribal-product-reviews-section .tribal-reviews-widget__stars,
.tribal-reviews-modal .tribal-reviews-widget__stars,
.tribal-review-card .tribal-reviews-widget__stars {
  flex-direction: row;
  gap: 1px;
  font-size: inherit;
}
.tribal-reviews-widget__text,
.tribal-reviews-widget__score{
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--tribal-text);
  letter-spacing: 0;
  line-height: 1.1;
  text-align: center;
}

/* Reviews modal overlay */
.tribal-reviews-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  pointer-events: auto;
}

body.tribal-reviews-modal-open{
  overflow: hidden;
}

/* Reviews modal */
.tribal-reviews-modal{
  width: min(580px, 96vw);
  max-height: min(80vh, 700px);
  background: linear-gradient(180deg, #0b1a2e 0%, #07111e 100%);
  border: 1px solid rgba(139,156,179,0.22);
  border-radius: 18px;
  padding: 28px;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
}
.tribal-reviews-modal__close{
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(231,235,239,0.18);
  background: rgba(7,17,30,0.55);
  color: rgba(231,235,239,0.9);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: border-color .15s ease;
}
.tribal-reviews-modal__close:hover{
  border-color: rgba(196,255,0,0.45);
}
.tribal-reviews-modal__list{
  padding-right: 4px;
}

/* Review card */
.tribal-review-card{
  background: rgba(7,17,30,0.45);
  border: 1px solid rgba(139,156,179,0.15);
  border-radius: 12px;
  padding: 16px;
  transition: border-color .15s ease;
}
.tribal-review-card:hover{
  border-color: rgba(196,255,0,0.18);
}

/* Star rating input (review form) */
.tribal-review-star{
  cursor: pointer;
  line-height: 1;
  border: none;
  background: none;
  padding: 0;
}
.tribal-review-star--active{
  color: var(--tribal-yellow);
}
.tribal-review-star--inactive{
  color: rgba(139,156,179,0.35);
}

/* Product reviews section (page builder) */
.tribal-product-reviews-section{
  background: rgba(7,17,30,0.25);
}

/* Mobile adjustments */
@media (max-width: 767px){
  .tribal-reviews-widget{
    display: none !important;
  }
}

@media (max-width: 1024px){
  .tribal-reviews-widget{
    right: 0;
    width: 36px;
    min-height: 84px;
    padding: 7px 4px;
  }
  .tribal-reviews-widget__stars{ font-size: 0.52rem; }
  .tribal-reviews-widget__text,
  .tribal-reviews-widget__score{ font-size: 0.58rem; }
}

@media (max-width: 640px){
  .tribal-reviews-modal{
    padding: 20px;
    border-radius: 14px;
  }
}
