/* =========================================
   Tokens & Reset
   ========================================= */
:root {
  --products-accent: #22c55e;
  --products-accent-strong: #16a34a;
  --products-accent-muted: rgba(34, 197, 94, 0.24);
  --products-surface: rgba(10, 14, 33, 0.92);
  --products-surface-soft: rgba(12, 16, 35, 0.8);
  --products-border: rgba(148, 163, 184, 0.25);
  --products-border-strong: rgba(148, 163, 184, 0.35);
  --products-text: #e2e8f0;
  --products-text-light: #f1f5f9; /* Very light for dark backgrounds */
  --products-muted: #94a3b8;
  --products-danger: #f87171;
  --products-shadow: 0 15px 30px rgba(2, 6, 23, 0.35);
  --products-hero-tint: radial-gradient(circle at top, rgba(34, 197, 94, 0.12), rgba(8, 15, 40, 0.85));
  --products-card-gradient: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(8, 47, 73, 0.7));
  --products-radius-lg: 24px;
  --products-radius-md: 18px;
  --products-radius-sm: 12px;
  --products-radius-full: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Cairo', sans-serif;
  background: var(--background-dark, #030712);
  color: var(--text-light, #f5f5f5);
  transition: background 0.35s ease, color 0.35s ease;
}

#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#products-body {
  position: relative;
  z-index: 1;
  min-height: auto;
  padding-bottom: 1rem;
  overflow-x: hidden; /* [Systems UI Fix] Allow horizontal scroll prevention but enable vertical overflow for chip zoom */
  overflow-y: visible;
}

/* [Systems UI Fix] Enable overflow for systems section to show chip zoom effects without clipping */
#products-body .systems-grid-section,
#products-body #systems-grid,
#products-body .system-card,
#products-body .system-card-visuals {
  overflow: visible;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}


/* =========================================
   Section: Products Hero (Solar Day/Night Scene)
   ========================================= */
.products-hero {
  position: relative;
  min-height: clamp(520px, 78vh, 780px);
  width: 100%;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 4rem) 0;
  --hero-heading-color: #f8fafc;
}

.products-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 15%, rgba(34, 197, 94, 0.15), transparent 45%);
  z-index: 1;
  pointer-events: none;
}

