/* ==========================================================================
   DISEÑO "UN AMIGO FIEL" - HOJA DE ESTILOS PRINCIPAL (CSS VANILLA)
   ========================================================================== */

/* Nota: La fuente Outfit se carga vía <link> en _header.php (preconnect, no bloqueante) */

/* Variables de Diseño (Temas y Paleta Tierna) */
:root {
    --primary: #ff7a7a;          /* Rosa cálido/Coral */
    --primary-hover: #e56666;
    --primary-light: #fff0f0;
    --secondary: #ffb03a;        /* Amarillo dorado tierno */
    --secondary-hover: #e5982e;
    --secondary-light: #fff8ee;
    
    --bg-light: #fefcf9;         /* Crema cálido de fondo */
    --bg-white: #ffffff;
    --bg-footer: #2d3748;
    
    --text-dark: #2d3748;        /* Gris pizarra para textos principales */
    --text-muted: #718096;       /* Gris medio para descripciones */
    --text-light: #ffffff;
    
    --border-color: #f1e9df;     /* Bordes suaves */
    --shadow-sm: 0 2px 4px rgba(45, 55, 72, 0.05);
    --shadow-md: 0 8px 16px rgba(45, 55, 72, 0.08);
    --shadow-lg: 0 16px 24px rgba(255, 122, 122, 0.15);
    
    --success: #48bb78;          /* Verde para adoptados o activos */
    --info: #3182ce;             /* Azul para apadrinados */
    --warning: #dd6b20;          /* Naranja para pendientes */
    --danger: #e53e3e;           /* Rojo para errores/rechazos */
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    --container-max: 1200px;
}

/* ==========================================================================
   TEMAS DE SECCIÓN (Visualmente Notables)
   ========================================================================== */

/* Tema Cuidadores: Tonos Verde Azulado / Teal (Profesional y Enfocado en Cuidado) */
body.theme-cuidador {
    --primary: #0d9488;          /* Teal principal */
    --primary-hover: #0f766e;
    --primary-light: #f0fdfa;
    --secondary: #06b6d4;        /* Cyan secundario */
    --secondary-hover: #0891b2;
    --secondary-light: #ecfeff;
    --bg-light: #f4fbfb;         /* Crema verdoso muy suave */
    --shadow-lg: 0 16px 24px rgba(13, 148, 136, 0.15);
}

/* Tema Administradores (aPanel): Tonos Violeta / Púrpura (Institucional y Autoridad) */
body.theme-apanel {
    --primary: #7c3aed;          /* Púrpura principal */
    --primary-hover: #6d28d9;
    --primary-light: #f5f3ff;
    --secondary: #db2777;        /* Rosa secundario */
    --secondary-hover: #be185d;
    --secondary-light: #fdf2f8;
    --bg-light: #fafafd;         /* Crema azulado/purpúreo muy suave */
    --shadow-lg: 0 16px 24px rgba(124, 58, 237, 0.15);
}

/* Reset de Estilos */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('../uploads/webimages/bg_pattern.webp');
    background-repeat: repeat;
    background-size: 180px; /* Escalado para lucir sutil y decorativo */
    opacity: 0.25; /* Sólo 12% de opacidad para que el fondo sea súper tenue */
    pointer-events: none;
}

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

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

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

/* ==========================================================================
   ESTRUCTURA DE CONTENIDO
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

/* ==========================================================================
   CABECERA & MENÚ RESPONSIVO
   ========================================================================== */
.navbar {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    height: 75px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
}

.logo-img {
    height: 65px;
    width: auto;
    object-fit: contain;
    margin: 5px 0;
    transition: var(--transition);
}

.logo-icon {
    font-size: 1.8rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

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

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* Botón de acción en navbar */
.nav-btn {
    background-color: var(--primary);
    color: var(--text-light) !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 10px rgba(255, 122, 122, 0.2);
}

.nav-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(255, 122, 122, 0.3);
}

