/*
   ===========================
   TARJETAS DE SERVICIOS - ESTILO POLAROID PREMIUM
   ===========================
*/

/* Grid de servicios */
.services-grid {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    padding: 50px 20px;
    perspective: 1000px;
}

/* Contenedor de la tarjeta polaroid */
.service-card {
    position: relative;
    width: 300px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f8f8 100%);
    padding: 12px;
    padding-bottom: 100px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(0, 0, 0, 0.06),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    transform-style: preserve-3d;
}

/* Borde sutil tipo foto real */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    pointer-events: none;
    z-index: 5;
}

/* Sombra trasera que simula profundidad */
.service-card::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 10px;
    right: 10px;
    bottom: -5px;
    background: rgba(0, 0, 0, 0.1);
    filter: blur(15px);
    z-index: -1;
    transition: all 0.5s ease;
    border-radius: 5px;
}

/* Rotaciones naturales */
.services-grid .service-card:nth-child(1) {
    transform: rotate(-3deg);
}

.services-grid .service-card:nth-child(2) {
    transform: rotate(2deg);
    margin-top: 20px;
}

.services-grid .service-card:nth-child(3) {
    transform: rotate(-2deg);
}

/* Hover effects */
.service-card:hover {
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.18),
        0 10px 20px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.services-grid .service-card:nth-child(1):hover {
    transform: rotate(-5deg) translateY(-15px) scale(1.02);
}

.services-grid .service-card:nth-child(2):hover {
    transform: rotate(4deg) translateY(-15px) scale(1.02);
}

.services-grid .service-card:nth-child(3):hover {
    transform: rotate(-4deg) translateY(-15px) scale(1.02);
}

.service-card:hover::after {
    top: 20px;
    filter: blur(20px);
    opacity: 0.8;
}

/* Área de la imagen */
.service-image {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Efecto de brillo sutil en la imagen */
.service-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(140, 158, 255, 0.1) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
}

.service-card:hover .service-image::before {
    opacity: 1;
}

/* Marco interior de la imagen */
.service-image::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

/* Icono del servicio */
.service-image .service-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 5px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 2;
    filter: drop-shadow(0 5px 15px rgba(140, 158, 255, 0.3));
}

.service-card:hover .service-image .service-icon {
    transform: scale(1.1) translateY(-5px);
    filter: drop-shadow(0 10px 25px rgba(140, 158, 255, 0.5));
}

/* Número del servicio */
.service-image .service-number {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 5rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.04);
    line-height: 1;
    transition: all 0.4s ease;
    font-family: var(--font-primary);
}

.service-card:hover .service-image .service-number {
    color: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

/* Contenido inferior - estilo manuscrito/pie de foto */
.service-content {
    padding: 20px 10px 5px;
    text-align: center;
    position: relative;
}

.service-content h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    display: inline-block;
}

/* Línea decorativa bajo el título */
.service-content h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.service-card:hover .service-content h3::after {
    width: 60px;
}

.service-content p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 18px;
    min-height: 50px;
    font-weight: 400;
}

/* Botón estilo etiqueta elegante */
.service-card .btn-more {
    display: inline-block;
    padding: 12px 28px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.service-card .btn-more::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: -1;
}

.service-card .btn-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.service-card .btn-more:hover::before {
    transform: translateX(0);
}

/* Clip decorativo mejorado */
.service-card .clip {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 50px;
    z-index: 10;
    pointer-events: none;
}

