* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #000000, #FF8C00);
    font-family: 'Montserrat', sans-serif;
}

.tree {
    width: 565px;
    background-color: transparent; /* Fully transparent background */
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 1; /* Ensure content is above background */
    overflow: visible; /* Allow content to overflow for fixed background */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Create a fixed background element */
.bg-image {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 565px;
    height: 400px;
    background-image: url("../../images/tree-leias.webp");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 85%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 85%, rgba(0,0,0,0) 100%);
    z-index: 1; /* Position between body background and content */
    opacity: 1; /* Initial opacity managed by JS */
    transition: opacity 0.3s ease-out;
    pointer-events: none; /* Allow clicks to pass through to content */
}

/* Remove the ::before background */
.tree::before {
    display: none;
    opacity: var(--bg-opacity, 1);
    pointer-events: none;
    transition: opacity 0.3s ease-out;
    z-index: 0;
}

.tree>* {
    position: relative;
    z-index: 2;
}

.tree a.menu-item {
    display: block;
    margin: 1rem 0;
    text-decoration: none;
    color: #fff;
    font-weight: 700;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    transition: background 0.3s, transform 0.2s;
}

.tree a.menu-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* Custom style for the Distribución button */
.tree a.menu-item.distribuciones {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-distrib.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tree a.menu-item.distribuciones:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-distrib.webp");
    background-size: cover;
    background-position: center;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Custom style for the Comunidad button */
.tree a.menu-item.comunidad {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-comunidad.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tree a.menu-item.comunidad:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-comunidad.webp");
    background-size: cover;
    background-position: center;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Custom style for the Sucursales button */
.tree a.menu-item.sucursales {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-sucursal.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tree a.menu-item.sucursales:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-sucursal.webp");
    background-size: cover;
    background-position: center;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Custom style for the Instagram button */
.tree a.menu-item.instagram {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-instagram.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tree a.menu-item.instagram:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-instagram.webp");
    background-size: cover;
    background-position: center;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Custom style for the Facebook button */
.tree a.menu-item.facebook {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-facebook.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tree a.menu-item.facebook:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-facebook.webp");
    background-size: cover;
    background-position: center;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Custom style for the WhatsApp button */
.tree a.menu-item.whatsapp {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-whatsapp.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tree a.menu-item.whatsapp:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-whatsapp.webp");
    background-size: cover;
    background-position: center;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Custom style for the Email button */
.tree a.menu-item.email {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-email.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tree a.menu-item.email:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-email.webp");
    background-size: cover;
    background-position: center;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Custom style for the eBook button */
.tree a.menu-item.ebook {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-ebook.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tree a.menu-item.ebook:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-ebook.webp");
    background-size: cover;
    background-position: center;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Custom style for the Web button */
.tree a.menu-item.web {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-web.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tree a.menu-item.web:hover {
    background-image: linear-gradient(rgba(0, 0, 0, 0.40), rgba(0, 0, 0, 0.85)), url("../../images/tree-web.webp");
    background-size: cover;
    background-position: center;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Style for icon placeholder */
.tree .icon-placeholder {
    height: 32px; /* Same height as fa-2x icon */
    width: 32px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.tree .icon {
    color: #FFA500;
    margin-bottom: 0.5rem;
}

.tree .menu-text {
    font-weight: 700;
    color: #fff;
}

.tree .menu-text.copyright {
    font-size: 0.85rem;
    opacity: 0.7;
    display: block;
    margin-top: 2rem;
    letter-spacing: 0.02em;
}

.leias-text a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 900;
}

.fixed-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    z-index: 10000;
}

.fixed-bar img {
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
}

.fixed-bar .bar-text {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.fixed-bar .leias-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

@media screen and (max-width: 600px) {
    .tree {
        width: 100%;
        max-width: none;
    }
}
