.projects_services{
    width: 100%;
    height: auto;
    display: flex;
    align-items: start;
    justify-content: space-around;
    flex-direction: column;
    padding: 2% 5%;
    position: relative;
    margin-bottom: 50dvh;
}

.services_header{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    text-align: center;
    margin-bottom: 2rem;
    z-index: 2;
    position: relative;
    margin: 20% 0% 10% 0%;
}

.services_header h2{
    font-weight: 300;
    font-size: 5rem;
    margin-bottom: 0.5rem;
    color: var(--white);
    background-image: linear-gradient(45deg, var(--white) 15%, var(--grey) 82%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2%;
}

.services_header p{
    color: var(--grey);
    font-size: 1.2rem;
    text-align: left;
    width: 30%;
}

.services_content{
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Máscara para disimular los bordes del bottom SOLAMENTE */
.services_content::before {
    content: '';
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, var(--black) 0%, var(--black) 70%, transparent 100%);
    z-index: 3;
    pointer-events: none;
}

.services_grid{
    width: 85%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: relative;
    z-index: 2;
}

/* Botón movido fuera del contenedor con máscara */
.btn_grid_services{
    position: absolute;
    z-index: 500;
    bottom: 0%;
    left: 50%;
    gap: 1rem;
    transform: translateX(-50%);
    white-space: nowrap;
    
    /* Hacer el botón mucho más pequeño */
    padding: 1% 3% !important;
    min-width: auto !important;
    width: auto !important;
    height: auto !important;
}

.grid_item{
    width: 100%;
    height: 50dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1rem;
    border: 1px solid var(--grey);
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.grid_item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.grid_item h4{
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--white);
    transition: color 0.3s ease;
    cursor: default;
    position: relative;
    z-index: 2;
}

.grid_item p{
    font-size: 1rem;
    color: var(--grey);
    position: relative;
    z-index: 2;
}

/* Estilos para el canvas de puntos en grid items vacíos */
.grid_item .dots-bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.grid_item.empty:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* TABLET (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .projects_services {
        padding: 3% 5%;
        margin-bottom: 50dvh;
        margin-top: 30vh; /* Más separación en tablet */
    }

    .services_header {
        margin: 15% 0% 8% 0%;
        text-align: center;
        align-items: center;
    }

    .services_header h2 {
        font-size: 3.5rem;
        text-align: center;
        width: 100%;
    }

    .services_header p {
        width: 70%;
        font-size: 1.1rem;
        text-align: center;
    }

    .services_content {
        flex-direction: column;
        gap: 2rem;
    }

    .services_grid {
        width: 90%;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Ocultar elementos vacíos (canvas) en tablet */
    .grid_item:has(.dots-bg-canvas) {
        display: none;
    }

    .grid_item {
        height: auto; /* Cambio a auto para mejor adaptación */
        min-height: 25dvh;
        gap: 0.8rem;
        padding: 1.5rem 1rem;
    }

    .grid_item h4 {
        font-size: 1.3rem;
    }

    .grid_item p {
        font-size: 0.9rem;
    }

    .btn_grid_services {
        position: static;
        transform: none;
        padding: 0.8rem 2rem !important;
        font-size: 0.9rem;
        margin-top: 2rem;
    }

    .services_content::before {
        display: none;
    }
}

/* MÓVIL GRANDE (481px - 767px) */
@media screen and (max-width: 767px) {
    .projects_services {
        padding: 4% 5%;
        margin-bottom: 40dvh;
        margin-top: 30vh; /* Separación en móvil grande */
    }

    .services_header {
        margin: 8% 0% 6% 0%;
    }

    .services_header h2 {
        font-size: 2.8rem;
    }

    .services_header p {
        width: 90%;
        font-size: 1rem;
    }

    .services_grid {
        width: 95%;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Ocultar elementos vacíos (canvas) en móvil grande */
    .grid_item:has(.dots-bg-canvas) {
        display: none;
    }

    .grid_item {
        height: auto; /* Cambio a auto */
        min-height: 15vh;
        gap: 0.8rem;
        padding: 1.5rem 1rem;
        border-radius: 8px; /* Añadir esquinas redondeadas */
    }

    .grid_item h4 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }

    .grid_item p {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .btn_grid_services {
        padding: 0.7rem 1.5rem !important;
        font-size: 0.85rem;
        margin-top: 2rem;
    }
}

/* MÓVIL PEQUEÑO (hasta 480px) */
@media screen and (max-width: 480px) {
    .projects_services {
        padding: 5% 2.5%;
        margin-bottom: 25dvh;
        margin-top: 20vh; /* Separación en móvil pequeño */
    }

    .services_header {
        margin: 6% 0% 4% 0%;
    }

    .services_header h2 {
        font-size: 2.2rem;
        line-height: 1.1;
    }

    .services_header p {
        width: 95%;
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .services_grid {
        width: 100%;
        gap: 1rem;
    }

    /* Ocultar elementos vacíos (canvas) en móvil pequeño */
    .grid_item:has(.dots-bg-canvas) {
        display: none;
    }

    .grid_item {
        height: auto; /* Cambio a auto para mejor contenido */
        min-height: 12vh;
        gap: 0.6rem;
        padding: 1.2rem 1rem;
        border-radius: 8px;
    }

    .grid_item h4 {
        font-size: 1.1rem;
        line-height: 1.2;
        margin-bottom: 0.4rem;
    }

    .grid_item p {
        font-size: 0.85rem;
        line-height: 1.3;
    }

    .btn_grid_services {
        padding: 0.8rem 1.5rem !important;
        font-size: 0.85rem;
        margin-top: 2rem;
        width: 90%;
        max-width: 250px;
    }
}

/* MÓVIL MUY PEQUEÑO (hasta 360px) */
@media screen and (max-width: 360px) {
    .projects_services {
        padding: 5% 2%;
        margin-top: 6vh;
    }

    .services_header {
        margin: 4% 0% 3% 0%;
    }

    .services_header h2 {
        font-size: 1.9rem;
    }

    .services_header p {
        width: 100%;
        font-size: 0.85rem;
    }

    .grid_item {
        height: auto;
        min-height: 10vh;
        padding: 1rem 0.8rem;
        gap: 0.5rem;
    }

    .grid_item h4 {
        font-size: 1rem;
        margin-bottom: 0.3rem;
    }

    .grid_item p {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .btn_grid_services {
        padding: 0.7rem 1.2rem !important;
        font-size: 0.8rem;
        width: 95%;
        margin-top: 1.5rem;
    }
}

