:root {
    --primary: #356ae6;
    --primary-dark: #274381;
    --accent: #46bfa7;
    --background: #f7fafb;
    --text: #2c3e50;
    --text-light: #5a6c7d;
    --card-bg: #ffffff;
    --shadow: rgba(52, 106, 230, 0.1);
    --shadow-hover: rgba(52, 106, 230, 0.2);
    --border: #e8f4f8;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --gradient-blue: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-teal: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    --wave-color: rgba(70, 191, 167, 0.1);
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--background);
    overflow-x: hidden;
}

/* Header original */
header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary);
    transition: color 0.3s ease;
}

.logo-link:hover {
    color: var(--accent);
}

.logo-icon {
    height: 30px;
    width: auto;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
}

.header-right {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* Hero section original */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 200"><path d="M0,100 C150,200 350,0 500,100 C650,200 850,0 1000,100 L1000,200 L0,200 Z" fill="rgba(255,255,255,0.1)"/></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero .scientific-name {
    font-size: 1.4rem;
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.95;
    line-height: 1.7;
}

.main-content-single-column {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.content-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 8px 30px var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.content-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--shadow-hover);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--primary);
}

/* Características en grid */
.characteristics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.characteristic-item {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent);
    transition: all 0.3s ease;
}

.characteristic-item:hover {
    background: white;
    transform: translateX(5px);
    box-shadow: 0 4px 15px var(--shadow);
}

.characteristic-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.characteristic-value {
    color: var(--text);
    font-size: 0.95rem;
}

/* Estilos de las tarjetas de peces optimizados */
.peces-lista {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.pez-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
}

.pez-card.animate-card {
    animation: slideInUp 0.6s ease forwards;
}

.pez-card:nth-child(1) { animation-delay: 0.1s; }
.pez-card:nth-child(2) { animation-delay: 0.15s; }
.pez-card:nth-child(3) { animation-delay: 0.2s; }
.pez-card:nth-child(4) { animation-delay: 0.25s; }
.pez-card:nth-child(5) { animation-delay: 0.3s; }
.pez-card:nth-child(6) { animation-delay: 0.35s; }
.pez-card:nth-child(7) { animation-delay: 0.4s; }
.pez-card:nth-child(8) { animation-delay: 0.45s; }

.pez-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px var(--shadow-hover);
}

.pez-img {
    position: relative;
    height: 200px;
    overflow: hidden;
    cursor: pointer;
}

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

.pez-img:hover img {
    transform: scale(1.05);
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    gap: 0.5rem;
}

.pez-img:hover .img-overlay {
    opacity: 1;
}

.img-overlay i {
    font-size: 2rem;
}

.img-overlay-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.pez-info {
    padding: 1.5rem;
}

.pez-info h4 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.pez-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.pez-link:hover {
    color: var(--accent);
}

.cientifico {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.9rem;
    display: block;
    margin-top: 0.2rem;
}

.pez-info p {
    margin: 1rem 0;
    color: var(--text);
    line-height: 1.6;
}

.leer-mas-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--ocean-blue);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.leer-mas-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 106, 230, 0.3);
}

.leer-mas-btn i {
    transition: transform 0.3s ease;
}

.leer-mas-btn:hover i {
    transform: translateX(3px);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--gradient-blue);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 106, 230, 0.3);
}

