/* Base Styles */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #ffffff;
    --color-bg-secondary: #f7f7f7;
    --color-bg-dark: #181818;
    --color-text: #181818;
    --color-primary: #ED1C24;
    --color-primary-hover: #BF0006;
    --color-secondary: #58585A;
    --color-secondary-hover: #181818;
    --color-accent: #F2F2F2;
    --color-accent-hover: #A9A9A9;
    --color-border: #ED1C24;
    --color-border-hover: #BF0006;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-shadow: rgba(204, 0, 0, 0.1);
    --color-shadow-hover: rgba(0, 0, 0, 0.2);

    --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --max-width: 1200px;
}

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

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

header {
    background-color: var(--color-bg-secondary);
}

section {
    padding: 4rem 0;
}


/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 {
    font-size: clamp(1.8rem, 2.5vw, 2.5rem);
}

h2 {
    font-size: clamp(1.6rem, 2.2vw, 2.1rem);
}

h3 {
    font-size: clamp(1.4rem, 1.9vw, 1.8rem);
}

h4 {
    font-size: clamp(1.2rem, 1.6vw, 1.5rem);
}

h5 {
    font-size: clamp(1.05rem, 1.3vw, 1.25rem);
}

h6 {
    font-size: clamp(1rem, 1.1vw, 1.1rem);
}

p {
    margin-bottom: 1em;
}

a,
button,
input,
textarea,
select {
    transition: background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}

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

a:hover {
    text-decoration: none;
}

/* Lists */
ul,
ol {
    margin-left: 2em;
    margin-bottom: 1em;
}

li {
    margin-bottom: 0.5em;
}

/* Forms */
input,
textarea,
select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5em;
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-shadow);
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5em 1em;
    border: none;
    border-radius: 4px;
    background-color: var(--color-primary);
    color: var(--color-white);
    cursor: pointer;
}

button:hover {
    background-color: var(--color-primary-hover);
}

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

/* Utilities */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.col {
    flex: 1;
}

/* Boton volver arriba */

#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;

    width: 45px;
    height: 45px;

    background: #e11d2e;
    color: white;
    border: none;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);

    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;

    transition: opacity 0.35s ease, transform 0.35s ease;
}

#scrollTopBtn:hover {
    background: #c91524;
    transform: translateY(-3px);
}

#scrollTopBtn.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#scrollTopBtn i {
    color: white;
}

#scrollTopBtn:hover i {
    transform: translateY(-2px);
}

/* ======================================================
    ESTILOS
====================================================== */

/* ======================================================
    HEADER - NAVEGACIÓN
====================================================== */


.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo {
    height: 60px;
    cursor: pointer;
}

.header-logo:hover {
    opacity: 0.9;
}

.navbar {
    display: flex;
    gap: 2rem;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    text-decoration: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links li {
    display: flex;
    align-items: center;
    margin: 0;

}

.active {
    color: var(--color-primary);
    font-weight: 600;
}

.nav-link {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}

.nav-link::after {
    content: "";
    display: block;
    width: 0%;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--color-primary);
    font-weight: 600;
}

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

.header-cta {
    color: var(--color-primary);
    font-weight: 500;
}

.header-cta:hover {
    color: var(--color-secondary-hover);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-primary);
}
.menu-toggle:hover {
    color: var(--color-primary-hover);
}
.menu-toggle:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    color: var(--color-white);
}


/*  ======================================================
HERO 
====================================================== */

.hero {
    height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;

    padding: 4rem 4rem;

    position: relative;
    overflow: hidden;
}

/* imagen blur */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;

    background-image: url('../img/takemec-mecanizados-CNC.webp');
    background-size: cover;
    background-position: center;

    filter: blur(5px);
    transform: scale(1.1);

    animation: heroZoom 12s ease-out forwards;

    z-index: -2;
}

@keyframes heroZoom {
    from {
        transform: scale(1.2);
    }

    to {
        transform: scale(1.1);
    }
}

/* Overlay oscuro */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: -1;
}

.hero-content {
    padding: 2rem;
    border-radius: 8px;
    max-width: 900px;
    position: relative;
    z-index: 1;
}

.hero-content img {
    height: 150px;
    margin-bottom: 1rem;
    opacity: 0.6;

    animation: fadeUp 0.8s ease forwards;
}

.hero-content h1 {
    font-size: 6rem;
    margin-bottom: 1rem;

    background: linear-gradient(90deg,
            var(--color-primary) 0%,
            var(--color-primary) 40%,
            #ffffff 50%,
            var(--color-primary) 60%,
            var(--color-primary) 100%);

    background-size: 200% 100%;

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;

    animation: shine 2s ease forwards;
}

@keyframes shine {
    from {
        background-position: -100% 0;
    }

    to {
        background-position: 100% 0;
    }
}