.hero-sky-layer,
.hero-stars-layer,
.hero-terrain-layer,
.hero-scene-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-sky-layer {
  z-index: 0;
  background: linear-gradient(180deg, #020617 0%, #0f172a 100%);
  transition: background 1.2s ease;
}

/* Enhanced night sky gradient */
body.dark-mode .hero-sky-layer {
  background: linear-gradient(180deg, 
    rgb(0, 0, 0) 0%,
    rgb(25, 19, 39) 80%, 
    rgb(43, 32, 72) 100%
  );
}

.hero-stars-layer {
  z-index: 1;
  opacity: 0.6;
  transition: opacity 1.2s ease;
}

/* =========================================
   Enhanced Night Sky Effects
   ========================================= */

/* Constellation container */
/* Constellation container (PARENT - FIXED POSITIONING) */
/* Constellation container */
.hero-constellation {
  position: absolute;
  inset: 0;
  z-index: 1; /* Above sky, below terrain */
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
  animation: constellationRotate 600s infinite linear; /* Slow rotation like reference */
}

.products-hero[data-hero-phase="night"] .hero-constellation {
  opacity: 1;
}

/* Constellation rotation */
@keyframes constellationRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Individual stars */
.hero-star {
  position: absolute;
  background-color: white;
  border-radius: 50%;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* Star twinkle animation */
@keyframes starTwinkle {
  0%, 100% { box-shadow: 0 0 10px 0px rgba(255, 255, 255, 0.05); }
  50% { box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.4); }
}

/* Colorful stars animation */
@keyframes starColorful {
  0%, 100% { 
    background-color: #fff; 
    box-shadow: 0 0 10px 0px rgba(255, 255, 255, 1);
  }
  33% { 
    background-color: #ffc4c4; 
    box-shadow: 0 0 10px 0px rgb(255, 196, 196, 1);
  }
  66% { 
    background-color: #c4cfff; 
    box-shadow: 0 0 10px 0px rgb(196, 207, 255, 1);
  }
}

/* Moon with arc path */
.hero-moon {
  position: absolute;
  /* Start position: far right outside hero */
  left: 100%;
  top: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #fff;
  /* Reduced glow intensity */
  box-shadow: 0 0 60px 0px rgba(255,255,255,0.6), 0 0 20px -4px rgba(255,255,255,0.4), 0 0 8px 2px rgba(255, 255, 255, 0.2);
  z-index: 1; /* Above sky, below terrain */
  opacity: 0;
  pointer-events: none;
  transform: translate(0, -50%);
}

.products-hero[data-hero-phase="night"] .hero-moon {
  opacity: 1;
  animation: moonEllipticalArc 60s linear 0s 1 normal forwards; /* Linear = constant speed */
}

/* Moon texture overlay */
.hero-moon-texture {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background-image: url('hero/bgMoon.png');
  background-position: center;
  background-size: 100%;
  opacity: 0.4;
}

/* ================== SUN (Day Cycle) ================= */
.hero-sun {
  position: absolute;
  left: 100%;
  top: 50%;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, #FDB813 0%, #F59E0B 50%, #F97316 100%);
  /* Sun glow - warmer, golden */
  box-shadow: 
    0 0 40px rgba(253, 184, 19, 0.8),
    0 0 80px rgba(251, 146, 60, 0.5),
    0 0 120px rgba(249, 115, 22, 0.3);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(0, -50%);
}

.products-hero[data-hero-phase="day"] .hero-sun {
  opacity: 1;
  animation: sunEllipticalArc 60s linear 0s 1 normal forwards;
}

/* Moon arc - SIMPLE EVEN TIME DISTRIBUTION (9 points) */
@keyframes moonEllipticalArc {
  0% {
    /* 36° */
    transform: translate(15vw, 0vh) rotate(36deg);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  12.5% {
    /* 49.5° */
    transform: translate(1vw, -11vh) rotate(49.5deg);
  }
  25% {
    /* 63° */
    transform: translate(-12vw, -17vh) rotate(63deg);
  }
  37.5% {
    /* 76.5° */
    transform: translate(-28vw, -20vh) rotate(76.5deg);
  }
  50% {
    /* 90° - PEAK */
    transform: translate(-50vw, -20vh) rotate(90deg);
  }
  62.5% {
    /* 103.5° */
    transform: translate(-72vw, -20vh) rotate(103.5deg);
  }
  75% {
    /* 117° */
    transform: translate(-88vw, -17vh) rotate(117deg);
  }
  87.5% {
    /* 130.5° */
    transform: translate(-99vw, -11vh) rotate(130.5deg);
  }
  92% {
    opacity: 1;
  }
  100% {
    /* 144° */
    transform: translate(-115vw, 0vh) rotate(144deg);
    opacity: 0;
  }
}

/* Sun arc - IDENTICAL to moon */
@keyframes sunEllipticalArc {
  0% {
    transform: translate(15vw, 0vh) rotate(36deg);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  12.5% {
    transform: translate(1vw, -11vh) rotate(49.5deg);
  }
  25% {
    transform: translate(-12vw, -17vh) rotate(63deg);
  }
  37.5% {
    transform: translate(-28vw, -20vh) rotate(76.5deg);
  }
  50% {
    transform: translate(-50vw, -20vh) rotate(90deg);
  }
  62.5% {
    transform: translate(-72vw, -20vh) rotate(103.5deg);
  }
  75% {
    transform: translate(-88vw, -17vh) rotate(117deg);
  }
  87.5% {
    transform: translate(-99vw, -11vh) rotate(130.5deg);
  }
  92% {
    opacity: 1;
  }
  100% {
    transform: translate(-115vw, 0vh) rotate(144deg);
    opacity: 0;
  }
}

/* Responsive - Tablet (Full coverage calculation: ~150vw linear travel) */
@media (max-width: 768px) {
  .hero-moon { width: 80px; height: 80px; }
  .hero-sun { width: 80px; height: 80px; }
  
  /* Shared Keyframes for Tablet - Linear X (-20vw to -120vw), Parabolic Y (0 to -25vh to 0) */
  @keyframes moonEllipticalArc {
    0% { transform: translate(25vw, 0vh) rotate(36deg) scale(0.8); opacity: 0; }
    8% { opacity: 1; transform: translate(7vw, -11vh) rotate(49.5deg) scale(0.8); }
    25% { transform: translate(-30.5vw, -19vh) rotate(63deg) scale(0.8); }
    50% { transform: translate(-87.5vw, -25vh) rotate(90deg) scale(0.8); } /* Center Y Peak */
    75% { transform: translate(-144.5vw, -19vh) rotate(117deg) scale(0.8); }
    92% { opacity: 1; transform: translate(-182vw, -11vh) rotate(130.5deg) scale(0.8); }
    100% { transform: translate(-200vw, 0vh) rotate(144deg) scale(0.8); opacity: 0; }
  }

  @keyframes sunEllipticalArc {
    0% { transform: translate(25vw, 0vh) rotate(36deg) scale(0.8); opacity: 0; }
    8% { opacity: 1; transform: translate(7vw, -11vh) rotate(49.5deg) scale(0.8); }
    25% { transform: translate(-30.5vw, -19vh) rotate(63deg) scale(0.8); }
    50% { transform: translate(-87.5vw, -25vh) rotate(90deg) scale(0.8); }
    75% { transform: translate(-144.5vw, -19vh) rotate(117deg) scale(0.8); }
    92% { opacity: 1; transform: translate(-182vw, -11vh) rotate(130.5deg) scale(0.8); }
    100% { transform: translate(-200vw, 0vh) rotate(144deg) scale(0.8); opacity: 0; }
  }
}

/* Responsive - Mobile (Wider travel range for safety: ~170vw) */
@media (max-width: 480px) {
  .hero-moon { width: 60px; height: 60px; }
  .hero-sun { width: 60px; height: 60px; }
  
  /* Calculated Linear Motion: Start X=30vw, End X=-140vw */
  @keyframes moonEllipticalArc {
    0%    { transform: translate(30vw, 0vh) rotate(36deg) scale(0.6); opacity: 0; }
    12.5% { transform: translate(8.75vw, -9vh) rotate(49.5deg) scale(0.6); opacity: 1; }
    25%   { transform: translate(-12.5vw, -16vh) rotate(63deg) scale(0.6); }
    37.5% { transform: translate(-33.75vw, -21vh) rotate(76.5deg) scale(0.6); }
    50%   { transform: translate(-55vw, -24vh) rotate(90deg) scale(0.6); } /* Center Peak */
    62.5% { transform: translate(-76.25vw, -21vh) rotate(103.5deg) scale(0.6); }
    75%   { transform: translate(-97.5vw, -16vh) rotate(117deg) scale(0.6); }
    87.5% { transform: translate(-118.75vw, -9vh) rotate(130.5deg) scale(0.6); opacity: 1; }
    100%  { transform: translate(-140vw, 0vh) rotate(144deg) scale(0.6); opacity: 0; }
  }

  @keyframes sunEllipticalArc {
    0%    { transform: translate(30vw, 0vh) rotate(36deg) scale(0.6); opacity: 0; }
    12.5% { transform: translate(8.75vw, -9vh) rotate(49.5deg) scale(0.6); opacity: 1; }
    25%   { transform: translate(-12.5vw, -16vh) rotate(63deg) scale(0.6); }
    37.5% { transform: translate(-33.75vw, -21vh) rotate(76.5deg) scale(0.6); }
    50%   { transform: translate(-55vw, -24vh) rotate(90deg) scale(0.6); }
    62.5% { transform: translate(-76.25vw, -21vh) rotate(103.5deg) scale(0.6); }
    75%   { transform: translate(-97.5vw, -16vh) rotate(117deg) scale(0.6); }
    87.5% { transform: translate(-118.75vw, -9vh) rotate(130.5deg) scale(0.6); opacity: 1; }
    100%  { transform: translate(-140vw, 0vh) rotate(144deg) scale(0.6); opacity: 0; }
  }
}



/* Moon glow pulse */
@keyframes moonGlow {
  0%, 100% {
    box-shadow: 0 0 120px 0px #fff, 0 0 30px -4px #fff, 0 0 8px 2px rgba(255, 255, 255, 0.26);
  }
  50% {
    box-shadow: 0 0 80px 0px #fff, 0 0 30px -4px #fff, 0 0 8px 2px rgba(255, 255, 255, 0.26);
  }
}

/* Meteor shower container */
.hero-meteor-shower {
  position: absolute;
  inset: 0;
  z-index: 1; /* Above sky/stars, below terrain and objects */
  opacity: 0;
  pointer-events: none;
}

.products-hero[data-hero-phase="night"] .hero-meteor-shower {
  opacity: 1;
}

/* Meteor - EXACT SOURCE CODE */
.meteoro {
  position: absolute;
  background-color: #fff;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  transform: rotate(-35deg);
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-duration: 1s;
}

.meteoro:before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
  width: 0;
  height: 0;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  border-left: 85px solid white;
  position: absolute;
  left: 2px;
  top: 0;
}

.meteoro.style1 { animation-name: meteoroStyle1; }
.meteoro.style2 { animation-name: meteoroStyle2; }
.meteoro.style3 { animation-name: meteoroStyle3; }
.meteoro.style4 { animation-name: meteoroStyle4; }

@keyframes meteoroStyle1 {
  0% { opacity: 0; right: 300px; top: 100px; }
  30% { opacity: .3; }
  60% { opacity: .3; }
  100% { opacity: 0; right: 1000px; top: 600px; }
}

@keyframes meteoroStyle2 {
  0% { opacity: 0; right: 700px; top: 100px; }
  30% { opacity: 1; }
  60% { opacity: 1; }
  100% { opacity: 0; right: 1400px; top: 600px; }
}

@keyframes meteoroStyle3 {
  0% { opacity: 0; right: 300px; top: 300px; }
  30% { opacity: 1; }
  60% { opacity: 1; }
  100% { opacity: 0; right: 1000px; top: 800px; }
}

@keyframes meteoroStyle4 {
  0% { opacity: 0; right: 700px; top: 300px; }
  30% { opacity: 1; }
  60% { opacity: 1; }
  100% { opacity: 0; right: 1400px; top: 800px; }
}

/* Individual meteor - ULTRA SIMPLE FOR TESTING */
.hero-meteor {
  position: absolute;
  width: 30px !important;
  height: 30px !important;
  background: white !important;
  border-radius: 50%;
  box-shadow: 0 0 30px white, 0 0 60px rgba(255, 255, 255, 0.8) !important;
  z-index: 9999 !important;
}

/* Meteor tail - SIMPLIFIED */
.hero-meteor::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 100px;
  height: 2px;
  background: linear-gradient(to right, white, transparent);
  transform: translateY(-50%);
}

/* Meteor animation styles - VERY SIMPLE AND VISIBLE */
.hero-meteor.style1 {
  left: 10%;
  top: 5%;
  animation: meteorFallSimple 2s linear forwards;
}
.hero-meteor.style2 {
  left: 30%;
  top: 10%;
  animation: meteorFallSimple 2s linear 0.2s forwards;
}
.hero-meteor.style3 {
  left: 50%;
  top: 8%;
  animation: meteorFallSimple 2s linear 0.4s forwards;
}
.hero-meteor.style4 {
  left: 70%;
  top: 12%;
  animation: meteorFallSimple 2s linear 0.6s forwards;
}

/* Simple diagonal fall animation */
@keyframes meteorFallSimple {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(50vw, 80vh);
  }
}

.hero-terrain-layer {
  inset-inline: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 2; /* Above night sky effects */
}

.hero-terrain {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: bottom;
  filter: drop-shadow(0 -8px 24px rgba(2, 6, 23, 0.65));
}

.hero-scene-layer {
  z-index: 3;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-inline: min(6vw, 72px);
}

.hero-item {
  position: absolute;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 1.2s ease, transform 0.6s ease;
  z-index: 3;
}

.hero-object {
  --hero-scale: 1;
  --hero-translate-x: 0;
  width: clamp(45px, 11vw, 180px);
  height: auto;
  transform-origin: center bottom;
  transform: translateX(var(--hero-translate-x)) scale(var(--hero-scale));
}

.hero-solar {
  bottom: 8%;
  left: clamp(2%, 10vw, 13%);
  --hero-scale: 1;
}

.hero-battery {
  bottom: 38%;
  left: 50%; /* Centered */
  --hero-scale: 0.55;
  --hero-translate-x: -50%;
}

.hero-inverter {
  bottom: 8%;
  left: 50%; /* Centered like battery */
  --hero-scale: 0.55;
  --hero-translate-x: -50%;
}

.hero-house,
.hero-house--day,
.hero-house--night {
  bottom: 8%;
  right: clamp(1%, 7vw, 10%);
  --hero-scale: 1.1;
}

.hero-house--day {
  opacity: 0;
}

.hero-house--night {
  opacity: 1;
}

.hero-energy-line {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  background-image: repeating-linear-gradient(
    to right,
    rgba(34, 197, 94, 0.1) 0px,
    rgba(34, 197, 94, 0.1) 40px,
    rgba(34, 197, 94, 0.95) 40px,
    rgba(34, 197, 94, 0.95) 120px
  );
  background-size: 200% 100%;
  filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.6));
  opacity: 0;
  transition: opacity 0.9s ease;
  z-index: 1;
  top: 0;
  left: 0;
  transform-origin: 0 50%;
}

.hero-energy-line--active {
  opacity: 1;
  animation: heroEnergyFlow 6.5s linear infinite;
}

.hero-energy-line--direction-reverse {
  animation-direction: reverse;
}

