/**
 * Branch.io Deep Links Styles
 * 
 * Стили для мобильного баннера и элементов Deep Links
 * 
 * @package Astra
 * @since 1.0.0
 */

/* Мобильный баннер установки приложения */
.branch-mobile-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.banner-content {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    max-width: 100%;
}

.banner-icon {
    flex-shrink: 0;
    margin-right: 15px;
}

.banner-icon img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.banner-text {
    flex: 1;
    min-width: 0;
}

.banner-text h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.banner-text p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.3;
}

.banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.install-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.install-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-button:hover {
    opacity: 1;
}

/* Секция Deep Link на странице товара */
.branch-deep-link-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.branch-deep-link-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.branch-deep-link-btn:before {
    content: "📱";
    font-size: 16px;
}

.branch-deep-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.branch-deep-link-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Результат генерации Deep Link */
#deep-link-result {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

#deep-link-url {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
    background: #f8f9fa;
    margin-bottom: 10px;
}

#copy-deep-link {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s ease;
}

#copy-deep-link:hover {
    background: #218838;
}

/* Share buttons removed as per requirements */

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .banner-content {
        padding: 12px 15px;
    }
    
    .banner-icon img {
        width: 40px;
        height: 40px;
    }
    
    .banner-text h4 {
        font-size: 14px;
    }
    
    .banner-text p {
        font-size: 12px;
    }
    
    .install-button {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .branch-deep-link-section {
        margin: 15px 0;
        padding: 12px;
    }
    
    .branch-deep-link-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
    
    #deep-link-url {
        font-size: 11px;
    }
}

/* Анимации загрузки */
.branch-loading {
    position: relative;
    overflow: hidden;
}

.branch-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Стили для уведомлений */
.branch-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Темная тема для баннера */
@media (prefers-color-scheme: dark) {
    .branch-deep-link-section {
        background: #2d3748;
        border-color: #4a5568;
        color: white;
    }
    
    #deep-link-result {
        background: #1a202c;
        border-color: #4a5568;
    }
    
    #deep-link-url {
        background: #2d3748;
        border-color: #4a5568;
        color: white;
    }
}

/* Скрытие баннера на десктопе - только мобильные устройства */
@media (min-width: 769px) {
    .branch-mobile-banner {
        display: none !important;
    }
}

/* Позиционирование для товаров в сетке */
.woocommerce ul.products li.product {
    position: relative;
}

/* Share button styles removed */

/* Стили для состояния успеха */
.branch-success {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

/* Стили для состояния ошибки */
.branch-error {
    background: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}

/* REMOVED: Affiliate widget styles
 * The affiliate widget has been removed as per requirements
 * to avoid informing customers that they arrived via an affiliate link
 */

/* Индикатор партнерской ссылки */
.affiliate-indicator {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 6px 0 0 6px;
    font-size: 12px;
    z-index: 9999;
    cursor: pointer;
    transition: all 0.3s ease;
}

.affiliate-indicator:hover {
    padding-right: 20px;
}

.affiliate-indicator::before {
    content: "🔗";
    margin-right: 5px;
}

/* Стили для партнерских ссылок в каталоге */
.product.has-affiliate-link {
    position: relative;
}

.product.has-affiliate-link::before {
    content: "👥";
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 2;
}

/* Улучшенные стили для кнопок Deep Links */
.branch-deep-link-btn.affiliate {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.branch-deep-link-btn.affiliate:hover {
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Стили для уведомлений о партнерских действиях */
.affiliate-notification {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.affiliate-notification::before {
    content: "👥";
    font-size: 16px;
}

/* REMOVED: Dark theme styles for affiliate widget
 * The affiliate widget has been removed as per requirements
 */
