/* ============================================
   MOBILE EXCLUSIVE DESIGN (<768px)
   Diseño tipo app nativa, totalmente diferente al desktop.
   Se carga como media query, no afecta al escritorio.
============================================ */

/* ============================================
   NAVIGATION — Bottom tab bar (tipo app)
============================================ */
.nav {
    top: auto;
    bottom: 0;
    padding: 0;
    background: var(--white);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
    border-top: 1px solid var(--gray-200);
    z-index: 1000;
}

.nav.scrolled {
    background: var(--white);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
    padding: 0;
    backdrop-filter: none;
}

.nav-inner {
    padding: 0;
    height: auto;
    justify-content: center;
}

.nav-logo {
    display: none;
}

.nav-toggle {
    display: none !important;
}

/* Bottom tab links - visible always */
.nav-links {
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: transparent !important;
    flex-direction: row !important;
    padding: 0 !important;
    gap: 0 !important;
    width: 100%;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}

.nav-links li {
    opacity: 1 !important;
    transform: none !important;
    flex: 1;
    transition: none !important;
}

.nav-links a {
    color: var(--gray-400) !important;
    font-size: 0.6rem !important;
    font-weight: 600 !important;
    padding: 10px 4px 8px !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
    line-height: 1;
    position: relative;
}

.nav-links a::after {
    display: none !important;
}

.nav-links a::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    margin-bottom: 2px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

/* Tab icons via CSS */
.nav-links li:nth-child(1) a::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E"); }
.nav-links li:nth-child(2) a::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E"); }
.nav-links li:nth-child(3) a::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); }
.nav-links li:nth-child(4) a::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E"); }
.nav-links li:nth-child(5) a::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }

/* Hide servicios y contacto del tab bar (demasiados items) */
.nav-links li:nth-child(6),
.nav-links li:nth-child(7) {
    display: none;
}

.nav-links a.is-active,
.nav-links a:active {
    color: var(--pink) !important;
}

.nav-links a.is-active::before {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(26%) sepia(81%) saturate(2868%) hue-rotate(326deg) brightness(87%) contrast(91%);
}

.nav-cta {
    background: transparent !important;
    color: var(--gray-400) !important;
    padding: 10px 4px 8px !important;
    border-radius: 0 !important;
    margin-top: 0 !important;
}

/* ============================================
   HERO — Estilo app: fullscreen con card
============================================ */
html {
    scroll-padding-top: 20px;
    scroll-padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.hero {
    min-height: 100svh;
    padding-bottom: 80px;
}

.hero-content {
    padding: 60px 20px 40px;
    gap: 28px;
    text-align: center;
}

.hero-badge {
    font-size: 0.65rem;
    padding: 5px 12px;
    margin-bottom: 16px;
}

.hero h1 {
    font-size: 1.85rem;
    line-height: 1.15;
    margin-bottom: 14px;
}

.hero-description {
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 24px;
    opacity: 0.8;
}

.hero-buttons {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding: 0 10px;
}

.btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 0.92rem;
    border-radius: 14px;
}

.hero-visual {
    max-width: 100%;
    padding: 0 4px;
}

.hero-card {
    border-radius: 16px;
}

.hero-card img {
    height: 200px;
}

.hero-card-overlay {
    padding: 14px 16px;
}

.hero-card-overlay span { font-size: 0.65rem; }
.hero-card-overlay p { font-size: 0.8rem; }

.float-stat { display: none; }
.hero-particles { display: none; }
.hero-pattern { background-size: 30px 30px; }

/* ============================================
   STATS — Horizontal scroll cards
============================================ */
.stats-bar {
    margin-top: -20px;
    padding-bottom: 8px;
}

.stats-inner {
    padding: 0 16px;
}

.stats-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding: 4px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    scrollbar-width: none;
}

.stats-grid::-webkit-scrollbar { display: none; }

.stat-item {
    flex: 0 0 auto;
    width: calc(50% - 5px);
    scroll-snap-align: start;
    padding: 20px 16px;
    border-radius: 14px;
    background: var(--white);
}

.stat-item::after { display: none !important; }

.stat-item:nth-child(odd) {
    background: var(--pink-bg);
}

.stat-number {
    font-size: 1.6rem;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.7rem;
}

/* ============================================
   SECTIONS — App-style containers
============================================ */
section {
    padding: 48px 0;
    margin-bottom: 0;
}

.container {
    padding: 0 16px;
}

.section-header {
    margin-bottom: 28px;
    text-align: left;
}

.section-tag {
    font-size: 0.68rem;
    margin-bottom: 8px;
}