/* Parte superior del clip */
.service-card .clip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 35px;
    height: 25px;
    background: linear-gradient(180deg, #e8e8e8 0%, #c0c0c0 50%, #a0a0a0 100%);
    border-radius: 8px 8px 0 0;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Parte inferior del clip */
.service-card .clip::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 28px;
    background: linear-gradient(180deg, #a0a0a0 0%, #888 100%);
    border-radius: 0 0 4px 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* Efecto de textura de papel */
.service-card {
    background-image:
        linear-gradient(145deg, #ffffff 0%, #f8f8f8 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ==================== MEDIA QUERIES ==================== */

@media (max-width: 1100px) {
    .services-grid {
        gap: 40px;
    }

    .service-card {
        width: 280px;
    }
}

@media (max-width: 992px) {
    .services-grid {
        gap: 35px;
        padding: 40px 15px;
    }

    .service-card {
        width: 260px;
        padding-bottom: 90px;
    }

    .service-image {
        height: 190px;
    }

    .service-image .service-icon {
        font-size: 3.5rem;
    }

    .service-image .service-number {
        font-size: 4rem;
    }

    .services-grid .service-card:nth-child(2) {
        margin-top: 0;
    }
}

@media (max-width: 768px) {
    .services-grid {
        gap: 45px;
        padding: 30px 10px;
        flex-direction: column;
        align-items: center;
    }

    .service-card {
        width: 300px;
        max-width: 90%;
    }

    /* Reset rotaciones en móvil */
    .services-grid .service-card:nth-child(1),
    .services-grid .service-card:nth-child(2),
    .services-grid .service-card:nth-child(3) {
        transform: rotate(0deg);
        margin-top: 0;
    }

    .services-grid .service-card:nth-child(1):hover,
    .services-grid .service-card:nth-child(2):hover,
    .services-grid .service-card:nth-child(3):hover {
        transform: translateY(-10px) scale(1.01);
    }

    .service-image {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .service-card {
        width: 100%;
        max-width: 320px;
        padding: 10px;
        padding-bottom: 85px;
    }

    .service-image {
        height: 180px;
    }

    .service-image .service-icon {
        font-size: 3rem;
    }

    .service-content h3 {
        font-size: 1rem;
    }

    .service-content p {
        font-size: 0.85rem;
        min-height: 40px;
    }

    .service-card .btn-more {
        padding: 10px 24px;
        font-size: 0.65rem;
    }

    .service-card .clip {
        display: none;
    }
}

/* ==================== BOTÓN CREATIVO VER TODOS LOS SERVICIOS ==================== */

.services-cta {
    text-align: center;
    margin-top: 60px;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Botón creativo con animación */
.button-creative {
    --line_color: #1a1a1a;
    --back_color: rgba(140, 158, 255, 0.15);
    position: relative;
    z-index: 0;
    width: 340px;
    height: 60px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    color: var(--line_color);
    letter-spacing: 3px;
    transition: all 0.3s ease;
    font-family: var(--font-primary);
}

.button-creative .button__text {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.button-creative::before,
.button-creative::after,
.button-creative .button__text::before,
.button-creative .button__text::after {
    content: "";
    position: absolute;
    height: 3px;
    border-radius: 2px;
    background: var(--line_color);
    transition: all 0.5s ease;
}

.button-creative::before {
    top: 0;
    left: 54px;
    width: calc(100% - 56px * 2 - 16px);
}

.button-creative::after {
    top: 0;
    right: 54px;
    width: 8px;
}

.button-creative .button__text::before {
    bottom: 0;
    right: 54px;
    width: calc(100% - 56px * 2 - 16px);
}

.button-creative .button__text::after {
    bottom: 0;
    left: 54px;
    width: 8px;
}

.button-creative .button__line {
    position: absolute;
    top: 0;
    width: 56px;
    height: 100%;
    overflow: hidden;
}

.button-creative .button__line::before {
    content: "";
    position: absolute;
    top: 0;
    width: 150%;
    height: 100%;
    box-sizing: border-box;
    border-radius: 300px;
    border: solid 3px var(--line_color);
}

.button-creative .button__line:nth-child(1),
.button-creative .button__line:nth-child(1)::before {
    left: 0;
}

.button-creative .button__line:nth-child(2),
.button-creative .button__line:nth-child(2)::before {
    right: 0;
}

.button-creative:hover {
    letter-spacing: 5px;
    color: var(--primary-color);
    --line_color: var(--primary-color);
}

.button-creative:hover::before,
.button-creative:hover .button__text::before {
    width: 8px;
}

.button-creative:hover::after,
.button-creative:hover .button__text::after {
    width: calc(100% - 56px * 2 - 16px);
}

/* Elementos decorativos animados */
.button-creative .button__drow1,
.button-creative .button__drow2 {
    position: absolute;
    z-index: -1;
    border-radius: 16px;
    transform-origin: 16px 16px;
}

.button-creative .button__drow1 {
    top: -16px;
    left: 40px;
    width: 32px;
    height: 0;
    transform: rotate(30deg);
}

.button-creative .button__drow2 {
    top: 44px;
    left: 77px;
    width: 32px;
    height: 0;
    transform: rotate(-127deg);
}

.button-creative .button__drow1::before,
.button-creative .button__drow1::after,
.button-creative .button__drow2::before,
.button-creative .button__drow2::after {
    content: "";
    position: absolute;
}

.button-creative .button__drow1::before {
    bottom: 0;
    left: 0;
    width: 0;
    height: 32px;
    border-radius: 16px;
    transform-origin: 16px 16px;
    transform: rotate(-60deg);
}

.button-creative .button__drow1::after {
    top: -10px;
    left: 45px;
    width: 0;
    height: 32px;
    border-radius: 16px;
    transform-origin: 16px 16px;
    transform: rotate(69deg);
}

.button-creative .button__drow2::before {
    bottom: 0;
    left: 0;
    width: 0;
    height: 32px;
    border-radius: 16px;
    transform-origin: 16px 16px;
    transform: rotate(-146deg);
}

.button-creative .button__drow2::after {
    bottom: 26px;
    left: -40px;
    width: 0;
    height: 32px;
    border-radius: 16px;
    transform-origin: 16px 16px;
    transform: rotate(-262deg);
}

.button-creative .button__drow1,
.button-creative .button__drow1::before,
.button-creative .button__drow1::after,
.button-creative .button__drow2,
.button-creative .button__drow2::before,
.button-creative .button__drow2::after {
    background: var(--back_color);
}

/* Animaciones al hover */
.button-creative:hover .button__drow1 {
    animation: drow1 ease-in 0.06s forwards;
}

.button-creative:hover .button__drow1::before {
    animation: drow2 linear 0.08s 0.06s forwards;
}

.button-creative:hover .button__drow1::after {
    animation: drow3 linear 0.03s 0.14s forwards;
}

.button-creative:hover .button__drow2 {
    animation: drow4 linear 0.06s 0.2s forwards;
}

.button-creative:hover .button__drow2::before {
    animation: drow3 linear 0.03s 0.26s forwards;
}

.button-creative:hover .button__drow2::after {
    animation: drow5 linear 0.06s 0.32s forwards;
}

@keyframes drow1 {
    0% { height: 0; }
    100% { height: 100px; }
}

@keyframes drow2 {
    0% { width: 0; opacity: 0; }
    10% { opacity: 0; }
    11% { opacity: 1; }
    100% { width: 120px; }
}

@keyframes drow3 {
    0% { width: 0; }
    100% { width: 80px; }
}

@keyframes drow4 {
    0% { height: 0; }
    100% { height: 120px; }
}

@keyframes drow5 {
    0% { width: 0; }
    100% { width: 124px; }
}

/* Responsive del botón */
@media (max-width: 768px) {
    .button-creative {
        width: 300px;
        height: 55px;
        font-size: 11px;
        letter-spacing: 2px;
    }

    .button-creative:hover {
        letter-spacing: 3px;
    }
}

@media (max-width: 480px) {
    .button-creative {
        width: 280px;
        height: 50px;
        font-size: 10px;
    }

    .button-creative .button__drow1,
    .button-creative .button__drow2 {
        display: none;
    }
}
