/* styles.css */
:root {
  /* Color system */
  --MARRON: #6c552b;
  --DORADO: #dba854;
  --CAMEL: #fefeda;
  --GRIS: #363734;
  --NEGRO: #0e0f11;
  --AZUL: #0d1621;

  /* Typography */
  --font-primary: "Cormorant Garamond", serif;
  --font-secondary: "Open Sans", sans-serif;

  /* Spacing & Layout */
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --container-width: 70rem;
  --nav-height: 80px;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-secondary);
  color: var(--AZUL);
  font-size: 1.125rem;
  line-height: 1.7;
  padding-top: var(--nav-height);

  /* FONDO */
  background:
    radial-gradient(
      circle,
      rgba(14, 15, 17, 0.7) 0%,
      rgba(54, 55, 52, 0.8) 100%
    ),
    url("../images/libros.webp");
  background-color: var(--AZUL);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

:focus-visible {
  outline: 2px solid var(--DORADO);
  outline-offset: 4px;
}

p {
  margin-bottom: var(--spacing-sm);
  max-width: 70ch;
}

h1,
h2,
h3 {
  font-family: var(--font-primary);
  color: var(--DORADO);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

/* Navigation Fixed */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background-color: rgba(13, 22, 33, 0.95);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: height 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav a {
  color: var(--CAMEL);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 600;
}

nav a:hover,
nav a.active {
  background-color: rgba(219, 168, 84, 0.15);
  color: var(--DORADO);
  border: 1px solid var(--DORADO);
}

/* Sections */
section {
  min-height: calc(100vh - var(--nav-height));
  padding: var(--spacing-xl) var(--spacing-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: transparent;
}

.content {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  gap: var(--spacing-lg);
}

/* Hero */
#inicio {
  text-align: center;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none;
}

#inicio h1 {
  font-size: 3.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 700;
}

/* Button */
.button {
  display: inline-block;
  background-color: var(--DORADO);
  color: var(--AZUL);
  border: 2px solid var(--DORADO);
  padding: 0.8rem 2.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  font-family: var(--font-secondary);
  transition: all 0.3s ease;
  cursor: pointer;
  margin-top: var(--spacing-md);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.button:hover {
  background-color: #eec170;
  border-color: #eec170;
  color: var(--AZUL);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(219, 168, 84, 0.4);
}

/* --- ESTILO GLASS LIMPIO (Unified) --- */
.container,
.card {
  /* Fondo sólido con ligera transparencia para nitidez total */
  background-color: rgba(254, 254, 218, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  color: var(--AZUL);
}

.container {
  padding: var(--spacing-lg);
  width: 100%;
}

/* Services Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: var(--spacing-lg);
}

.card {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  transition:
    transform 0.3s ease,
    background-color 0.3s,
    box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  background-color: rgba(254, 254, 218, 0.98);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.8);
}

.card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.6rem;
  padding-bottom: 0;
  display: block;
}

.card ul {
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card li {
  font-size: 1rem;
  font-weight: 500;
}

.card_image {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card_image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

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

/* --- CONTACT STYLES (REFINED HIERARCHY) --- */
#contacto .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.text-container {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Estilo general para items de contacto */
.contact-info {
  margin-bottom: 0.5rem;
}

.contact-info a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 400;
  transition: color 0.2s;
}

.contact-info a:hover {
  color: #5a4622;
}

.contact-info img {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

/* Nota pequeña debajo de WhatsApp */
.note {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-top: -0.5rem; /* Pegado al item superior */
  margin-bottom: 0; /* Sin espacio extra abajo */
  margin-left: 2.8rem;
  font-style: italic;
}

/* Dirección (Separación visual) */
.address-item {
  margin-top: 1.5rem; /* Separa lo físico de lo digital */
  padding-top: 1.5rem;
  border-top: 1px solid rgba(13, 22, 33, 0.05); /* Separador sutil opcional */
}

/* Etiquetas de sección (Redes) */
.section-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--DORADO); /* Contraste elegante */
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.social-media {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.social-media img {
  width: 2rem;
  height: 2rem;
  transition: transform 0.2s;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  opacity: 0.9;
}

.social-media img:hover {
  transform: scale(1.15);
  opacity: 1;
}

/* Urgencias (Bloque final destacado) */
.urgencies {
  margin-top: auto;
  border-top: 1px solid rgba(13, 22, 33, 0.1);
  padding-top: 1.5rem;
}

.urgency-label {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.phone-wrapper a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s;
}

.phone-wrapper a:hover {
  opacity: 0.8;
}

.highlight {
  font-size: 1.4rem;
  font-weight: 700;
  color: #000;
}

/* Imagen Contacto (Split + B&W) */
.contact-image {
  width: 100%;
  height: 100%;
  min-height: 100%;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  background-color: var(--AZUL);
}

.contact-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(100%) contrast(1.1);
  opacity: 0.9;
  transition: all 0.5s ease;
}

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

/* Footer */
footer {
  background-color: rgba(13, 22, 33, 0.95);
  padding: var(--spacing-lg);
  text-align: center;
  border-top: 1px solid var(--DORADO);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  color: var(--CAMEL);
  width: 100%;
}

footer .barra img {
  max-width: 150px;
  height: auto;
}

/* Media Queries */
@media (min-width: 1024px) {
  section {
    padding: 6rem var(--spacing-md);
  }

  #inicio h1 {
    font-size: 5.5rem;
    line-height: 1.1;
  }

  h2 {
    font-size: 2.8rem;
  }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
    --spacing-lg: 1.5rem;
  }

  nav {
    gap: 0.5rem;
  }

  nav a {
    font-size: 0.9rem;
    padding: 0.4rem 0.6rem;
  }

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

  #contacto .container {
    grid-template-columns: 1fr;
  }

  .text-container {
    padding: 2rem 1.5rem;
  }

  .contact-image {
    height: 250px;
    min-height: 250px;
    order: -1;
  }

  #inicio h1 {
    font-size: 3rem;
  }

  .container,
  .card {
    padding: var(--spacing-md);
  }
}
