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

:root {
    --primary-color: #000000;
    --secondary-color: #ede8e3;
    --text-color: #000000;
    --accent-color: #8b7d6b;
    --page-padding: 40px;
    --cursor-default: url('assets/cursor-proyectos.svg') 3 1, auto;
    --cursor-pointer: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    cursor: var(--cursor-default);
}

a,
button,
.menu-toggle,
.language-selector .lang,
.menu-item,
.menu-social-link,
.service-card,
.related-card,
.modal-close,
.modal-cta,
.modal-links a,
.footer-link,
.footer-right .social-icon,
.instagram-section a {
    cursor: var(--cursor-pointer);
}

/* Barra superior sticky */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 120px;
    background-color: var(--secondary-color);
    z-index: 999;
}

/* Logo */
.logo-container {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 1000;
}

.logo {
    width: 60px;
    height: auto;
}

.logo-container a {
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
}

/* Top right menu (idioma + hamburguesa) */
.top-right-menu {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 30px;
}

/* Selector de idioma */
.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.language-selector .lang {
    color: var(--primary-color);
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
    transition: opacity 0.3s ease;
    opacity: 0.4;
}

.language-selector .lang:hover {
    opacity: 0.7;
}

.language-selector .lang.active {
    opacity: 1;
    font-weight: 400;
}

.language-selector .separator {
    color: var(--primary-color);
    opacity: 0.4;
    user-select: none;
}

/* Botón menú hamburguesa */
.menu-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity 0.3s ease;
}

.menu-toggle:hover {
    opacity: 0.6;
}

.menu-toggle .line {
    width: 24px;
    height: 2px;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

/* Contenedor de servicios */
.services-container {
    width: 100%;
    padding: 140px var(--page-padding) 100px var(--page-padding);
}

/* Header de servicios */
.services-header {
    margin-bottom: 60px;
    text-align: left;
}

.page-title {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 0;
    opacity: 0.8;
}

/* Estadísticas */
.stats-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    margin-top: 60px;
    padding: 60px 0 20px 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.stat-number {
    font-size: 4rem;
    font-weight: 300;
    letter-spacing: -0.02em;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    opacity: 0.6;
    text-transform: uppercase;
    text-align: center;
}

.stat-divider {
    width: 1px;
    height: 60px;
    background-color: var(--primary-color);
    opacity: 0.15;
}

/* Sección FAQ */
.faq-section {
    margin-top: 120px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.faq-title {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 40px;
    opacity: 0.8;
    text-align: center;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 15px;
    margin-bottom: 0;
}

.faq-question {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--primary-color);
    letter-spacing: 0.5px;
    margin-bottom: 0;
    line-height: 1.4;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    transition: opacity 0.3s ease;
}

.faq-question:hover {
    opacity: 0.7;
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary-color);
    opacity: 0.5;
    transition: transform 0.3s ease, opacity 0.3s ease;
    flex-shrink: 0;
    margin-left: 20px;
}

.faq-item.active .faq-question::after {
    transform: rotate(45deg);
    opacity: 0.8;
}

.faq-answer {
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--primary-color);
    opacity: 0.7;
    line-height: 1.8;
    letter-spacing: 0.3px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
    padding: 0;
    opacity: 0;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding-top: 10px;
    opacity: 0.7;
}

/* Grid de servicios */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

/* Card de servicio */
.service-card {
    position: relative;
    height: 500px;
    overflow: hidden;
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover .card-image {
    transform: scale(1.05);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 70%, transparent 100%);
    color: white;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-number {
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 0.7;
}

.card-title {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0;
}

.card-subtitle {
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.8;
    margin: 0;
}

/* Modal */
.service-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 5vw, 60px);
    cursor: default;
}

.service-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
    z-index: 3001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

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

.close-line {
    position: absolute;
    width: 30px;
    height: 2px;
    background-color: white;
}

.close-line:first-child {
    transform: rotate(45deg);
}

.close-line:last-child {
    transform: rotate(-45deg);
}