/* Hamburguesa para Móvil */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Tap target mínimo 44x44px (WCAG 2.5.5 / Apple HIG) */
    width: 44px;
    height: 44px;
    padding: 11px 7px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
    border-radius: var(--radius-sm);
    gap: 5px;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-dark);
    border-radius: 3px;
    transition: var(--transition);
}

/* ==========================================================================
   HERO / BANNER PRINCIPAL
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--secondary-light) 100%);
    padding: 80px 0;
    border-radius: 0 0 50px 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '🐾';
    position: absolute;
    bottom: 20px;
    right: 5%;
    font-size: 5rem;
    opacity: 0.05;
}

.hero::before {
    content: '🐶';
    position: absolute;
    top: 20px;
    left: 5%;
    font-size: 5rem;
    opacity: 0.05;
}

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

.hero-title span {
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 35px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-light);
    box-shadow: 0 6px 16px rgba(255, 122, 122, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 122, 122, 0.35);
    color: var(--text-light);
}

.btn-secondary {
    background-color: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-light);
    border-color: var(--secondary);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--secondary);
    color: var(--text-light);
    box-shadow: 0 6px 16px rgba(255, 176, 58, 0.25);
}

.btn-accent:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 176, 58, 0.35);
    color: var(--text-light);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-light);
}
.btn-danger:hover {
    background-color: #c53030;
}

/* ==========================================================================
   SECCIÓN: ESTERILIZAR ES AMAR
   ========================================================================== */
.section-sterilize {
    padding: 60px 0;
    background-color: var(--bg-white);
    border-radius: var(--radius-lg);
    margin: 40px 0;
    box-shadow: var(--shadow-sm);
}

.section-title {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    margin: 10px auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Grid de Beneficios */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.benefit-card {
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.benefit-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.benefit-title {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-dark);
}

.benefit-card ul {
    list-style-position: inside;
    margin-top: 10px;
}

.benefit-card li {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

/* Tarjeta informativa de la Edad recomendada */
.age-info-box {
    margin-top: 40px;
    background: linear-gradient(135deg, var(--secondary-light) 0%, #fffcf0 100%);
    border-left: 5px solid var(--secondary);
    padding: 30px;
    border-radius: var(--radius-md);
}

.age-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.age-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.age-item {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.age-item h5 {
    color: var(--secondary-hover);
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* ==========================================================================
   SECCIÓN: CATÁLOGO DE PERROS (ADOPTA/APADRINA)
   ========================================================================== */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* Filtros en Barra Lateral */
.filters-sidebar {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    height: fit-content;
    position: sticky;
    top: 95px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-light);
    color: var(--text-dark);
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    background-color: var(--bg-white);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.filters-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 25px;
}

/* Grid de Perros */
.dogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
}

.dog-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.dog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.dog-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #f7fafc;
}

/* Fallback de imagen en CSS */
.dog-image-placeholder {
    width: 100%;
    height: 220px;
    background-color: var(--secondary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--secondary);
}

.dog-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    color: var(--text-light);
}

.badge-success { background-color: var(--success); }
.badge-info { background-color: var(--info); }
.badge-warning { background-color: var(--warning); }
.badge-danger { background-color: var(--danger); }

.dog-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.dog-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.dog-breed {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 12px;
}

.dog-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: auto;
    color: var(--text-muted);
}

.dog-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dog-card-footer {
    padding: 0 20px 20px;
}

.no-results {
    text-align: center;
    padding: 50px 20px;
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    grid-column: 1 / -1;
}

.no-results-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: block;
}

/* ==========================================================================
   FICHA DE DETALLE DEL PERRO
   ========================================================================== */
.dog-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
    align-items: start;
}

