:root {
    --red: #b11226;
    --dark: #222;
    --light: #f9f5ee;
    --gray: #666;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}
body {
    font-family: 'Montserrat', sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #faf7f2;
    padding-top: 0px;
}
.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}
/* HEADER & NAV */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    z-index: 999;
    box-shadow: none;
    transition: background 0.45s ease, box-shadow 0.45s ease;
}
header.scrolled {
    background: #fdfbf8;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
}
.header-inner {
    height: 90px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo img {
    height: 60px;
    display: block;
}
nav ul {
    display: flex;
    gap: 30px;
    list-style: none;
}
nav a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.3px;
    transition: color 0.3s;
}
nav a:hover {
    color: var(--red);
}
.lang {
    display: flex;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
}
body [lang="ca"], body [lang="es"] {
    display: none;
}

html[data-lang="ca"] body [lang="ca"] {
    display: revert;
}

html[data-lang="es"] body [lang="es"] {
    display: revert;
}
.lang span {
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}
.lang span.active {
    color: var(--red);
}
/* MENU MÓVIL */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
}
.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--dark);
    transition: 0.3s;
}
/* HERO SECTION */
.hero {
    min-height: 100vh;
    background: linear-gradient(rgba(255,255,255,.15), rgba(255,255,255,.15)), url('images/cendros5.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 90px;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(to bottom, 
                rgba(255,255,255,0.45) 0%, 
                rgba(255,255,255,0.18) 50%, 
                rgba(255,255,255,0) 100%);
    z-index: 1;
    pointer-events: none; 
}
.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
                rgba(255,255,255,0.27) 0%,
                rgba(255,255,255,0.15) 45%,
                rgba(255,255,255,0.04) 75%,
                rgba(255,255,255,0) 90%);
    z-index: 1;
    pointer-events: none;
}
.hero-content {
    max-width: 650px;
    padding: 40px;
    position: relative;
    z-index: 2;
}
.hero h1 {
    font-size: 52px;
    line-height: 1.1;
    margin-bottom: 20px;
    font-weight: 800;
    color: #111;
}
.hero h1 span {
    color: var(--red);
}
.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    color: #1c1c1c;
    font-weight: 500;
}
.buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.btn {
    padding: 15px 30px;
    text-decoration: none;
    font-weight: 700;
    border-radius: 4px;
    display: inline-block;
    transition: all 0.3s;
    text-align: center;
    border: 2px solid transparent;
    cursor: pointer;
}
.btn-red {
    background: var(--red);
    color: white;
}
.btn-red:hover {
    background: #8e0e1e;
}
.btn-outline {
    border: 2px solid var(--dark);
    color: var(--dark);
    background: transparent;
}
.btn-outline:hover {
    background: var(--dark);
    color: white;
}
/* QUI SOM */
.about {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}
.about-inner {
    display: flex;
    justify-content: center;
}

.about-text {
    max-width: 750px;
    text-align: center;
}

.about-text .section-tag {
    text-align: center;
}
.section-tag {
    color: var(--red);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    font-size: 14px;
    letter-spacing: 1px;
}
.about h2 {
    font-size: 42px;
    line-height: 1.2;
    margin-bottom: 25px;
    color: var(--dark);
}
.about p {
    font-size: 17px;
    color: #555;
    margin-bottom: 20px;
}

/* SERVEIS */
.services {
    background: var(--light);
    padding: 100px 0;
    text-align: center;
}
.services h2 {
    font-size: 38px;
    margin-bottom: 50px;
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 30px;
}

.service {
    background: none;
    padding: 10px;
    transition: transform 0.3s;
}

.service:hover {
    transform: translateY(-5px);
}

.service-icon {
    width: 44px;
    height: 44px;
    color: var(--red);
    margin: 0 auto 18px;
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dark);
}
/* PROJECTES */
.projects {
    padding: 100px 0;
}
.projects h2 {
    font-size: 38px;
    margin-bottom: 50px;
    text-align: center;
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.project-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}
.project-card-image {
    height: 260px;
    overflow: hidden;
}
.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.project-card:hover .project-card-image img {
    transform: scale(1.05);
}
.project-card-content {
    padding: 28px 24px;
}
.project-card-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark);
}
.project-card-content p {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}
/* Responsive */
@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* CONTACTE */
.contact {
    background: white;
    border-top: 1px solid #eee;
}
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
}
.contact-info {
    background: var(--red);
    color: white;
    padding: 80px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.contact-info h2 {
    font-size: 36px;
    margin-bottom: 30px;
}
.contact-detail {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    font-size: 16px;
}

.contact-detail a {
    color: inherit;
    text-decoration: none;
}

.contact-detail a:hover {
    text-decoration: underline;
}
.contact-detail span {
    font-size: 20px;
}
.contact-form {
    padding: 80px 50px;
    background: #fff;
}
.form-group-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
input, textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    margin-bottom: 20px;
    font-family: inherit;
    font-size: 15px;
    border-radius: 4px;
    outline: none;
}
input:focus, textarea:focus {
    border-color: var(--red);
}
textarea {
    min-height: 140px;
    resize: vertical;
}
.legal-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--gray);
}
.legal-checkbox input {
    width: auto;
    margin-top: 4px;
}
.legal-checkbox a {
    color: var(--red);
    text-decoration: none;
}
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
/* FOOTER */
footer {
    background: #14181d;
    color: #ccc;
    padding: 40px 0;
    font-size: 14px;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}
.footer-links {
    display: flex;
    gap: 25px;
}
.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}
.footer-links a:hover {
    color: white;
}
/* MODAL LEGAL */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}
/* RESPONSIVE */
@media (max-width: 992px) {
    body {
        padding-top: 80px;
    }
    .header-inner {
        height: 80px;
    }
    .hero h1 {
        font-size: 40px;
    }
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .project-wrapper {
        grid-template-columns: 1fr;
    }
    .project-image {
        min-height: 300px;
    }
    .contact-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    nav {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        padding: 20px 0;
    }
    nav.active {
        display: block;
    }
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }
.about-text { text-align: center; }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-group-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .project-text, .contact-info, .contact-form {
        padding: 40px 20px;
    }
    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}
/* Estils que abans estaven definits directament a l'HTML */
.section-tag-centered {
    text-align: center;
}
.modal-title {
    margin-bottom: 15px;
    font-size: 24px;
}
.modal-text {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease, background 0.3s ease;
}
#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}
#back-to-top:hover {
    background: #8e0e1e;
    transform: translateY(-3px);
}
/* Popup Cookies */
.cookie-popup {
    position: fixed;
    bottom: 30px;
    left: 30px;
    max-width: 420px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 24px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s ease;
}
.cookie-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.cookie-content p {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 18px;
}
.cookie-content a {
    color: var(--red);
    text-decoration: none;
    font-weight: 600;
}
.cookie-content a:hover {
    text-decoration: underline;
}
.cookie-content .btn {
    padding: 10px 24px;
    font-size: 14px;
}
@media (max-width: 480px) {
    .cookie-popup {
        left: 15px;
        right: 15px;
        bottom: 20px;
        max-width: none;
    }
}
#preloader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

/*Rueda Carga*/

#preloader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #eee;
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
