/* ============================================================
   JJR GROUP — main.css
   Sistema de diseño: variables, reset, grid, tipografía, utilidades
   ============================================================ */

/* ── 1. VARIABLES ─────────────────────────────────────────── */
:root {
  /* Colores principales */
  --color-primary:          #E8790A;
  --color-primary-dark:     #C45F00;
  --color-primary-light:    #FF9B3A;
  --color-secondary:        #1A2B4A;
  --color-secondary-light:  #243659;
  --color-gold:             #C4A042;
  --color-gold-light:       #D4B562;

  /* Neutros */
  --color-bg:               #F5F4F0;
  --color-bg-dark:          #0D1B2A;
  --color-bg-darker:        #081422;
  --color-white:            #FFFFFF;
  --color-text:             #1C1C1C;
  --color-text-muted:       #6B7280;
  --color-text-light:       #9CA3AF;
  --color-border:           #E2E0D8;
  --color-border-dark:      rgba(255,255,255,0.1);

  /* Tipografía */
  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Tamaños de fuente */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* Espaciado */
  --section-padding:    120px 0;
  --section-padding-sm: 70px 0;
  --container-max:      1280px;
  --container-pad:      0 clamp(20px, 4vw, 40px);

  /* Sombras */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.12);
  --shadow-lg:  0 20px 60px rgba(0,0,0,0.18);
  --shadow-xl:  0 32px 80px rgba(0,0,0,0.25);
  --shadow-orange: 0 8px 32px rgba(232,121,10,0.35);

  /* Bordes */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  32px;
  --radius-full: 9999px;

  /* Transiciones */
  --transition-fast:   0.2s ease;
  --transition-normal: 0.4s ease;
  --transition-slow:   0.7s cubic-bezier(0.16, 1, 0.3, 1);

  /* Z-index */
  --z-base:    1;
  --z-dropdown: 100;
  --z-sticky:  200;
  --z-modal:   300;
  --z-chat:    400;
  --z-toast:   500;
}

/* ── 2. RESET ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── 3. TIPOGRAFÍA ────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.5rem, 6vw, var(--text-7xl)); font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, var(--text-5xl)); }
h3 { font-size: clamp(1.5rem, 3vw, var(--text-3xl)); }
h4 { font-size: clamp(1.25rem, 2vw, var(--text-2xl)); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p { line-height: 1.75; }

.mono { font-family: var(--font-mono); }

/* ── 4. LAYOUT / GRID ─────────────────────────────────────── */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding: var(--container-pad);
  width: 100%;
}

.section {
  padding: var(--section-padding);
}

.section--dark {
  background-color: var(--color-bg-dark);
  color: var(--color-white);
}

.section--secondary {
  background-color: var(--color-secondary);
  color: var(--color-white);
}

.section--light {
  background-color: var(--color-white);
}

.grid {
  display: grid;
  gap: 2rem;
}

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

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* ── 5. SECCIÓN HEADERS ───────────────────────────────────── */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.section-tag::before {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  flex-shrink: 0;
}

.section-tag--gold {
  color: var(--color-gold);
}
.section-tag--gold::before {
  background: var(--color-gold);
}

.section-tag--white {
  color: rgba(255,255,255,0.7);
}
.section-tag--white::before {
  background: rgba(255,255,255,0.4);
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 600px;
  line-height: 1.7;
}

.section-header {
  margin-bottom: 4rem;
}

.section-header--center {
  text-align: center;
}

.section-header--center .section-tag {
  justify-content: center;
}

.section-header--center .section-subtitle {
  margin-inline: auto;
}

/* ── 6. BOTONES ───────────────────────────────────────────── */
/* ── BUTTON ANIMATIONS ──────────────────────────────────────── */
@keyframes btn-shimmer {
  0%   { transform: translateX(-150%) skewX(-20deg); }
  100% { transform: translateX(350%) skewX(-20deg); }
}
@keyframes btn-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,121,10,0); }
  50%       { box-shadow: 0 0 0 10px rgba(232,121,10,0); }
}
@keyframes btn-ripple {
  0%   { transform: scale(0); opacity: 0.5; }
  100% { transform: scale(4); opacity: 0; }
}
@keyframes btn-border-spin {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  z-index: 1;
}

/* shimmer sweep on all buttons */
.btn::before {
  content: '';
  position: absolute;
  top: -10%;
  left: 0;
  width: 35%;
  height: 120%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  transform: translateX(-150%) skewX(-20deg);
  transition: none;
  pointer-events: none;
}
.btn:hover::before {
  animation: btn-shimmer 0.65s ease forwards;
}

/* ripple on click */
.btn .btn-ripple {
  position: absolute;
  border-radius: 50%;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.35);
  pointer-events: none;
  animation: btn-ripple 0.7s ease-out forwards;
}

