/* ── Reset & Base ────────────────────────────────── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--rl-gris-oscuro);
  background: var(--rl-blanco);
  overflow-x: hidden;
}

/* Override PicoCSS max-width on layout elements so backgrounds go full-width */
main,
footer {
  max-width: 100% !important;
  margin: 0 !important;
}

main {
  padding: 0 !important;
}

/* ── Navbar ──────────────────────────────────────── */
nav.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0.75rem 0;
  transition: box-shadow 0.3s ease;
}

nav.navbar.scrolled {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

nav.navbar .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

nav.navbar .logo img {
  height: 56px;
  width: auto;
}

nav.navbar .nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
  margin-left: 3rem;
}

nav.navbar .nav-links a {
  text-decoration: none;
  color: var(--rl-gris-oscuro);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

nav.navbar .nav-links a:hover,
nav.navbar .nav-links a.active {
  color: var(--rl-azul-primario);
}

nav.navbar .nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--rl-azul-primario);
  transition: width 0.3s;
}

nav.navbar .nav-links a:hover::after {
  width: 100%;
}

/* WhatsApp button override */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--rl-whatsapp) !important;
  color: #FFFFFF !important;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.3s;
  border: none;
}

.btn-whatsapp::after {
  display: none !important;
}

.btn-whatsapp:hover {
  background: #1EBE5D !important;
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--rl-gris-oscuro);
  margin: 5px 0;
  transition: all 0.3s;
}

/* ── Hero ────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--rl-azul-claro) 0%, var(--rl-blanco) 50%, var(--rl-azul-claro) 100%);
  padding: 8rem 0 4rem;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 193, 216, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-content h1 {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--rl-gris-oscuro);
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero-content h1 span {
  color: var(--rl-azul-primario);
}

.hero-content p {
  font-size: 1.15rem;
  color: #6B7280;
  line-height: 1.7;
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--rl-azul-primario);
  color: var(--rl-blanco);
  padding: 0.85rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--rl-azul-primario-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(129, 193, 216, 0.4);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--rl-azul-primario);
  padding: 0.85rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid var(--rl-azul-primario);
  transition: all 0.3s;
  cursor: pointer;
}

.btn-outline:hover {
  background: var(--rl-azul-primario);
  color: var(--rl-blanco);
  transform: translateY(-2px);
}

.hero-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Blob de fondo que morphea */
.hero-image::before {
  content: '';
  position: absolute;
  width: 460px;
  height: 460px;
  background: linear-gradient(135deg, rgba(129, 193, 216, 0.35) 0%, rgba(232, 244, 248, 0.6) 100%);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: morphBlob 9s ease-in-out infinite;
  z-index: 0;
}

/* Anillo decorativo */
.hero-image::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border: 2px solid rgba(129, 193, 216, 0.4);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: morphBlob 9s ease-in-out infinite reverse;
  z-index: 0;
}

.hero-photo-wrapper {
  position: relative;
  z-index: 1;
  animation: floatImage 6s ease-in-out infinite;
}

.hero-photo {
  width: 380px;
  height: 380px;
  object-fit: cover;
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: morphImage 9s ease-in-out infinite;
  box-shadow: 0 20px 60px rgba(94, 171, 196, 0.35);
  display: block;
}

@keyframes morphBlob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes morphImage {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50%       { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes floatImage {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-14px); }
}

/* ── Section Base ────────────────────────────────── */
section {
  padding: 6rem 1.5rem;
}

section .container {
  max-width: 1200px;
  margin: 0 auto;
}

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

.section-header .badge {
  display: inline-block;
  background: var(--rl-azul-claro);
  color: var(--rl-azul-primario-dark);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--rl-gris-oscuro);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 1.05rem;
  color: #6B7280;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Stats ───────────────────────────────────────── */
.stats {
  background: var(--rl-gris-oscuro);
  padding: 4rem 1.5rem;
}

.stats .container {
  max-width: 1200px;
  margin: 0 auto;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
}

.stat-item {
  text-align: center;
  color: var(--rl-blanco);
}

.stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  display: block;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Mission/Vision ──────────────────────────────── */
.mision-vision {
  background: var(--rl-blanco);
}

.mv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.mv-card {
  background: var(--rl-azul-claro);
  border-radius: 16px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s;
}

.mv-card:hover {
  transform: translateY(-4px);
}

.mv-card .mv-icon {
  width: 56px;
  height: 56px;
  background: var(--rl-azul-primario);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: white;
}

.mv-card h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--rl-gris-oscuro);
  margin-bottom: 1rem;
}

.mv-card p {
  color: #4B5563;
  line-height: 1.7;
  font-size: 0.85rem;
}

/* ── Logos Grid (Proveedores/Clientes) ────────────── */
.proveedores,
.clientes {
  background: var(--rl-azul-claro);
}

.clientes {
  background: var(--rl-blanco);
}

.logos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
}

.logo-card {
  background: var(--rl-blanco);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: all 0.3s;
}

.proveedores .logo-card {
  background: var(--rl-blanco);
}

.clientes .logo-card {
  background: var(--rl-blanco);
}

.logo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.logo-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.7;
  transition: all 0.3s;
  display: block;
}

.logo-card:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

