/* ========================================= */
/* 1. ESTILOS GENERALES (PRINCIPAL)          */
/* ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { background-color: #f8f9fa; color: #333; }
a { text-decoration: none; }

/* HEADER */
.main-header {
    background-color: #ffffff; height: 80px; display: flex;
    justify-content: space-between; align-items: center; padding: 0 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 100;
}
.logo-container { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; color: #333; }
.logo-icon { color: #FF6600; font-size: 26px; }
.nav-menu { display: flex; align-items: center; gap: 30px; margin-left:auto;}
.nav-link { color: #666; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; transition: color 0.3s; }
.nav-link:hover { color: #FF6600; }
.header-buttons { display: flex; gap: 15px; }

/* Botones y Perfil */
.btn { padding: 10px 24px; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; transition: 0.3s; }
.btn-outline { border: 2px solid #FF6600; color: #FF6600; background: transparent; }
.btn-outline:hover { background-color: #fff0e6; }
.btn-solid { background-color: #FF6600; color: white; border: 2px solid #FF6600; }
.btn-solid:hover { background-color: #e65c00; border-color: #e65c00; }
.user-profile { 
    display: flex;
    align-items: center;
    gap: 15px; 
    cursor: pointer;
}
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name { color: #333; font-size: 15px; }
.avatar-img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #FF6600; object-fit: cover; }
.dropdown-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    width: 170px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
}

.dropdown-menu a,
.dropdown-menu button {
    padding: 12px 15px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    width: 100%;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: #FF6600;
    color: white;
}
.dropdown-menu i {
    font-size: 14px;
}

/* Mostrar menú */
.dropdown-menu.active {
    display: flex;
}


/* CONTENIDO PRINCIPAL */
.main-content { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.hero-section h1 { font-size: 32px; color: #222; margin-bottom: 10px; }
.underline { width: 60px; height: 4px; background-color: #FF6600; margin-bottom: 30px; border-radius: 2px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-btn { padding: 8px 20px; border: 1px solid #eee; background-color: #fff; border-radius: 6px; color: #555; font-weight: 500; cursor: pointer; }
.filter-btn:hover { background-color: #f0f0f0; }
.filter-btn.active { background-color: #FF6600; color: white; border-color: #FF6600; }

/* GRID DE TARJETAS */
.pets-grid {
    display: grid;
    /* Crea columnas de al menos 280px. Se ajustan solas al ancho de la pantalla */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 30px; /* Espacio entre tarjetas */
    padding: 40px 0;
    max-width: 1200px;
    margin: 0 auto;
}
.pet-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Para que todas las tarjetas midan lo mismo */
}

.pet-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(255, 102, 0, 0.1);
}

/* Contenedor de la foto */
.card-image {
    width: 100%;
    height: 220px; /* Altura fija para uniformidad */
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ESTO evita que la imagen se vea alargada */
    display: block;
}
.badge { position: absolute; top: 15px; right: 15px; padding: 4px 12px; border-radius: 20px; color: white; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.badge.disponible { background-color: #28a745; }
.badge.pendiente { background: linear-gradient(135deg, #FFEA00, #FFC400); color: #ffffff; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.badge.adoptado { background-color: #007bff; }
.card-info { padding: 20px; }
.pet-header h3 { font-size: 18px; color: #222; margin: 0; }
.pet-header h3 span { font-weight: 400; color: #777; font-size: 16px; margin-left: 5px; }
.breed { color: #888; font-size: 14px; margin-bottom: 20px; }
.card-footer { display: flex; justify-content: center; align-items: center; }
.btn-conocer { 
    background-color: #FF6600; color: white; border: none; 
    padding: 10px 20px; border-radius: 6px; font-weight: 600; 
    cursor: pointer; width: 100%; text-align: center;
}

/* MODAL (Estilos Verticales) */
.modal-overlay-vert {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); z-index: 10000;
    justify-content: center; align-items: center; padding: 20px;
}
.modal-card-vert {
    background: #fff; width: 100%; max-width: 950px;
    border-radius: 20px; overflow: hidden; position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3); animation: popIn 0.3s ease;
}
@keyframes popIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-body-vert { display: flex; min-height: 580px; }
.col-img-vert { flex: 1.1; position: relative; background-color: #eee; }
.col-img-vert img { width: 100%; height: 100%; object-fit: cover; }
.badge-vert {
    position: absolute; top: 25px; left: 25px; background-color: #28a745; color: white;
    padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; z-index: 10;
}
.btn-close-vert {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background-color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    color: #000000;
    cursor: pointer;
    z-index: 50;
    display: flex; 
    align-items: center; 
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); 
    transition: transform 0.2s;
}

.btn-close-vert:hover { transform: scale(1.1); color: #000; }
.col-info-vert { flex: 1; padding: 50px; display: flex; flex-direction: column; background-color: #ffffff; }
.header-vert h2 { font-size: 36px; color: #222; margin: 0 0 5px 0; font-weight: 700; }
.header-vert h2 span { font-weight: 300; color: #555; font-size: 30px; margin-left: 5px; }
.breed-vert { color: #888; font-size: 18px; margin-bottom: 30px; }
.details-list-vertical { display: flex; flex-direction: column; gap: 20px; margin-bottom: 30px; }
.detail-row { display: flex; gap: 15px; align-items: flex-start; }
.icon-wrap { width: 24px; display: flex; justify-content: center; margin-top: 3px; }
.icon-orange { color: #FF6600; font-size: 22px; }
.text-wrap { display: flex; flex-direction: column; }
.label-vert { display: block; font-size: 13px; color: #888; margin-bottom: 3px; }
.val-vert { display: block; font-size: 16px; color: #222; font-weight: 600; line-height: 1.3; }
.txt-green { color: #28a745; font-weight: 600; }
.pills-container-vert { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.dot { width: 6px; height: 6px; border-radius: 50%; }
.pill-green { background-color: #e8f5e9; color: #2e7d32; }
.dot.g { background-color: #2e7d32; }
.pill-blue { background-color: #e3f2fd; color: #1976d2; }
.dot.b { background-color: #1976d2; }
.bio-vert h3 { font-size: 18px; color: #333; margin-bottom: 10px; font-weight: 600; }
.bio-vert p { color: #555; font-size: 15px; line-height: 1.6; margin-bottom: 30px; }
.footer-vert { margin-top: auto; }
.btn-adopt-vert {
    width: 100%; background-color: #FF6600; color: white; border: none;
    padding: 16px; border-radius: 10px; font-size: 18px; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    gap: 10px; transition: background 0.2s; box-shadow: 0 4px 15px rgba(255, 102, 0, 0.2);
}
.btn-adopt-vert:hover { background-color: #e65c00; }
@media (max-width: 768px) {
    .modal-body-vert { flex-direction: column; }
    .col-img-vert { height: 250px; flex: none; }
    .modal-card-vert { max-width: 95%; height: 90vh; overflow-y: auto; }
}

/* ========================================= */
/* ESTILOS DEL WIDGET FLOTANTE (CHAT)        */
/* ========================================= */

/* La Burbuja Naranja */
.chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #FF6600;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.4);
    cursor: pointer;
    z-index: 10000;
    transition: transform 0.3s, background-color 0.3s;
}

.chat-bubble:hover {
    transform: scale(1.1);
    background-color: #e65c00;
}

/* El Contenedor de la Ventana (Iframe) */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 360px;
    height: 520px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.25);
    z-index: 9999;
    overflow: hidden;
    /* Animación */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

/* Clase para ocultar el chat */
.chat-widget.hidden {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    visibility: hidden;
    pointer-events: none;
}

/* El Iframe ocupa todo el espacio */
.chat-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Contenedor del perfil */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
}

/* Esto alinea el "Hola, Noa" con el círculo naranja */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 50px;
    transition: background 0.3s;
}

.profile-trigger:hover {
    background: #fff0e6;
}

/* El círculo naranja idéntico al admin */
.avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #FF6600;
    object-fit: cover;
}

/* Estilos para el dropdown */
.dropdown-menu {
    display: none; /* Se activa con la clase .active en JS */
    position: absolute;
    top: 60px;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-radius: 12px;
    flex-direction: column;
    padding: 10px 0;
    z-index: 1000;
}

.dropdown-menu.active {
    display: flex;
}

/* Esto quita el color crema/naranja de fondo */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 50px;
    background: transparent; /* Cambiado de #fff8f5 a transparente */
    transition: all 0.3s ease;
}

/* Esto quita el efecto naranja cuando pasas el mouse por encima */
.profile-trigger:hover {
    background: rgba(0, 0, 0, 0.05); /* Un gris casi invisible en lugar de naranja */
}
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: none; justify-content: center; align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white; width: 90%; max-width: 800px;
    border-radius: 20px; position: relative; overflow: hidden;
}
.modal-body { display: flex; flex-wrap: wrap; }
.modal-image-container { flex: 1; min-width: 300px; }
.modal-image-container img { width: 100%; height: 100%; object-fit: cover; }
.modal-info { flex: 1.2; padding: 30px; }
.btn-adoptar-modal {
    width: 100%; background: #FF6600; color: white;
    padding: 15px; border: none; border-radius: 10px;
    font-size: 18px; font-weight: bold; cursor: pointer; margin-top: 20px;
}
.close-modal {
    position: absolute; top: 15px; right: 20px;
    font-size: 30px; border: none; background: none; cursor: pointer;
}
/* --- MODAL OVERLAY --- */
.modal-overlay-vert {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); z-index: 10000;
    justify-content: center; align-items: center; padding: 20px;
}

/* --- TARJETA DEL MODAL --- */
.modal-card-vert {
    background: #fff; width: 100%; max-width: 1050px;
    border-radius: 25px; overflow: hidden; position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3); animation: popIn 0.3s ease;
}

@keyframes popIn { 
    from { transform: scale(0.95); opacity: 0; } 
    to { transform: scale(1); opacity: 1; } 
}

/* --- CUERPO --- */
.modal-body-vert { display: flex; min-height: 650px; }

/* --- COLUMNA IMAGEN --- */
.col-img-vert { flex: 1.2; position: relative; background-color: #eee; }
.col-img-vert img { width: 100%; height: 100%; object-fit: cover; }
.badge-vert {
    position: absolute; top: 25px; left: 25px; background-color: #28a745; color: white;
    padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; z-index: 10;
}

/* --- BOTÓN CERRAR --- */
.btn-close-vert {
    position: absolute; top: 20px; right: 20px; width: 36px; height: 36px;
    background-color: #fff; border: none; border-radius: 50%;
    font-size: 20px; font-weight: bold; cursor: pointer; z-index: 50;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2); transition: 0.2s;
}
.btn-close-vert:hover { transform: scale(1.1); }

/* --- COLUMNA INFO --- */
.col-info-vert { flex: 1; padding: 50px; display: flex; flex-direction: column; background-color: #ffffff; }

.header-vert h2 { font-size: 42px; color: #222; margin: 0; font-weight: 700; }
.header-vert h2 span { font-weight: 300; color: #888; font-size: 32px; }
.breed-vert { color: #888; font-size: 18px; margin-bottom: 30px; }

/* --- LISTA DETALLES --- */
.details-list-vertical { display: flex; flex-direction: column; gap: 20px; margin-bottom: 30px; }
.detail-row { display: flex; gap: 15px; align-items: flex-start; }
.icon-orange { color: #FF6600; font-size: 22px; }
.label-vert { display: block; font-size: 13px; color: #888; margin-bottom: 2px; }
.val-vert { display: block; font-size: 16px; color: #222; font-weight: 600; }
.txt-green { color: #28a745; }

/* --- PILLS SALUD --- */
.pills-container-vert { display: flex; gap: 8px; margin-top: 5px; }
.pill { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pill-green { background: #e8f5e9; color: #2e7d32; }
.pill-blue { background: #e3f2fd; color: #1976d2; }
.dot { width: 6px; height: 6px; border-radius: 50%; }
.dot.g { background: #2e7d32; }
.dot.b { background: #1976d2; }

/* --- BIO --- */
.bio-vert h3 { font-size: 20px; margin-bottom: 10px; }
.bio-vert p { color: #555; line-height: 1.6; font-size: 15px; }

/* --- BOTÓN ADOPTAR --- */
.btn-adopt-vert {
    width: 100%; background-color: #FF6600; color: white; border: none;
    padding: 18px; border-radius: 12px; font-size: 20px; font-weight: 700;
    cursor: pointer; transition: 0.3s; margin-top: auto;
}
.btn-adopt-vert:hover { background-color: #e65c00; transform: translateY(-2px); }

@media (max-width: 768px) {
    .modal-body-vert { flex-direction: column; }
    .col-img-vert { height: 250px; }
    .modal-card-vert { height: 95vh; overflow-y: auto; }
}
.card-image {
    position: relative;
    overflow: hidden;
}

.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: white;
    z-index: 10;
}

.status-badge.disponible { background-color: #259453; }
.status-badge.pendiente {
    background: linear-gradient(135deg, #FFEA00, #FFC400);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.status-badge.adoptado { background-color: #007bff;  }

/* =================================================== */
/* RESPONSIVE MOBILE (unificado)                        */
/* =================================================== */
@media (max-width: 900px) {
    .main-header { padding: 0 16px; height: 64px; }
    .logo-container span { font-size: 18px; }
    .logo-icon { font-size: 22px; }
    .nav-menu { gap: 14px; }
    .nav-link { font-size: 13px; }
    .btn { padding: 8px 16px; font-size: 13px; }
    .header-buttons { gap: 8px; }
    .user-name { font-size: 13px; }
    .avatar-img { width: 34px; height: 34px; }
    .pets-grid { gap: 20px; padding: 20px 16px; }
}

@media (max-width: 600px) {
    .main-header {
        height: auto;
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
        position: relative;
    }
    .nav-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        margin-left: 0;
    }
    .nav-link { font-size: 12px; }
    .header-buttons { margin-left: auto; }
    .user-profile { margin-left: auto; }
    .hero-section h1 { font-size: 24px; text-align: center; }
    .hero-content { padding: 0 16px; }
    .pets-grid {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
    .pet-card { max-width: 420px; margin: 0 auto; width: 100%; }
    .dropdown-menu { right: 0; left: auto; }

    /* Modal perfil de mascota en móvil */
    .modal-overlay-vert { padding: 0; }
    .modal-card-vert {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        overflow-y: auto;
    }
    .modal-body-vert { flex-direction: column; }
    .col-img-vert { height: 220px; width: 100%; }
    .col-info-vert { padding: 20px; }
    .header-vert h2 { font-size: 22px; }
    .breed-vert { font-size: 14px; }
    .btn-close-vert { top: 10px; right: 10px; z-index: 20; }
    .btn-adopt-vert { font-size: 16px; padding: 14px; }
    .bio-vert h3 { font-size: 18px; }
    .bio-vert p { font-size: 14px; }

    /* Chat widget en móvil: pantalla casi completa */
    .chat-widget {
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 100px) !important;
        right: 10px !important;
        bottom: 80px !important;
    }
    .chat-bubble { right: 15px !important; bottom: 15px !important; }
}

@media (max-width: 380px) {
    .nav-menu { gap: 6px; }
    .nav-link { font-size: 11px; }
    .btn { padding: 7px 12px; font-size: 12px; }
    .pet-card h3 { font-size: 16px; }
}