@keyframes heroEnergyFlow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -200% 0;
  }
}

.hero-battery-meter {
  position: absolute;
  bottom: 34%;
  left: 50%; /* Centered to match battery */
  transform: translateX(-50%);
  width: clamp(60px, 15vw, 210px);
  height: 10px;
  border-radius: 999px;
  background: rgba(6, 10, 24, 0.8);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.35), 0 0 10px rgba(15, 23, 42, 0.6);
  overflow: hidden;
}

.hero-battery-meter-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0.2);
  border-radius: inherit;
  background-color: #94a3b8;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.4);
  transition: transform 1.2s ease-out, background-color 0.6s ease-out;
}

.hero-content-layer {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: min(1200px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-inline: min(3vw, 32px);
}

.products-hero-heading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.4px;
  color: var(--hero-heading-color, #0b1120);
  text-align: center;
  text-shadow: 0 3px 14px rgba(2, 6, 23, 0.55);
  margin-top: clamp(3rem, 6vh, 4rem);
  margin-bottom: clamp(1rem, 2vh, 1.75rem);
  min-height: 2.6rem;
  transition: color 0.6s ease, text-shadow 0.6s ease;
}

.products-hero-heading span,
.products-hero-heading #products-hero-typed {
  color: inherit;
}

.products-hero-heading .typing-cursor {
  height: 1.4rem;
  background: currentColor;
  width: 2px;
  display: inline-block;
  animation: heroCursorBlink 0.9s steps(2, start) infinite;
}

.products-hero-heading .typing-cursor.typing-cursor--hidden {
  opacity: 0;
}

.products-hero-heading.hero-heading-finished #products-hero-typed {
  animation: heroHeadingPulse 6s ease-in-out infinite, heroHeadingColorPulse 4s ease-in-out infinite;
}

@keyframes heroHeadingPulse {
  0% {
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
    transform: translateY(0);
  }
  50% {
    text-shadow: 0 0 32px rgba(34, 197, 94, 0.25);
    transform: translateY(-2px);
  }
  100% {
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.15);
    transform: translateY(0);
  }
}

@keyframes heroCursorBlink {
  50% {
    opacity: 0;
  }
}

@keyframes heroHeadingColorPulse {
  0% {
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.1));
  }
  35% {
    filter: drop-shadow(0 0 18px rgba(34, 197, 94, 0.3));
  }
  70% {
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.25));
  }
  100% {
    filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.1));
  }
}

.hero-title {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  margin: 0;
  color: #f8fafc;
  text-shadow: 0 3px 14px rgba(2, 6, 23, 0.6);
}

.hero-subtitle {
  margin: 0;
  max-width: 680px;
  color: rgba(226, 232, 240, 0.9);
  line-height: 1.7;
  font-size: clamp(0.95rem, 2.2vw, 1rem);
}

/* removed hero-side cards */

body.light-mode .products-hero {
  background: linear-gradient(180deg, #e2e8f0 0%, #cbd5f5 100%);
}

body.light-mode .hero-title {
  color: #0f172a;
  text-shadow: none;
}

body.light-mode .products-hero-heading {
  color: var(--hero-heading-color, #0b1120);
  text-shadow: none;
}

body.light-mode .hero-subtitle {
  color: #1f2937;
}



/* =========================================
   Toolbar, Tabs & Actions
   2025 – Products toolbar responsive layout & cart colors/icon refinement
   ========================================= */
.products-panel {
  position: relative;
  max-width: min(1200px, 92vw);
  margin: -2.4rem auto 0;
  padding: 0 1.25rem;
}

.products-view[hidden] {
  display: none !important;
}

.products-view.active {
  animation: fadeInView 0.35s ease;
}

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.products-mode-toggle {
  max-width: min(1200px, 92vw);
  margin: 2rem auto 0;
  padding: 0.5rem;
  border-radius: 999px;
  background: var(--products-surface);
  border: 1px solid var(--products-border);
  box-shadow: 0 15px 30px rgba(3, 7, 18, 0.15);
  display: flex;
  gap: 0.5rem;
}

.mode-btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  cursor: pointer;
  background: transparent;
  color: var(--products-muted);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mode-btn.active {
  background: var(--products-accent);
  color: #05131f;
  box-shadow: 0 0 16px var(--products-accent-muted);
}

.mode-btn:focus-visible {
  outline: 2px solid var(--products-accent);
  outline-offset: 3px;
}

.products-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-radius: var(--products-radius-lg);
  background: var(--products-surface);
  border: 1px solid var(--products-border);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 32px rgba(3, 7, 18, 0.35);
}

.products-tabs {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  min-height: auto;
  order: 1;
}

.products-tabs::-webkit-scrollbar {
  display: none;
}

.products-tab-btn {
  position: relative;
  flex: 0 0 auto;
  padding: 0.4rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--products-border);
  background: transparent;
  color: var(--products-text);
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.products-tab-btn:hover {
  border-color: var(--products-accent);
  color: #fff;
}

.products-tab-btn.active {
  color: #05131f;
  background: var(--products-accent);
  border-color: transparent;
  box-shadow: 0 0 12px var(--products-accent-muted);
}

.products-tab-indicator {
  display: none;
}

.systems-panel {
  max-width: min(1240px, 94vw);
  margin: 2rem auto 0;
  padding: 0 1.5rem;
}

.systems-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
  column-gap: 0.75rem;
  row-gap: 0.65rem;
  align-items: start;
  padding: 0.9rem 1.05rem;
  border-radius: var(--products-radius-lg);
  background: var(--products-surface);
  border: 1px solid var(--products-border);
  backdrop-filter: blur(18px);
}

.systems-tabs {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.systems-tabs::-webkit-scrollbar {
  display: none;
}

.systems-tab-btn {
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--products-border);
  background: transparent;
  color: var(--products-text);
  padding: 0.4rem 1.05rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.systems-tab-btn.active {
  background: var(--products-accent);
  color: #05131f;
  border-color: transparent;
  box-shadow: 0 0 12px var(--products-accent-muted);
}

.systems-tab-btn:hover {
  border-color: var(--products-accent);
  color: #fff;
}

/* System tabs thematic colors by category */
.systems-tab-btn[data-system-category="all"].active {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.systems-tab-btn[data-system-category="full_system"].active {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.systems-tab-btn[data-system-category="agro_industrial"].active {
  background: #0ea5e9;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.25);
}

.systems-tab-btn[data-system-category="backup_hybrid"].active {
  background: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.systems-tab-btn[data-system-category]:not(.active):hover {
  color: #fff;
  border-color: currentColor;
}

.systems-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  align-items: stretch;
  min-width: 200px;
  width: 100%;
}

/* Filter and Cart buttons for systems */
.systems-filter-btn,
.systems-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--products-border);
  background: rgba(13, 17, 34, 0.85);
  color: var(--products-text);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.systems-filter-btn:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--products-accent);
  color: #22c55e;
}

.systems-cart-btn:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: var(--products-accent);
  color: #22c55e;
}

.systems-filter-btn i,
.systems-cart-btn i {
  font-size: 0.9rem;
}

.systems-actions input {
  width: 100%;
  border-radius: var(--products-radius-full);
  border: 1px solid var(--products-border);
  background: rgba(15, 23, 42, 0.4);
  color: #fff;
  padding: 0.5rem 0.9rem;
}

.products-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  order: 2;
}

.products-actions > * {
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0 !important;
}

.products-actions input,
.products-actions select,
.products-actions button {
  border-radius: 10px;
  border: 1px solid var(--products-border);
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
  line-height: 1.3;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.products-actions input,
.products-actions select {
  background: rgba(13, 17, 34, 0.85);
  color: var(--products-text);
}

/* حقل البحث: ضيق جداً */
#products-search {
  width: 120px;
}

/* قائمة الترتيب: بحجم المحتوى */
#products-sort {
  width: auto;
  min-width: 0;
  padding-inline-end: 1.3rem;
}

.advanced-filter-toggle {
  background: rgba(15, 23, 42, 0.7);
  color: var(--products-text);
  cursor: pointer;
  white-space: nowrap;
}

.cart-toggle {
  background: rgba(34, 197, 94, 0.12);
  color: var(--products-text);
  cursor: pointer;
  white-space: nowrap;
}

.products-actions input::placeholder {
  color: var(--products-muted);
}

.products-actions input:focus,
.products-actions select:focus {
  border-color: var(--products-accent);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  outline: none;
}

.advanced-filter-toggle.active,
.advanced-filter-toggle:hover {
  border-color: var(--products-accent);
  color: var(--products-accent);
}

.advanced-filter-panel {
  margin-top: 0.8rem;
  padding: 1.1rem;
  border-radius: var(--products-radius-md);
  border: 1px solid var(--products-border);
  background: rgba(8, 12, 28, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.45);
  transform-origin: top;
  transform: scaleY(0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.advanced-filter-panel:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
  transform: scaleY(1);
}

.filter-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--products-muted);
}