.logo-card .logo-placeholder {
  font-size: 0.8rem;
  color: #9CA3AF;
  text-align: center;
  font-weight: 500;
}

/* ── Certificaciones ─────────────────────────────── */
.certificaciones-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.cert-card {
  background: var(--rl-blanco);
  border-radius: 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(129, 193, 216, 0.2);
  transition: transform 0.3s, box-shadow 0.3s;
}

.cert-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.cert-logo {
  background: var(--rl-azul-claro);
  height: 200px;
  border-bottom: 1px solid rgba(129, 193, 216, 0.2);
  overflow: hidden;
}

.cert-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cert-info {
  padding: 1.5rem 2rem;
}

.cert-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--rl-gris-oscuro);
  margin-bottom: 0.2rem;
}

.cert-info .cert-entity {
  font-size: 0.82rem;
  color: var(--rl-azul-primario-dark);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.cert-info p {
  font-size: 0.9rem;
  color: #6B7280;
  line-height: 1.5;
}

/* ── Contact ─────────────────────────────────────── */
.contacto {
  background: var(--rl-azul-claro);
}

.contacto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contacto-info h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--rl-gris-oscuro);
}

.contacto-items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contacto-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.contacto-item .ci-icon {
  width: 44px;
  height: 44px;
  background: var(--rl-azul-primario);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 1.1rem;
}

.contacto-item strong {
  display: block;
  font-size: 0.85rem;
  color: var(--rl-gris-oscuro);
  margin-bottom: 0.15rem;
}

.contacto-item span {
  font-size: 0.9rem;
  color: #6B7280;
}

.contacto-form {
  background: var(--rl-blanco);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.contacto-form h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--rl-gris-oscuro);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rl-gris-oscuro);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--rl-blanco);
  color: var(--rl-gris-oscuro);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--rl-azul-primario);
  box-shadow: 0 0 0 3px rgba(129, 193, 216, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-success {
  display: none;
  background: #ECFDF5;
  color: var(--rl-verde);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  margin-top: 1rem;
}

/* ── Footer ──────────────────────────────────────── */
.footer {
  background: var(--rl-gris-oscuro);
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 1.5rem 2rem;
}

.footer .container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 0.9fr 1.1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo {
  height: 48px;
  width: auto;
  margin-bottom: 1.25rem;
  display: block;
}

.footer-brand p {
  font-size: 0.82rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 0.75rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s;
  font-size: 1.1rem;
}

.social-links a:hover {
  background: var(--rl-azul-primario);
  color: var(--rl-blanco);
  transform: translateY(-2px);
}

.footer-col h4 {
  color: var(--rl-blanco);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  opacity: 0.9;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col ul a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.2s;
}

.footer-col ul a:hover {
  color: var(--rl-blanco);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-copy {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 0;
  letter-spacing: 0.02em;
}

.footer-subtle-link:hover {
  color: rgba(255, 255, 255, 0.5);
}

/* ── Legal Modal ─────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--rl-blanco);
  border-radius: 16px;
  padding: 2rem 2.5rem;
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
}

.modal-content::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}

/* Logo watermark on all legal modals */
.modal-content::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background: url('/static/img/logo-rlpharma.png') no-repeat center center;
  background-size: contain;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

.modal-content h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--rl-gris-oscuro);
  position: relative;
  z-index: 1;
}

.modal-content p,
.modal-content #modalBody {
  line-height: 1.6;
  color: #4B5563;
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: var(--rl-azul-claro);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--rl-gris-oscuro);
  transition: background 0.2s;
}

.modal-close:hover {
  background: #d1e8ef;
}

/* Estados financieros links in modal */
.ef-links {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
}

.ef-links li {
  margin-bottom: 0.5rem;
}

.ef-links a {
  color: var(--rl-azul-primario-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.ef-links a:hover {
  color: var(--rl-gris-oscuro);
  text-decoration: underline;
}

/* Canal de denuncia info in modal */
.canal-denuncia-info {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.canal-denuncia-info .canal-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.6rem;
}

.canal-denuncia-info .canal-item > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.canal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  background: var(--rl-azul-claro);
  border-radius: 8px;
  flex-shrink: 0;
}

.canal-icon svg {
  width: 18px;
  height: 18px;
}

.canal-reserva {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--rl-azul-claro);
  border-radius: 8px;
  font-size: 0.78rem;
  color: #4B5563;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border-left: 3px solid var(--rl-azul-primario);
}

.canal-reserva svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.canal-denuncia-info .canal-item strong {
  font-size: 0.8rem;
  color: var(--rl-gris-oscuro);
}

.canal-denuncia-info .canal-item a {
  color: var(--rl-azul-primario-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.83rem;
  transition: color 0.2s;
}

.canal-denuncia-info .canal-item a:hover {
  color: var(--rl-gris-oscuro);
  text-decoration: underline;
}

/* ── Scroll Animations ───────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
  .hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2.6rem;
  }

  .hero-content p {
    max-width: 100%;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-image {
    display: none;
  }

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

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

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav.navbar .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--rl-blanco);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  }

  nav.navbar .nav-links.active {
    display: flex;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

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

  .logos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

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

  .contacto-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  section {
    padding: 4rem 1.5rem;
  }

  .section-header h2 {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.7rem;
  }

  .stat-number {
    font-size: 2rem;
  }

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

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
}
