/* =========================
   SECCIONES
========================= */

.products-section,
.services-section {
    padding: 80px 0;
    background: var(--body-bg);
    color: var(--body-text);
}

/* TITULOS */
.section-title {
    font-size: 28px;
    margin-bottom: 40px;
    text-align: center;
    color: var(--body-text);
}

/* =========================
   GRID
========================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.services-grid {
    display: grid;
    gap: 20px;
}

/* ===== CONFIGURACIÓN BASE ===== */

.grid-1 { grid-template-columns: repeat(1, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== RESPONSIVE ===== */

@media (max-width: 992px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 576px) {
    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* =========================
   PRODUCT CARD
========================= */

.service-card {
    text-decoration: none;
    color: inherit;
    position: relative;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background-repeat: no-repeat;
    background-size: 100%;
    background-position: center;

    box-shadow: var(--shadow-md);

    transform: scale(1);
    transition:
        transform var(--transition-normal),
        box-shadow var(--transition-normal),
        background-size 0.6s var(--ease-smooth);

    cursor: pointer;
}
.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.product-card:active {
    transform: scale(0.98);
}
.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

/* ajuste en dark mode para imágenes */
.dark-theme .product-card img {
    filter: brightness(0.9);
}

.product-content {
    padding: 20px;
}

.product-content h3 {
    margin-bottom: 10px;
    color: var(--body-text);
}

.product-content p {
    font-size: 14px;
    color: var(--color-gray-500);
    margin-bottom: 10px;
}

/* mejora contraste en dark */
.dark-theme .product-content p {
    color: var(--color-gray-400);
}

.price {
    font-weight: bold;
    color: var(--color-primary-500);
}

/* =========================
   SERVICE CARD
========================= */

.service-card {
    text-decoration: none; /* quita subrayado */
    color: inherit; /* mantiene color del texto */
    position: relative;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    /* La imagen ahora viene desde Blade */
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;

    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-size 0.4s ease;

    cursor: pointer;
}


/* Overlay oscuro (mejorado con gradiente) */
.service-card::before {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.6),
        rgba(0, 0, 0, 0.25)
    );

    transition: opacity var(--transition-normal);
    opacity: 1;
    z-index: 1;
}

/* Hover más elegante */
.service-card:active {
    transform: scale(0.97);
}

.service-card:hover {
    transform: scale(1.04);
    box-shadow: var(--shadow-xl);
    background-size: 110%;
}

.service-card:active {
    transform: scale(0.97);
}
/* Texto encima */
.service-card h3 {
    position: relative;
    z-index: 2;

    color: #fff;
    font-size: 20px;
    font-weight: 600;
    text-align: center;

    padding: 0 10px;

    transform: translateY(10px);
    opacity: 0.9;

    transition:
        transform var(--transition-normal),
        opacity var(--transition-normal);
}

.service-card:hover h3 {
    transform: translateY(0);
    opacity: 1;
}

.service-card p {
    font-size: 14px;
    color: var(--color-gray-500);
}

/* ajuste dark */
.dark-theme .service-card p {
    color: var(--color-gray-400);
}
/* Mejor legibilidad en pantallas pequeñas */
@media (max-width: 576px) {
    .service-card {
        height: 140px;
    }

    .service-card h3 {
        font-size: 16px;
    }
}

/* Mejora en dark mode (opcional, más contraste) */
.dark-theme .service-card::before {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85),
        rgba(0, 0, 0, 0.5)
    );
}