.filter-field input {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.95); /* Lighter dark background */
  color: #f1f5f9; /* Explicitly light text (Slate-100) */
  padding: 0.45rem 0.75rem;
}

.filter-field input::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.filter-field input:focus {
  border-color: var(--products-accent);
  background: rgba(15, 23, 42, 1);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  outline: none;
}

.filter-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.filter-actions button {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.3rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.filter-apply {
  background: var(--products-accent);
  color: #05131f;
}

.filter-reset {
  background: rgba(148, 163, 184, 0.12);
  color: var(--products-text);
}

/* =========================================
   Cart Drawer & Toggles
   ========================================= */
.cart-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  transition: background 0.2s ease, border 0.2s ease, color 0.2s ease;
}

.cart-toggle:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: var(--products-accent);
}

.cart-toggle-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

.cart-toggle-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
}

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  z-index: 1500;
}

.cart-panel {
  position: fixed;
  inset-inline-end: 1.5rem;
  bottom: 2rem;
  width: min(420px, 94vw);
  max-height: calc(100vh - 4rem);
  padding: 1.5rem;
  border-radius: var(--products-radius-md);
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 18px 40px rgba(3, 6, 23, 0.5);
  overflow-y: auto;
  z-index: 1600;
  transform: translateY(12px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cart-panel:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

.cart-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.cart-panel-header h3 {
  margin: 0;
  font-size: 1.3rem;
  color: #ffffff;
  font-weight: 700;
}

.cart-close {
  border: none;
  background: rgba(148, 163, 184, 0.15);
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.cart-close:hover {
  background: rgba(248, 113, 113, 0.25);
}

.cart-alert {
  font-size: 0.88rem;
  color: #fecaca;
  background: rgba(248, 113, 113, 0.15);
  border-radius: 12px;
  padding: 0.85rem;
  border: 1px solid rgba(248, 113, 113, 0.35);
  line-height: 1.6;
}

.cart-alert strong {
  color: #fca5a5;
  font-weight: 700;
}

.cart-items {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cart-item {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(30, 41, 59, 0.6);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

.cart-item h4 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  color: #ffffff;
  font-weight: 600;
}

.cart-item-badge {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 0.35rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(34, 197, 94, 0.25);
  color: #6ee7b7;
  font-weight: 600;
}

.cart-item-info {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.cart-item-meta {
  font-size: 0.82rem;
  color: #94a3b8;
  padding: 0.3rem 0.6rem;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 8px;
  margin-top: 0.3rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-qty {
  color: #e2e8f0;
  font-size: 0.9rem;
}

.cart-qty input {
  width: 54px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.6);
  color: #ffffff;
  padding: 0.3rem 0.4rem;
  text-align: center;
  font-weight: 600;
}

.cart-remove {
  border: none;
  background: transparent;
  color: #f87171;
  cursor: pointer;
  font-size: 0.88rem;
  transition: color 0.2s ease;
}

.cart-remove:hover {
  color: #ef4444;
  text-decoration: underline;
}

.cart-empty {
  text-align: center;
  font-size: 0.95rem;
  color: #cbd5e1;
  margin: 2rem 0;
}

.cart-note-field {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cart-note-field label {
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
}

.cart-note-field textarea {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.6);
  color: #ffffff;
  padding: 0.7rem 0.85rem;
  resize: vertical;
  font-size: 0.9rem;
  line-height: 1.6;
}

.cart-note-field textarea::placeholder {
  color: #94a3b8;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(30, 41, 59, 0.5);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.95rem;
  color: #cbd5e1;
}

.cart-summary strong {
  display: block;
  color: #ffffff;
  margin-top: 0.25rem;
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.cart-action {
  border-radius: 14px;
  padding: 0.75rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-action:hover {
  transform: translateY(-1px);
}

.cart-action.primary {
  background: linear-gradient(135deg, #22c55e, #10b981);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.cart-action.primary:hover {
  box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.cart-action.secondary {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.cart-action.secondary:hover {
  background: rgba(148, 163, 184, 0.3);
  color: #ffffff;
}

.products-feedback {
  margin: 1rem 0 0;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  border: 1px dashed var(--products-border);
  color: var(--products-text);
  background: rgba(15, 23, 42, 0.75);
  font-size: 0.95rem;
}

.products-feedback.hidden {
  display: none;
}

/* =========================================
   AI Status + Grid
   ========================================= */
.products-grid-section {
  max-width: min(1240px, 94vw);
  margin: 0.75rem auto 1rem;
  padding: 0 1.1rem;
}

.products-ai-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(10, 13, 30, 0.8);
  color: var(--products-text);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  animation: aiPulse 1.2s ease-in-out infinite;
}

.products-ai-status.hidden {
  display: none;
}

.ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--products-accent);
  box-shadow: 0 0 10px var(--products-accent);
}

@keyframes aiPulse {
  50% {
    opacity: 0.4;
  }
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.systems-grid-section {
  max-width: min(1280px, 96vw);
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem 2rem;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0.5rem 0;
}


/* =========================================
   System Cards - Complete Redesign
   Premium, Modern, Elegant
   ========================================= */
.system-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15),
              0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  height: 100%;
}

/* Badges at Top */
.system-card-badges-top {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.system-type-badge {
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.2));
  backdrop-filter: blur(10px);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.system-discount-badge {
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(22, 163, 74, 0.2));
  backdrop-filter: blur(10px);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
  animation: pulse-glow 2s ease-in-out infinite;
}

/* =========================================
   Dynamic System Card Colors by Type
   ========================================= */

/* Default hover (green - full_system) */
.system-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: #22c55e;
  box-shadow: 0 20px 50px rgba(34, 197, 94, 0.25);
}

/* Agro/Industrial hover (blue) */
.system-card[data-system-type="agro_industrial"]:hover {
  border-color: #0ea5e9;
  box-shadow: 0 20px 50px rgba(14, 165, 233, 0.25);
}

/* Backup hybrid hover (orange) */
.system-card[data-system-type="backup_hybrid"]:hover {
  border-color: #f59e0b;
  box-shadow: 0 20px 50px rgba(245, 158, 11, 0.25);
}

/* Dynamic text colors on hover */
.system-card[data-system-type="full_system"]:hover .stat-value,
.system-card[data-system-type="full_system"]:hover .stat-icon {
  color: #22c55e;
  filter: drop-shadow(0 2px 6px rgba(34, 197, 94, 0.4));
}

.system-card[data-system-type="agro_industrial"]:hover .stat-value,
.system-card[data-system-type="agro_industrial"]:hover .stat-icon {
  color: #0ea5e9;
  filter: drop-shadow(0 2px 6px rgba(14, 165, 233, 0.4));
}

.system-card[data-system-type="backup_hybrid"]:hover .stat-value,
.system-card[data-system-type="backup_hybrid"]:hover .stat-icon {
  color: #f59e0b;
  filter: drop-shadow(0 2px 6px rgba(245, 158, 11, 0.4));
}

/* Price styling - removed glow effect */
.price-current {
  font-weight: 800;
  transition: all 0.3s ease;
}

/* Dynamic gradient colors by type */
.system-card[data-system-type="full_system"] .system-card-visuals::before {
  background: linear-gradient(90deg, 
    rgba(34, 197, 94, 0) 0%,
    rgba(34, 197, 94, 0.6) 50%,
    rgba(22, 163, 74, 0.6) 75%,
    rgba(34, 197, 94, 0) 100%
  );
}

.system-card[data-system-type="agro_industrial"] .system-card-visuals::before {
  background: linear-gradient(90deg, 
    rgba(14, 165, 233, 0) 0%,
    rgba(14, 165, 233, 0.6) 50%,
    rgba(2, 132, 199, 0.6) 75%,
    rgba(14, 165, 233, 0) 100%
  );
}

.system-card[data-system-type="backup_hybrid"] .system-card-visuals::before {
  background: linear-gradient(90deg, 
    rgba(245, 158, 11, 0) 0%,
    rgba(245, 158, 11, 0.6) 50%,
    rgba(217, 119, 6, 0.6) 75%,
    rgba(245, 158, 11, 0) 100%
  );
}

/* Hide components based on system type */
/* Agro/Industrial: Hide battery stats and warranty (has panels + inverter only) */
.system-card[data-system-type="agro_industrial"] .stat-item[title*="البطاريات"],
.system-card[data-system-type="agro_industrial"] .stat-item[title*="بطارية"],
.system-card[data-system-type="agro_industrial"] .stat-item:nth-child(3), /* Battery is 3rd stat */
.system-card[data-system-type="agro_industrial"] .warranty-item:has(.fa-battery-full),
.system-card[data-system-type="agro_industrial"] .warranty-item:nth-child(2) /* Battery warranty is 2nd */ {
  display: none !important;
}

/* Backup: Hide panel stats and warranty (has batteries + inverter only) */
.system-card[data-system-type="backup_hybrid"] .stat-item[title*="الألواح"],
.system-card[data-system-type="backup_hybrid"] .stat-item[title*="ألواح"],
.system-card[data-system-type="backup_hybrid"] .stat-item:nth-child(2), /* Panels is 2nd stat */
.system-card[data-system-type="backup_hybrid"] .stat-item[title*="التيار"], /* Current depends on panels */
.system-card[data-system-type="backup_hybrid"] .stat-item:nth-child(4), /* Current is 4th stat */
.system-card[data-system-type="backup_hybrid"] .warranty-item:has(.fa-solar-panel),
.system-card[data-system-type="backup_hybrid"] .warranty-item:first-child /* Panel warranty is 1st */ {
  display: none !important;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2); }
  50% { box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4); }
}

/* Component Images Section - Large & Beautiful */
.system-card-visuals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 24px 20px 20px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.5), rgba(30, 41, 59, 0.3));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