.btn-primary {
  background: linear-gradient(135deg, #f08a1a 0%, #E8790A 60%, #c96208 100%);
  color: #fff !important;
  box-shadow: 0 6px 24px rgba(232,121,10,0.45), 0 2px 8px rgba(0,0,0,0.2);
  border: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #f59420 0%, #f08a1a 60%, #d97010 100%);
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(232,121,10,0.55), 0 4px 16px rgba(0,0,0,0.25);
}
.btn-primary:active { transform: translateY(-1px); }

/* continuous glow ring on primary in hero */
.hero .btn-primary {
  animation: hero-btn-glow 3s ease-in-out infinite;
}
@keyframes hero-btn-glow {
  0%, 100% { box-shadow: 0 6px 24px rgba(232,121,10,0.45), 0 0 0 0 rgba(232,121,10,0.4); }
  50%       { box-shadow: 0 10px 32px rgba(232,121,10,0.6), 0 0 0 8px rgba(232,121,10,0); }
}
.hero .btn-primary:hover { animation: none; }

.btn-secondary {
  background: var(--color-secondary);
  color: var(--color-white) !important;
}
.btn-secondary:hover {
  background: var(--color-secondary-light);
  transform: translateY(-2px);
}

.btn-outline {
  background: rgba(255,255,255,0.06);
  color: #fff !important;
  border: 2px solid rgba(255,255,255,0.75);
  backdrop-filter: blur(4px);
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(255,255,255,0.12);
}

.btn-outline-primary {
  background: transparent;
  color: var(--color-primary) !important;
  border: 2px solid var(--color-primary);
}
.btn-outline-primary:hover {
  background: var(--color-primary);
  color: var(--color-white) !important;
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: var(--text-base);
}
.btn-lg {
  padding: 1.125rem 2.75rem;
  font-size: var(--text-xl);
}

.btn-gold {
  background: var(--color-gold);
  color: var(--color-white) !important;
}
.btn-gold:hover {
  background: var(--color-gold-light);
  transform: translateY(-2px);
}

/* ── 7. BADGES / TAGS ─────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-primary { background: rgba(232,121,10,0.15); color: var(--color-primary); }
.badge-secondary { background: rgba(26,43,74,0.1); color: var(--color-secondary); }
.badge-gold { background: rgba(196,160,66,0.15); color: var(--color-gold); }

/* ── 8. FORMULARIOS ───────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(232,121,10,0.12);
}

.form-control::placeholder {
  color: var(--color-text-light);
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
}

/* ── 9. CARDS BASE ────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.card-img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
}

/* ── 10. DIVISORES ────────────────────────────────────────── */
.divider {
  width: 64px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 2px;
  margin: 1rem 0;
}

.divider--center { margin-inline: auto; }
.divider--gold { background: var(--color-gold); }

/* ── 11. OVERLAY ──────────────────────────────────────────── */
.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay--dark { background: rgba(13,27,42,0.65); }
.overlay--gradient {
  background: linear-gradient(to right, rgba(13,27,42,0.9) 40%, rgba(13,27,42,0.3) 100%);
}
.overlay--bottom {
  background: linear-gradient(to top, rgba(13,27,42,0.9) 0%, transparent 60%);
}

/* ── 12. UTILITIES ────────────────────────────────────────── */
.text-primary   { color: var(--color-primary) !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-gold      { color: var(--color-gold) !important; }
.text-white     { color: var(--color-white) !important; }
.text-muted     { color: var(--color-text-muted) !important; }
.text-upper     { text-transform: uppercase; }
.text-center    { text-align: center; }

.bg-dark        { background: var(--color-bg-dark); }
.bg-secondary   { background: var(--color-secondary); }
.bg-primary     { background: var(--color-primary); }
.bg-white       { background: var(--color-white); }

.hidden         { display: none !important; }
.sr-only        { position: absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-6 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-6 { margin-bottom: 3rem; }

/* Lazy load image fade */
img[loading="lazy"] { opacity: 0; transition: opacity 0.4s; }
img.loaded          { opacity: 1; }

/* ── 13. RESPONSIVE BREAKPOINTS ──────────────────────────── */
@media (max-width: 1200px) {
  :root { --container-max: 1024px; }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 80px 0;
    --section-padding-sm: 50px 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }

  .section-header { margin-bottom: 2.5rem; }
  .section-subtitle { font-size: var(--text-base); }

  .btn-lg {
    padding: 1rem 2rem;
    font-size: var(--text-lg);
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 60px 0;
  }

  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.8rem; }
}

/* ── 14. SCROLLBAR PERSONALIZADO ──────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-dark); }

/* ── 15. SELECTION ────────────────────────────────────────── */
::selection {
  background: var(--color-primary);
  color: var(--color-white);
}