.dog-detail-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.dog-card-module {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

.dog-card-module:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.dog-card-module-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.dog-gallery-main {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.dog-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
}

.gallery-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.gallery-thumb.active, .gallery-thumb:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

/* .dog-info-card se reemplaza por el sistema modular de .dog-card-module */

.dog-info-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dog-info-fields {
    list-style: none;
    margin: 20px 0;
}

.dog-info-fields li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

.dog-info-fields strong {
    color: var(--text-dark);
}

.caregiver-contact {
    margin-top: 30px;
    background-color: var(--secondary-light);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid #ffe8cc;
}

.caregiver-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #cc7a00;
}


/* Lightbox / Slider en Grande */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.show {
    display: flex;
    opacity: 1;
}

.lightbox-header {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #f8fafc;
    z-index: 10001;
    width: 90%;
    max-width: 600px;
    animation: lightboxFadeInDown 0.4s ease;
}

.lightbox-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
    color: var(--bg-white);
}

.lightbox-subtitle {
    font-size: 0.95rem;
    color: #cbd5e1;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lightbox-subtitle .divider {
    color: var(--primary);
    font-weight: bold;
}

.lightbox-content {
    position: relative;
    max-width: 85%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    object-fit: contain;
    transform: scale(0.95);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.lightbox-modal.show .lightbox-content img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #f8fafc;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10002;
}

.lightbox-close:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #f8fafc;
    font-size: 30px;
    padding: 15px 20px;
    cursor: pointer;
    border-radius: 50%;
    transition: var(--transition);
    user-select: none;
    z-index: 10001;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: var(--primary);
    transform: scale(1.05);
}

.lightbox-prev {
    left: -80px;
}

.lightbox-next {
    right: -80px;
}

@media (max-width: 992px) {
    .lightbox-prev { left: -50px; }
    .lightbox-next { right: -50px; }
}

@media (max-width: 768px) {
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-prev, .lightbox-next {
        font-size: 20px;
        padding: 10px 14px;
        background: rgba(15, 23, 42, 0.6);
    }
    .lightbox-header {
        top: 20px;
        width: 80%;
    }
    .lightbox-title {
        font-size: 1.2rem;
    }
    .lightbox-subtitle {
        font-size: 0.8rem;
        gap: 6px;
    }
    .lightbox-close {
        top: 15px;
        right: 15px;
        font-size: 32px;
    }
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    width: auto;
    background-color: rgba(15, 23, 42, 0.6);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
    z-index: 10001;
}

@keyframes lightboxFadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -15px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}


