* {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Inter', sans-serif;
      background-color: #fafcff;
      color: #1a2c3e;
      scroll-behavior: smooth;
    }

    :root {
      --primary-dark: #0b2b5c;
      --primary: #1e4a76;
      --primary-light: #2e6a9e;
      --accent: #00a3b2;
      --gray-light: #f0f4f9;
      --gray-mid: #e2e8f0;
      --text-dark: #13294b;
      --text-soft: #2c3e50;
      --white: #ffffff;
    }

   
    .header {
      background: rgba(255,255,255,0.96);
      backdrop-filter: blur(8px);
      box-shadow: 0 2px 15px rgba(0,0,0,0.05);
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      z-index: 1000;
      padding: 0.8rem 5%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      transition: all 0.25s ease-in-out;
    }

    .header.scrolled {
      padding: 0.4rem 5%;
      background: rgba(255,255,255,0.98);
      box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }

    .logo-container {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .logo-img {
      height: 55px;
      width: auto;
      display: block;
      transition: height 0.25s ease;
    }
    .header.scrolled .logo-img {
      height: 45px;
    }

    .logo-text {
      font-weight: 800;
      font-size: 1.4rem;
      background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
      background-clip: text;
      -webkit-background-clip: text;
      color: transparent;
      letter-spacing: -0.3px;
    }

    .nav-links {
      display: flex;
      gap: 2rem;
      flex-wrap: wrap;
    }

    .nav-links a {
      text-decoration: none;
      font-weight: 600;
      color: var(--text-dark);
      transition: 0.2s;
      font-size: 1rem;
      padding: 0.5rem 0;
      border-bottom: 2px solid transparent;
    }

    .nav-links a:hover, .nav-links a.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
    }

    main {
      padding-top: 80px;
    }

   
    .hero-especialidades {
      position: relative;
      background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
      padding: 5rem 2rem;
      text-align: center;
      color: white;
      overflow: hidden;
      isolation: isolate;
    }
    .hero-bg-img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      opacity: 0.25;
      z-index: 0;
      pointer-events: none;
    }
    .hero-especialidades h1 {
      font-size: 3.5rem;
      font-weight: 800;
      margin-bottom: 1rem;
      position: relative;
      z-index: 2;
    }
    .hero-especialidades p {
      font-size: 1.2rem;
      max-width: 700px;
      margin: 0 auto;
      opacity: 0.95;
      position: relative;
      z-index: 2;
    }

    .container {
      max-width: 1400px;
      margin: 0 auto;
      padding: 4rem 2rem;
    }

  
    .especialidades-wrapper {
      position: relative;
      margin-top: 2rem;
    }
    .especialidades-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 2.5rem;
      justify-content: center;
      position: relative;
      z-index: 2;
    }
    .especialidad-card {
      background: white;
      border-radius: 50%;
      padding: 1.8rem 1rem;
      text-align: center;
      cursor: pointer;
      transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
      box-shadow: 0 15px 35px -10px rgba(0,0,0,0.1);
      border: 2px solid var(--gray-mid);
      position: relative;
      aspect-ratio: 1 / 1;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      overflow: hidden;
    }
    .especialidad-card::before {
      content: "";
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: radial-gradient(circle at center, rgba(0,163,178,0.05) 0%, rgba(0,0,0,0) 70%);
      opacity: 0;
      transition: opacity 0.3s;
    }
    .especialidad-card:hover::before {
      opacity: 1;
    }
    .especialidad-card:hover {
      transform: translateY(-8px) scale(1.02);
      box-shadow: 0 25px 45px -12px rgba(0,0,0,0.25);
      border-color: var(--accent);
    }
  
    .card-icon {
      font-size: 2.5rem;
      color: var(--accent);
      margin-bottom: 0.8rem;
      transition: transform 0.3s;
    }
    .especialidad-card:hover .card-icon {
      transform: scale(1.1);
    }
    .especialidad-card h3 {
      font-size: 1.1rem;
      font-weight: 800;
      color: var(--primary-dark);
      margin-bottom: 0.3rem;
    }
    .especialidad-card p {
      font-size: 0.75rem;
      color: var(--text-soft);
      line-height: 1.3;
      max-width: 90%;
      margin: 0 auto;
    }

  
    .arrow-svg {
      position: absolute;
      pointer-events: none;
      z-index: 1;
      width: 120px;
      height: 80px;
    }
    .arrow-svg svg {
      width: 100%;
      height: 100%;
    }

   
    .separator-center {
      width: 100px;
      height: 4px;
      background: var(--accent);
      margin: 2rem auto;
      border-radius: 4px;
    }

      .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.75);
      backdrop-filter: blur(6px);
      z-index: 2000;
      justify-content: center;
      align-items: center;
      animation: fadeIn 0.2s ease;
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    .modal-content {
      background: white;
      max-width: 520px;
      width: 90%;
      border-radius: 48px;
      padding: 2rem;
      position: relative;
      text-align: center;
      animation: slideUp 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
      box-shadow: 0 30px 50px rgba(0,0,0,0.3);
    }
    @keyframes slideUp {
      from { transform: translateY(40px); opacity: 0; }
      to { transform: translateY(0); opacity: 1; }
    }
    .modal-close {
      position: absolute;
      top: 18px;
      right: 22px;
      font-size: 1.8rem;
      cursor: pointer;
      color: #aaa;
      transition: 0.2s;
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
    }
    .modal-close:hover {
      color: var(--primary-dark);
      background: var(--gray-light);
      transform: rotate(90deg);
    }
    .modal-icon {
      font-size: 3rem;
      color: var(--accent);
      margin-bottom: 0.5rem;
    }
    
    .modal-content h2 {
      font-size: 1.8rem;
      color: var(--primary-dark);
      margin-bottom: 0.8rem;
    }
    .modal-content p {
      color: var(--text-soft);
      line-height: 1.6;
      margin-bottom: 1.2rem;
    }
    .modal-details {
      background: var(--gray-light);
      border-radius: 28px;
      padding: 1rem;
      margin: 1rem 0;
      font-size: 0.9rem;
      text-align: left;
    }
    .modal-details i {
      width: 24px;
      color: var(--accent);
    }
    .btn-agendar {
      background: var(--accent);
      color: white;
      border: none;
      padding: 0.9rem 2rem;
      border-radius: 60px;
      font-weight: 700;
      font-size: 1rem;
      cursor: pointer;
      transition: 0.2s;
      margin-top: 0.5rem;
      width: 100%;
    }
    .btn-agendar:hover {
      background: var(--primary);
      transform: scale(1.02);
      box-shadow: 0 8px 20px rgba(0,163,178,0.3);
    }


    .footer {
      background: #0e1f32;
      color: #cddfe7;
      padding: 3rem 5% 2rem;
      margin-top: 4rem;
      border-top-left-radius: 32px;
      border-top-right-radius: 32px;
    }
    .footer-grid {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 2rem;
      margin-bottom: 2rem;
    }
    .footer-col {
      flex: 1;
      min-width: 180px;
    }
    .footer-logo-area {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 1rem;
    }
    .footer-logo-img {
      height: 46px;
      width: auto;
      display: block;
    }
    .footer-quote {
      font-style: italic;
      font-size: 0.9rem;
      margin-top: 0.8rem;
      opacity: 0.8;
      max-width: 220px;
    }
    .footer-col h4 {
      color: white;
      margin-bottom: 1rem;
      font-weight: 700;
      font-size: 1.2rem;
    }
    .footer-col ul {
      list-style: none;
    }
    .footer-col li, .footer-col a {
      color: #bdd4e2;
      text-decoration: none;
      line-height: 1.8;
      transition: 0.2s;
    }
    .footer-col a:hover {
      color: white;
      text-decoration: underline;
    }
    .copyright {
      border-top: 1px solid #2c445c;
      padding-top: 1.5rem;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      font-size: 0.8rem;
      color: #98b1c4;
    }
    .footer-bottom-copy {
      color: #98b1c4;
      text-align: left;
    }
    .footer-megaweb {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      text-decoration: none;
      color: rgba(205, 223, 231, 0.75);
      font-size: 0.85rem;
      transition: color 0.2s, opacity 0.2s;
      margin-left: auto;
    }
    .footer-megaweb:hover {
      color: var(--accent);
      opacity: 1;
    }
    .footer-megaweb-logo {
      height: 32px;
      width: auto;
      max-width: 110px;
      object-fit: contain;
      display: block;
    }

    @media (max-width: 800px) {
      .hero-especialidades h1 { font-size: 2.2rem; }
      .nav-links { gap: 1rem; }
      .nav-links a { font-size: 0.85rem; }
      main { padding-top: 70px; }
      .container { padding: 2rem 1rem; }
      .especialidades-grid { gap: 1.2rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
      .especialidad-card { padding: 1rem 0.5rem; }
      .card-img { width: 60px; height: 60px; }
      .card-icon { font-size: 1.8rem; }
      .especialidad-card h3 { font-size: 0.85rem; }
      .especialidad-card p { font-size: 0.65rem; display: none; }
    }
    @media (max-width: 640px) {
      .footer-grid { flex-direction: column; text-align: center; }
      .footer-logo-area { justify-content: center; }
      .footer-quote { margin-left: auto; margin-right: auto; text-align: center; }
      .copyright {
        flex-direction: column;
        justify-content: center;
        text-align: center;
      }
      .footer-bottom-copy { text-align: center; }
      .footer-megaweb { margin-left: 0; }
      .modal-content { padding: 1.5rem; }
    }