.modal-content {
    max-width: 1200px;
    width: calc(100% - clamp(40px, 10vw, 120px));
    background-color: var(--secondary-color);
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 18px;
    transform: translateY(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-image-container {
    height: 100%;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.modal-details {
    padding: 60px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.modal-number {
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 0.5;
    text-transform: uppercase;
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    color: var(--primary-color);
    line-height: 1.2;
    margin: 0;
}

.modal-description {
    font-size: 1rem;
    font-weight: 300;
    color: var(--primary-color);
    opacity: 0.8;
    line-height: 1.9;
    margin: 0;
}

.modal-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.modal-features li {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--primary-color);
    opacity: 0.7;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
}

.modal-features li::before {
    content: "—";
    position: absolute;
    left: 0;
    opacity: 0.5;
}

.modal-cta {
    display: inline-block;
    padding: 16px 40px;
    background-color: var(--primary-color);
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
    margin-top: auto;
    align-self: flex-start;
}

.modal-cta:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.modal-details::-webkit-scrollbar {
    width: 6px;
}

.modal-details::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.modal-details::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
}

/* Bottom sheet helper */
.service-modal.sheet .modal-content {
    border-radius: 32px 32px 0 0;
}

.service-modal.sheet .modal-image-container {
    border-radius: 32px 32px 0 0;
    overflow: hidden;
}

/* Menú hamburguesa desplegable */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease, background-color 0.4s ease;
    pointer-events: none;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.3);
}

.menu-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(500px, 90vw);
    height: 100%;
    background-color: #5a4f42;
    padding: 0;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    font-family: system-ui, -apple-system, sans-serif;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
}

.menu-overlay.active .menu-nav {
    transform: translateX(0);
}

.menu-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 80px;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Selector de idioma arriba */
.menu-nav .language-selector-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 1px;
}

.menu-nav .language-selector-menu .lang {
    color: #ffffff;
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
    transition: opacity 0.3s ease;
    opacity: 0.4;
}

.menu-nav .language-selector-menu .lang:hover {
    opacity: 0.7;
}

.menu-nav .language-selector-menu .lang.active {
    opacity: 1;
}

.menu-nav .language-selector-menu .separator {
    color: #ffffff;
    opacity: 0.4;
}

/* Opciones del menú en el centro */
.menu-items {
    display: flex;
    flex-direction: column;
    gap: 40px;
    flex: 1;
    justify-content: center;
}

.menu-item {
    font-size: 0.9rem;
    font-weight: 300;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 1px;
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
    opacity: 1;
    font-family: system-ui, -apple-system, sans-serif;
    transition: opacity 0.3s ease;
    text-transform: uppercase;
}

.menu-item:hover {
    opacity: 0.6;
}

/* Instagram abajo */
.menu-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 18px;
}

.menu-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
}

.menu-social-link svg {
    width: 22px;
    height: 22px;
}

.menu-social-link:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

