/* =========================================
   Common Styles (Reset, Typography, Utilities)
   ========================================= */


/* ---- Reset & Base ---- */
* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scroll-padding-top: var(--header-height);
    overflow-x: hidden;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-kanit);
    display: flex;
    flex-direction: column;
    /* Destellos Circulares (Focused glows) */
    background-image:
        radial-gradient(500px circle at 15% 20%, rgba(var(--color-primary-rgb), 0.12) 0%, rgba(var(--color-primary-rgb), 0.05) 50%, transparent 80%),
        radial-gradient(400px circle at 85% 45%, rgba(var(--color-secondary-rgb), 0.1) 0%, rgba(var(--color-secondary-rgb), 0.04) 50%, transparent 70%),
        radial-gradient(600px circle at 25% 75%, rgba(var(--color-primary-rgb), 0.08) 0%, rgba(var(--color-primary-rgb), 0.03) 50%, transparent 80%),
        radial-gradient(450px circle at 75% 90%, rgba(var(--color-secondary-rgb), 0.1) 0%, rgba(var(--color-secondary-rgb), 0.04) 50%, transparent 70%);
    background-attachment: fixed;
    background-repeat: no-repeat;
    overflow-x: hidden;
    width: 100%;
}

/* Fix: background-attachment: fixed causes severe jank on iOS Safari */
@media (max-width: 1024px) {
    body {
        background-attachment: scroll;
    }
}

p,
button,
.nav__item,
.nav__subitem {
    font-size: 18px;
    line-height: 1.6;
}

/* ---- Accessibility: Focus & Skip Link ---- */
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 10px 15px;
    z-index: 10000;
    transition: top 0.3s ease;
    border-radius: 0 0 8px 8px;
    font-weight: 500;
    text-decoration: none;
}

.skip-link:focus-visible {
    top: 0;
    outline: 3px solid var(--color-white);
    outline-offset: 2px;
}

/* Global focus-visible for keyboard navigation */
*:focus-visible {
    outline: 3px solid var(--color-primary-hover);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Remove default focus when not navigating by keyboard */
:focus:not(:focus-visible) {
    outline: none;
}

/* ---- Typography ---- */
h1 {
    font-size: 4rem;
}

h2 {
    font-size: 2.1rem;
}

h3 {
    font-size: 1.4rem;
}

/* Responsive Typography */
@media (max-width: 1010px) {
    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 1.9rem;
        text-align: center;
    }
}

@media (max-width: 800px) {

    p,
    button,
    .nav__item,
    .nav__subitem {
        font-size: 1.1rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.2rem;
    }
}

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

    h3 {
        font-size: 19px;
    }

    p,
    button,
    .nav__item,
    .nav__subitem {
        font-size: 1rem;
    }
}

/* ---- Layout Utilities ---- */
.main {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.main--padding {
    padding: 1rem 3rem;
}

@media (max-width: 600px) {
    .main--padding {
        padding: 1rem 1.5rem;
    }
}

/* ---- Component: Section Title ---- */
.section-title {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.section-title h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    padding-bottom: 15px;

    /* Text Styling - Match About/Index styles */
    color: var(--text-dark);
    font-family: var(--font-goldman);
    font-size: 1.8rem;
    letter-spacing: 0.1rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}

/* Adaptive colors for dark sections */
#nuestra-mision .section-title h2,
#nuestro-equipo .section-title h2,
#exoesqueletos .motus-r__description-card__title {
    color: var(--color-white);
    font-weight: 700;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 2px;
}

.section-title i {
    color: var(--color-primary);
    margin-right: 10px;
}

@media (max-width: 500px) {
    .section-title h2 {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .section-title i {
        margin-right: 0;
        margin-bottom: 0.2rem;
    }
}

/* ---- Component: Buttons ---- */
.btn {
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-family: var(--font-kanit);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
    display: inline-block;
    cursor: pointer;
    border: none;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb), 0.4);
    border: 1px solid var(--color-primary-light);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(var(--color-primary-rgb), 0.5);
}

.btn--secondary {
    background: transparent;
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn--secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    border-color: var(--color-white);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

/* ---- Component: Cards (Base) ---- */
.card-base {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-base:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glass);
    background: rgba(255, 255, 255, 0.1);
}

/* ---- Component: Helpers ---- */
.highlight-text {
    color: var(--color-primary);
    font-weight: 600;
}

.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
    visibility: hidden;
}

.show {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* ---- Animations ---- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Content (Shared Structure) */
.hero-section {
    background-color: var(--color-dark-bg);
    background-image: radial-gradient(circle at 50% 50%, rgba(var(--color-primary-rgb), 0.15) 0%, rgba(var(--color-dark-bg-rgb), 1) 90%);
    display: flex;
    position: relative;
    width: 100%;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: visible;
    z-index: 12;
}

/* ---- Homepage Hero Content — left-aligned, no glass card ---- */
.hero-content {
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 6rem;
    max-width: 900px;
    width: 100%;
    animation: fadeIn 1s ease-out forwards;
}

/* Badge pill — replaces subtitle */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(var(--color-primary-rgb), 0.15);
    border: 1px solid rgba(var(--color-primary-rgb), 0.35);
    border-radius: 999px;
    padding: 0.4rem 1rem;
    margin-bottom: 1.75rem;
    animation: slideDown 0.9s ease-out 0.15s forwards;
    opacity: 0;
}

.hero-badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-primary-light);
    box-shadow: 0 0 8px rgba(var(--color-primary-rgb), 0.8);
    flex-shrink: 0;
}

.hero-badge__text {
    font-family: var(--font-kanit);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(var(--color-white-rgb), 0.8);
    text-transform: uppercase;
}