.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;

    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);

    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.hero-cta {
    display: inline-block;
    padding: 0.9rem 1.8rem;

    background: var(--color-primary);
    color: white;

    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;

    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);

    transition: transform 0.25s ease, background 0.25s ease;

    transform: translateY(10px);

    animation: fadeUpCTA 0.8s ease forwards;
    animation-delay: 0.6s;

    opacity: 0;
}

.hero-cta:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.35);
}

@keyframes fadeUpCTA {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* ======================================================
ABOUT
====================================================== */

.about-us {
    background-color: var(--color-bg-secondary);
    padding: 4rem;
}

.about-container {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.about-content {
    flex: 0 0 55%;
}

.about-content h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    position: relative;
}

.about-content h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    margin-top: 12px;
    background: var(--color-primary);
}

.about-content p {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--color-text);
    max-width: 600px;
}

.about-content p span {
    color: var(--color-primary);
    font-weight: 600;
}

.about-img-container {
    flex: 0 0 45%;
    display: flex;
    align-items: center;
}

.about-img-container img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* ======================================================
PRODUCTS
====================================================== */

.products {
    padding: 4rem 0;
}

.products-container {
    text-align: center;
}

.products-container h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    position: relative;
}

.products-container h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    margin: 12px auto 0;
    background: var(--color-primary);
}

.product-cards-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.carousel {
    position: relative;
    margin-top: 4rem;
    margin-bottom: 4rem;
    overflow: visible;
}

.carousel-viewport {
    overflow: hidden;
    padding: 5rem 2rem 3rem;
}

.carousel-track {
    display: flex;
    gap: 2rem;
    transition: transform 0.6s ease;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-radius: 6px;
    z-index: 10;
    transition: background 0.3s ease, transform 0.2s ease;
}

.carousel-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: -60px;
}

.carousel-btn.next {
    right: -60px;
}

/* Cards */

.product-card {
    position: relative;
    flex: 0 0 calc((100% - 6rem) / 4);
    background: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform .35s ease, box-shadow .35s ease;
    transform-origin: center;
}

.product-card:hover {
    transform: translateY(-6px) scale(1.2);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

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

/* -------------- */

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.7rem 1rem;
    cursor: pointer;
    border-radius: 6px;
    z-index: 2;
}

.carousel-btn.prev {
    left: -50px;
}

.carousel-btn.next {
    right: -50px;
}

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

/* ======================================================
TECNOLOGIES
====================================================== */

.technologies {
    position: relative;
    background: var(--color-bg-secondary);
    padding: 4rem 0;
    overflow: hidden;
    z-index: 0;
}

.technologies::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    background: url("../img/takemec-mecanizado-CNC-300x300.png") no-repeat center;
    background-size: contain;
    opacity: 0.08;
    transform: translate(-50%, -50%) rotate(-15deg);
    pointer-events: none;
    filter: blur(2px);
    z-index: -1;
}

.technologies-container {
    max-width: var(--max-width);
    margin: auto;
}

.technologies-content {
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
    text-align: center;
}

.technologies-content h2 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    position: relative;
}

.technologies-content h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    margin: 12px auto 0;
    background: var(--color-primary);
}

.technologies-content p {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--color-text);
    max-width: 600px;
    margin: 0 auto;
}

/* GRID - CARD CONTAINER */

.technologies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

/* CARDS */

.technology-card {
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    min-height: 300px;
    overflow: hidden;
    transition: transform .35s ease, box-shadow .35s ease;
    z-index: 2;
}

.technology-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.25);
    z-index: 3;
}

.technology-img-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.technology-img-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: scale(1.2);
}

.technology-card h3 {
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);

    height: 90px;
    /* Para mantener altura constante y evitar salto al mostrar el underline */
    position: relative;
}

.technology-card h3::before {
    content: "";
    display: block;
    width: 20%;
    height: 3px;
    background: var(--color-primary);
    margin: 0 auto 10px auto;
    transition: width .40s ease;

}

.technology-card:hover h3::before {
    width: 100%;
}

.technology-card p {
    padding: 0 1rem 1rem 1rem;
    font-size: 0.95rem;
    color: var(--color-secondary);
}

/* ======================================================
CONTACT
====================================================== */

.contact {
    padding: 4rem 1rem;
    background: var(--color-bg);
}

.contact h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    position: relative;
}

.contact h2::after {
    content: "";
    display: block;
    width: 70px;
    height: 4px;
    background: var(--color-primary);
    margin: 15px auto 0;
}

.contact-container {
    max-width: 1200px;
    margin: auto;
    display: flex;
    gap: 50px;
    flex-wrap: wrap;
    align-items: stretch;
}

