/* ===========================
   Kismet Candles – Dark Theme
   Enhanced Version with Readability & Performance
   =========================== */

:root{
  /* Global tokens */
  --kismet-ink:#0d0d12;
  --kismet-smoke:#1a1a24;
  --kismet-star:#eaeaff;
  --kismet-accent:#00d4ff;
  --kismet-rose:#ff6f91;
  --kismet-pink:#f15bb5;
  --kismet-ember:#ff9650;
  --kismet-emerald:#34c759;
  --kismet-gold:#ffd166;
  --kismet-violet:#7a5cff;

  /* Context variables (overridden by context-plus plugin when present) */
  --kismet-theme-base:#7a5cff;
  --kismet-theme-secondary:#00d4ff;
  --kismet-theme-halo:#ffd166;
}

/* ===========================
   HEADER BACKGROUND FIX
   =========================== */
   
/* Force header background to display properly */
#masthead,
.header,
.header-wrapper,
.header-main {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* Flatsome header builder compatibility */
.header-bg-image {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Ensure background displays behind content */
.header-bg {
  z-index: 0 !important;
}

.header-wrapper {
  position: relative;
  z-index: 1;
}

/* Reduce overlay opacity to show header image */
.header:before,
.header-wrapper:before {
  background-color: rgba(13, 13, 18, 0.6) !important;
}

/* ===========================
   DARK SITE BASELINE
   =========================== */

html, body{
  background-color: var(--kismet-ink);
  color: #f1f1f8;
  background-image: 
    radial-gradient(1200px 800px at 50% -10%, rgba(122, 92, 255, 0.05), transparent),
    radial-gradient(800px 600px at 20% 100%, rgba(255, 111, 145, 0.03), transparent),
    radial-gradient(600px 400px at 80% 80%, rgba(0, 212, 255, 0.02), transparent);
}

/* Enhanced readability */
body,
.page-wrapper,
.section-content {
  color: #f1f1f8;
}

p, li, span, div {
  color: inherit;
}

/* Headers should pop more */
h1, h2, h3, h4, h5, h6 {
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ===========================
   NAVIGATION
   =========================== */

.header-nav,
.nav-top {
  background-color: rgba(13, 13, 18, 0.9);
  backdrop-filter: blur(10px);
}

.nav > li > a {
  color: #f1f1f8 !important;
  transition: all 0.3s ease;
}

.nav > li > a:hover {
  color: var(--kismet-accent) !important;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.nav > li.active > a,
.nav > li.current-menu-item > a {
  color: var(--kismet-gold) !important;
}

/* ===========================
   LINKS
   =========================== */

a{ 
  color: var(--kismet-accent);
  transition: color 0.3s ease;
}

a:hover{ 
  color: var(--kismet-gold);
}

/* ===========================
   BUTTONS
   =========================== */

.button, .ux-button{
  border-radius: 16px;
  padding: 0.8em 1.4em;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  min-height: 44px; /* Better touch target */
}

.button:hover, 
.ux-button:hover{ 
  transform: translateY(-2px);
}

/* Primary variants */
.button.primary{
  background-image: linear-gradient(135deg, var(--kismet-violet), var(--kismet-rose));
  color: #fff;
}

.button.outline{
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: #fff;
}

.button.outline:hover{
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.9);
}

/* Category-themed button glows */
.button-love {
  background: linear-gradient(135deg, #f15bb5, #ff6f91);
  color: #fff;
}

.button-love:hover{
  box-shadow: 
    0 0 8px rgba(255, 110, 145, 0.6),
    0 0 20px rgba(241, 91, 181, 0.6),
    0 0 40px rgba(255, 140, 200, 0.4);
}

.button-protect {
  background: linear-gradient(135deg, #ff9650, #ff6a00);
  color: #fff;
}

.button-protect:hover{
  box-shadow: 
    0 0 8px rgba(255, 150, 80, 0.7),
    0 0 20px rgba(255, 100, 40, 0.6),
    0 0 40px rgba(255, 180, 100, 0.4);
}

.button-abund {
  background: linear-gradient(135deg, #34c759, #ffd166);
  color: #fff;
}

.button-abund:hover{
  box-shadow: 
    0 0 8px rgba(52, 199, 89, 0.7),
    0 0 20px rgba(255, 209, 102, 0.6),
    0 0 40px rgba(52, 199, 89, 0.4);
}

.button-vision {
  background: linear-gradient(135deg, #7a5cff, #00d4ff);
  color: #fff;
}

.button-vision:hover{
  box-shadow: 
    0 0 8px rgba(122, 92, 255, 0.7),
    0 0 20px rgba(0, 212, 255, 0.6),
    0 0 40px rgba(122, 92, 255, 0.4);
}

.button-magic {
  background: linear-gradient(135deg, #f15bb5, #00d4ff, #ffd166);
  color: #fff;
}

.button-magic:hover{
  box-shadow: 
    0 0 10px rgba(255, 255, 255, 0.6),
    0 0 25px rgba(241, 91, 181, 0.5),
    0 0 45px rgba(0, 212, 255, 0.5),
    0 0 65px rgba(255, 209, 102, 0.35);
}

/* ===========================
   GLOW TEXT UTILITIES
   =========================== */

.kismet-glow-text{
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.3),
    0 0 28px rgba(122, 92, 255, 0.35),
    0 0 48px rgba(0, 212, 255, 0.25);
}

.kismet-glow-love{
  text-shadow:
    0 0 10px rgba(255, 110, 145, 0.7),
    0 0 25px rgba(241, 91, 181, 0.6),
    0 0 45px rgba(255, 140, 200, 0.4);
}

.kismet-glow-protect{
  text-shadow:
    0 0 10px rgba(255, 150, 80, 0.7),
    0 0 25px rgba(255, 100, 40, 0.6),
    0 0 45px rgba(255, 180, 100, 0.4);
}

.kismet-glow-abund{
  text-shadow:
    0 0 10px rgba(52, 199, 89, 0.7),
    0 0 25px rgba(255, 209, 102, 0.6),
    0 0 45px rgba(52, 199, 89, 0.4);
}

.kismet-glow-vision{
  text-shadow:
    0 0 10px rgba(122, 92, 255, 0.7),
    0 0 25px rgba(0, 212, 255, 0.6),
    0 0 45px rgba(122, 92, 255, 0.4);
}

.kismet-glow-magic{
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.6),
    0 0 30px rgba(241, 91, 181, 0.5),
    0 0 50px rgba(0, 212, 255, 0.5),
    0 0 70px rgba(255, 209, 102, 0.35);
}

/* Soft glow for images and elements */
.kismet-glow-soft {
  box-shadow: 
    0 0 20px rgba(122, 92, 255, 0.2),
    0 0 40px rgba(0, 212, 255, 0.1);
}

/* ===========================
   FORMS
   =========================== */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea,
select {
  background-color: rgba(26, 26, 36, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--kismet-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
  background-color: rgba(26, 26, 36, 0.95);
}

/* ===========================
   WOOCOMMERCE PRODUCTS
   =========================== */

/* Product titles and prices */
.product-title,
.woocommerce-loop-product__title {
  color: #fff !important;
}

.price,
.amount {
  color: var(--kismet-gold) !important;
  font-weight: 600;
}

/* Product cards */
.product,
.product-small,
.col-inner {
  background-color: rgba(26, 26, 36, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.product:hover,
.product-small:hover {
  background-color: rgba(26, 26, 36, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Product images with glow on hover */
.product-small img,
.product img {
  transition: all 0.4s ease;
}

.product-small img:hover,
.product img:hover {
  box-shadow: 
    0 0 30px rgba(255, 255, 255, 0.1),
    0 0 60px var(--kismet-theme-base, rgba(122, 92, 255, 0.3));
  transform: scale(1.02);
}

/* ===========================
   WOOCOMMERCE CART & CHECKOUT
   =========================== */

.woocommerce-cart,
.woocommerce-checkout {
  color: #f1f1f8;
}

.woocommerce table.shop_table {
  background-color: rgba(26, 26, 36, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #f1f1f8;
}

.woocommerce table.shop_table th {
  background-color: rgba(122, 92, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
}

.woocommerce table.shop_table td {
  border-color: rgba(255, 255, 255, 0.08);
  color: #f1f1f8;
}

.cart-totals,
.woocommerce-checkout-review-order {
  background-color: rgba(26, 26, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 12px;
}

/* ===========================
   SECTION UTILITIES
   =========================== */

.kismet-hero{
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 140px 0;
}

.kismet-stars::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.35), transparent 30%),
    radial-gradient(1.5px 1.5px at 70% 60%, rgba(255, 255, 255, 0.25), transparent 30%),
    radial-gradient(2px 2px at 40% 80%, rgba(0, 212, 255, 0.25), transparent 30%);
}

.kismet-bloom::before{
  content: "";
  position: absolute;
  inset: -2%;
  pointer-events: none;
  box-shadow: 
    0 0 140px rgba(255, 255, 255, 0.08) inset,
    0 0 200px rgba(122, 92, 255, 0.12) inset;
}

.kismet-rotating{
  position: relative;
  padding: 40px 0;
}

.kismet-intro{
  position: relative;
  padding: 80px 0;
}

.kismet-featured-hero{
  position: relative;
  padding: 80px 0;
  text-align: center;
}

.kismet-incantations{
  padding: 60px 0;
}

.kismet-cta{
  padding: 100px 0;
  text-align: center;
}

.kismet-footer-signup{
  padding: 40px 0;
  text-align: center;
}

/* Category banner halo helper */
.kismet-banner{
  position: relative;
  padding: 110px 0;
}

.kismet-banner::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    600px 260px at 50% 40%,
    color-mix(in oklab, var(--kismet-theme-halo) 30%, transparent),
    transparent
  );
  mix-blend-mode: screen;
}

/* Fallback for browsers without color-mix */
@supports not (color: color-mix(in oklab, red, blue)) {
  .kismet-banner::after {
    background: radial-gradient(
      600px 260px at 50% 40%,
      rgba(255, 209, 102, 0.3),
      transparent
    );
  }
}

/* ===========================
   CATEGORY-BASED AUTO GLOWS
   =========================== */

/* Love & Passion */
.tax-product_cat.term-love-passion .button{
  background: linear-gradient(135deg, #f15bb5, #ff6f91);
  color: #fff;
}

.tax-product_cat.term-love-passion .button:hover{
  box-shadow: 
    0 0 8px rgba(255, 110, 145, 0.6),
    0 0 20px rgba(241, 91, 181, 0.6),
    0 0 40px rgba(255, 140, 200, 0.4);
}

/* Protection & Renewal */
.tax-product_cat.term-protection-renewal .button{
  background: linear-gradient(135deg, #ff9650, #ff6a00);
  color: #fff;
}

.tax-product_cat.term-protection-renewal .button:hover{
  box-shadow: 
    0 0 8px rgba(255, 150, 80, 0.7),
    0 0 20px rgba(255, 100, 40, 0.6),
    0 0 40px rgba(255, 180, 100, 0.4);
}

/* Prosperity & Abundance */
.tax-product_cat.term-prosperity-abundance .button{
  background: linear-gradient(135deg, #34c759, #ffd166);
  color: #fff;
}

.tax-product_cat.term-prosperity-abundance .button:hover{
  box-shadow: 
    0 0 8px rgba(52, 199, 89, 0.7),
    0 0 20px rgba(255, 209, 102, 0.6),
    0 0 40px rgba(52, 199, 89, 0.4);
}

/* Wisdom & Vision */
.tax-product_cat.term-wisdom-vision .button{
  background: linear-gradient(135deg, #7a5cff, #00d4ff);
  color: #fff;
}

.tax-product_cat.term-wisdom-vision .button:hover{
  box-shadow: 
    0 0 8px rgba(122, 92, 255, 0.7),
    0 0 20px rgba(0, 212, 255, 0.6),
    0 0 40px rgba(122, 92, 255, 0.4);
}

/* Transformation & Magic */
.tax-product_cat.term-transformation-magic .button{
  background: linear-gradient(135deg, #f15bb5, #00d4ff, #ffd166);
  color: #fff;
}

.tax-product_cat.term-transformation-magic .button:hover{
  box-shadow: 
    0 0 10px rgba(255, 255, 255, 0.6),
    0 0 25px rgba(241, 91, 181, 0.5),
    0 0 45px rgba(0, 212, 255, 0.5),
    0 0 65px rgba(255, 209, 102, 0.35);
}

/* ===========================
   ACCESSIBILITY
   =========================== */

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--kismet-accent);
  outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--kismet-accent);
  color: #000;
  padding: 8px 16px;
  z-index: 9999;
  transition: top 0.3s;
}

.skip-to-content:focus {
  top: 0;
}

/* ===========================
   ANIMATIONS
   =========================== */

/* Fade-in on scroll helper */
.kismet-fade{
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.kismet-fade.is-visible{
  opacity: 1;
  transform: none;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 849px){
  .kismet-hero{
    padding: 60px 20px !important;
  }
  
  .kismet-banner{
    padding: 60px 20px;
  }
  
  .kismet-cta{
    padding: 60px 20px;
  }
  
  /* Reduce glow intensity on mobile (performance) */
  .kismet-glow-text,
  .kismet-glow-love,
  .kismet-glow-protect,
  .kismet-glow-abund,
  .kismet-glow-vision,
  .kismet-glow-magic {
    text-shadow: 
      0 0 8px rgba(255, 255, 255, 0.3),
      0 0 16px var(--kismet-theme-base, rgba(122, 92, 255, 0.3));
  }
  
  /* Larger touch targets on mobile */
  .button,
  a.button,
  button {
    min-height: 44px;
    padding: 12px 20px;
  }
}

/* Extra small devices */
@media (max-width: 549px){
  .kismet-hero{
    padding: 40px 15px !important;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  h2 {
    font-size: 1.5em;
  }
}