/* ====== Variables CSS ====== */
:root {
  --primary-color: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #e0f2fe;
  --secondary-color: #10b981;
  --secondary-dark: #059669;
  --accent-color: #f59e0b;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --background: #ffffff;
  --surface: #f8fafc;
  --surface-elevated: #ffffff;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* ====== Base ====== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--background);
  scroll-behavior: smooth;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 48px 0;
}

/* ====== Header Moderno ====== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-light);
  z-index: 100;
  transition: all 0.3s ease;
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  gap: 2rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav a:hover {
  color: var(--primary-color);
}

.nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 50%;
  background: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav a:hover::after {
  width: 100%;
}

.desktop-nav {
  display: flex;
}

/* ====== Botones Modernos ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-cta {
  background: var(--gradient-primary);
  color: white;
  padding: 16px 28px;
  font-size: 1.1rem;
  box-shadow: 0 8px 32px rgba(14, 165, 233, 0.3);
  border-radius: 14px;
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(14, 165, 233, 0.4);
}

/* ====== HERO banner con imagen original ====== */
.hero-section {
  position: relative;
  min-height: 760px;
  background-image:
    linear-gradient(90deg, #f6f7f8 0%, #f3f5f6 18%, rgba(243,245,246,0) 42%),
    url('../img/banner_rodilla.png');
  background-size: 100% 100%, 95% auto;
  background-position: left top, calc(100% + 120px) center;
  background-repeat: no-repeat, no-repeat;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 80px 6% 60px 6%; /* Añadido padding-top para el header fijo */
  margin-top: 0; /* Removido margin-top negativo */
}

.hero-content {
  max-width: 580px;
  color: var(--text-primary);
  text-align: left;
  margin-left: 0;
  transform: translateY(-30px);
}

.hero-content h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 14px;
  text-align: left;
}

.hero-content p {
  font-size: 18px;
  color: #1f2937;
  margin: 0 0 24px;
  text-align: left;
  line-height: 1.6;
}

/* Features del hero que estaban faltando */
.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 2rem;
}

.feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.feature i {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* ====== Calculadora flotante (ajustada) ====== */
.calc-wrap {
  position: relative;
  margin-top: -120px; /* Ajustado para no tapar el texto */
  padding-top: 0;
  padding-bottom: 60px;
}

.calc-card {
  max-width: 920px;
  margin: 0 auto;
  border-radius: 24px;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
}

.calc-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--text-primary);
}

.k-meta {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.input, .select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: var(--surface);
  transition: all 0.3s ease;
  font-size: 1rem;
}

.input:focus, .select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  background: var(--background);
}

.check-group .label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 1rem;
  background: var(--surface);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.check-group .label:hover {
  background: var(--primary-light);
}

.check-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.slider-group {
  background: var(--surface);
  padding: 1.2rem;
  border-radius: 12px;
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 0.5rem;
}

.slider {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
  appearance: none;
}

.slider::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
}

#pain_value {
  background: var(--primary-color);
  color: white;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  min-width: 36px;
  text-align: center;
  font-size: 0.95rem;
}

