/* ===== PAKO MARTÍNEZ — MASTER BRAND STYLES (AWWWARDS EDITION + CUSTOM MAGNETIC CURSOR) ===== */

/* 1. BRAND DESIGN SYSTEM TOKENS (OFFICIAL PACO MARTÍNEZ MANUAL) */
:root {
  /* Official Brand Colors */
  --pako-green: #009840;   /* PANTONE® Official Green */
  --pako-neon: #009840;    /* Primary Brand Green */
  --pako-navy: #0F1324;    /* PANTONE® Official Black Beauty */
  --pako-dark: #0F1324;    /* Primary Background Navy */
  --pako-forest: #16442D;  /* PANTONE® Forest Tonal */
  --pako-mint: #63DEC4;    /* PANTONE® Soft Mint Highlight */
  --pako-red: #991915;     /* Accent Red */
  --pako-slate: #5C6079;   /* Slate Grey Contraste */

  /* Design Token Aliases */
  --color-bg-navy: var(--pako-navy);
  --color-brand-green: var(--pako-green);
  --color-brand-forest: var(--pako-forest);
  --color-brand-mint: var(--pako-mint);
  --color-brand-red: var(--pako-red);
  --color-brand-slate: var(--pako-slate);
  
  /* Typography Design Tokens */
  --font-heading: 'Bebas Neue', sans-serif;
  --font-body: 'Metropolis', 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Fluid Typography Clamps (Sin Media Queries manuales) */
  --font-size-hero-title: clamp(2rem, 5vw + 1rem, 3.75rem);
  --font-size-section-title: clamp(1.5rem, 3vw + 0.75rem, 2.5rem);
  --font-size-card-title: clamp(1.125rem, 2vw + 0.5rem, 1.75rem);
  --font-size-body-base: clamp(0.875rem, 1vw + 0.5rem, 1.125rem);
  --font-size-body-sm: clamp(0.75rem, 0.8vw + 0.4rem, 0.95rem);
  
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 2. SELF-HOSTED METROPOLIS FONT REGISTRATION */
@font-face {
  font-family: 'Metropolis';
  src: url('IDENTIDAD/metropolis/Metropolis-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('IDENTIDAD/metropolis/Metropolis-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('IDENTIDAD/metropolis/Metropolis-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('IDENTIDAD/metropolis/Metropolis-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('IDENTIDAD/metropolis/Metropolis-Black.otf') format('opentype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* 3. GLOBAL RESET & BASE STYLES */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  cursor: auto !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, a, input[type="range"], input[type="checkbox"], input[type="radio"], select, [role="button"], .cursor-pointer {
  cursor: pointer !important;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
  cursor: text !important;
}

body {
  font-family: var(--font-body);
  background-color: #F8FAFC;
  color: var(--color-bg-navy);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .font-bebas {
  font-family: var(--font-heading);
  letter-spacing: 0.04em;
}

/* Fluid Heading Clamps */
h1 { font-size: var(--font-size-hero-title); }
h2 { font-size: var(--font-size-section-title); }
h3 { font-size: var(--font-size-card-title); }

/* 5. CUSTOM CURSOR DISABLED FOR OPTIMAL NATIVE RESPONSIVENESS */
.custom-cursor-dot {
  display: none !important;
}

/* 6. PRELOADER OVERLAY & GLOWS (GLASSMORPHIC LIGHT THEME) */
.preloader-overlay {
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 70%, #F1F5F9 100%);
  backdrop-filter: blur(20px);
}

.emerald-glow-bg {
  background: radial-gradient(circle at 50% 0%, rgba(0, 152, 64, 0.15) 0%, rgba(15, 19, 36, 0) 70%);
}

.emerald-glow-border {
  border-color: rgba(0, 152, 64, 0.4) !important;
  box-shadow: 0 0 20px rgba(0, 152, 64, 0.25);
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #FFFFFF 0%, var(--color-brand-mint) 50%, var(--color-brand-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.bg-gradient-brand {
  background: linear-gradient(135deg, var(--color-brand-forest) 0%, var(--color-bg-navy) 100%);
}

.card-glassmorphic {
  background: rgba(15, 19, 36, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-glassmorphic-hover {
  transition: all 0.3s var(--ease-expo);
}

.card-glassmorphic-hover:hover {
  border-color: var(--color-brand-green);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 152, 64, 0.2);
}

/* 7. CUSTOM SCROLLBAR WITH PACO MARTÍNEZ BRAND TOKENS */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--color-bg-navy);
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--color-brand-green);
  border-radius: 9999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand-mint);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-navy);
}
::-webkit-scrollbar-thumb {
  background: var(--color-brand-green);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-brand-mint);
}

/* 8. CONTAINER QUERIES & MODERN DYNAMIC VIEWPORT (dvh) ARCHITECTURE */
#simulador-container,
.fixed.inset-0 > div,
.modal-container {
  container-type: inline-size;
  container-name: cotizador-card;
}

/* Container Query Dynamic Behavior */
@container cotizador-card (max-width: 480px) {
  .modal-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.375rem !important;
  }
}

