/* ================= VARIABLES ================= */
:root {
  --primary: #ff9f43;
  --secondary: #ffe9d2;
  --dark: #333;
  --light: #fff;
  --max-width: 75rem;
}

/* ================= RESET ================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ================= BASE ================= */
html { font-size: 16px; }
body {
  font-family: Arial, sans-serif;
  color: var(--dark);
  background: url("imagenes/campo-verde.webp") center / cover no-repeat fixed;
  min-height: 100vh;
  padding: 1rem;
}
header, main, footer {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ================= HEADER ================= */
.pet-header {
  background: linear-gradient(90deg, #ffb26b, var(--primary));
  border-radius: 1rem;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,.15);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.logo-animals { height: clamp(3rem, 8vw, 6rem); width: auto; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }

.hero {
  flex: 1 1 100%;
  text-align: center;
  color: white;
  font-weight: bold;
  line-height: 1.2;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  text-shadow: 0 2px 4px rgba(0,0,0,.6);
}

/* ================= BUSCADOR ================= */
.search-container {
  position: relative;
  width: 100%;
  max-width: 22rem;
  display: flex;
  align-items: center;
  gap: 0.4rem; /* espacio real entre input y lupa */
}


.search-container input {
  width: calc(100% - 2.6rem); /* ← input más corto */
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  border: none;
  font-size: 1rem;
}

.search-container button {
  position: static; /* ← MUY IMPORTANTE */
  border: none;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  cursor: pointer;
  flex-shrink: 0;
}


/* ================= MENÚ / HAMBURGUESA ================= */
.menu-toggle {
  display: block; 
  font-size: 2rem; 
  cursor: pointer; 
  background: none; 
  border: none;
  transition: transform 0.3s ease, color 0.3s ease;
}

.menu-toggle.open { 
  transform: rotate(90deg); 
  color: var(--primary); 
}


.pet-nav {
  display: none;
  flex-direction: column;
  background: rgba(255, 233, 210, 0.95);
  margin-top: 1rem;
  border-radius: 1rem;
  padding: 1rem;
  gap: 0.75rem; /* MÁS separación */
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  backdrop-filter: blur(6px);
  flex-wrap: wrap;
}

.pet-nav.show { 
  display: flex; 
  flex-direction: column; /* Asegura que los enlaces se apilen verticalmente en móvil */
  background: rgba(255, 255, 255, 0.9); /* Opcional: Fondo del menú */
  padding: 1rem;
  border-radius: 1rem;
}

.pet-nav a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  text-align: center;
  padding: 0.6rem 1rem;
  border-radius: 999px; /* píldora */
  transition: background 0.25s ease, transform 0.2s ease;
}

.pet-nav a:hover,
.pet-nav a:focus-visible {
  background: var(--primary);
  color: white;
  transform: translateY(-2px);
}


/* ================= HERO IMAGE ================= */
.hero-image { margin: 1.5rem 0; }
.hero-image img { width: 100%; height: auto; border-radius: 1rem; }

/* ================= GRID SECCIONES ================= */
.section-links { margin: 2rem 0; }
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1rem;
  justify-items: center;
}
.section-card {
  display: flex; flex-direction: column; align-items: center;
  text-decoration: none; color: var(--dark); gap: 0.5rem;
  background: rgba(255,255,255,0.8); border-radius: 1rem; padding: 0.5rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease; backdrop-filter: blur(5px);
}
.section-card img {
  width: 100%; max-width: 9rem; aspect-ratio: 1/1; object-fit: cover;
  border-radius: 0.75rem; box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,.2);
  transition: transform .3s, box-shadow .3s;
}
.section-card span { font-weight: bold; text-align: center; }
.section-card:hover, .section-card:focus { transform: translateY(-8px) rotateX(3deg); box-shadow: 0 12px 20px rgba(0,0,0,0.25); }