.form-actions {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.calc-result-space {
  max-width: 920px;
  margin: 2rem auto 0;
}

/* ====== Productos ====== */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  height: 120px;
  background: var(--gradient-primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.description {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ====== Footer ====== */
.footer {
  background: var(--surface);
  padding: 2rem 0;
  border-top: 1px solid var(--border-light);
  margin-top: 3rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* ====== Result Card ====== */
.card.result {
  border-left: 4px solid var(--primary-color);
  background: var(--surface-elevated);
}

.badge {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ===== Hamburger Menu ===== */
.hamburger {
  display: none;
  width: 32px;
  height: 28px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 0;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.mobile-nav.active {
  display: flex;
}

.mobile-nav a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.mobile-nav a:hover {
  background: var(--surface);
  color: var(--primary-color);
}

.mobile-nav .btn {
  margin: 1rem 2rem;
  align-self: flex-start;
}

/* ====== Responsive Design ====== */
@media (max-width: 992px) {
  .desktop-nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .header-inner {
    padding: 0 1rem;
    height: 70px;
  }

  .brand {
    font-size: 1rem;
  }

  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .hero-section {
    min-height: 600px;
    background-image: url('../img/banner_rodilla.png');
    background-size: cover;
    background-position: center top;
    padding: 70px 5% 40px 5%;
    overflow: hidden;
  }

  .hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      90deg,
      rgba(0,0,0,0.45) 0%,
      rgba(0,0,0,0.25) 30%,
      rgba(0,0,0,0.05) 70%
    );
    z-index: 1;
    pointer-events: none;
  }

  .hero-content {
    position: relative;
    z-index: 2;
    color: #ffffff;
    transform: translateY(10px); /* Bajado más para separar del header */
    padding-top: 20px; /* Espacio adicional del header */
  }

  .hero-content p {
    color: #f3f4f6;
  }

  .feature {
    color: rgba(255, 255, 255, 0.9);
  }

  .feature i {
    background: rgba(255, 255, 255, 0.2);
    color: white;
  }

  .calc-wrap {
    margin-top: -40px; /* Reducido para que no se vea el borde dentro del banner */
  }

  .calc-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .calc-card {
    margin: 0 1rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); /* Sombra más suave en móvil */
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0 1rem;
  }

  .hero-section {
    min-height: 500px;
    padding: 70px 4% 30px 4%;
  }

  .hero-content {
    max-width: 100%;
    transform: translateY(15px); /* Más espacio del header */
    padding-top: 25px; /* Espacio adicional para separar bien del header */
  }

  .hero-content h1 {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-content p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-features {
    gap: 1rem;
    margin-top: 1.5rem;
  }

  .feature {
    font-size: 0.9rem;
  }

  .feature i {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .calc-wrap {
    margin-top: -20px; /* Aún menos negativo para que no interfiera */
  }

  .calc-card {
    padding: 1.5rem 1rem;
    margin: 0 0.5rem;
  }

  .calc-title {
    font-size: 1.5rem;
  }

  /* Arreglar desbordamiento en móvil */
  .input, .select {
    min-width: 0;
    max-width: 100%;
  }

  .check-group .label {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  .slider-group {
    padding: 1rem;
  }

  .row {
    gap: 8px;
  }

  #pain_value {
    min-width: 32px;
    padding: 4px 8px;
    font-size: 0.9rem;
  }

  .btn-cta {
    padding: 14px 20px;
    font-size: 1rem;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-section {
    min-height: 450px;
    padding-top: 90px; /* Más espacio del header fijo */
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-content {
    padding-top: 30px; /* Espacio adicional del header */
  }

  .calc-wrap {
    margin-top: -10px; /* Mínimo negativo para evitar superposición */
  }

  .calc-card {
    border-radius: 16px;
    margin: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06); /* Sombra muy suave */
  }

  .calc-grid {
    gap: 1rem;
  }

  .form-group {
    gap: 6px;
  }

  .label {
    font-size: 0.9rem;
  }

  .input, .select {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  /* Asegurar que los inputs no se desborden */
  .calc-grid {
    overflow: hidden;
  }

  .form-group {
    min-width: 0;
  }
}

/* ===== Desktop: forzar oculto SIEMPRE ===== */
@media (min-width: 993px) {
  .hamburger {
    display: none !important;
  }
  .mobile-nav {
    display: none !important;
  }
  .header.open .mobile-nav {
    display: none !important;
  }
}

/* ====== Animaciones ====== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* ====== Utilities ====== */
.text-center {
  text-align: center;
}

.hidden {
  display: none;
}

.cart-link{ position:relative; display:inline-flex; align-items:center; gap:8px; }
.cart-link i{ font-size:20px; }
.cart-badge{
  position:absolute; top:-6px; right:-10px;
  background:#ef4444; color:#fff; font-weight:800; font-size:11px;
  min-width:18px; height:18px; line-height:18px; text-align:center;
  border-radius:999px; padding:0 4px;
}
@media (max-width:900px){
  .mobile-nav .cart-link{ align-self:flex-start; }
  .mobile-nav .cart-badge{ position:relative; top:auto; right:auto; margin-left:6px; }
}

/* Icono carrito + burbuja */
.cart-link{ position:relative; display:inline-flex; align-items:center; gap:8px; }
.cart-link i{ font-size:20px; }
.cart-badge{
  position:absolute; top:-6px; right:-10px;
  background:#ef4444; color:#fff; font-weight:800; font-size:11px;
  min-width:18px; height:18px; line-height:18px; text-align:center;
  border-radius:999px; padding:0 4px;
}
@media (max-width:900px){
  .mobile-nav .cart-link{ align-self:flex-start; }
  .mobile-nav .cart-badge{ position:relative; top:auto; right:auto; margin-left:6px; }
}

/* Unificar botones al estilo del index (verde) */
.btn{display:inline-block;padding:12px 16px;border-radius:12px;font-weight:700;text-decoration:none;cursor:pointer;border:0}
.btn-cta{background:#21a607;color:#fff;box-shadow:0 8px 24px rgba(33,166,7,.25)}
.btn-cta:hover{background:#1a8505}

/* Botón de tarjeta a lo ancho */
.btn-full{ display:block; width:100%; text-align:center; padding:14px 18px; border-radius:14px; }

/* Carrito más llamativo */
.cart-link{ position:relative; display:inline-flex; align-items:center; gap:8px; }
.cart-link i{ font-size:26px; }           /* Ícono más grande */
.cart-badge{
  position:absolute; top:-8px; right:-12px;
  background:#ef4444; color:#fff; font-weight:800; font-size:12px;
  min-width:22px; height:22px; line-height:22px; text-align:center;
  border-radius:999px; padding:0 6px;
  box-shadow:0 4px 10px rgba(0,0,0,.15);
}

@keyframes pop{ 0%{transform:scale(.9)} 60%{transform:scale(1.15)} 100%{transform:scale(1)} }
.badge-pop{ animation: pop .22s ease-out; }

@media (max-width:900px){
  .mobile-nav .cart-link{ align-self:flex-start; }
  .mobile-nav .cart-badge{ position:relative; top:auto; right:auto; margin-left:6px; }
}

/* Evitar que el H1 quede tapado por el header sticky */
.page-main{ margin-top: 18px; }

/* Carrito visible y con pequeño pop */
.cart-link{ position:relative; display:inline-flex; align-items:center; gap:8px; }
.cart-link i{ font-size:26px; }
.cart-badge{
  position:absolute; top:-8px; right:-12px;
  background:#ef4444; color:#fff; font-weight:800; font-size:12px;
  min-width:22px; height:22px; line-height:22px; text-align:center;
  border-radius:999px; padding:0 6px;
  box-shadow:0 4px 10px rgba(0,0,0,.15);
}
@keyframes pop{ 0%{transform:scale(.9)} 60%{transform:scale(1.15)} 100%{transform:scale(1)} }
.badge-pop{ animation: pop .22s ease-out; }

/* Botón ancho de tarjeta (respeta color original del index) */
.btn-full{ display:block; width:100%; text-align:center; padding:14px 18px; border-radius:14px; }

