/* --- ESTILOS GENERALES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Nunito', sans-serif;
}

body {
    background-color: #fffdf9; /* Cremita cálido ultra suave */
    color: #333;
}

/* --- ENCABEZADO Y NAVEGACIÓN --- */
header {
    background: linear-gradient(180deg, #ffdca8 0%, #fffdf9 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1000;
}

.logo img {
    height: 65px;
    width: auto;
    display: block;
}

/* Botón de Hamburguesa */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    background: none;
    border: none;
    padding: 5px;
    margin-left: auto; /* Fuerza pegarse a la derecha */
}

.menu-toggle span {
    width: 28px;
    height: 3.5px;
    background-color: #2b77c0;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Menú Navegación */
nav {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 12px;
    align-items: center;
}

/* Submenú desplegable (Adopciones) */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    border-radius: 12px;
    min-width: 180px;
    overflow: hidden;
    padding: 5px 0;
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* Botones del Menú (Estilo Cápsula) */
.nav-btn {
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    display: inline-block;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: none;
    cursor: pointer;
    text-align: center;
}

.nav-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Colores de botones */
.btn-adopciones { background-color: #2b77c0; }
.btn-historias  { background-color: #d9383a; }
.btn-hospedaje  { background-color: #1ea253; }
.btn-nosotros   { background-color: #e67e22; }
.btn-contacto   { background-color: #7d2ae8; }
.btn-donar      { background-color: #ffb800; color: #222; }

.dropdown-menu a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background-color: #f0f4f8;
    color: #2b77c0;
}

/* --- CONTENEDOR PRINCIPAL --- */
.main-container {
    max-width: 1200px;
    margin: 10px auto;
    padding: 0 15px;
}

/* --- DISEÑO RESPONSIVO (MÓVILES) --- */
@media (max-width: 900px) {
    header {
        padding: 12px 15px; /* Mantiene aire en los bordes */
    }

    .menu-toggle {
        display: flex; /* Muestra hamburguesa */
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        
        /* FONDO CREMITA AL 95% CON DESENFOQUE (Combina perfecto con el body) */
        background-color: rgba(255, 253, 249, 0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        
        box-shadow: 0 10px 15px rgba(0,0,0,0.04);
        padding: 15px 20px 25px 20px;
        gap: 12px;
        align-items: flex-end; /* Alineación a la derecha */
    }

    .nav-links.active {
        display: flex;
    }

    /* Ajuste de botones en móvil */
    .nav-btn {
        width: auto;
        min-width: 170px; /* Tamaño homogéneo y compacto */
        text-align: center;
    }

    .dropdown {
        width: auto;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        background-color: rgba(240, 244, 248, 0.85);
        margin-top: 8px;
        border-radius: 10px;
        width: 100%;
        min-width: 190px;
        text-align: right;
    }

    .dropdown:hover .dropdown-menu {
        display: none;
    }

    .dropdown.open .dropdown-menu {
        display: block;
    }
}

/* ==========================================================================
   MÓDULO: ADOPCIONES Y FICHA DE PETS
   ========================================================================== */

/* --- GALERÍA DE ADOPCIONES --- */
.adopciones-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.encabezado-adopciones {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.encabezado-adopciones h1 {
    color: #6b93f2;
    font-size: 2.2rem;
    font-family: 'Baloo 2', cursive;
    margin: 0 0 8px 0;
}

.btn-cachorros {
    background: linear-gradient(45deg, #FF914D, #FFB347);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(255, 145, 77, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-cachorros:hover {
    background: linear-gradient(45deg, #e67e22, #f39c12);
    transform: translateY(-2px);
}

.fecha-actualizacion {
    text-align: right;
    font-size: 0.88rem;
    color: #666;
    font-style: italic;
}

/* Tarjetas de Pets (Galería) */
.galeria-pets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
}

.pet-card {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    background-color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pet-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

/* --- SOMBRAS LUMINOSAS POR SEXO EN GALERÍA (MÁS DEFINIDAS Y MENOS TRANSPARENTES) --- */

/* Machos (Azul / Morado) */
.pet-card.macho,
.pet-card.Macho {
    box-shadow: 0 0 12px rgba(60, 120, 250, 1) !important; /* Azul más solido y definido */
    border-radius: 12px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.pet-card.macho:hover,
.pet-card.Macho:hover {
    box-shadow: 0 0 20px rgba(40, 100, 255, 1) !important;
    transform: translateY(-3px);
}

/* Hembras (Rosa) */
.pet-card.hembra,
.pet-card.Hembra {
    box-shadow: 0 0 12px rgba(255, 50, 150, 1) !important; /* Rosa más sólido y definido */
    border-radius: 12px;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.pet-card.hembra:hover,
.pet-card.Hembra:hover {
    box-shadow: 0 0 20px rgba(255, 20, 140, 1) !important;
    transform: translateY(-3px);
}

.pet-card:hover {
    transform: translateY(-5px) scale(1.02);
}

.pet-name-tag {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    background: rgba(0, 0, 0, 0.45);
    padding: 4px 12px;
    border-radius: 6px;
    white-space: nowrap;
}

/* --- MODAL DE ADOPCIONES --- */
.modal-overlay {
    display: flex;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65);
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2000;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: #fff;
    width: 1000px;
    max-width: 92%;
    height: 480px;
    max-height: 90vh;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 18px;
    font-size: 32px;
    font-weight: bold;
    color: #2b77c0;
    cursor: pointer;
    z-index: 100;
    background: rgba(255,255,255,0.8);
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #FF914D;
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    z-index: 90;
    transition: background 0.2s ease;
}
.nav-arrow:hover { background: #e67e22; }
.nav-arrow.left { left: 15px; }
.nav-arrow.right { right: 15px; }

/* --- FICHA DEL PET --- */
.ficha {
    display: flex;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    gap: 20px;
    box-sizing: border-box;
}

/* CONTENEDOR DEL CARRUSEL (DESKTOP) */
.carousel {
    flex: 0 0 30%;
    max-width: 30%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    border-radius: 16px !important;
    height: 440px;
    overflow: hidden !important; /* Mantiene bordes redondeados limpios */
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

/* IMÁGENES DEL CARRUSEL */
.carousel img {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Cubre todo el marco respetando bordes */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, visibility 0.6s ease-in-out;
    border-radius: 16px !important;
    box-shadow: none !important;
}

/* IMAGEN ACTIVA */
.carousel img.active {
    opacity: 1;
    visibility: visible;
}

.datos {
    flex: 0 0 65%;
    max-width: 65%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px 10px;
}

.datos h2 {
    margin: 0 0 4px 0; /* Reducido de 10px a 4px */
    color: #FF914D;
    font-size: 2rem;
    font-weight: 800;
}

.datos p {
    margin: 8px 0;      /* Reducido de 8px a 3px para compactar espacio entre campos */
    font-size: 0.92rem; /* Ligero ajuste para optimizar lectura */
    line-height: 1.28;  /* Interlineado más ajustado para aprovechar altura */
}

.datos p strong {
    color: #2b77c0;
    font-weight: 700;
}
.botones-linea {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.btn-nav-desktop {
    background: #FF914D;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btn-nav-desktop:hover { background: #e67e22; }

.btn-solicitud-azul {
    background: #6b93f2;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(107, 147, 242, 0.3);
    transition: all 0.2s ease;
    font-size: 0.95rem;
    flex-grow: 1;
    text-align: center;
}

.btn-solicitud-azul:hover {
    background: #2b77c0;
    transform: translateY(-2px);
}

/* --- REGLAS RESPONSIVAS MÓVILES (MÁXIMO 768px) --- */
@media (max-width: 768px) {
    .encabezado-adopciones {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .fecha-actualizacion { text-align: center; }

    .galeria-pets {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .pet-name-tag {
        font-size: 0.88rem;
        padding: 3px 8px;
    }

    .modal-box {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }

    .nav-arrow {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    .nav-arrow.left { left: 8px; }
    .nav-arrow.right { right: 8px; }

    /* FICHA EN MÓVIL (TARJETA VERTICAL DE FOTO CENTRADA) */
    .ficha {
        flex-direction: column;
        padding: 15px 10px;
        gap: 15px;
        align-items: center;
    }

    .carousel {
        width: 100% !important;
        max-width: 260px !important;  /* Mantiene proporción vertical limpia */
        height: 400px !important;     /* Altura vertical para no cortar a la mascota */
        min-height: 400px !important;
        position: relative !important;
        display: block !important;
        overflow: hidden !important;
        border-radius: 16px !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.12) !important;
        margin: 0 auto 10px auto;
    }

    .carousel img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 16px !important;
    }

    .datos {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    .datos h2 {
        text-align: center;
        font-size: 1.7rem;
    }

    .botones-linea {
        flex-direction: column;
        gap: 10px;
    }

    .btn-nav-desktop { display: none; }

    .btn-solicitud-azul {
        width: 100%;
        padding: 14px;
    }
}

/* --- PAGINACIÓN DE HISTORIAS --- */
.paginacion-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 35px 0 20px 0;
    flex-wrap: wrap;
}

.pag-btn, .pag-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    background: #ffffff;
    color: #2b77c0;
    border: 1px solid #dcdcdc;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.pag-num {
    min-width: 38px;
}

.pag-btn:hover, .pag-num:hover {
    background: #6b93f2;
    color: #ffffff;
    border-color: #6b93f2;
}

.pag-num.activo {
    background: #FF914D;
    color: #ffffff;
    border-color: #FF914D;
    box-shadow: 0 4px 10px rgba(255, 145, 77, 0.3);
}

.pag-puntos {
    color: #888;
    font-weight: bold;
    padding: 0 4px;
}