/* Botones de Compartir */
.btn-facebook:hover {
    background-color: #166fe5 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.btn-whatsapp:hover {
    background-color: #20ba5a !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* ==========================================================================
   FORMULARIOS & LOGIN & REGISTRO
   ========================================================================== */
.form-card {
    background-color: var(--bg-white);
    max-width: 500px;
    margin: 40px auto;
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

.form-title {
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ==========================================================================
   ALERTA DE MENSAJES FLASH
   ========================================================================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background-color: #def7ec;
    color: #03543f;
    border-left: 4px solid var(--success);
}

.alert-error {
    background-color: #fde8e8;
    color: #9b1c1c;
    border-left: 4px solid var(--danger);
}

@keyframes slideDown {
    from { transform: translateY(-15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   DASHBOARDS & ADMINISTRACIÓN
   ========================================================================== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 30px;
}

/* Aprovechar la anchura al 90% en desktop para el aPanel */
@media (min-width: 1200px) {
    body.theme-apanel .container {
        max-width: 90% !important;
    }
}

/* Sidebar Dashboard */
.dashboard-sidebar {
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 20px;
    height: fit-content;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    color: var(--text-dark);
    font-weight: 500;
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Tarjetas de Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--bg-white);
    padding: 25px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-num {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tablas Administrativas */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background-color: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-top: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 600px;
}

.table th, .table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: #faf8f5;
    font-weight: 600;
    color: var(--text-dark);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: #fefdfb;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   PIE DE PÁGINA
   ========================================================================== */
.footer {
    background-color: var(--bg-footer);
    color: #cbd5e0;
    padding: 40px 0 20px;
    margin-top: auto;
    font-size: 0.95rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 700;
}

.footer-col p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #a0aec0;
}

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

.footer-bottom {
    text-align: center;
    border-top: 1px solid #4a5568;
    padding-top: 20px;
    color: #a0aec0;
    font-size: 0.85rem;
}

/* ==========================================================================
   DISEÑO RESPONSIVO (MEDIAS QUERIES)
   ========================================================================== */

/* Tablet Grande (Menor a 1024px) */
@media (max-width: 1024px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
        margin-bottom: 20px;
    }
    
    .dog-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* Tablet Mediana (Menor a 900px) — catálogo y sidebar colapsan antes */
@media (max-width: 900px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }
    
    /* Botón colapsador de filtros en Catálogo */
    .filter-toggle-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background-color: var(--primary-light) !important;
        color: var(--primary) !important;
        border: 2px dashed var(--primary) !important;
        padding: 12px 20px !important;
        font-weight: 700 !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 25px !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .filters-sidebar {
        display: none; /* Se muestra al activar toggle */
        position: static;
        width: 100%;
        margin-bottom: 25px !important;
    }
    
    .filters-sidebar.active {
        display: block !important;
        animation: slideDown 0.3s ease;
    }
}

/* Móvil (Menor a 768px) */
@media (max-width: 768px) {
    .navbar {
        height: 65px;
    }
    
    .logo-img {
        height: 45px;
        margin: 5px 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 65px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 65px);
        background-color: var(--bg-white);
        flex-direction: column;
        align-items: stretch;
        padding: 30px;
        gap: 15px;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
        transition: var(--transition);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-link {
        display: block;
        padding: 12px 20px;
        font-size: 1.1rem;
        border-radius: var(--radius-sm);
    }
    
    /* Transformación del icono de hamburguesa */
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
    
    .hero {
        padding: 50px 0;
        border-radius: 0 0 30px 30px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .form-card {
        padding: 25px;
        margin: 20px auto;
    }

    /* Pantallas muy pequeñas: reducir padding del form-card */
    @media (max-width: 375px) {
        .form-card {
            padding: 20px 12px;
            margin: 10px auto;
        }
    }
    
    .actions-cell {
        flex-direction: column;
    }
    
    /* Adaptaciones de los nuevos elementos divididos */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }
    
    .hero-img {
        max-width: 80%;
        margin-top: 15px;
    }
    
    .sterilize-intro-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .section-title-left::after {
        margin: 10px auto 0;
    }
}

/* ==========================================================================
   ESTILOS DE GRID SPLIT & DISEÑO EDITORIAL (NUEVO)
   ========================================================================== */
.hero-container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: center;
    text-align: left;
}

.hero-text {
    padding: 20px 0;
}

.hero-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img {
    max-width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: floatDog 4s ease-in-out infinite;
    border: 8px solid var(--bg-white);
    background-color: var(--bg-white);
}

@keyframes floatDog {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}

.sterilize-intro-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 40px;
}

.section-title-left {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title-left::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    margin-top: 10px;
    border-radius: 2px;
}

.sterilize-intro-image {
    display: flex;
    justify-content: center;
}

.sterilize-img {
    max-width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 5px solid var(--bg-white);
    background-color: var(--bg-white);
}

