/* =========================
   CONTACT OVERLAY
   - Capa negra translúcida
   - Vive por encima del sistema
   ========================= */

.contact-overlay {
    position: fixed;
    inset: 0;

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

    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.35s ease;
    z-index: 200;
}

/* Estado activo */
.contact-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

/* =========================
   CONTACT PANEL
   - Recuadro central
   - Grid 2x2
   ========================= */

.contact-panel {
    width: 260px;
    height: 260px;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;

    padding: 20px;

    background: rgba(0, 0, 0, 0.65);
    border-radius: 15px;

    transform: scale(0.95);
    transition: transform 0.35s ease;
}

/* Animación de entrada */
.contact-overlay.is-active .contact-panel {
    transform: scale(1);
}

/* =========================
   CONTACT ITEM
   - Botón individual
   ========================= */

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border: none;

    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.20);
    transform: translateY(-2px);
}

/* =========================
   ICON IMAGE
   ========================= */

.contact-item img {
    width: 48%;
    height: 48%;
    object-fit: contain;
    pointer-events: none;
}


// =========================
// CONTACT ACTIONS
// =========================

const contactActions= {
    facebook: 'https: //www.facebook.com/CandilesBlackDiamond',
    instagram: 'https: //www.instagram.com/bd_candiles?igsh=ZWdrNXFwOWp2Z3ly',
    whatsapp: 'https://wa.me/TU_NUMERO',
    phone: 'tel:+353XXXXXXXXX'
}

;

document.querySelectorAll('.contact-item').forEach(item=> {
        item.addEventListener('click', ()=> {
                const action=item.dataset.action;
                const link=contactActions[action];

                if (link) {
                    window.open(link, '_blank');
                }
            });
    });