/**
 * Search Modal Component
 * 
 * Модальное окно поиска для мобильных устройств
 * Используется на всех страницах проекта через includes/search_modal.php
 */

/* Search Modal */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 10000;
    flex-direction: column;
}

.search-modal.active {
    display: flex;
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}

.search-modal-back {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1f2937;
    transition: all 0.2s;
    border-radius: 6px;
}

.search-modal-back:hover {
    background: #f3f4f6;
}

.search-modal-back svg {
    width: 24px;
    height: 24px;
}

.search-modal-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-modal-search-icon {
    position: absolute;
    left: 12px;
    width: 20px;
    height: 20px;
    color: #9ca3af;
    pointer-events: none;
}

.search-modal-input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    background: #f9fafb;
    transition: all 0.2s;
}

.search-modal-input:focus {
    background: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-modal-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 24px;
    color: #9ca3af;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.search-modal-input:not(:placeholder-shown) + .search-modal-clear {
    display: flex;
}

.search-modal-clear:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.search-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.search-section {
    margin-bottom: 24px;
}

.search-section:last-child {
    margin-bottom: 0;
}

.search-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}

.search-clear-all {
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.search-clear-all:hover {
    text-decoration: underline;
}

.recent-searches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
    text-decoration: none;
    color: #1f2937;
    transition: all 0.2s;
}

.recent-search-item:hover {
    background: #f3f4f6;
}

.recent-search-item svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
    flex-shrink: 0;
}

.recent-search-item span {
    font-size: 14px;
}

.search-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.search-category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: #f9fafb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.search-category-card:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.search-category-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.search-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.search-category-icon svg {
    width: 28px;
    height: 28px;
    color: #9ca3af;
}

.search-category-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.3;
}

.search-category-count {
    font-size: 11px;
    color: #6b7280;
}

.search-trending {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trending-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 20px;
    text-decoration: none;
    color: #1f2937;
    font-size: 13px;
    transition: all 0.2s;
}

.trending-tag:hover {
    background: #3b82f6;
    color: #fff;
}

.trending-tag svg {
    width: 14px;
    height: 14px;
    color: #ef4444;
}

.trending-tag:hover svg {
    color: #fff;
}

/* Desktop - hide modal, use regular search */
@media (min-width: 769px) {
    .search-modal {
        display: none !important;
    }
}