/* Dynamic visuals background by type */
.system-card[data-system-type="full_system"] .system-card-visuals {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(255, 255, 255, 0.05));
}

.system-card[data-system-type="agro_industrial"] .system-card-visuals {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(255, 255, 255, 0.05));
}

.system-card[data-system-type="backup_hybrid"] .system-card-visuals {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(255, 255, 255, 0.05));
}

.system-card-visuals::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, 
    rgba(59, 130, 246, 0) 0%,
    rgba(59, 130, 246, 0.6) 50%,
    rgba(139, 92, 246, 0.6) 75%,
    rgba(236, 72, 153, 0) 100%
  );
  background-size: 200% 100%;
  animation: border-flow 3s linear infinite;
}

@keyframes border-flow {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.system-component-chip {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.3s ease;
  position: relative; /* For z-index */
}

.system-component-chip.chip-clickable:hover {
  transform: translateY(-4px);
}

.system-component-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  border: 2px solid rgba(148, 163, 184, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Contain image zoom */
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.system-component-chip:hover .system-component-visual {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.system-component-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  filter: brightness(0.95) contrast(1.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}

/* 1.5x Inner Zoom + 1.3x Outer Zoom on Hover */
.system-component-chip:hover .system-component-visual {
  transform: scale(1.3); /* Outer zoom */
  z-index: 200; /* Float above all other images */
}

.system-component-chip:hover .system-component-visual img {
  transform: scale(1.5); /* Inner zoom */
  filter: brightness(1.05) contrast(1.1);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.4);
}

.system-component-qty {
  position: absolute;
  top: 8px;
  left: 8px;
  color: #0f172a; /* Dark text for contrast */
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 2;
  /* background-color set inline via style attribute */
}

.system-component-info {
  text-align: center;
}

.system-component-name {
  font-size: 0.85rem;
  color: #cbd5e1;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Card Body - Content */
.system-card-body {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.system-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b; /* Dark color for contrast */
  margin: 0;
  line-height: 1.4;
  text-shadow: none;
}

/* Stats Grid */
.system-card-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
}

.stat-item:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.stat-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 0.95rem;
  color: #e2e8f0;
  font-weight: 700;
}

/* Warranties Section */
.system-card-warranties {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.warranty-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(22, 163, 74, 0.08));
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 10px;
  font-size: 0.85rem;
  color: #86efac;
  transition: all 0.3s ease;
}

.warranty-item:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(22, 163, 74, 0.12));
  border-color: rgba(34, 197, 94, 0.35);
  transform: translateX(-3px);
}

.warranty-item i {
  font-size: 1.1rem;
  color: #4ade80;
}

.warranty-item strong {
  color: #22c55e;
  font-weight: 700;
}

/* Description Section */
.system-card-description {
  padding: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(37, 99, 235, 0.05));
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  margin-top: 12px;
  animation: fadeIn 0.3s ease;
}

.system-card-description p {
  margin: 0;
  color: #1e293b; /* Dark text for light background */
  font-size: 0.9rem;
  line-height: 1.6;
  font-weight: 500;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Warranty Info - OLD (keeping for compatibility) */
.system-card-warranty-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(22, 163, 74, 0.05));
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 12px;
  font-size: 0.85rem;
  color: #86efac;
}

.system-card-warranty-info i {
  font-size: 1.1rem;
  color: #4ade80;
}

.system-card-warranty-info strong {
  color: #22c55e;
  font-weight: 700;
}

/* Footer - Price & Actions */
.system-card-footer {
  padding: 20px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.3), rgba(15, 23, 42, 0.2));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Dynamic footer background by type */
.system-card[data-system-type="full_system"] .system-card-footer {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(255, 255, 255, 0.03));
  border-top: 1px solid rgba(34, 197, 94, 0.15);
}

.system-card[data-system-type="agro_industrial"] .system-card-footer {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(255, 255, 255, 0.03));
  border-top: 1px solid rgba(14, 165, 233, 0.15);
}

.system-card[data-system-type="backup_hybrid"] .system-card-footer {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.03));
  border-top: 1px solid rgba(245, 158, 11, 0.15);
}

.system-card-price-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.price-current {
  font-size: 1.65rem;
  font-weight: 800;
  color: #10b981; /* Emerald green - more modern */
  text-shadow: 0 1px 4px rgba(16, 185, 129, 0.3); /* Reduced glow */
  transition: all 0.3s ease;
}

.price-old {
  font-size: 1.1rem;
  color: #64748b; /* Slate-500 - Darker gray for better visibility */
  text-decoration: line-through;
  opacity: 1; /* Remove opacity to ensure color is solid */
}

.system-card-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
}

.system-card-actions button {
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  position: relative;
  overflow: hidden;
}

.system-card-actions button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.system-card-actions button:hover::before {
  width: 300px;
  height: 300px;
}

.btn-secondary {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.3), rgba(71, 85, 105, 0.25));
  backdrop-filter: blur(10px);
  color: #cbd5e1;
  border: 2px solid rgba(100, 116, 139, 0.4);
}

.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.5), rgba(71, 85, 105, 0.4));
  border-color: rgba(100, 116, 139, 0.6);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(100, 116, 139, 0.3);
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: 2px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
  border-color: rgba(59, 130, 246, 0.5);
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .system-card-visuals {
    padding: 20px 16px 16px;
  }
  
  .system-card-body {
    padding: 20px 16px;
  }
  
  .system-card-footer {
    padding: 16px;
  }
  
  .system-card-title {
    font-size: 1.1rem;
  }
  
  .price-current {
    font-size: 1.4rem;
  }
  
  .system-card-actions {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 992px) {
  .system-card-visuals {
    gap: 20px;
    padding: 28px 24px 24px;
  }
  
  .systems-grid:hover .system-card {
    opacity: 0.7;
    filter: blur(0.5px);
    transform: scale(0.98);
  }

  .systems-grid .system-card:hover {
    opacity: 1;
    filter: none;
    transform: translateY(-8px) scale(1.02);
    z-index: 10;
  }
}

.system-card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(15, 23, 42, 0.5);
  border-radius: 12px;
  padding: 0;
  margin-top: 0.5rem;
}

.system-card.expanded .system-card-details {
  max-height: 500px;
  padding: 1rem;
}

.system-card-description,
.system-card-components {
  margin: 0;
  color: #f1f5f9;
  line-height: 1.7;
  font-size: 0.95rem;
}

.system-card-components {
  font-size: 0.9rem;
  color: #e2e8f0;
  padding: 0.7rem 0.9rem;
  background: rgba(30, 41, 59, 0.6);
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  margin-top: 0.6rem;
}

.system-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.system-card .btn-secondary,
.system-card .btn-primary {
  flex: 1;
  min-width: 160px;
  border-radius: 12px;
  padding: 0.7rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.system-card .btn-primary {
  background: linear-gradient(135deg, var(--products-accent), var(--products-accent-strong));
  color: #ffffff;
  box-shadow: 0 4px 12px var(--products-accent-muted);
}

.system-card .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px var(--products-accent-muted), 0 0 20px var(--products-accent-muted);
}

/* [Systems UI Fix] Improved button styling to match components tab buttons */
.system-card .btn-secondary {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.1));
  color: var(--products-text);
  border: 1px solid rgba(148, 163, 184, 0.35);
  position: relative;
}

.system-card .btn-secondary:hover {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.3), rgba(148, 163, 184, 0.15));
  border-color: var(--products-accent);
  color: #ffffff;
}

/* خط أخضر تحت زر التفاصيل */
.system-card .btn-secondary::after {
  content: '';
  position: absolute;
  bottom: 0.3rem;
  left: 15%;
  right: 15%;
  height: 2px;
  border-radius: 999px;
  background: var(--products-accent);
  opacity: 0;
  transition: opacity 0.2s ease, left 0.2s ease, right 0.2s ease;
  pointer-events: none;
}

.system-card .btn-secondary:hover::after {
  opacity: 0.8;
  left: 10%;
  right: 10%;
}

.system-card.skeleton,
.system-card .skeleton-block {
  background: rgba(15, 23, 42, 0.55);
}