.section-tag::before,
.section-tag::after {
    width: 16px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.section-subtitle {
    font-size: 0.85rem;
    text-align: left;
}

/* ============================================
   ABOUT — Stacked story card layout
============================================ */
.about {
    background: var(--white);
    padding-top: 40px;
}

.about-grid {
    gap: 28px;
}

.about-image-main {
    border-radius: 16px;
}

.about-image-main img {
    height: 200px;
}

.about-image-float {
    display: none;
}

.about h2 {
    font-size: 1.35rem;
    margin-bottom: 12px;
}

.about-text p {
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.highlight-item {
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: var(--gray-50);
}

.highlight-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.highlight-item h4 { font-size: 0.82rem; }
.highlight-item p { font-size: 0.74rem; }

/* ============================================
   RESEARCH — Horizontal swipe cards
============================================ */
.research {
    overflow: hidden;
}

.research .section-header {
    padding: 0 0 0 4px;
}

.research-grid {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding: 4px 16px 16px;
    margin: 0 -16px;
    scrollbar-width: none;
}

.research-grid::-webkit-scrollbar { display: none; }

.research-card {
    flex: 0 0 82vw;
    scroll-snap-align: center;
    padding: 24px 20px;
    border-radius: 18px;
    border: none;
    border-left: none;
    background: var(--gray-50);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.research-card::before { display: none; }

.research-number {
    font-size: 2.2rem;
    color: var(--pink);
    opacity: 0.15;
}

.research-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.research-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.research-card p {
    font-size: 0.82rem;
    line-height: 1.6;
}

.research-tags {
    margin-top: 12px;
    gap: 5px;
}

.research-tags span {
    font-size: 0.65rem;
    padding: 3px 8px;
}

/* ============================================
   LAB — Full-bleed photo grid + pills
============================================ */
.lab {
    padding-top: 48px;
    padding-bottom: 48px;
}

.lab .section-header {
    text-align: left;
}

.lab-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding: 0 16px 12px;
    margin: 0 -16px;
    scrollbar-width: none;
}

.lab-gallery::-webkit-scrollbar { display: none; }

.lab-item {
    flex: 0 0 75vw;
    scroll-snap-align: center;
    border-radius: 16px;
}

.lab-item.featured {
    flex: 0 0 75vw;
    grid-row: auto;
}

.lab-item img {
    height: 200px;
}

.lab-item.featured img {
    height: 200px;
}

.lab-item-overlay {
    opacity: 1;
    padding: 14px;
    background: linear-gradient(transparent 30%, rgba(26, 26, 46, 0.9));
}

.lab-item-overlay h4 { font-size: 0.85rem; }
.lab-item-overlay p { font-size: 0.72rem; }

.equipment-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 24px;
}

.equip-card {
    padding: 16px 10px;
    border-radius: 14px;
}

.equip-card h4 { font-size: 0.72rem; }
.equip-card p { font-size: 0.62rem; }

/* ============================================
   TEAM — Compact list view (no cards)
============================================ */
.team {
    padding-top: 48px;
}

.team .section-header {
    text-align: left;
}

.team-section-title {
    font-size: 0.88rem;
    margin-top: 28px;
    margin-bottom: 12px;
    padding-bottom: 8px;
}

.team-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

/* Transform card to compact row */
.team-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    border-radius: 14px;
    overflow: visible;
    border: none;
    background: var(--white);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.team-avatar {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 14px;
    flex-shrink: 0;
    margin: 8px;
    position: relative;
    background: linear-gradient(135deg, var(--pink), var(--pink-dark));
}

.team-avatar-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: var(--white);
    box-shadow: none;
}

.team-info {
    padding: 10px 14px 10px 4px;
    text-align: left;
}

.team-info h4 {
    font-size: 0.82rem;
    margin-bottom: 1px;
}

.team-info .role {
    font-size: 0.7rem;
}

.team-info .dept {
    font-size: 0.64rem;
}

/* Coordinador single card stays compact too */
.team-grid[style*="grid-template-columns: 1fr"] {
    max-width: 100% !important;
}

/* ============================================
   SERVICES — Icon + text rows (app-style)
============================================ */
.services {
    padding-top: 48px;
}

.services .section-header {
    text-align: left;
}

.services-grid {
    gap: 10px !important;
}

.service-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    padding: 18px 16px;
    border-radius: 16px;
    gap: 14px;
    background: var(--gray-50);
}

.service-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    margin: 0;
    border-radius: 14px;
}

.service-card h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.service-card p {
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ============================================
   CONTACT — Clean stacked app cards
============================================ */
.contact {
    padding-top: 48px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.contact-grid {
    gap: 28px;
}

.contact-info h2 {
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.contact-info > p {
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.contact-items {
    gap: 8px;
}

.contact-item {
    border: none;
    background: var(--white);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    padding: 14px;
    gap: 12px;
}

.contact-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.contact-item h4 { font-size: 0.8rem; }
.contact-item p { font-size: 0.78rem; }

.contact-map {
    border-radius: 16px;
    min-height: 220px;
}

.contact-map iframe {
    min-height: 220px;
}

/* ============================================
   FOOTER — Minimal app footer
============================================ */
.footer {
    padding: 40px 0 calc(80px + env(safe-area-inset-bottom, 0px));
}

.footer-top {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.footer-brand img { height: 36px; }
.footer-brand p { font-size: 0.8rem; }

.footer h4 { font-size: 0.8rem; margin-bottom: 10px; }

.footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
}

.footer-links a {
    font-size: 0.78rem;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    display: inline-block;
}

.footer-links a:hover {
    padding-left: 12px;
    background: rgba(200, 50, 110, 0.15);
}

.footer-bottom {
    font-size: 0.7rem;
    gap: 2px;
    opacity: 0.6;
}

/* ============================================
   BACK TO TOP — Adapt for bottom nav
============================================ */
.back-to-top {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 42px;
    height: 42px;
}

/* ============================================
   SCROLL INDICATOR for swipeable sections
============================================ */
.research-grid::after,
.lab-gallery::after {
    content: '';
    flex: 0 0 4px;
}

/* Active tab icon coloring */
.nav-links li:nth-child(1) a.is-active::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23c8326e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E"); }
.nav-links li:nth-child(2) a.is-active::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23c8326e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='16' x2='12' y2='12'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E"); }
.nav-links li:nth-child(3) a.is-active::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23c8326e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); }
.nav-links li:nth-child(4) a.is-active::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23c8326e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='13 2 3 14 12 14 11 22 21 10 12 10 13 2'/%3E%3C/svg%3E"); }
.nav-links li:nth-child(5) a.is-active::before { content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23c8326e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