/* ================= FOOTER ================= */
footer {
  margin-top: 2rem; padding: 1.5rem; text-align: center;
  background: var(--primary); color: var(--light); border-radius: 1rem;
}

/* ================= GATITO ANIMADO ================= */
.gatito-salta { position: fixed; width: 100px; z-index: 9999; pointer-events: none; transform-origin: bottom center; }
@keyframes gatito-bounce {
  0% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-60px) rotate(-15deg); }
  50% { transform: translateY(-40px) rotate(10deg); }
  75% { transform: translateY(-20px) rotate(-5deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* ================= BREAKPOINTS ================= */
@media (min-width: 48rem) {
  .header-inner { flex-wrap: nowrap; justify-content: space-between; }
  .hero { flex: 1; }
  .menu-toggle { display: none; }
  .pet-nav { display: flex !important; flex-direction: row; justify-content: center; margin-top: 1rem; }
}

.search-results {
  position: absolute;
  top: calc(100% + 0.3rem); /* justo debajo del input */
  left: 0;
  width: calc(100% - 2.6rem); /* MISMO ancho que el input */
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  padding: 0.5rem;
  z-index: 1000;
  display: none;
}

.search-results.show {
  display: block;
}

.result-item {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 0.5rem;
  color: var(--dark);
  text-decoration: none;
}

.result-item:hover,
.result-item.selected {
  background: var(--secondary);
}

.pet-header {
  transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  overflow-x: hidden;
}

.pet-header.is-scrolled {
  padding: 0.6rem 1rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  background: linear-gradient(
    90deg,
    #ffb26b,
    #ff9f43
  );
}

.pet-header.is-scrolled .hero {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.home-intro {
  text-align: center;
  margin: 1rem 0 2rem;
}

.home-intro h1 {
  color: white;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  text-shadow: 0 3px 6px rgba(0,0,0,.5);
  margin-bottom: 0.5rem;
}

.home-intro h2 {
  max-width: 52rem;
  margin: 0 auto;
  font-size: clamp(1,5rem, 3vw, 1.2rem);
  line-height: 1.6;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,.5);
}

.home-intro p {
  max-width: auto;
  margin: 0 auto;
  font-size: clamp(1rem, 3vw, 1.2rem);
  line-height: 1.6;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,.5);
}

.search-body-results {
  max-width: 40rem;
  margin: 1rem auto 2rem;
  background: rgba(255,255,255,0.9);
  border-radius: 1rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  padding: 0.5rem;
  display: none;
}

.search-body-results.show {
  display: block;
}

.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6rem;
  z-index: 2000;
}

.search-modal.show {
  display: flex;
}

.search-modal-box {
  width: 100%;
  max-width: 40rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  padding: 0.75rem;
}

.site-footer {
  margin-top: 2rem;
  background: var(--primary);
  color: white;
  border-radius: 1rem;
  padding: 1.5rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.5rem;
}

.footer-col strong {
  display: block;
  margin-bottom: 0.5rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li {
  margin-bottom: 0.3rem;
}

.footer-col a {
  color: white;
  text-decoration: none;
}

.footer-col a:hover {
  text-decoration: underline;
}

.footer-copy {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}


/*********************AVISO LEGAL **********************/
.legal-page {
  max-width: 50rem;
  margin: 2rem auto;
  background: rgba(255,255,255,0.9);
  padding: 2rem;
  border-radius: 1rem;
}

.legal-page h1 {
  margin-bottom: 1rem;
}

.legal-page h2 {
  margin-top: 1.5rem;
}

/**************************cookies***************/
.cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  display: flex;
  gap: 1rem;
  align-items: center;
  z-index: 3000;
  font-size: 0.9rem;
}

.cookie-banner a {
  color: var(--primary);
}

.cookie-banner button {
  border: none;
  background: var(--primary);
  color: white;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
}

/* Añadir clase 'hidden' al banner */
.cookie-banner.hidden {
  display: none;
}