.system-card.skeleton .skeleton-line,
.system-card.skeleton .skeleton-block {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  animation: shimmer 1.4s ease-in-out infinite;
}

.system-card-details.skeleton-block {
  height: 80px;
}

.products-grid.grid-leaving {
  opacity: 0;
  transform: translateY(6px) scale(0.99);
}

.products-grid.grid-entering {
  opacity: 0;
  transform: translateY(4px);
}

.products-grid.grid-entering-active {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   Product Cards & Hover Effects
   ========================================= */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--products-radius-md);
  padding: 1rem;
  background: var(--products-card-gradient);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: var(--products-shadow);
  overflow: hidden;
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
  animation: cardEnter 0.24s ease forwards;
  animation-delay: calc(var(--card-index, 0) * 30ms);
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, var(--products-accent-muted), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.product-card:hover::before {
  opacity: 0.6;
}

.product-card:hover {
  transform: translateY(-4px) scale(1.005);
  border-color: var(--products-border-strong);
  box-shadow: 0 18px 30px rgba(2, 6, 23, 0.4), 0 0 12px var(--products-accent-muted);
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  margin-bottom: 0.9rem;
  background: rgba(15, 23, 42, 0.6);
  cursor: zoom-in;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.24s ease;
}

.product-card:hover .product-image {
  transform: scale(1.03);
}

.product-image-lens {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid var(--products-accent);
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 250%;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-image-wrapper.has-lens .product-image-lens {
  opacity: 1;
}

.product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.product-info-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem;
}

.product-title {
  font-size: 1.05rem;
  margin: 0;
  color: #fff;
  animation: fadeSlideIn 0.22s ease both;
}

.product-category {
  font-size: 0.9rem;
  color: var(--products-muted);
  margin: 0;
  animation: fadeSlideIn 0.24s ease both;
}

.product-price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--products-accent);
  margin: 0.25rem 0;
  animation: priceRise 0.24s ease both;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes priceRise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-availability {
  font-size: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: var(--products-accent);
}

.product-availability.is-limited {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.15);
  color: var(--products-danger);
}

.product-pinned-specs {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.product-pinned-specs li {
  position: relative;
  font-size: 0.85rem;
  color: var(--products-text);
  background: rgba(15, 23, 42, 0.6);
  border-radius: 12px;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  animation: specStagger 0.24s ease both;
  animation-delay: calc(var(--spec-index, 0) * 40ms);
}

.product-pinned-specs li::after {
  content: attr(data-tooltip);
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + 6px);
  transform: translateX(15%);
  padding: 0.3rem 0.6rem;
  border-radius: 10px;
  background: rgba(5, 10, 25, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #fff;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.product-pinned-specs li:hover::after {
  opacity: 1;
  transform: translateX(0);
}

@keyframes specStagger {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-footer {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-details {
  border-radius: 14px;
  border: none;
  padding: 0.55rem 1.35rem;
  font-size: 0.95rem;
  cursor: pointer;
  color: #05131f;
  background: linear-gradient(120deg, var(--products-accent), #3b82f6);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-details:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(34, 197, 94, 0.45);
}

.btn-cart {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: transparent;
  color: var(--products-text);
  transition: border 0.2s ease, color 0.2s ease;
}

.btn-cart:hover {
  border-color: var(--products-accent);
  color: var(--products-accent);
}

/* =========================================
   Skeleton Placeholder
   ========================================= */
.product-card.skeleton {
  border: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(10, 13, 30, 0.85);
  animation: skeletonFloat 2.2s ease-in-out infinite;
}

.skeleton-thumb,
.skeleton-line {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.5);
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 0.75rem;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 0.4rem;
}

.skeleton-line.short {
  width: 60%;
}

.skeleton-thumb::after,
.skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@keyframes skeletonFloat {
  50% {
    transform: translateY(-1px);
  }
}

/* =========================================
   Modal & Image Viewer
   ========================================= */
.product-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2000;
}

.product-modal.hidden {
  display: none;
}

.product-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
}

.product-modal-content {
  position: relative;
  max-width: 980px;
  width: min(980px, 96vw);
  max-height: min(90vh, 900px);
  border-radius: var(--products-radius-lg);
  padding: 1.75rem;
  background: rgba(5, 11, 30, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.7);
  overflow: hidden;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.product-modal.is-visible .product-modal-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  border: none;
  background: rgba(148, 163, 184, 0.15);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: rgba(148, 163, 184, 0.35);
}

.modal-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(8, 12, 28, 0.8);
  color: #fff;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.modal-gallery-prev {
  inset-inline-start: 1rem;
}

.modal-gallery-next {
  inset-inline-end: 1rem;
}

.modal-gallery-nav:hover {
  background: rgba(34, 197, 94, 0.35);
}

.modal-body {
  overflow-y: auto;
  max-height: calc(90vh - 4rem);
  padding-right: 0.5rem;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.modal-main {
  position: relative;
}

.modal-main img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  object-fit: cover;
  background: rgba(15, 23, 42, 0.5);
}

.modal-details h3 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  color: #fff;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.modal-chip {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--products-text);
}

.modal-price {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--products-accent);
  margin-bottom: 0.75rem;
}

.modal-description {
  font-size: 0.95rem;
  color: var(--products-text);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.modal-specs h4,
.modal-gallery h4,
.highlight-bars h4 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: #fff;
}

.modal-specs-list,
.modal-gallery-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.modal-specs-item {
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(13, 17, 34, 0.75);
}

.modal-specs-item span {
  display: block;
  font-size: 0.85rem;
  color: #cbd5e1 !important; /* Force light color for label */
}

.modal-specs-item strong {
  display: block;
  margin-top: 0.35rem;
  color: #f1f5f9 !important; /* Force very light color for value */
  font-weight: 700;
}

.modal-gallery-list {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.modal-gallery img {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.highlight-bars {
  margin: 1.5rem 0;
}

.highlight-entry {
  margin-bottom: 0.9rem;
}

.highlight-entry span {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--products-muted);
  margin-bottom: 0.35rem;
}

.highlight-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.highlight-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--products-accent), var(--products-accent-strong));
  transform-origin: right;
  animation: highlightGrow 0.3s ease forwards;
}

@keyframes highlightGrow {
  from {
    transform: scaleX(0.2);
  }
  to {
    transform: scaleX(1);
  }
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.image-viewer:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.image-viewer-inner {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
}

.image-viewer-inner img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  object-fit: contain;
}

.image-viewer-close {
  position: absolute;
  top: -16px;
  inset-inline-end: -16px;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-open {
  overflow: hidden;
}

/* =========================================
   Responsive Enhancements
   ========================================= */
@media (max-width: 1199px) {
  .products-toolbar,
  .systems-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.9rem;
  }

  .products-tabs,
  .systems-tabs {
    width: 100%;
    order: 1;
  }

  .products-actions,
  .systems-actions {
    width: 100%;
    justify-content: flex-start;
    order: 2;
  }

  .products-actions input {
    width: 150px;
  }

  #products-sort {
    width: auto;
    min-width: 110px;
  }
}

@media (max-width: 1024px) {
  .products-toolbar {
    flex-direction: column;
  }

  .products-actions {
    width: 100%;
    justify-content: stretch;
  }

  .products-actions input,
  .products-actions select {
    min-width: auto;
  }

  .hero-content-layer {
    padding-inline: 1.25rem;
  }

  .hero-side-cards {
    gap: 0.75rem;
  }
}

@media (max-width: 820px) {
  .products-panel {
    margin-top: -2rem;
  }

  .products-toolbar {
    padding: 0.85rem;
    gap: 0.65rem;
    grid-template-columns: 1fr;
  }

  .products-tabs {
    order: 1;
    width: 100%;
  }

  .products-actions {
    order: 2;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .products-mode-toggle {
    flex-direction: column;
  }

  .products-actions > * {
    flex: 0 0 auto !important;
    width: auto !important;
  }

  #products-search {
    flex-grow: 1;
    min-width: 140px;
  }

  #products-sort {
    width: auto;
    min-width: 100px;
  }

  .advanced-filter-toggle {
    width: auto;
  }

  .cart-toggle {
    width: auto;
  }

  .systems-toolbar {
    padding: 0.95rem;
    align-items: flex-start;
  }

  .systems-actions input {
    width: 100%;
  }

  .products-tabs,
  .systems-tabs {
    gap: 6px;
    min-height: 46px;
    white-space: normal;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 8px;
  }

  .products-tab-indicator {
    display: none;
  }
  .hero-content-layer {
    text-align: center;
    align-items: center;
  }

  .products-hero-heading {
    font-size: clamp(1rem, 4vw, 1.4rem);
    margin-top: clamp(1.5rem, 4vh, 2.2rem);
    margin-bottom: 1rem;
  }

}

@media (max-width: 768px) {
  .products-toolbar,
  .systems-toolbar {
    grid-template-columns: 1fr;
  }

  .products-tabs,
  .systems-tabs {
    white-space: normal;
    flex-wrap: wrap;
    justify-content: center;
  }

  .products-tab-indicator {
    display: none;
  }
}