.sterilize-img:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   SCROLL REVEAL (NUEVO)
   ========================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.active-reveal {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   MASCOTA VIRTUAL CAMINANTE & PELOTA (NUEVO)
   ========================================================================== */
.walking-dog {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 9998;
    pointer-events: none; /* No obstruir clics en la página */
    height: 75px;
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dog-body-wrapper {
    pointer-events: auto; /* El perrito sí es interactivo */
    cursor: pointer;
    transform-origin: center bottom;
}

.dog-svg {
    display: block;
    transform-origin: center bottom;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}



/* Burbuja de Diálogo de la Mascota */
.pet-bubble {
    background-color: var(--bg-white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 600;
    position: absolute;
    bottom: 74px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

.pet-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0;
    border-style: solid;
    border-color: var(--bg-white) transparent;
    display: block;
    width: 0;
}

.pet-bubble::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: var(--border-color) transparent;
    display: block;
    width: 0;
    z-index: -1;
}

.pet-bubble.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* --- ANIMACIONES DE LAS PIERNAS (WALKING & RUNNING) --- */
.dog-body-wrapper.walking #legF1,
.dog-body-wrapper.walking #legB2 {
    animation: swingLegA 0.4s infinite alternate ease-in-out;
}

.dog-body-wrapper.walking #legF2,
.dog-body-wrapper.walking #legB1 {
    animation: swingLegB 0.4s infinite alternate ease-in-out;
}

.dog-body-wrapper.running #legF1,
.dog-body-wrapper.running #legB2 {
    animation: swingLegA 0.2s infinite alternate ease-in-out;
}

.dog-body-wrapper.running #legF2,
.dog-body-wrapper.running #legB1 {
    animation: swingLegB 0.2s infinite alternate ease-in-out;
}

@keyframes swingLegA {
    0% { transform: rotate(18deg); transform-origin: 76px 52px; }
    100% { transform: rotate(-18deg); transform-origin: 76px 52px; }
}
/* Re-mapeo para pierna trasera */
.dog-body-wrapper.walking #legB2 {
    animation-name: swingLegBackA;
}
.dog-body-wrapper.running #legB2 {
    animation-name: swingLegBackA;
}
@keyframes swingLegBackA {
    0% { transform: rotate(18deg); transform-origin: 42px 52px; }
    100% { transform: rotate(-18deg); transform-origin: 42px 52px; }
}

@keyframes swingLegB {
    0% { transform: rotate(-18deg); transform-origin: 82px 52px; }
    100% { transform: rotate(18deg); transform-origin: 82px 52px; }
}
/* Re-mapeo para pierna trasera */
.dog-body-wrapper.walking #legB1 {
    animation-name: swingLegBackB;
}
.dog-body-wrapper.running #legB1 {
    animation-name: swingLegBackB;
}
@keyframes swingLegBackB {
    0% { transform: rotate(-18deg); transform-origin: 48px 52px; }
    100% { transform: rotate(18deg); transform-origin: 48px 52px; }
}

/* Cola (Movimiento normal) */
.wag-tail {
    transform-origin: 37px 40px;
    animation: tailWag 0.8s infinite alternate ease-in-out;
}

/* Cola (Corriendo/Jugando) */
.wag-tail.fast-wag {
    animation: tailWag 0.25s infinite alternate ease-in-out;
}

@keyframes tailWag {
    0% { transform: rotate(-8deg); }
    100% { transform: rotate(20deg); }
}

/* Salto de alegría */
.pet-jump {
    animation: petJumpAnim 0.6s ease-in-out;
}

@keyframes petJumpAnim {
    0%, 100% { transform: translateY(0) scale(1); }
    30% { transform: translateY(-20px) scale(1.08) rotate(-4deg); }
    50% { transform: translateY(-20px) scale(1.08) rotate(4deg); }
    75% { transform: translateY(1px) scale(0.96); }
}

/* Orejas */
.ear-wiggle {
    transform-origin: 88px 12px;
    animation: earWiggleAnim 6s infinite ease-in-out;
}

@keyframes earWiggleAnim {
    0%, 90%, 100% { transform: rotate(0deg); }
    93% { transform: rotate(-12deg); }
    96% { transform: rotate(6deg); }
    98% { transform: rotate(-3deg); }
}

/* ==========================================================================
   ESTILO BOTÓN CATÁLOGO LLAMATIVO (NUEVO)
   ========================================================================== */