/*****************news letter*****/
.newsletter-form {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.newsletter-form input {
  border-radius: 999px;
  border: none;
  padding: 0.4rem 0.8rem;
}

.newsletter-form button {
  border: none;
  background: #333;
  color: white;
  padding: 0.4rem;
  border-radius: 999px;
  cursor: pointer;
}

/***************contacto***********/
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
}

.contact-form button {
  background: var(--primary);
  border: none;
  color: white;
  padding: 0.6rem;
  border-radius: 0.75rem;
  cursor: pointer;
}

.newsletter-alert {
  max-width: 42rem;
  margin: 1.5rem auto;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

/* Estados */
.newsletter-alert.ok {
  background: #e9f8ee;
  color: #1e7e34;
}

.newsletter-alert.existe {
  background: #fff4e5;
  color: #b46900;
}

.newsletter-alert.error {
  background: #fdecea;
  color: #a61b1b;
}

.footer-col h3 {
  margin-bottom: 0.4rem;
  font-size: 1.1rem;
}

.newsletter-text {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0.6rem;
}

.newsletter-form {
  margin-top: 0.5rem;
}

/* Mensaje de éxito */
.form-message.success {
  background-color: #d4edda;
  color: #155724;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
  border-radius: 5px;
  font-size: 1rem;
}

/* Mensaje de error */
.form-message.error {
  background-color: #f8d7da;
  color: #721c24;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #f5c6cb;
  border-radius: 5px;
  font-size: 1rem;
}

/* ================= IMAGEN DE LA RAZA ================= */
.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
}

/* ================= pagina de razas ================= 

/*Títulos h2 de las secciones de las razas*/
.behavior h2 { 
  font-size: 2rem; 
  font-weight: 700; 
  color: var(--primary);
  text-align: center; 
  margin-bottom: 1.5rem; 
}

/*colores de fondo de las secciones de las razas*/
.behavior {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--secondary);
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}


.content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 10px;
    padding-right: 10px;
}

.text {
    flex: 1; /* El texto ocupará el espacio disponible */
    padding-left: 15px;
    padding-right: 15px;
}

.text h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-align: left; /* Alineamos el texto a la izquierda */
    margin-bottom: 1.5rem;
}

.text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark);
}

.image {
    width: 250px; /* Establecemos el tamaño de la imagen */
    height: auto;
}

.image img {
    width: 100%; /* Hace que la imagen ocupe todo el ancho del contenedor */
    height: auto;
    border-radius: 1rem;
}

/* ================= MEDIA QUERIES ================= */
@media (max-width: 768px) {
    .behavior {
        padding: 1.5rem;
    }

    .content {
        flex-direction: column; /* En pantallas pequeñas, la imagen y el texto se apilan */
        align-items: flex-start; /* Alineamos los elementos al inicio */
    }

    .text h2 {
        text-align: center; /* Alineamos el título al centro en pantallas pequeñas */
    }

    .image {
        margin-top: 1rem; /* Separar la imagen del texto en pantallas pequeñas */
        width: 200px; /* Reducimos el tamaño de la imagen en pantallas pequeñas */
          margin: 1.5rem auto 0 auto;

      }

    behavior ul {
      margin: 1.5rem auto 0 auto;
    }
}

/*********************listas***************/
.behavior ul {
    list-style: none;              /* Quitamos los puntos por defecto */
    padding: 1.5rem;
    margin: 1.5rem auto 0 auto;
    background: #ffffff;
    border-radius: 0.8rem;
    box-shadow: 0 6px 15px rgba(0,0,0,0.12);
    max-width: 600px;       /*anchura de los cuadros blancos de las listas*/
}

.behavior ul li {
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    font-weight: 500;
    color: #333;
    display: flex;
    align-items: center;
}

.behavior ul li:last-child {
    border-bottom: none;
}

.behavior ul li::before {
    content: "🐾";
    margin-right: 0.6rem;
    font-size: 1.1rem;
}