@media (max-width: 640px) {
  .products-hero {
    padding: 3rem 1.25rem 2.5rem;
    min-height: 520px;
  }

  /* Unified smooth scaling for all hero objects */
  .hero-object {
    width: clamp(35px, 18vw, 110px); /* Smoother transition */
  }

  .hero-solar {
    left: 4%;
    bottom: 5%;
    --hero-scale: 0.9; /* Slightly smaller on mobile */
  }

  .hero-battery {
    left: 50%;
    bottom: 38%;
    --hero-scale: 0.5; /* Consistent with base */
  }

  .hero-inverter {
    left: 50%;
    bottom: 8%;
    --hero-scale: 0.5; /* Consistent with base */
  }

  .hero-house {
    right: 2%;
    bottom: 5%;
    --hero-scale: 1; /* Unified scaling */
  }

  .hero-energy-line--solar-to-battery,
  .hero-energy-line--battery-to-house {
    width: clamp(120px, 42vw, 200px);
  }

  .hero-battery-meter {
    width: clamp(55px, 26vw, 130px);
    bottom: 34%;
    left: 50%;
    transform: translateX(-50%);
  }

  .hero-content-layer {
    text-align: center;
    align-items: center;
  }

  .hero-subtitle {
    max-width: 520px;
  }

  .products-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
  }

  .products-actions > * {
    flex: 0 0 auto;
    width: auto !important;
  }

  #products-search {
    flex: 1 1 auto;
    min-width: 120px;
  }

  #products-sort,
  .advanced-filter-toggle,
  .cart-toggle {
    flex: 0 0 auto;
    width: auto;
  }

  .products-tab-btn,
  .systems-tab-btn {
    padding: 0.38rem 0.9rem;
    font-size: 0.82rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }

  .advanced-filter-panel {
    position: relative;
  }

  .cart-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    border-radius: 0;
    padding-bottom: 4rem;
  }

  .product-footer {
    flex-direction: column;
  }

  .btn-cart,
  .btn-details {
    width: 100%;
  }

  .product-modal-content {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .modal-body {
    max-height: calc(100vh - 3rem);
  }
}

@media (max-width: 480px) {
  .products-hero {
    min-height: 460px;
  }

  .products-hero-heading {
    font-size: clamp(0.95rem, 4.8vw, 1.2rem);
    margin-top: clamp(1rem, 4vh, 1.5rem);
    margin-bottom: 0.85rem;
  }

  .hero-object {
    width: clamp(22px, 32vw, 85px);
  }

  .hero-solar {
    left: 3%;
    bottom: 4%;
  }

  .hero-battery {
    bottom: 38%;
  }

  .hero-house {
    bottom: 4%;
  }

  .hero-battery-meter {
    width: clamp(45px, 30vw, 110px);
    bottom: 34%;
  }

  .hero-content-layer {
    gap: 0.75rem;
  }

  .hero-card {
    padding: 0.9rem 1rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    padding: 0.9rem;
  }
}

body.light-mode {
  background: #f5f7fb;
  color: #0f172a;
  /* [Systems UI Fix] Override CSS variables for light mode to ensure proper contrast */
  --products-text: #0f172a;
  --products-muted: #64748b;
  --products-border: rgba(15, 23, 42, 0.14);
}

body.light-mode .products-toolbar {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .products-tab-btn {
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.1);
}

/* Match systems toolbar look & feel with products toolbar in light mode */
body.light-mode .systems-toolbar {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .systems-tab-btn {
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.1);
  background: transparent;
}

body.light-mode .systems-tab-btn.active {
  background: var(--products-accent);
  color: #05131f;
  border-color: transparent;
  box-shadow: 0 0 12px var(--products-accent-muted);
}

/* Light mode per-category colors */
body.light-mode .systems-tab-btn[data-system-category="all"].active,
body.light-mode .systems-tab-btn[data-system-category="full_system"].active {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

body.light-mode .systems-tab-btn[data-system-category="agro_industrial"].active {
  background: #0ea5e9;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.25);
}

body.light-mode .systems-tab-btn[data-system-category="backup_hybrid"].active {
  background: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

body.light-mode .systems-actions input {
  background: rgba(15, 23, 42, 0.04);
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.12);
}

body.light-mode .cart-toggle {
  background: #e5f9ef;
  border-color: #bbf7d0;
  color: #065f46;
}

body.light-mode .cart-toggle:hover {
  background: #d1fae5;
  border-color: #22c55e;
  color: #065f46;
}

body.light-mode #cart-count {
  color: #065f46;
}

body.light-mode .product-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 247, 255, 0.9));
  border-color: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

body.light-mode .product-title {
  color: #0f172a;
}

body.light-mode .product-category {
  color: #4b5563;
}

body.light-mode .product-price {
  color: #059669;
}

body.light-mode .product-pinned-specs li {
  background: rgba(15, 23, 42, 0.04);
  color: #0f172a;
}

body.light-mode .system-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 250, 255, 0.92));
  border-color: rgba(15, 23, 42, 0.1);
}

body.light-mode .system-card-title {
  color: #0f172a;
  text-shadow: none;
}

body.light-mode .system-card-price {
  color: #059669;
}

body.light-mode .system-card-stats {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.08);
}

body.light-mode .system-card-stats span {
  color: #4b5563;
}

body.light-mode .system-card-stats strong {
  color: #0f172a;
  text-shadow: none;
}

body.light-mode .system-card-warranty {
  color: #374151;
}

body.light-mode .system-card-warranty strong {
  color: #0f172a;
}

body.light-mode .system-component-label {
  color: #4b5563;
}

/* [Systems UI Fix] Light mode button styling for better contrast */
body.light-mode .system-card .btn-secondary {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.04));
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.2);
}

body.light-mode .system-card .btn-secondary:hover {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.06));
  color: #059669;
  border-color: #22c55e;
}

body.light-mode .system-card .btn-primary {
  color: #ffffff;
}

body.light-mode .price-current {
  color: #059669;
}

body.light-mode .stat-value,
body.light-mode .stat-label,
body.light-mode .system-component-name {
  color: #4b5563;
}

body.light-mode .stat-value {
  color: #0f172a;
}

/* =========================================
   [NEW] System Card Redesign (Grid & Compact)
   ========================================= */

/* 1. Header & Title */
.system-card-header {
  margin-bottom: 0.8rem;
}

.system-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0.3rem 0 0;
  color: #fff;
  line-height: 1.5;
  
  /* Force 2 lines max to ensure consistent height */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.3rem; /* Height for 2 lines */
}

/* 2. Specs Grid (Fixed 2x2) */
/* 2. Specs Grid (Fixed 2x2 - Adaptive) */
.system-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Always 2 columns */
  gap: 0.8rem; /* Slightly larger gap */
  margin-bottom: 1.2rem;
  width: 100%;
}

.spec-item {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 12px; /* Smoother corners */
  padding: 1rem 0.8rem; /* Larger padding for "bigger" look */
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: background 0.2s ease, transform 0.2s ease;
  min-width: 0; /* Prevent overflow flex items */
  position: relative;
  overflow: hidden;
  height: 100%; /* Fill grid cell height */
}


.spec-item.primary {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.25);
}

.spec-item.dimmed {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.spec-item:hover {
  background: rgba(30, 41, 59, 0.7);
  transform: translateY(-2px);
}

.spec-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--products-accent);
  font-size: 1rem;
}

.spec-icon .icon-svg {
  width: 20px;
  height: 20px;
}

.spec-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.spec-info .label {
  font-size: 0.75rem;
  color: var(--products-muted);
}

.spec-info .value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.spec-info .value small {
  font-size: 0.75em;
  font-weight: 400;
  opacity: 0.8;
}

/* 3. Compact Warranties Strip */
.system-card-warranties-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.2);
}

.warranty-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #22c55e;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-svg-tiny {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
}

/* 4. Colored Trims for Specs 
   (Inverter=Orange, Panels=Blue, Battery=Green, Amps=Yellow)
*/

/* Shared glass effect override for specific items */
.spec-item.spec-inverter {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0.05));
  border-color: rgba(249, 115, 22, 0.2);
}
.spec-item.spec-inverter .spec-icon {
  color: #f97316; /* Orange-500 */
  background: rgba(249, 115, 22, 0.1);
}

.spec-item.spec-panel {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
  border-color: rgba(59, 130, 246, 0.2);
}
.spec-item.spec-panel .spec-icon {
  color: #3b82f6; /* Blue-500 */
  background: rgba(59, 130, 246, 0.1);
}

.spec-item.spec-battery {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
  border-color: rgba(34, 197, 94, 0.2);
}
.spec-item.spec-battery .spec-icon {
  color: #22c55e; /* Green-500 */
  background: rgba(34, 197, 94, 0.1);
}

