/**
 * Estilos para los botones de producto WooCommerce
 * Compatible con diseño Elementor
 */

/* Contenedor principal de botones */
.bpwc-product-buttons-wrapper {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
}

/* Botón base - estilo Elementor */
.bpwc-product-button {
    --button-color: #0073aa;
    
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--button-color);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 3px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Botón de ancho completo (tercera posición) */
.bpwc-product-button.bpwc-button-full-width {
    grid-column: 1 / -1;
}

/* Hover effect */
.bpwc-product-button:hover {
    background-color: var(--button-color);
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    color: #ffffff;
    text-decoration: none;
}

/* Active/Click effect */
.bpwc-product-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Contenedor del contenido del botón */
.bpwc-button-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

/* Texto del botón */
.bpwc-button-text {
    flex-grow: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Iconos */
.bpwc-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bpwc-button-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Ocultar icono derecho por defecto */
.bpwc-button-icon.right {
    display: none;
}

/* Mostrar icono derecho en botón de ancho completo */
.bpwc-button-full-width .bpwc-button-icon.right {
    display: inline-flex;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .bpwc-product-buttons-wrapper {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .bpwc-product-button {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .bpwc-product-button.bpwc-button-full-width {
        grid-column: 1;
    }
    
    /* Mostrar iconos en ambos lados en móvil */
    .bpwc-button-icon.right {
        display: inline-flex;
    }
    
    .bpwc-button-text {
        white-space: normal;
        text-align: center;
    }
}

/* Ajustes para temas específicos */
.woocommerce div.product .bpwc-product-buttons-wrapper {
    clear: both;
}

/* Asegurar que los botones no hereden estilos no deseados */
.bpwc-product-button * {
    box-sizing: border-box;
}

/* Focus para accesibilidad */
.bpwc-product-button:focus {
    outline: 2px solid var(--button-color);
    outline-offset: 2px;
}

/* Prevenir conflictos con otros estilos */
.bpwc-product-button,
.bpwc-product-button:visited {
    color: #ffffff;
}

/* Animación de carga suave */
@keyframes bpwcFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bpwc-product-buttons-wrapper {
    animation: bpwcFadeIn 0.4s ease-out;
}

/* Variaciones de color específicas para WhatsApp */
.bpwc-product-button[href*="whatsapp"] {
    --button-color: #25D366;
}

/* Estilos para botones deshabilitados (si se necesita en el futuro) */
.bpwc-product-button:disabled,
.bpwc-product-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}
