/* 
  COSVI - Clínica de Ojos Salud Visual 
  Main Stylesheet 
*/

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Poppins:wght@300;400;500;600&display=swap');

:root {
  /* Color Palette */
  --primary-blue: #40568D;
  --secondary-blue: #3B4B75;
  --accent-cyan: #4DA5D6;
  --light-cyan: #F0F9FF; /* Slightly adjusted for better contrast */
  --white: #ffffff;
  --text-dark: #2C3E50;
  --text-light: #64748B;
  --bg-gray: #F8FAFC;
  --border-color: #E2E8F0;
  
  /* Typography */
  --font-heading: 'Nunito', sans-serif;
  --font-body: 'Poppins', sans-serif;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 50px;
  
  /* Shadows */
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(64, 86, 141, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(64, 86, 141, 0.15);
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--primary-blue);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: var(--primary-blue);
  transition: var(--transition);
}

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

ul {
  list-style: none;
}

/* ================= Layout & Utilities ================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
  position: relative;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-title p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.125rem;
}

.bg-gray {
  background-color: var(--bg-gray);
}

.bg-light-cyan {
  background-color: var(--light-cyan);
}

/* ================= Buttons ================= */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-family: var(--font-heading);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--accent-cyan);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(77, 165, 214, 0.4);
}

.btn-primary:hover {
  background-color: #3B8DBD;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(77, 165, 214, 0.5);
  color: var(--white);
}

.btn-secondary {
  background-color: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.btn-secondary:hover {
  background-color: var(--primary-blue);
  color: var(--white);
}

.btn-whatsapp {
  background-color: #25D366;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
  background-color: #128C7E;
  transform: translateY(-2px);
  color: white;
}

/* ================= Header & Navigation ================= */
.topbar {
  background-color: var(--primary-blue);
  color: var(--white);
  padding: 0.5rem 0;
  font-size: 0.875rem;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-info {
  display: flex;
  gap: 1.5rem;
}

.topbar-info span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 0;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  transition: var(--transition);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo img {
  height: 60px;
  width: auto;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary-blue);
  line-height: 1.1;
}

.logo-slogan {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-dark);
  font-weight: 500;
  font-family: var(--font-heading);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-cyan);
  transition: var(--transition);
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-blue);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--primary-blue);
  cursor: pointer;
}

/* ================= Hero Section ================= */
.hero {
  position: relative;
  padding: 8rem 0 10rem;
  background: linear-gradient(135deg, var(--light-cyan) 0%, var(--white) 100%);
  overflow: hidden;
}

/* Decorative fluid shapes */
.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  right: -5%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(77,165,214,0.1) 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  z-index: 0;
}

.hero .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  position: relative;
  z-index: 1;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary-blue);
}

.hero h1 span {
  color: var(--accent-cyan);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-light);
  margin-bottom: 2.5rem;
}

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

.hero-image {
  flex: 1;
  position: relative;
}

.hero-image img {
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  box-shadow: var(--shadow-lg);
  animation: blob-morph 8s ease-in-out infinite alternate;
}

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

/* Wave divider */
.wave-divider {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.wave-divider svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 120px;
}

.wave-divider .shape-fill {
  fill: var(--white);
}

/* ================= Cards & Grids ================= */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-cyan);
}

.card-icon {
  width: 80px;
  height: 80px;
  background: var(--light-cyan);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: var(--primary-blue);
  transition: var(--transition);
}

.card:hover .card-icon {
  background: var(--primary-blue);
  color: var(--white);
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-link {
  color: var(--accent-cyan);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
}

.card-link:hover {
  gap: 0.8rem;
  color: var(--primary-blue);
}

/* Service Card variant with images */
.service-card {
  padding: 0;
  text-align: left;
}

.service-card-img {
  height: 200px;
  width: 100%;
  overflow: hidden;
}

.service-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.service-card:hover .service-card-img img {
  transform: scale(1.05);
}

.service-card-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  height: calc(100% - 200px);
}

/* ================= Confidence Block ================= */
.confidence-section {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.confidence-image {
  flex: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
}

.confidence-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.2);
}

.confidence-content {
  flex: 1;
}

.confidence-list {
  margin-top: 2rem;
}

.confidence-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.confidence-list-icon {
  color: var(--accent-cyan);
  font-size: 1.5rem;
  margin-top: 0.2rem;
}

/* ================= Obras Sociales ================= */
.obras-sociales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  align-items: center;
  justify-items: center;
  opacity: 0.7;
}

.obras-sociales-grid img {
  filter: grayscale(100%);
  transition: var(--transition);
  max-height: 60px;
}

.obras-sociales-grid img:hover {
  filter: grayscale(0%);
  transform: scale(1.05);
}

/* ================= FAQ Section ================= */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--primary-blue);
}

.faq-icon {
  color: var(--accent-cyan);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  color: var(--text-light);
}

.faq-item.active .faq-answer {
  max-height: 200px; /* Arbitrary large number */
  margin-top: 1rem;
}

/* ================= Footer ================= */
.footer {
  background-color: var(--secondary-blue);
  color: var(--white);
  padding: 4rem 0 2rem;
}

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

.footer-logo {
  margin-bottom: 1.5rem;
}

.footer-logo img {
  height: 50px;
  filter: brightness(0) invert(1);
}

.footer p {
  color: #CBD5E1;
  margin-bottom: 1.5rem;
}

.footer h4 {
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #CBD5E1;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-cyan);
  padding-left: 5px;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  color: #CBD5E1;
}

.footer-contact i {
  color: var(--accent-cyan);
  margin-top: 0.3rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #94A3B8;
  font-size: 0.875rem;
}

/* ================= Responsive ================= */
@media (max-width: 992px) {
  .hero .container {
    flex-direction: column;
    text-align: center;
  }
  
  .hero-content {
    margin: 0 auto;
  }
  
  .hero-btns {
    justify-content: center;
  }
  
  .confidence-section {
    flex-direction: column;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .topbar {
    display: none;
  }

  .logo img {
    height: 45px;
  }
  
  .logo-title {
    font-size: 1rem;
  }
  
  .logo-slogan {
    font-size: 0.75rem;
  }
  
  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--white);
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    transition: var(--transition);
    z-index: 999;
  }
  
  .nav-links.active {
    left: 0;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: 0 1rem;
  }
}

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

/* ================= WhatsApp Float ================= */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  right: 40px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 3px #999;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.whatsapp-float:hover {
  background-color: #128C7E;
  color: #FFF;
  transform: translateY(-3px);
  box-shadow: 2px 5px 10px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
    font-size: 25px;
  }
}
