/* ==========================================================================
   FRIXEL — Ingeniería en Refrigeración y Climatización
   Premium SaaS Design System (Stripe / Linear / Vercel Inspired)
   ========================================================================== */

:root {
  --frixel-navy: #040d1a;
  --frixel-dark: #071426;
  --frixel-blue: #005bb5;
  --frixel-cyan: #00b4d8;
  --frixel-ice: #90e0ef;
  --frixel-frost: rgba(255, 255, 255, 0.06);
  --frixel-border: rgba(144, 224, 239, 0.16);
  --card-radius: 1.25rem;
}

/* Light Mode Override (Ice Clean Mode) */
html.light-mode {
  --frixel-navy: #f4f9fc;
  --frixel-dark: #ffffff;
  --frixel-frost: rgba(0, 91, 181, 0.04);
  --frixel-border: rgba(0, 91, 181, 0.14);
}

* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  background-color: var(--frixel-navy);
  color: #f8fafc;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  selection-background-color: #00b4d8;
  selection-color: #040d1a;
  transition: background-color 0.45s cubic-bezier(0.22, 1, 0.36, 1), color 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

html.light-mode body {
  background-color: #f0f7ff;
  color: #071426;
}

/* View Transitions API Support */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.38s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #040d1a;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #005bb5, #00b4d8);
  border-radius: 9999px;
}

/* Hide scrollbar for horizontal mobile carousels */
.scrollbar-none::-webkit-scrollbar {
  display: none;
}
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.safe-area-pb {
  padding-bottom: max(0.6rem, env(safe-area-inset-bottom));
}

/* Subtle Cryo Grid Background */
.cryo-grid-bg {
  background-size: 48px 48px;
  background-image: 
    linear-gradient(to right, rgba(0, 180, 216, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 180, 216, 0.05) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 25%, #000 50%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 25%, #000 50%, transparent 100%);
}

html.light-mode .cryo-grid-bg {
  background-image: 
    linear-gradient(to right, rgba(0, 91, 181, 0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 91, 181, 0.07) 1px, transparent 1px);
}

/* Glassmorphism & Depth Layering */
.glass-panel {
  background: linear-gradient(145deg, rgba(12, 28, 52, 0.78) 0%, rgba(6, 16, 32, 0.88) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(144, 224, 239, 0.14);
  box-shadow: 
    0 20px 50px -12px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

html.light-mode .glass-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(240, 248, 255, 0.88) 100%);
  border: 1px solid rgba(0, 116, 217, 0.16);
  box-shadow: 
    0 20px 45px -15px rgba(0, 59, 115, 0.12),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.9);
  color: #071426;
}

.glass-nav {
  background: rgba(4, 13, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0, 180, 216, 0.14);
}

html.light-mode .glass-nav {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 91, 181, 0.12);
}

/* 3D Perspective & Tilt Cards */
.perspective-container {
  perspective: 1100px;
}

.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tilt-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    550px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(0, 180, 216, 0.13),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.tilt-card:hover::before {
  opacity: 1;
}

.tilt-card:hover {
  border-color: rgba(0, 180, 216, 0.42);
  box-shadow: 
    0 26px 60px -15px rgba(0, 180, 216, 0.2),
    0 0 0 1px rgba(0, 180, 216, 0.22);
}

.tilt-content {
  transform: translateZ(24px);
  position: relative;
  z-index: 2;
}

/* Button Microinteractions */
.btn-premium {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}

.btn-premium:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 32px -6px rgba(0, 180, 216, 0.45);
}

.btn-premium:active {
  transform: translateY(0) scale(0.97);
}

.btn-secondary-glass {
  transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-secondary-glass:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(0, 180, 216, 0.5);
  background: rgba(0, 180, 216, 0.1);
}

.btn-secondary-glass:active {
  transform: scale(0.97);
}

/* Animated Gradient Text */
.text-gradient-cryo {
  background: linear-gradient(135deg, #ffffff 0%, #90e0ef 45%, #00b4d8 75%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

html.light-mode .text-gradient-cryo {
  background: linear-gradient(135deg, #002855 0%, #005bb5 50%, #0096c7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Light Mode Text Adaptations */
html.light-mode .theme-text-primary {
  color: #06152d !important;
}
html.light-mode .theme-text-secondary {
  color: #334155 !important;
}
html.light-mode .theme-text-muted {
  color: #475569 !important;
}
html.light-mode .theme-bg-alt {
  background-color: #e6f2ff !important;
}
html.light-mode .theme-card-inner {
  background-color: rgba(241, 245, 249, 0.85) !important;
  border-color: rgba(0, 91, 181, 0.15) !important;
}

/* Mini-Carousel & Bento Grid Light Mode Styles */
html.light-mode .bg-frixel-950\/80,
html.light-mode .bg-frixel-950\/85,
html.light-mode .bg-frixel-950\/90,
html.light-mode .bg-frixel-950\/70,
html.light-mode .bg-frixel-950\/75,
html.light-mode .bg-frixel-950\/60,
html.light-mode .bg-frixel-950\/40 {
  background-color: rgba(255, 255, 255, 0.95) !important;
  color: #071426 !important;
}

html.light-mode .bg-frixel-900\/70,
html.light-mode .bg-frixel-900\/80,
html.light-mode .bg-frixel-900\/90 {
  background-color: rgba(240, 248, 255, 0.95) !important;
}

html.light-mode .border-frixel-400\/20,
html.light-mode .border-frixel-400\/25,
html.light-mode .border-frixel-400\/30,
html.light-mode .border-frixel-400\/35,
html.light-mode .border-frixel-400\/15,
html.light-mode .border-frixel-400\/10 {
  border-color: rgba(0, 91, 181, 0.16) !important;
}

html.light-mode [id*="CarouselTrack"] .text-white,
html.light-mode #catalogGrid .text-white {
  color: #071426 !important;
}

html.light-mode [id*="CarouselTrack"] .text-slate-400,
html.light-mode #catalogGrid .text-slate-400 {
  color: #475569 !important;
}

/* Lightbox Image Cursor & Hover Microinteraction */
[id*="CarouselTrack"] .group\/item,
.catalog-item {
  cursor: pointer;
}

[id*="CarouselTrack"] .group\/item:hover,
.catalog-item:hover {
  transform: translateY(-2px);
}

/* Glowing Orbs */
.orb-glow {
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* Custom Range Input for Calculator */
input[type="range"].cryo-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(0, 180, 216, 0.18);
  border-radius: 999px;
  outline: none;
}

input[type="range"].cryo-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00b4d8, #0077b6);
  border: 2px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 180, 216, 0.7);
  transition: transform 0.15s ease;
}

input[type="range"].cryo-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

/* Rotating Snowflake Animation */
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin-slow {
  animation: spin-slow 18s linear infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

.animate-pulse-glow {
  animation: pulse-glow 4s ease-in-out infinite;
}

/* Equipment SVG Shimmer */
@keyframes frost-flow {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

.frost-flow-line {
  stroke-dasharray: 8 6;
  animation: frost-flow 3s linear infinite;
}

/* Step Workflow Cards Depth & Imagery */
.step-card-bg-img {
  transform-origin: center center;
  will-change: transform, opacity;
}

html.light-mode .step-card-bg-img {
  opacity: 0.12 !important;
}

html.light-mode .tilt-card:hover .step-card-bg-img {
  opacity: 0.22 !important;
}

html.light-mode .step-card-bg-overlay {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.96) 0%, rgba(240, 248, 255, 0.88) 60%, rgba(240, 248, 255, 0.72) 100%) !important;
}