.map-container {
    flex: 1 1 500px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border: none;
    filter: grayscale(30%) contrast(105%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.info-container {
    flex: 1 1 400px;
    background: white;
    padding: 40px;
    border-left: 6px solid var(--color-primary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.info-container h5 {
    margin-bottom: 30px;
    font-weight: 600;
}

.info-container ul {
    list-style: none;
    padding: 0;
}

.info-container li {
    margin-bottom: 20px;
    font-weight: 500;
}

.info-container li i {
    color: var(--color-primary);
    margin-right: 10px;
}

.btn-contact {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--color-primary);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

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

/* =======================================
    FOOTER
==========================================*/

.footer {
    background: var(--color-secondary);
    padding: 3rem 4rem 2rem;
}

.footer::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--color-primary);
    margin-bottom: 3rem;
}

.footer-body {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.footer-col h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
}

.identity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-logo {
    height: 100px;
}

.identity p {
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--color-accent);
    max-width: 280px;
}

.footer-nav {
    text-align: left;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 0.6rem;
}

.footer-nav a {
    color: var(--color-accent);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.footer-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 1px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

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

.footer-nav a::after {
    background: var(--color-primary);
}

.footer-nav a:hover::after {
    width: 100%;
}

.footer-contact {
    color: var(--color-accent);
    text-align: left;
}

.footer-contact ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    margin-bottom: 0.6rem;
}

.footer-contact li strong {
    color: var(--color-accent);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 0.9rem;
}

.footer-bottom p {
    color: var(--color-accent-hover)
}

.footer-bottom p a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-bottom p a:hover {
    color: var(--color-primary-hover);
}

/* ======================================================
RESPONSIVE
====================================================== */

/* =============================
TABLET GRANDE / LAPTOP
============================= */

@media (max-width: 1200px) {

    .hero-content h1 {
        font-size: 4.5rem;
    }

    .about-container {
        gap: 2rem;
    }

    .product-card {
        flex: 0 0 calc((100% - 4rem) / 3);
    }

    .carousel-btn.prev {
        left: -30px;
    }

    .carousel-btn.next {
        right: -30px;
    }

    .footer-body {
        grid-template-columns: 1fr 1fr;
    }

}


/* =============================
TABLET
============================= */

@media (max-width: 992px) {

    section {
        padding: 3rem 0;
    }

    .header {
        padding: 1rem;
    }

    .navbar {
        gap: 1rem;
    }

    .hero {
        padding: 3rem 2rem;
    }

    .hero-content h1 {
        font-size: 3.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
    }

    .about-content {
        flex: 1;
    }

    .about-img-container {
        flex: 1;
        width: 100%;
    }

    .about-content p {
        margin: auto;
    }

    .product-card {
        flex: 0 0 calc((100% - 2rem) / 2);
    }

    .carousel-btn {
        display: none;
    }

    .technologies-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-container {
        flex-direction: column;
    }

    .info-container {
        border-left: none;
        border-top: 6px solid var(--color-primary);
    }

    .footer-body {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .identity {
        align-items: center;
    }

}


/* =============================
MOBILE
============================= */

@media (max-width: 768px) {

    html {
        font-size: 15px;
    }

    .header {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
    }

    .menu-toggle {
        display: block;
    }

    .header-cta {
        display: none;
    }

    .navbar {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--color-white);

        max-height: 0;
        overflow: hidden;

        transition: max-height .35s ease;
    }

    .navbar.open {
        max-height: 300px;
    }

    .nav-links {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;

        align-items: center;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .hero {
        padding: 2rem;
        height: auto;
        min-height: 90vh;
    }

    .hero-content h1 {
        font-size: 2.7rem;
    }

    .hero-content img {
        height: 100px;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .about-us {
        padding: 3rem 1.5rem;
    }

    .about-content h2 {
        font-size: 2rem;
    }

    .products-container h2,
    .technologies-content h2,
    .contact h2 {
        font-size: 2rem;
    }

    .carousel-track {
        scroll-snap-type: x mandatory;
        gap: 1rem;
    }

    .product-card {
        flex: 0 0 80%;
        scroll-snap-align: center;
    }
    
    .product-card:hover,
    .product-card:active {
        transform: none;
    }

    .carousel-viewport {
        padding: 3rem 1rem;
    }

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

    .technology-card {
        min-height: auto;
    }

    .contact {
        padding: 3rem 1rem;
    }

    .info-container {
        padding: 25px;
    }

    .footer {
        padding: 2rem 1.5rem;
    }

    .footer-logo {
        height: 80px;
    }

}


/* =============================
MOBILE CHICO
============================= */

@media (max-width: 480px) {

    html {
        font-size: 14px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content img {
        height: 80px;
    }

    .hero-cta {
        width: 100%;
        text-align: center;
    }

    .about-content h2 {
        font-size: 1.7rem;
    }

    .products-container h2,
    .technologies-content h2,
    .contact h2 {
        font-size: 1.7rem;
    }

    .footer-logo {
        height: 70px;
    }

    #scrollTopBtn {
        right: 15px;
        bottom: 15px;
    }

}