.btn-secondary {
    background: var(--background);
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* Decoraciones */
.wave-decoration {
    position: absolute;
    width: 100%;
    height: 60px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100"><path d="M0,50 C150,100 350,0 500,50 C650,100 850,0 1000,50 L1000,100 L0,100 Z" fill="%23f7fafb"/></svg>') no-repeat;
    background-size: cover;
}

.wave-decoration.top {
    top: -1px;
    transform: rotate(180deg);
}

.wave-decoration.bottom {
    bottom: -1px;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1rem;
    }

    .sidebar {
        position: static;
        order: -1;
        top: auto;
        max-height: none;
    }

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

    .content-section {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .main-content {
        padding: 1rem 0.5rem;
    }

    .content-section {
        padding: 1.5rem;
    }
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section {
    animation: fadeInUp 0.6s ease-out;
}

.content-section:nth-child(2) { animation-delay: 0.1s; }
.content-section:nth-child(3) { animation-delay: 0.2s; }
.content-section:nth-child(4) { animation-delay: 0.3s; }

/* Efectos de hover mejorados */
.characteristic-item:hover .characteristic-label {
    color: var(--accent);
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles para accesibilidad */
.btn:focus,
.logo:focus,
.breadcrumb a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Estilos para listas de peces con nuevas animaciones */
.peces-lista {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.pez-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 35px var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.pez-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 50px var(--shadow-hover);
}

.pez-img {
    position: relative;
    height: 250px;
    overflow: hidden;
    cursor: zoom-in;
}

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

.pez-card:hover .pez-img img {
    transform: scale(1.08);
}

.img-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(52, 106, 230, 0.8), rgba(70, 191, 167, 0.8));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    gap: 0.5rem;
}

.pez-card:hover .img-overlay {
    opacity: 1;
}

.img-overlay i {
    color: white;
    font-size: 2.5rem;
}

.img-overlay-text {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pez-info {
    padding: 1.5rem;
}

.pez-info h4 {
    margin-bottom: 0.5rem;
}

.pez-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.pez-link:hover {
    color: var(--accent);
}

.cientifico {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.9rem;
    display: block;
    margin-top: 0.25rem;
}

.pez-info p {
    color: var(--text);
    margin: 1rem 0;
    line-height: 1.6;
}

.pez-tags {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.tag {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag.native {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
    border: 1px solid rgba(39, 174, 96, 0.3);
}

.tag.invasive {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.tag.habitat {
    background: rgba(52, 106, 230, 0.1);
    color: var(--primary);
    border: 1px solid rgba(52, 106, 230, 0.3);
}

.leer-mas-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.leer-mas-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.leer-mas-btn i {
    transition: transform 0.3s ease;
}

.leer-mas-btn:hover i {
    transform: translateX(3px);
}

/* Footer estilos con ocean blue */
footer {
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
background-image: radial-gradient(circle, #3700ff, #1634ff, #004bfb, #005df5, #226bed, #2376ea, #2e7fe6, #3e88e1, #3c90e2, #3f98e2, #45a0e1, #4fa7e0);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    text-decoration: underline ;
    color: #ffffff;
}

.footer-content p {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
}

/* Animaciones fluidas optimizadas */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal para imágenes ampliadas */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideInUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: -40px;
    right: -10px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: opacity 0.3s ease;
}

.modal-close:hover {
    opacity: 0.7;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.modal-info {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    text-align: center;
    max-width: 500px;
}

.modal-info h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.modal-info p {
    color: var(--text);
    margin: 0;
}

/* Responsive mejorado */
@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .main-content-single-column {
        padding: 2rem 1rem;
    }

    .peces-lista {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .content-section {
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .main-content-single-column {
        padding: 1rem 0.5rem;
    }

    .content-section {
        padding: 1.5rem;
    }

    .pez-img {
        height: 180px;
    }
}

/* Modal para imagen ampliada */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    animation: scaleIn 0.3s ease;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--accent);
}

.modal-info {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem;
    border-radius: 10px;
}

.modal-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--seafoam);
}

.modal-info p {
    margin: 0;
    opacity: 0.9;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.5);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Animaciones ultra rápidas para mejor experiencia */
@keyframes fastFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación rápida principal */
.fast-animate {
    opacity: 0;
    animation: fastFadeIn 0.3s ease forwards;
}

.fast-animate:nth-child(1) { animation-delay: 0.1s; }
.fast-animate:nth-child(2) { animation-delay: 0.2s; }
.fast-animate:nth-child(3) { animation-delay: 0.3s; }
.fast-animate:nth-child(4) { animation-delay: 0.4s; }

/* Animaciones de scroll más suaves */
.pez-card {
    transform: translateY(0);
    transition: all 0.2s ease;
}

/* Ajuste para el layout sin sidebar */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.content-area {
    width: 100%;
}

/* --- (pantallas ≤ 768px) --- */
@media (max-width: 768px) {
    /* Layout principal: lista de peces y tarjetas */
    .peces-lista {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .pez-card {
        margin: 0 1rem;
        max-width: 400px;
        max-height: 600px;
    }

    /* Modales */
    .modal-content {
        max-width: 95%;
        max-height: 80%;
    }

    .modal-close {
        top: -30px;
        font-size: 28px;
    }

    .modal-info {
        bottom: -50px;
        padding: 0.8rem;
    }

    /* Header */
    header {
        height: auto;
        padding: 0;
    }

    .header-container {
        padding: 0.5rem 1rem;
        height: 100%;
        display: flex; /* asegúrate de que sea flex si no está en estilos base */
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    /* Logo: mostrar solo icono */
    .logo {
        display: none;
    }

    .logo-icon {
        height: 30px;
    }

    /* Navegación: íconos y texto más compactos */
    .nav-link {
        font-size: 0.9rem;
        padding: 0.4rem 0.6rem;
        gap: 0.3rem;
        display: inline-flex; /* para que gap funcione con íconos+texto */
        align-items: center;
    }

    .nav-link i {
        font-size: 1rem;
    }

    .header-right {
        display: flex;
        gap: 0.8rem;
        align-items: center;
    }

    /* desactivar transiciones moviles */
     .pez-card {
        transition: none;
         -webkit-tap-highlight-color: transparent;
          touch-action: manipulation;
    }
    .pez-card:hover {
        transform: none;
        box-shadow: 0 8px 30px var(--shadow);
    }
    .pez-img img {
        transition: none;
    }
    .img-overlay {
        display: none;
    }
}