/* Legacy subtitle (used by about-hero and other pages) */
.hero-subtitle {
    font-family: var(--font-goldman);
    font-size: 1rem;
    letter-spacing: 0.3em;
    color: var(--color-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    animation: slideDown 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-title {
    font-family: var(--font-goldman);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.1;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--color-white);
    letter-spacing: -2px;
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards;
    opacity: 0;
}

.hero-description {
    font-family: var(--font-kanit);
    font-size: 1.15rem;
    color: rgba(var(--color-white-rgb), 0.65);
    margin-bottom: 2.75rem;
    max-width: 520px;
    font-weight: 300;
    line-height: 1.7;
    animation: fadeInUp 1s ease-out 0.4s forwards;
    opacity: 0;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.55s forwards;
    opacity: 0;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.scroll-indicator:hover {
    opacity: 0.9;
}

.mouse {
    width: 24px;
    height: 40px;
    border: 1.5px solid rgba(var(--color-white-rgb), 0.6);
    border-radius: 20px;
    position: relative;
    flex-shrink: 0;
}

.wheel {
    width: 3px;
    height: 7px;
    background: rgba(var(--color-white-rgb), 0.8);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

.arrow-scroll {
    display: none;
}

.scroll-indicator__label {
    font-family: var(--font-kanit);
    font-size: 0.75rem;
    color: rgba(var(--color-white-rgb), 0.5);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 400;
}

/* --- Responsive Hero --- */
@media (max-width: 1024px) {
    .hero-content {
        padding: 0 3rem;
        max-width: 100%;
    }

    .hero-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }
}

@media (max-width: 768px) {
    .hero-content {
        padding: 0 1.75rem;
        align-items: center;
        text-align: center;
    }

    .hero-description {
        max-width: 100%;
    }

    .scroll-indicator {
        bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        letter-spacing: -1px;
        margin: 1rem 0 1.5rem 0;
    }

    .hero-badge {
        margin-bottom: 1.25rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        align-items: stretch;
    }

    .hero-actions .btn {
        text-align: center;
    }
}

/* About Us Section (Shared) */
.main__about-us {
    position: relative;
    overflow: hidden;
    background: transparent;
    padding: 6rem 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    z-index: 10;
    transform: translateZ(0);
    will-change: transform;
}

.about-us__container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    gap: 4rem;
    max-width: 1400px;
    width: 100%;
}

.about-us__content {
    flex: 1;
    background: rgba(var(--color-white-rgb), 0.95);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    box-shadow: var(--shadow-glass);
    border-radius: 24px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.8s ease;
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
}

.about-us__content.hidden {
    opacity: 0;
    transform: translateY(30px);
}

.about-us__content.show {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.8s forwards;
}

.about-us__content:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(76, 33, 70, 0.15);
}

.main__about-us__title {
    font-family: var(--font-goldman);
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.main__about-us__title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 2px;
}

.main__about-us__description {
    font-family: var(--font-kanit);
    font-size: 1.15rem;
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.about-us-btn {
    align-self: flex-start;
    margin-top: 1rem;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(137, 74, 129, 0.3);
}

/* Carousel Section */
.carousel-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateX(30px);
    transition: all 1s ease;
    will-change: transform, opacity;
}

.carousel-container.show {
    opacity: 1;
    transform: translateX(0);
}

.carousel {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 500px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--glass-border-opaque);
    background-color: var(--color-white);
    transform: translateZ(0);
}

.carousel-inner {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-item {
    min-width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 6s ease;
    will-change: transform;
}

.carousel-item.active:hover img {
    transform: scale(1.05);
}

.carousel-caption {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-family: var(--font-goldman);
    font-size: 1.2rem;
    letter-spacing: 1px;
    text-align: center;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s ease 0.3s;
}

.carousel-item.active .carousel-caption {
    opacity: 1;
    transform: translateY(0);
}

.carousel-caption {
    opacity: 1;
    transform: translateY(0);
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 1.2rem;
}

.carousel-control:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--bg-color-btn);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.carousel-control.prev {
    left: 20px;
}

.carousel-control.next {
    right: 20px;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.carousel-indicators button.active {
    background: white;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@media (max-width: 1100px) {
    .main__about-us {
        padding: 4rem 2rem;
        flex-direction: column;
    }

    .about-us__container {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .about-us__content {
        width: 100%;
        text-align: center;
        align-items: center;
        padding: 2.5rem 2rem;
    }

    .main__about-us__title::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .about-us-btn {
        align-self: center;
    }

    .carousel-container {
        width: 100%;
    }

    .carousel {
        height: 400px;
        max-width: 700px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .main__about-us {
        padding: 3rem 1.5rem;
    }

    .about-us__content {
        padding: 2rem 1.5rem;
    }

    .main__about-us__title {
        font-size: 1.8rem;
    }

    .carousel {
        height: 300px;
    }

    .about-us-btn {
        align-self: center;
    }

    .carousel-control {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Animations (Missing in Common) */
@keyframes scrollWheel {
    0% {
        top: 8px;
        opacity: 1;
    }

    100% {
        top: 25px;
        opacity: 0;
    }
}

@keyframes scrollArrow {
    0% {
        opacity: 0;
        transform: rotate(45deg) translate(-5px, -5px);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: rotate(45deg) translate(5px, 5px);
    }
}

@keyframes floatBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, 50px) scale(1.1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* ---- Loader ---- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-body);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    flex-direction: column;
    gap: 20px;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#loader img {
    width: 200px;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(var(--color-secondary-rgb), 0));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 10px var(--color-primary));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(var(--color-secondary-rgb), 0));
    }
}

.loader-progress-container {
    width: 250px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.loader-progress {
    height: 100%;
    background-color: var(--color-primary);
    width: 0%;
    animation: loadProgress 0.6s ease-out forwards;
}

@keyframes loadProgress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}