.btn-catalog {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-light);
    border: none;
    box-shadow: 0 4px 10px rgba(255, 122, 122, 0.25);
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.btn-catalog:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 122, 122, 0.4);
    color: var(--text-light);
    filter: brightness(1.06);
}

.btn-catalog:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(255, 122, 122, 0.2);
}

.dog-card-image-link {
    display: block;
    overflow: hidden;
}

.dog-card-image-link .dog-card-image {
    transition: var(--transition);
}

.dog-card-image-link:hover .dog-card-image {
    transform: scale(1.05);
}

/* ==========================================================================
   DISEÑO EXCLUSIVO PARA TEMAS DE PANEL (Notoriedad Visual)
   ========================================================================== */

/* Impedir que el logotipo se rompa en dos líneas */
.logo {
    white-space: nowrap !important;
    flex-wrap: nowrap !important;
}

/* TEMA CUIDADORES: Cabecera Sólida Verde Azulado Oscuro y Fondo Sutil */
body.theme-cuidador {
    background-color: #eafcf9 !important; /* Fondo verdoso sutil y refrescante */
}
body.theme-cuidador::before {
    opacity: 0.15 !important;
}
body.theme-cuidador .navbar {
    background-color: #0f766e !important; /* Encabezado Teal Oscuro */
    border-bottom: 3px solid #0d9488;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.15);
}
body.theme-cuidador .navbar .logo {
    color: #ffffff !important;
}
body.theme-cuidador .navbar .nav-link {
    color: #ccfbf1 !important; /* Enlaces en color verde claro */
}
body.theme-cuidador .navbar .nav-link:hover, 
body.theme-cuidador .navbar .nav-link.active {
    color: #ffffff !important;
    background-color: #0d9488 !important;
}
body.theme-cuidador .navbar .panel-badge {
    background-color: #06b6d4 !important; /* Badge en Cyan */
    color: #ffffff !important;
}
body.theme-cuidador .navbar .nav-link-text {
    color: #ffffff !important;
}
body.theme-cuidador .menu-toggle span {
    background-color: #ffffff !important; /* Hamburguesa blanca */
}

/* TEMA ADMINISTRACIÓN (aPanel): Cabecera Sólida Violeta Imperial y Fondo Púrpura */
body.theme-apanel {
    background-color: #f5f0ff !important; /* Fondo purpúreo sutil y profesional */
}
body.theme-apanel::before {
    opacity: 0.12 !important;
}
body.theme-apanel .navbar {
    background-color: #5b21b6 !important; /* Encabezado Violeta Oscuro */
    border-bottom: 3px solid #7c3aed;
    box-shadow: 0 4px 12px rgba(91, 33, 182, 0.15);
}
body.theme-apanel .navbar .logo {
    color: #ffffff !important;
}
body.theme-apanel .navbar .nav-link {
    color: #f3e8ff !important; /* Enlaces en color púrpura claro */
}
body.theme-apanel .navbar .nav-link:hover, 
body.theme-apanel .navbar .nav-link.active {
    color: #ffffff !important;
    background-color: #7c3aed !important;
}
body.theme-apanel .navbar .panel-badge {
    background-color: #ec4899 !important; /* Badge en Rosa */
    color: #ffffff !important;
}
body.theme-apanel .navbar .nav-link-text {
    color: #ffffff !important;
}
body.theme-apanel .menu-toggle span {
    background-color: #ffffff !important; /* Hamburguesa blanca */
}

/* ==========================================================================
   BARRA DE PROGRESO DE SUBIDA DE IMÁGENES
   ========================================================================== */
.upload-progress-container {
    display: none;
    margin-top: 20px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.upload-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.upload-progress-bar-wrapper {
    height: 10px;
    background-color: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.upload-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 5px;
    transition: width 0.1s linear;
}

/* ==========================================================================
   BLOG HERO SECTION
   ========================================================================== */
.blog-hero {
    background: linear-gradient(rgba(234, 88, 12, 0.9), rgba(251, 146, 60, 0.9));
    text-align: center;
    padding: 60px 20px;
    color: white;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-bottom: 45px;
    box-shadow: var(--shadow-sm);
}

.blog-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.blog-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: white;
}