/* Animación del botón hamburguesa */
.menu-toggle.active .line:first-child {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active .line:last-child {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Contenido legal */
.legal-content {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.legal-content h2 {
    font-size: 1.4rem;
    font-weight: 400;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.legal-content h3 {
    font-size: 1.1rem;
    font-weight: 400;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.legal-content p {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--primary-color);
    opacity: 0.8;
    margin-bottom: 20px;
}

.legal-content ul {
    margin-left: 25px;
    margin-bottom: 20px;
}

.legal-content li {
    font-size: 0.95rem;
    font-weight: 300;
    color: var(--primary-color);
    opacity: 0.8;
    margin-bottom: 10px;
    line-height: 1.8;
}

.legal-content em {
    display: block;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.03);
    border-left: 3px solid var(--accent-color);
    margin-bottom: 30px;
    font-style: normal;
    opacity: 0.7;
}

.legal-content a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.legal-content a:hover {
    opacity: 0.7;
}

/* Footer */
.site-footer {
    background-color: var(--secondary-color);
    padding: 40px 0;
    margin-top: 20px;
}

.footer-content {
    width: 100%;
    margin: 0;
    padding: 0 var(--page-padding);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    gap: 40px;
}

.footer-left {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.footer-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.footer-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
}

.footer-legal {
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--primary-color);
    opacity: 0.7;
    margin: 0;
    line-height: 1.6;
}

.footer-link {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
}

.footer-link:hover {
    opacity: 1;
}

.footer-separator {
    color: var(--primary-color);
    opacity: 0.3;
    font-size: 0.75rem;
}

.footer-right .social-icon {
    color: var(--primary-color);
    opacity: 0.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
    cursor: url('assets/cursor-proyectos-hover.svg') 4 2, pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-right .social-icon:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .service-card {
        height: 420px;
    }

    .modal-content {
        grid-template-columns: 1fr 1fr;
    }

    .modal-details {
        padding: 40px;
    }
}

@media (max-width: 900px) {
    body {
        padding-bottom: 60px;
    }
    .menu-nav {
        width: min(360px, 85vw);
    }

    .menu-content {
        padding: 60px 40px;
    }

    .top-bar {
        height: 100px;
    }

    :root {
        --page-padding: 30px;
    }
    
    .logo-container {
        top: 30px;
        left: 30px;
    }

    .top-right-menu {
        top: 30px;
        right: 30px;
        gap: 20px;
    }
    
    .language-selector {
        font-size: 0.85rem;
        gap: 8px;
    }
    
    .menu-toggle .line {
        width: 20px;
    }

    .services-container {
        padding: 120px var(--page-padding) 80px;
    }

    .stats-container {
        flex-direction: column;
        gap: 30px;
    }

    .stat-divider {
        display: none;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .service-card {
        height: 360px;
    }

    .card-overlay {
        padding: 28px;
    }

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

    .faq-section {
        margin-top: 80px;
        padding: 0 10px;
    }

    .faq-question {
        font-size: 1rem;
        padding: 16px 0;
    }

    .faq-answer {
        font-size: 0.9rem;
    }

    .service-modal {
        padding: 20px;
    }

    .modal-content {
        grid-template-columns: 1fr;
        max-height: 85vh;
        width: min(640px, 95vw);
    }

    .modal-image-container {
        height: 200px;
    }

    .modal-details {
        padding: 28px;
        max-height: calc(85vh - 200px);
        min-height: 0;
    }

    .modal-close {
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 600px) {
    body {
        padding-bottom: 40px;
    }

    .logo {
        width: 50px;
    }

    .top-bar {
        height: 90px;
    }

    .language-selector {
        font-size: 0.75rem;
        gap: 6px;
    }

    .services-container {
        padding: 110px var(--page-padding) 60px;
    }

    .menu-nav {
        width: min(310px, 82vw);
    }

    .menu-content {
        padding: 40px 30px;
    }

    .service-card {
        height: 300px;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .card-subtitle {
        font-size: 0.8rem;
    }

    .card-overlay {
        padding: 22px;
    }

    .faq-question::after {
        font-size: 1.2rem;
    }

    .faq-answer {
        line-height: 1.6;
    }

    .modal-content {
        border-radius: 12px;
        width: min(520px, 92vw);
        max-height: 82vh;
    }

    .modal-details {
        padding: 22px;
        gap: 18px;
        max-height: calc(82vh - 200px);
    }

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

    .modal-description {
        font-size: 0.95rem;
    }

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

@media (max-width: 480px) {
    :root {
        --page-padding: 24px;
    }
    
    body {
        padding-bottom: 30px;
    }
    
    .logo-container {
        top: 24px;
        left: 24px;
    }

    .top-right-menu {
        top: 24px;
        right: 24px;
        gap: 15px;
    }

    .language-selector {
        font-size: 0.8rem;
    }

    .menu-toggle .line {
        width: 18px;
    }

    .services-container {
        padding: 100px var(--page-padding) 50px;
    }

    .menu-nav {
        width: min(280px, 80vw);
    }

    .menu-content {
        padding: 32px 24px;
    }

    .service-card {
        height: 260px;
    }

    .card-overlay {
        padding: 18px;
        gap: 6px;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .card-number {
        font-size: 0.6rem;
    }

    .faq-section {
        margin-top: 60px;
    }

    .faq-question {
        font-size: 0.95rem;
    }

    .faq-answer {
        font-size: 0.85rem;
    }

    .modal-image-container {
        height: 170px;
    }

    .modal-content {
        width: 88vw;
        max-height: 78vh;
    }

    .modal-details {
        padding: 18px;
        gap: 14px;
        max-height: calc(78vh - 170px);
    }

    .modal-close {
        top: 10px;
        right: 10px;
    }

    .modal-cta {
        padding: 14px 24px;
        font-size: 0.75rem;
    }
}

/* Footer responsive */
@media (max-width: 1024px) {
    .site-footer {
        padding: 40px 0;
    }
}

/* Banner de publicidad */
.ad-banner {
    width: 100%;
    max-width: 700px;
    margin: 50px auto 30px auto;
    padding: 0 40px;
    display: block;
    text-align: center;
}

.ad-banner .ad-link {
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 6px;
}

.ad-banner .ad-link:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.ad-banner .ad-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

@media (max-width: 768px) {
    .ad-banner {
        margin: 30px auto 20px auto;
        padding: 0 24px;
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding: 30px 0;
        margin-top: 20px;
    }

    .footer-content {
        padding: 0 var(--page-padding);
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

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

    .footer-right {
        justify-content: center;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .site-footer {
        padding: 25px 0;
        margin-top: 15px;
    }

    .footer-content {
        padding: 0 var(--page-padding);
        gap: 20px;
    }

    .footer-legal {
        font-size: 0.85rem;
        font-weight: 300;
        color: var(--primary-color);
        opacity: 0.7;
        margin: 0;
        line-height: 1.6;
    }

    .footer-link {
        font-size: 0.7rem;
    }
}
