/**
 * 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;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    background: #ffffff;
    overflow: hidden;
    min-width: 0;
}

.search-modal-search-icon {
    position: absolute;
    left: 10px;
    width: 16px;
    height: 16px;
    color: #9ca3af;
    pointer-events: none;
    opacity: 0.7;
    z-index: 1;
}

.search-modal-input {
    flex: 1;
    padding: 8px 12px 8px 36px;
    border: none;
    border-radius: 24px 0 0 24px;
    font-size: 15px;
    outline: none;
    background: transparent;
    transition: all 0.2s;
    height: 36px;
    min-height: 36px;
    color: #1f2937;
    min-width: 0;
}

.search-modal-input:focus {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.search-modal-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.search-modal-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    background: #E85A2B;
    color: #ffffff;
    border: none;
    border-left: 2px solid #E85A2B;
    cursor: pointer;
    transition: all 0.2s;
    height: 36px;
    flex-shrink: 0;
    min-width: 60px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 0 24px 24px 0;
}

.search-modal-submit-btn:hover {
    background: #D94F26;
    border-left-color: #D94F26;
    color: #ffffff;
}

.search-modal-submit-btn:active {
    background: #C74620;
    border-left-color: #C74620;
}

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

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

.rtl-content .search-modal-clear {
    right: auto;
    left: 70px;
}

.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;
}

/* RTL Support */
.rtl-content .search-modal-input-wrapper {
    flex-direction: row-reverse;
}

.rtl-content .search-modal-search-icon {
    left: auto;
    right: 10px;
}

.rtl-content .search-modal-input {
    padding: 8px 36px 8px 12px;
}

.rtl-content .search-modal-submit-btn {
    border-left: none;
    border-right: 2px solid #E85A2B;
    border-radius: 24px 0 0 24px;
}

.rtl-content .search-modal-submit-btn:hover {
    border-right-color: #D94F26;
}

.rtl-content .search-modal-submit-btn:active {
    border-right-color: #C74620;
}

.rtl-content .search-modal-input {
    border-radius: 0 24px 24px 0;
}

.rtl-content .search-modal-clear {
    right: auto;
    left: 65px;
}


