/* 
   CSS Variables for Theming 
   These will be dynamically modified by config.js via JavaScript to match the pharmacy's brand
*/
:root {
  --primary-color: #059669;
  --secondary-color: #10b981;
  --text-dark: #1f2937;
  --text-gray: #4b5563;
  --text-light: #9ca3af;
  --bg-light: #f9fafb;
  --white: #ffffff;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.3s ease;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-dark);
}

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

img {
  max-width: 100%;
  border-radius: 8px;
}

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

/* BUTTONS */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-light {
  background-color: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-outline-light:hover {
  background-color: var(--white);
  color: var(--primary-color);
}

/* HEADER */
.header {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 90px;
  padding: 10px 0;
  gap: 20px;
}

.logo h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 0;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  max-height: 80px; /* Aumentado para que logos con márgenes se vean grandes */
  max-width: 280px;
  width: auto;
  object-fit: contain;
  transform: scale(1.2); /* Truco visual por si la imagen original tiene mucho margen blanco */
  transform-origin: left center;
}

.nav-links {
  display: flex;
  gap: 30px;
  flex-wrap: wrap; /* Evita que se solapen los menús secundarios si no caben */
  justify-content: center;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-gray);
  transition: var(--transition);
}

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

/* HERO SECTION */
.hero {
  position: relative;
  height: 80vh;
  min-height: 500px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  margin-top: 110px; /* Offset for fixed header */
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Gradient overlay dynamically picks up primary color mixed with black */
  background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.4));
}

.hero-content {
  position: relative;
  z-index: 10;
  color: var(--white);
  max-width: 600px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
  color: var(--white);
}

.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.9;
}

/* SECTIONS */
.section {
  padding: 80px 0;
}

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

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.section-subtitle {
  color: var(--text-gray);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* GRID / CARDS */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.card-img-wrapper {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.card-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.card-text {
  color: var(--text-gray);
  font-size: 0.95rem;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-date {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: auto;
}

.content-placeholder {
  width: 100%;
  height: 100%;
  background-color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 2rem;
}

/* SPINNER */
.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-gray);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* FOOTER */
.footer {
  background-color: #111827;
  color: var(--white);
  padding: 60px 0 20px 0;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-info {
  flex: 1;
  min-width: 300px;
}

.footer-title {
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 20px;
}

.footer-brand-logo {
  max-height: 90px;
  max-width: 300px;
  width: auto;
  margin-bottom: 20px;
  background-color: var(--white);
  padding: 10px;
  border-radius: 8px;
  object-fit: contain;
}

.footer-text {
  color: #9ca3af;
  margin-bottom: 20px;
}

.contact-details p {
  margin-bottom: 10px;
  color: #d1d5db;
}

.contact-details strong {
  color: var(--white);
  width: 80px;
  display: inline-block;
}

.email-image {
  max-width: 250px;
  height: 24px; /* Fix the height and width to look perfectly cropped */
  margin-top: 5px;
  transition: var(--transition);
}

.email-image:hover {
  opacity: 0.8;
}

.footer-social {
  flex: 1;
  min-width: 250px;
}

.footer-subtitle {
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 20px;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d1d5db;
  transition: var(--transition);
}

.social-link:hover {
  color: var(--primary-color);
}

.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.powered-by {
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    height: auto;
    padding: 15px 0;
  }
  
  .nav-links {
    margin: 15px 0;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero {
    text-align: center;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
  }
}
