/* ===== DREJ - fondos por bot¨®n y efecto hover/zoom =====
   Incluye soporte para layout vertical (stacked)
   v1.4.0 - Mejoras en normalizaci¨®n de im¨˘genes
*/

/* --- Estilos base (background) --- */
.item-button,
.drej-bg-button {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background-image: var(--btn-bg), linear-gradient(135deg, #2d8659 0%, #1e5a3d 100%);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover, cover;
    transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s ease, background-size .25s ease, filter .25s ease;
    will-change: transform;
    border-radius: 10px;
}

/* Overlay sutil para legibilidad */
.item-button::after,
.drej-bg-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.12), rgba(0,0,0,0.04));
    pointer-events: none;
    transition: opacity .25s ease;
}

/* Hover: levantar, escalar y aumentar el fondo ligeramente */
.item-button:hover,
.drej-bg-button:hover {
    transform: translateY(-6px) scale(1.025);
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
    z-index: 3;
    background-size: 112% !important;
    filter: saturate(1.05) contrast(1.03);
}

/* Estilos internos, compatibles con tu theme */
.item-button .cell {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.item-button .icon {
    font-size: 44px;
    color: rgba(255,255,255,0.95);
    flex-shrink: 0;
}

.item-button .item-title {
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    margin: 0 0 6px 0;
}

.item-button .btn-content {
    color: rgba(255,255,255,0.95);
    font-size: 13px;
    line-height: 1.3;
}

/* --- LAYOUT STACKED: imagen arriba, texto abajo en tarjeta --- */

.drej-bg-button.stacked,
.item-button.stacked {
    background: none;
    padding: 0;
    border-radius: 12px;
}

/* tarjeta vertical que contiene imagen y cuerpo */
.vertical-card {
    overflow: hidden;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* wrap de imagen - NORMALIZADO POR DEFECTO */
.vertical-card .image-wrap {
    width: 100%;
    height: 180px; /* Altura por defecto normalizada */
    min-height: 180px; /* Evita colapso */
    overflow: hidden;
    background: #eaeaea;
    position: relative;
    flex-shrink: 0; /* No se comprime */
}

.vertical-card .image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* CLAVE: normaliza proporci¨®n de imagen */
    object-position: center center; /* Centra la imagen */
    display: block;
    transition: transform .35s cubic-bezier(.4,0,.2,1);
}

/* cuerpo blanco con texto centrado */
.vertical-card .card-body {
    padding: 16px 14px;
    text-align: center;
    flex-grow: 1; /* Toma el espacio restante */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vertical-card .card-icon {
    margin-bottom: 8px;
    font-size: 32px;
    color: #00286A;
}

.vertical-card .item-title {
    color: #222;
    font-weight: 800;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin: 6px 0;
    line-height: 1.3;
}

.vertical-card .btn-content {
    color: #666;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 6px;
}

/* Hover: zoom de la imagen y elevar tarjeta */
.drej-bg-button.stacked:hover .vertical-card,
.item-button.stacked:hover .vertical-card {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.18);
}

.drej-bg-button.stacked:hover .vertical-card .image-wrap img,
.item-button.stacked:hover .vertical-card .image-wrap img {
    transform: scale(1.08);
}

/* Estilos para icono en el ¨˘rea de imagen cuando no hay foto */
.image-wrap.icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
}

.image-wrap.icon-placeholder .icon-wrap {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00286A;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.image-wrap.icon-placeholder .icon-wrap svg,
.image-wrap.icon-placeholder .icon-wrap i {
    width: 48px;
    height: 48px;
    fill: currentColor;
    color: inherit;
    font-size: 48px;
}

/* Responsive: ajustar altura en m¨®viles */
@media (max-width: 768px) {
    .vertical-card .image-wrap {
        height: 140px;
        min-height: 140px;
    }
    
    .vertical-card .card-body {
        padding: 12px 10px;
    }
    
    .vertical-card .item-title {
        font-size: 14px;
    }
    
    .vertical-card .btn-content {
        font-size: 11px;
    }
    
    .image-wrap.icon-placeholder .icon-wrap {
        width: 60px;
        height: 60px;
    }
    
    .image-wrap.icon-placeholder .icon-wrap svg,
    .image-wrap.icon-placeholder .icon-wrap i {
        width: 36px;
        height: 36px;
        font-size: 36px;
    }
}

/* Clases utilitarias de color */
.drej-bg-button.text-white .item-title,
.drej-bg-button.text-white .btn-content,
.item-button.text-white .item-title,
.item-button.text-white .btn-content,
.item-button.stacked.text-white .item-title,
.item-button.stacked.text-white .btn-content {
    color: #fff !important;
}

.drej-bg-button.text-yellow .item-title,
.drej-bg-button.text-yellow .btn-content,
.item-button.text-yellow .item-title,
.item-button.text-yellow .btn-content {
    color: #FFD400 !important;
}

.drej-bg-button.text-dark .item-title,
.item-button.text-dark .item-title {
    color: #222 !important;
}

.drej-bg-button.text-dark .btn-content,
.item-button.text-dark .btn-content {
    color: #666 !important;
}

/* Soporte para grids con columnas iguales */
.drej-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.drej-buttons-grid .item-list {
    margin: 0;
}

.drej-buttons-grid .vertical-card {
    height: 100%;
}

@media (max-width: 768px) {
    .drej-buttons-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}