.blog-hero-desc {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.95;
}

/* ==========================================================================
   OPTIMIZACIONES MÓVILES EXCLUSIVAS (UI/UX PREMIUM)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Ocultar Mascota Virtual en Móviles para liberar espacio y evitar solapes */
    .walking-dog {
        display: none !important;
    }
    
    .blog-hero {
        padding: 25px 15px !important;
        margin-bottom: 25px !important;
    }
    
    .blog-hero-title {
        font-size: 1.6rem !important;
        margin-bottom: 0 !important;
    }
    
    .blog-hero-desc {
        display: none !important; /* Eliminar el texto debajo del título en móviles */
    }

    /* 2. Menú Móvil Moderno con Glassmorphism */
    .nav-menu {
        position: fixed;
        top: 65px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 65px);
        background-color: rgba(255, 255, 255, 0.96) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 24px !important;
        gap: 20px;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
        transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    }
        .nav-link {
        display: block;
        padding: 12px 24px !important;
        font-size: 1.15rem !important;
        font-weight: 600 !important;
        text-align: center;
        width: 100%;
        max-width: 280px;
        border-radius: 20px !important;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        color: var(--text-dark) !important;
        background-color: transparent !important;
    }
    
    .nav-link:not(.nav-btn) {
        border-bottom: 1px dashed rgba(255, 122, 122, 0.16);
        border-radius: 0 !important; /* Flat for standard separated links */
        margin-bottom: 5px;
    }

    .nav-link:not(.nav-btn):last-of-type {
        border-bottom: none; /* No border for the last text menu link */
    }
    
    .nav-link:hover, .nav-link.active {
        color: var(--primary) !important;
        background-color: var(--primary-light) !important;
        border-radius: 20px !important; /* Rounded pill when active/hovered */
        border-bottom-color: transparent !important;
        transform: translateY(-2px);
    }

    .nav-btn {
        background-color: var(--primary) !important;
        color: var(--text-light) !important;
        box-shadow: 0 6px 14px rgba(255, 122, 122, 0.25) !important;
        border-radius: 30px !important;
        margin-top: 5px;
    }
    
    .nav-btn:hover {
        background-color: var(--primary-hover) !important;
        color: var(--text-light) !important;
    }

    /* 3. Hero Section responsiva */
    .hero {
        padding: 45px 0 35px !important;
        border-radius: 0 0 35px 35px !important;
    }
    
    .hero-title {
        font-size: 2.1rem !important;
        margin-bottom: 12px !important;
        line-height: 1.3 !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 25px !important;
        padding: 0 10px;
    }
    
    .hero-img {
        max-width: 75% !important;
        margin-top: 10px !important;
    }



    /* 5. Sección Esterilizar y Beneficios */
    .section-sterilize {
        padding: 40px 15px !important;
        margin: 25px 0 !important;
    }

    .sterilize-intro-p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    .benefit-card {
        padding: 22px !important;
    }

    .benefit-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.5rem !important;
        margin-bottom: 15px !important;
    }

    .benefit-card li {
        font-size: 0.88rem !important;
        line-height: 1.5 !important;
    }

    .age-info-box {
        padding: 22px !important;
        margin-top: 25px !important;
    }

    .age-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .age-item {
        padding: 15px !important;
    }

    /* Forzar diseño vertical de 1 columna para retículas principales */
    .hero-container {
        grid-template-columns: 1fr !important;
        text-align: center !important;
        gap: 20px !important;
    }

    .sterilize-intro-grid {
        grid-template-columns: 1fr !important;
        text-align: center !important;
        gap: 30px !important;
    }
}