.spec-item.spec-amps {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.1), rgba(234, 179, 8, 0.05));
  border-color: rgba(234, 179, 8, 0.2);
}
.spec-item.spec-amps .spec-icon {
  color: #eab308; /* Yellow-500 */
  background: rgba(234, 179, 8, 0.1);
}

/* Force dark text for readability on light colored cards */
.spec-item.spec-inverter .spec-info .label,
.spec-item.spec-inverter .spec-info .value,
.spec-item.spec-panel .spec-info .label,
.spec-item.spec-panel .spec-info .value,
.spec-item.spec-battery .spec-info .label,
.spec-item.spec-battery .spec-info .value,
.spec-item.spec-amps .spec-info .label,
.spec-item.spec-amps .spec-info .value {
  color: #0f172a; /* Slate-900 (Very Dark) */
}

/* Slightly lighter color for labels inside these cards */
.spec-item.spec-inverter .spec-info .label,
.spec-item.spec-panel .spec-info .label,
.spec-item.spec-battery .spec-info .label,
.spec-item.spec-amps .spec-info .label {
  color: #334155; /* Slate-700 */
}

/* Hover effects for colored items */
.spec-item.spec-inverter:hover { background: rgba(249, 115, 22, 0.15); }
.spec-item.spec-panel:hover    { background: rgba(59, 130, 246, 0.15); }
.spec-item.spec-battery:hover  { background: rgba(34, 197, 94, 0.15); }
.spec-item.spec-amps:hover     { background: rgba(234, 179, 8, 0.15); }

/* 5. System Warranties Colored Badges */
.warranty-badge.warranty-panel {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}
.warranty-badge.warranty-battery {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}
.warranty-badge.warranty-inverter {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.2);
  color: #f97316;
}

/* 6. Systems Toolbar Buttons (Filter & Cart) Text Color Fix */
.systems-filter-btn,
.systems-cart-btn {
  color: #22c55e !important; /* Force green text */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.systems-filter-btn:hover,
.systems-cart-btn:hover {
  background: rgba(34, 197, 94, 0.1);
  border-color: #22c55e;
}

.systems-filter-btn.active {
  background: #22c55e;
  color: #fff !important;
}

/* 7. Description Rich Text Area */
.system-card-description {
  font-size: 0.9rem;
  color: #94a3b8;
  line-height: 1.6;
  margin-top: 0.5rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  /* Restore default list styling for rich text */
}
.system-card-description ul {
  padding-right: 1.2rem;
  list-style-type: disc;
  margin-bottom: 0.5rem;
}
.system-card-description li {
  margin-bottom: 0.2rem;
}
.system-card-description strong {
  color: #e2e8f0;
}
/* 8. Grid View Toggle Options */
.systems-view-options {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  overflow: hidden;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.view-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  border-left: 1px solid rgba(148, 163, 184, 0.1);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn:last-child {
  border-left: none;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

.view-btn.active {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

/* Grid Column Overrides */
.systems-grid {
  transition: grid-template-columns 0.3s ease;
}

.systems-grid.cols-1 {
  grid-template-columns: 1fr;
}

/* 2 Columns: Using minmax to keep responsiveness but targeting roughly half width */
.systems-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.systems-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Response Overrides */
@media (max-width: 1024px) {
  .systems-grid.cols-3 {
    grid-template-columns: repeat(2, 1fr); /* Force 2 cols on tablet even if 3 selected */
  }
}

@media (max-width: 768px) {
  .systems-grid.cols-2,
  .systems-grid.cols-3 {
    grid-template-columns: 1fr; /* Force 1 col on mobile */
  }
  .systems-view-options {
    display: none; /* Hide toggle on mobile since it's always 1 column */
  }
}

/* =========================================
   PRODUCTS PAGE UI ENHANCEMENTS - Phase 1
   Scoped to #products-body only
   ========================================= */

/* (4) Scoped Color System */
#products-body {
  --prod-bg: #F6FAF9;
  --prod-panel: rgba(255,255,255,0.78);
  --prod-card: rgba(255,255,255,0.92);
  --prod-border: rgba(14, 41, 54, 0.10);
  --prod-text: #0E2936;
  --prod-muted: rgba(14,41,54,0.65);
  --prod-accent: #00BFA6;
  --prod-accent-dark: #0A6B5D;
  background: var(--prod-bg);
  color: var(--prod-text);
}

body.dark-mode #products-body {
  --prod-bg: #07151D;
  --prod-panel: rgba(10, 20, 30, 0.70);
  --prod-card: rgba(12, 22, 33, 0.88);
  --prod-border: rgba(255,255,255,0.10);
  --prod-text: rgba(255,255,255,0.92);
  --prod-muted: rgba(255,255,255,0.65);
  --prod-accent: #00BFA6;
  --prod-accent-soft: rgba(0,191,166,0.18);
}

#products-body .products-panel,
#products-body .systems-panel,
#products-body .products-toolbar,
#products-body .systems-toolbar {
  background: var(--prod-panel);
  border-color: var(--prod-border);
}

#products-body .product-card,
#products-body .system-card {
  background: var(--prod-card);
  border-color: var(--prod-border);
  color: var(--prod-text);
}

#products-body .cart-panel {
  background: var(--prod-panel);
  border-color: var(--prod-border);
}

/* (1) Grid Column Limits */
@media (min-width: 1400px) {
  #products-body .products-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    max-width: 1600px;
    margin-inline: auto;
  }
  #products-body .systems-grid:not(.cols-1):not(.cols-2) {
    grid-template-columns: repeat(3, 1fr) !important;
    max-width: 1400px;
    margin-inline: auto;
  }
}

/* (2) Card Consistency */
#products-body .product-card {
  display: flex;
  flex-direction: column;
}

#products-body .product-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#products-body .product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  min-height: 2.8rem;
}

#products-body .product-pinned-specs {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#products-body .product-actions {
  margin-top: auto;
  padding-top: 0.5rem;
}

#products-body .system-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* (3) Refined Backdrop Filter */
#products-body .product-card,
#products-body .system-card {
  backdrop-filter: blur(4px) saturate(110%);
  -webkit-backdrop-filter: blur(4px) saturate(110%);
}

#products-body .products-toolbar,
#products-body .systems-toolbar,
#products-body .cart-panel,
#products-body .advanced-filter-panel,
#products-body .products-panel,
#products-body .systems-panel {
  backdrop-filter: blur(16px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(160%) !important;
}

/* (5) Premium Feel */
#products-body .product-price {
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--prod-border);
}

#products-body .system-card-price-block {
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--prod-border);
}

@media (hover: hover) and (pointer: fine) {
  #products-body .product-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(0, 191, 166, 0.12), 0 4px 12px rgba(14, 41, 54, 0.08) !important;
    border-color: rgba(0, 191, 166, 0.25) !important;
  }
  body.dark-mode #products-body .product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 191, 166, 0.15), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(0, 191, 166, 0.3) !important;
  }
  #products-body .system-card:hover {
    transform: translateY(-6px) scale(1.01) !important;
    box-shadow: 0 12px 32px rgba(0, 191, 166, 0.15), 0 6px 16px rgba(14, 41, 54, 0.1) !important;
  }
  body.dark-mode #products-body .system-card:hover {
    box-shadow: 0 12px 32px rgba(0, 191, 166, 0.18), 0 6px 16px rgba(0, 0, 0, 0.35) !important;
  }
}

/* Text Contrast */
body.light-mode #products-body .product-title,
body.light-mode #products-body .system-card-title {
  color: var(--prod-text);
}

body.light-mode #products-body .product-category,
body.light-mode #products-body .product-pinned-specs {
  color: var(--prod-muted);
}

body.light-mode #products-body .product-price,
body.light-mode #products-body .price-current {
  color: var(--prod-accent-dark);
}

body.dark-mode #products-body .product-price,
body.dark-mode #products-body .price-current {
  color: var(--prod-accent);
}

/* =========================================
   ACCESSIBILITY: Reduced Motion Support
   ========================================= */
@media (prefers-reduced-motion: reduce) {
  /* Disable constellation rotation */
  .hero-constellation {
    animation: none !important;
  }
  
  /* Disable star animations - keep static stars */
  .hero-star {
    animation: none !important;
    opacity: 0.6 !important;
  }
  
  /* Hide meteor shower completely */
  .hero-meteor-shower,
  .hero-meteor,
  .meteoro {
    display: none !important;
  }
  
  /* Disable energy line flow animation */
  .hero-energy-line--active {
    animation: none !important;
    opacity: 0.8 !important;
  }
  
  /* Disable card entrance animations */
  .product-card,
  .system-card {
    animation: none !important;
  }
  
  /* Reduce all transition/animation durations */
  *,
  *::before,
  *::after {
    animation-duration: 0.01s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01s !important;
  }
  
  /* Keep essential hover feedback but instant */
  @media (hover: hover) {
    #products-body .product-card:hover,
    #products-body .system-card:hover {
      transition: none !important;
    }
  }
}

