/* =========================
   Стили для footer.php
   ========================= */
.footer {
    background: linear-gradient(135deg, #18181b 0%, #23272f 100%);
    color: #fff;
    padding: 0;
    font-size: 1rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    margin-top: 60px;
}
.footer .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}
.footer-bottom {
    text-align: center;
    padding: 20px 0;
    color: #ffffff; /* Делаем текст белым для лучшей читаемости */
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column; /* stack top row and label vertically */
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.footer-top-row { display:flex; align-items:center; gap:12px; justify-content:center; }
.tg-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top:10px;
    text-decoration: none;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    box-shadow: 0 6px 18px rgba(3,102,214,0.06);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.tg-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(3,102,214,0.12);
    background: linear-gradient(135deg, #1fb6ff, #0086c7);
}
.tg-link:focus-visible {
    outline: 3px solid rgba(31,182,255,0.18);
    outline-offset: 4px;
}
.tg-icon { width: 22px; height: 22px; display: inline-block; object-fit: contain; border-radius: 6px; }
.tg-text { font-size: 0.95rem; color: #e6eef8; font-weight: 600; }
/* Telegram contact in footer */
.footer-contact { margin-left: 12px; margin-top: 6px; }
/* ensure tg-link uses pill layout and text is visible */
.tg-link { width: auto; height: auto; padding: 8px 14px; border-radius: 999px; }
.tg-text { display: inline-block; }

/* Feedback Widget */
.feedback-widget {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feedback-widget span {
    color: #e6eef8;
    font-size: 0.9rem;
}

.feedback-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.feedback-btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Feedback Modal */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.feedback-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    position: relative;
    z-index: 1;
}

.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.feedback-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.feedback-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.feedback-modal-close:hover {
    background: #f0f0f0;
}

.feedback-modal-body {
    padding: 20px;
}

.feedback-modal-body textarea {
    width: 100%;
    height: 120px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.feedback-modal-body textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.feedback-char-count {
    text-align: right;
    font-size: 0.8rem;
    color: #666;
    margin-top: 8px;
}

.feedback-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.feedback-modal-footer .btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.feedback-modal-footer .btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.feedback-modal-footer .btn-secondary:hover {
    background: #e9ecef;
}

.feedback-modal-footer .btn-primary {
    background: #007bff;
    color: white;
}

.feedback-modal-footer .btn-primary:hover:not(:disabled) {
    background: #0056b3;
}

.feedback-modal-footer .btn-primary:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

@media (max-width: 800px) {
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }
    .footer-section {
        min-width: 0;
    }
    
    .footer-top-row {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .feedback-widget {
        margin-left: 0;
        flex-direction: column;
        gap: 8px;
        align-items: center;
    }
    
    .feedback-modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .feedback-modal-footer {
        flex-direction: column-reverse;
    }
    
    .feedback-modal-footer .btn {
        width: 100%;
    }
}

/* Mobile floating add product button */
.mobile-add-btn {
    position: fixed;
    right: 18px;
    bottom: 18px; /* По умолчанию в нижней позиции */
    width: 46px; /* Такой же размер как у back to top */
    height: 46px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 0; /* Добавляю border: 0 как у back to top */
    margin: 0; /* Обнуляю margin */
    padding: 0; /* Обнуляю padding */
    box-sizing: border-box; /* Одинаковый box-sizing */
    text-decoration: none;
    cursor: pointer;
    background: linear-gradient(135deg, #059669, #047857); /* Зеленый градиент в стиле "добавить объявление" */
    color: #fff;
    box-shadow: 0 12px 32px rgba(0,0,0,0.22), 0 6px 18px rgba(5, 150, 105, 0.25); /* Тень под зеленый */
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Нейтральный transform вместо scale */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1999;
}

/* Когда back-to-top активна, поднимаем кнопку добавления выше */
.mobile-add-btn.elevated {
    bottom: 84px; /* Выше кнопки back-to-top (46px + 20px отступ) */
    z-index: 2001; /* Выше back-to-top */
}

.mobile-add-btn::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(135deg, #059669, #047857); /* Зеленый градиент для пульсации */
    border-radius: 50%;
    z-index: -1;
    opacity: 0.7;
    animation: mobileAddBtnPulse 2s infinite;
}

.mobile-add-btn:hover {
    background: linear-gradient(135deg, #10b981, #059669); /* Светлее зеленый при hover */
    transform: translateY(-2px); /* Легкий подъём вместо scale */
    color: #fff;
    text-decoration: none;
    box-shadow: 0 16px 40px rgba(0,0,0,0.3), 0 8px 24px rgba(5, 150, 105, 0.35); /* Зеленая тень */
}

.mobile-add-btn:hover::before {
    animation-play-state: paused;
}

.mobile-add-btn:focus {
    outline: 3px solid rgba(5, 150, 105, 0.4); /* Зеленая обводка при focus */
    outline-offset: 3px;
    color: #fff;
    text-decoration: none;
}

.mobile-add-btn:active {
    transform: translateY(1px); /* Легкое нажатие вместо scale */
    transition-duration: 0.1s;
}

.mobile-add-btn i {
    font-size: 18px; /* Уменьшаю иконку под размер кнопки */
    transition: transform 0.2s ease;
}

.mobile-add-btn:hover i {
    transform: rotate(90deg); /* Только поворот без scale */
}

/* Показываем только на мобильных */
@media (max-width: 768px) {
    .mobile-add-btn {
        display: inline-flex; /* Такой же display как у back to top */
        animation: mobileAddBtnFadeIn 0.4s ease-out;
    }
}

@media (max-width: 480px) {
    .mobile-add-btn {
        width: 44px; /* Немного меньше на малых экранах */
        height: 44px;
        right: 19px;
    }
    
    .mobile-add-btn.elevated {
        bottom: 78px; /* Пропорционально меньший отступ */
    }
    
    .mobile-add-btn i {
        font-size: 16px; /* Еще меньше иконка */
    }
    
    /* Также корректируем back to top для консистентности */
    #backToTopBtn {
        width: 44px;
        height: 44px;
        right: 15px;
    }
    
    #backToTopBtn i {
        font-size: 16px;
    }
}

@keyframes mobileAddBtnFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px); /* Без scale */
    }
    to {
        opacity: 1;
        transform: translateY(0); /* Нейтральное положение */
    }
}

@keyframes mobileAddBtnPulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

/* Back to top button */
#backToTopBtn{
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 0;
    margin: 0; /* Обнуляю margin */
    padding: 0; /* Обнуляю padding */
    box-sizing: border-box; /* Одинаковый box-sizing */
    cursor: pointer;
    /* Brand-like orange gradient to match logo */
    background: linear-gradient(135deg, #ff6a00, #ff3b00);
    color: #fff;
    box-shadow: 0 12px 32px rgba(0,0,0,0.22), 0 6px 18px rgba(255, 107, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease, background .2s ease;
    z-index: 2000; /* Выше мобильной кнопки */
}
#backToTopBtn.visible{ opacity:1; visibility:visible; transform: translateY(0); }
#backToTopBtn:hover{ background: linear-gradient(135deg, #ea580c, #c2410c); }
#backToTopBtn:focus{ outline: 3px solid rgba(234, 88, 12, 0.4); outline-offset: 3px; }
#backToTopBtn i{ font-size: 18px; }