/* Modern Dynamic Viewport (dvh) Overlay Rules */
.fixed.inset-0 {
  height: 100dvh !important;
  min-height: 100dvh !important;
  max-height: 100dvh !important;
  padding: clamp(0.25rem, 2vh, 1rem) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.fixed.inset-0 > div {
  max-height: 88dvh !important;
  box-sizing: border-box !important;
  margin: auto !important;
}

/* 6. LIQUID GLASS CARDS */
.liquid-glass-light {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 
    0 15px 35px rgba(15, 19, 36, 0.05), 
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 12px rgba(255, 255, 255, 0.5);
}

.liquid-glass-dark {
  background: rgba(15, 19, 36, 0.45);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5), 
    inset 0 1px 1px rgba(255, 255, 255, 0.35),
    inset 0 -1px 20px rgba(0, 255, 102, 0.04); /* Soft emerald inner glow */
}

/* 7. NEUMORPHIC FORM INPUT */
.premium-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), 0 4px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.4s var(--ease-expo);
  font-family: 'Metropolis', sans-serif;
  color: #fff;
}

.premium-input:focus {
  border-color: var(--pako-neon);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  outline: none;
}

.premium-label {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  transition: transform 0.5s var(--ease-elastic), font-size 0.5s var(--ease-elastic), color 0.4s ease;
  pointer-events: none;
}

.premium-input:focus ~ .premium-label,
.premium-input:not(:placeholder-shown) ~ .premium-label {
  transform: translateY(-2.2rem);
  font-size: 0.75rem;
  color: var(--pako-neon);
  letter-spacing: 0.1em;
}

/* 8. GLOW BORDERS */
.emerald-glow-border {
  position: relative;
}
.emerald-glow-border::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 255, 102, 0.6), rgba(0, 152, 74, 0.2));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* 9. RANGE SLIDER STYLING */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #00FF66;
  border: 3px solid #0F1324;
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.8);
  cursor: pointer;
  transition: transform 0.2s ease;
}

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

/* 10. AWWWARDS STAGGERED ENTRANCE TRANSITION */
@keyframes sutilEntrance {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-animate-reveal {
  animation: sutilEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 11. 3D PERSPECTIVE SCROLL LAYOUTS */
#impact-section, #how-it-works {
  perspective: 1500px;
  transform-style: preserve-3d;
}

.tilt-card {
  transition: transform 0.1s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
}

.card-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}

/* 12. CUSTOM AWWWARDS INTERACTIVE ANIMATIONS */
@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

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

.animate-fade-in {
  animation: fadeInHologram 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==============================================================================
 * 13. WORLD-CLASS RESPONSIVE ART-DIRECTION (MOBILE, TABLET, IPAD & DESKTOP)
 * ============================================================================== */

/* A. Mobile & Touch Screen Normalization (< 768px) */
@media (max-width: 768px) {
  /* Disable hover dimming/opacity drops on mobile touch devices */
  .tilt-card {
    opacity: 1 !important;
    transform: none !important;
    scale: 1 !important;
  }
  
  /* Ensure fluid font scaling without text clipping */
  h1 {
    font-size: clamp(2.1rem, 7.5vw, 3.2rem) !important;
    line-height: 1.1 !important;
  }
  h2 {
    font-size: clamp(1.8rem, 6.5vw, 2.6rem) !important;
    line-height: 1.15 !important;
  }
  
  /* Mobile padding and glass container refinements */
  .liquid-glass-light, .liquid-glass-dark {
    padding: 1.25rem !important;
    border-radius: 1.25rem !important;
  }
  
  /* Minimum touch target sizes for mobile accessibility */
  button, input[type="button"], input[type="submit"], a.button {
    min-height: 44px;
    touch-action: manipulation;
  }
}

/* B. Extra Small Screens (< 420px - iPhone SE, Galaxy S, Compact Devices) */
@media (max-width: 420px) {
  body {
    font-size: 13px !important;
  }
  .cotizador-subcard {
    padding: 0.5rem 0.25rem !important;
  }
  .cotizador-subcard-val {
    font-size: 0.9rem !important;
  }
  .cotizador-subcard-lbl {
    font-size: 0.6rem !important;
    letter-spacing: 0.01em !important;
  }
}

/* C. Tablet & iPad Portrait (641px - 1024px) Layout Adaptability */
@media (min-width: 641px) and (max-width: 1024px) {
  .impact-grid, .testimonials-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }
}

/* D. Smooth Glassmorphism & High-Contrast Adjustments */
.high-contrast-modal {
  background-color: #0F1324 !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

/* E. Custom Scrollbar for Sleek Mobile/Desktop Experience */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0F1324;
}
::-webkit-scrollbar-thumb {
  background: #00984A;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #00FF66;
}

/* F. Mobile Container Overflow & Box-Sizing Protection */
@media (max-width: 640px) {
  * {
    max-width: 100%;
  }
  .grid {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .truncate-mobile-fix {
    word-break: break-word !important;
    white-space: normal !important;
  }
  /* Global Modal Overlay Viewport Safety & Text Protection */
  .fixed.inset-0 {
    padding: 0.5rem !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .fixed.inset-0 > div {
    max-height: 90vh !important;
    margin: auto !important;
    box-sizing: border-box !important;
  }
  h1, h2, h3, h4, h5, h6 {
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }
}

/* Desktop & Universal Modal Height & Overflow Safety */
.fixed.inset-0 {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
.fixed.inset-0 > div {
  max-height: 88vh;
  box-sizing: border-box;
  margin: auto;
}
