/**
 * ========================================
 * ESTILOS PARA FACEBOOK INTEGRATION
 * ========================================
 */

/* Botón de Facebook Shop */
.fb-shop-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #1877f2;
    color: white !important;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.25);
}

.fb-shop-button:hover {
    background: #166fe5;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.35);
    color: white !important;
}

.fb-shop-button:active {
    transform: translateY(0);
}

.fb-shop-button svg {
    width: 20px;
    height: 20px;
}

/* Widget de Messenger flotante personalizado */
.fb-customerchat {
    z-index: 9999 !important;
}

/* Estilos para página de productos con Open Graph optimizado */
.single-product .product-share-facebook {
    margin: 20px 0;
}

.product-share-facebook a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #1877f2;
    color: white !important;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s;
}

.product-share-facebook a:hover {
    background: #166fe5;
}

.product-share-facebook svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Instagram Shopping badge */
.instagram-shopping-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin: 10px 0;
}

.instagram-shopping-badge svg {
    width: 16px;
    height: 16px;
}

/* Admin dashboard styles */
.mundo-facebook-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.mundo-facebook-stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #1877f2;
}

.mundo-facebook-stat-card h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
}

.mundo-facebook-stat-card .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #1877f2;
}

/* Feed XML link styling */
.facebook-feed-url {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #1877f2;
    margin: 20px 0;
}

.facebook-feed-url code {
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    display: inline-block;
    word-break: break-all;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .fb-shop-button {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }

    .mundo-facebook-stats {
        grid-template-columns: 1fr;
    }
}

/* Widget de sincronización en productos */
.facebook-sync-widget {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.facebook-sync-widget h4 {
    margin: 0 0 10px 0;
    color: #1877f2;
    font-size: 14px;
}

.facebook-sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.facebook-sync-status.synced {
    color: #46b450;
}

.facebook-sync-status.pending {
    color: #ffb900;
}

.facebook-sync-status.error {
    color: #dc3232;
}

/* Loading spinner for AJAX */
.fb-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1877f2;
    border-radius: 50%;
    animation: fb-spin 1s linear infinite;
}

@keyframes fb-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notice boxes en admin */
.notice-facebook {
    border-left-color: #1877f2 !important;
}

.notice-facebook .notice-title {
    color: #1877f2;
    font-weight: 600;
}

/* Tooltips para ayuda */
.facebook-help-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    color: #1877f2;
    margin-left: 5px;
}

.facebook-help-tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Iconos SVG inline */
.fb-icon-check {
    color: #46b450;
}

.fb-icon-warning {
    color: #ffb900;
}

.fb-icon-error {
    color: #dc3232;
}
