/* --- Botón de compartir --- */
.share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: 2px solid var(--secondary-color);
    border-radius: 50px;
    color: var(--secondary-color);
    font-weight: 600;
    font-family: var(--font-family-main);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
  top: -.25rem;
}

.share-button:hover {
    background-color: var(--secondary-color);
    color: var(--white-color);
    transform: translateY(-2px);
}

.share-button svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* Variante para el menú de navegación (solo icono) */
.share-button-nav {
    padding: 0.5rem;
    border-radius: 50%;
    min-width: auto;
}

.share-button-nav .share-text {
    display: none;
}

/* --- Modal de fallback (desktop) --- */
.share-fallback-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.share-fallback-modal.active {
    display: flex;
}

.share-fallback-content {
    background: var(--white-color);
    padding: 2rem;
    border-radius: 1rem;
    max-width: 500px; /* Un poco más ancho para la grilla */
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.share-fallback-content h3 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--primary-color);
}

/* --- NUEVO LAYOUT DE GRILLA (de Paamul) --- */
.share-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Botón copiar ocupa ambas columnas */
#share-option-copy {
    grid-column: 1 / -1;
}
/* --- FIN GRILLA --- */


.share-option {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Ajustado */
    padding: 0.875rem; /* Ajustado */
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    text-align: left; /* Aseguramos alineación */
    cursor: pointer;
}

.share-option:hover {
    background-color: var(--light-gray);
    border-color: var(--secondary-color);
    transform: translateX(3px); /* Reducido */
}

.share-option svg {
    width: 1.75rem; /* Ajustado */
    height: 1.75rem; /* Ajustado */
    flex-shrink: 0;
}

.share-option-text {
    flex-grow: 1;
}

.share-option-text strong {
    display: block;
    color: var(--primary-color);
    font-size: 0.95rem; /* Ajustado */
    font-weight: 600;
    /* Quitamos margin-bottom ya no hay <small> */
}

/* Ocultamos <small> (si es que existiera) ya que el JS no lo genera */
.share-option-text small {
    display: none;
}
/* --- FIN ESTILOS BOTONES --- */


.share-close {
    display: block;
    margin: 1.5rem auto 0;
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-close:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* --- Toast de confirmación (sin cambios) --- */
.share-toast {
    position: fixed;
    bottom: -100px;
    right: 2rem;
    background: var(--primary-color);
    color: var(--white-color);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 10001;
    transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.share-toast.active {
    bottom: 2rem;
}

.share-toast svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
    flex-shrink: 0;
}

.share-toast-message {
    font-weight: 600;
}

/* --- Animaciones (sin cambios) --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* --- Responsive --- */
@media (max-width: 850px) {
    .share-toast {
        right: 1rem;
        left: 1rem;
        bottom: -100px;
    }
    
    .share-toast.active {
        bottom: 1rem;
    }
    
    .share-fallback-content {
        padding: 1.5rem;
    }

    /* En móvil, volvemos a 1 columna */
    .share-options {
        grid-template-columns: 1fr;
    }
}

/* --- Estilos específicos para Cece (sin cambios) --- */
.chat-header .share-button-nav {
    display: none;
}

@media (min-width: 851px) {
    .chat-header .share-button-nav {
        display: inline-flex;
    }
}

/* En móvil, el botón estará en el menú hamburguesa de Cece */
@media (max-width: 850px) {
    .nav-menu .share-menu-item {
        display: block;
    }
}

@media (min-width: 851px) {
    .nav-menu .share-menu-item {
        display: none;
    }
}