/* ========================= PRODUCTS ========================= */
.products {
    padding: 80px 0;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg width='6' height='6' viewBox='0 0 6 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.3' fill-rule='evenodd'%3E%3Cpath d='M5 0h1L0 6V5zM6 5v1H5z'/%3E%3C/g%3E%3C/svg%3E");
}

@media (min-width: 640px) {
    .products {
        padding: 112px 0;
    }
}

.products-grid {
    display: grid;
    gap: 24px;
}

@media (min-width: 640px) {
    .products-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ========================= PRODUCT CARDS 3D ========================= */
.products-grid {
    gap: 50px;
    padding-top: 40px;
    /* espacio para que la imagen sobresalga */
}

.product-card {
    --rx: 0deg;
    --ry: 0deg;
    --mx: 50%;
    --my: 0%;

    position: relative;
    padding: 72px 28px 30px;
    /* arriba más espacio para la imagen */
    border-radius: 24px;
    overflow: visible;
    color: #fff;
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(186, 37, 29, 0.35), transparent 55%),
        linear-gradient(160deg, #1c1c1c 0%, #0a0a0a 60%, #1a0000 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 24px 40px -18px rgba(0, 0, 0, 0.55),
        0 50px 70px -40px rgba(186, 37, 29, 0.45);

    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
    transition: transform 0.25s ease-out, box-shadow 0.3s ease,
        border-color 0.3s ease, opacity 0.7s ease, translate 0.7s ease;
    will-change: transform;
}

/* La animación de entrada usa "translate" para no chocar con la inclinación 3D */
.product-card.reveal {
    transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
    translate: 0 40px;
}

.product-card.reveal.visible {
    translate: 0 0;
}

/* Brillo que sigue al cursor */
.product-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(280px circle at var(--mx) var(--my),
            rgba(255, 255, 255, 0.16),
            transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* ===== Imagen / icono que sobresale ===== */
.product-icon {
    position: absolute;
    top: -38px;
    left: 24px;
    width: 130px;
    height: 130px;
    margin: 0;
    border-radius: 20px;
    background: transparent;
    color: #fff;
    display: grid;
    place-items: center;
    transform: translateZ(70px);
    transition: transform 0.3s ease;
}

.product-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 18px 14px rgba(0, 0, 0, 0.55));
}

/* Si dejas un SVG en otras cards, se ve en una "pastilla" roja */
.product-icon svg {
    width: 100%;
    height: 100%;
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg, #e26c66, #ba251d);
    box-shadow: 0 18px 24px -8px rgba(186, 37, 29, 0.6);
}

/* ===== Textos con profundidad ===== */
.product-card h3 {
    margin-top: 50px;
    color: #fff;
    font-size: 21px;
    transform: translateZ(40px);
}

.product-card p {
    margin-top: 15px;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
    transform: translateZ(22px);
    font-size: 15px;
    line-height: 1.2;
}

/* ========================= PRODUCT TAGS EN LISTA ========================= */
.product-tags {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    transform: translateZ(30px);
}

.product-tags li {
    position: relative;
    padding-left: 22px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.2s ease, transform 0.2s ease;
}

/* Viñeta roja personalizada */
.product-tags li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 0.45em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ba251d;
    box-shadow: 0 0 0 3px rgba(186, 37, 29, 0.25);
}

@media (hover: hover) and (pointer: fine) {
    .product-card:hover .product-tags li {
        color: #fff;
    }

    .product-card:hover .product-tags li::before {
        background: #e26c66;
        box-shadow: 0 0 8px rgba(226, 108, 102, 0.8);
    }
}

/* Celular: sin efecto 3D */
@media (hover: none),
(pointer: coarse) {
    .product-tags {
        transform: none;
    }
}

.product-card-bar {
    height: 5px;
    border-radius: 0 0 24px 24px;
}

/* ===== Solo mouse (no celular): efecto hover ===== */
@media (hover: hover) and (pointer: fine) {
    .product-card:hover {
        border-color: rgba(226, 108, 102, 0.55);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.18),
            0 40px 60px -20px rgba(0, 0, 0, 0.65),
            0 70px 90px -40px rgba(186, 37, 29, 0.7);
    }

    .product-card:hover::after {
        opacity: 1;
    }

    .product-card:hover .product-icon {
        transform: translateZ(100px) scale(1.08);
        background: transparent;
        color: #fff;
    }

    .product-card:hover .product-tags span {
        background: rgba(186, 37, 29, 0.25);
        border-color: rgba(226, 108, 102, 0.5);
        color: #fff;
    }
}

/* ===== Celular: sin inclinación, solo un toque suave ===== */
@media (hover: none),
(pointer: coarse) {
    .product-card {
        transform: none;
        will-change: auto;
    }

    .product-card.reveal {
        transform: none;
    }

    .product-card:active {
        transform: scale(0.98);
    }

    .product-icon,
    .product-card h3,
    .product-card p,
    .product-tags {
        transform: none;
    }
}

@media (max-width: 480px) {
    .product-card {
        padding: 70px 22px 26px;
    }
}

/* ===== Menos movimiento ===== */
@media (prefers-reduced-motion: reduce) {

    .product-card,
    .product-card.reveal {
        transform: none;
        translate: 0 0;
        transition: none;
    }

    .product-icon,
    .product-card h3,
    .product-card p,
    .product-tags {
        transform: none;
    }
}