/**
 * Search Styles
 * Styles for search input, autocomplete dropdown, and results page
 */

/* =====================================================
   DESKTOP SEARCH BOX IN MENU BAR
   ===================================================== */

/* Header bottom inner - flex container for menu + search */
.header-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Desktop Search Box - in black menu bar */
.search-box-desktop {
    position: relative;
    margin-left: auto;
}

.search-form {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input {
    width: 180px;
    height: 30px;
    padding: 0 35px 0 10px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    outline: none;
    transition: width 0.2s ease;
    background: #fff;
}

.search-input:focus {
    width: 240px;
}

.search-input::placeholder {
    color: #999;
}

.search-clear {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #999;
    display: none;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    color: #333;
}

.search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit:hover {
    color: #333;
}

/* =====================================================
   MOBILE SEARCH
   ===================================================== */

/* Header right icons wrapper */
.header-right-icons {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Mobile Search Toggle Button - left of cart */
.search-toggle-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #ffffff;
}

@media (min-width: 992px) {
    .search-toggle-mobile {
        display: none;
    }
}

/* Mobile Search Bar - part of black header */
.search-mobile-bar {
    display: none;
    background: #1a1a1a;
    padding: 8px 0;
    position: relative;
}

.search-mobile-bar.active {
    display: block;
}

@media (min-width: 992px) {
    .search-mobile-bar {
        display: none !important;
    }
}

.search-form-mobile {
    display: flex;
    align-items: center;
    position: relative;
}

.search-input-mobile {
    flex: 1;
    height: 36px;
    padding: 0 45px 0 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    background: #fff;
}

.search-input-mobile:focus {
    outline: none;
}

.search-submit-mobile {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit-mobile:hover {
    color: #333;
}

/* =====================================================
   AUTOCOMPLETE DROPDOWN
   ===================================================== */

.search-dropdown,
.search-dropdown-mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 70vh;
    overflow-y: auto;
    z-index: 1001;
}

.search-dropdown.active,
.search-dropdown-mobile.active {
    display: block;
}

/* Desktop dropdown positioning */
.search-dropdown {
    min-width: 350px;
    right: 0;
    left: auto;
}

/* Mobile dropdown - full width under input */
.search-dropdown-mobile {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    border-radius: 4px;
    border-top: 1px solid #e0e0e0;
    max-height: calc(100vh - 150px);
}

/* Loading state */
.search-loading {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* No results */
.search-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Section styling */
.search-section {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.search-section:last-of-type {
    border-bottom: none;
}

.search-section-header {
    padding: 5px 15px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Categories as tags */
.search-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 5px 15px;
}

.search-category-tag {
    display: inline-block;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-category-tag:hover,
.search-category-tag.selected {
    background: #333;
    border-color: #333;
    color: #fff;
}

.search-category-tag mark {
    background: transparent;
    font-weight: 600;
}

.search-category-tag:hover mark,
.search-category-tag.selected mark {
    color: inherit;
}

/* Products list */
.search-products {
    display: flex;
    flex-direction: column;
}

.search-product-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: background 0.15s ease;
}

.search-product-item:hover,
.search-product-item.selected {
    background: #f8f8f8;
}

.search-product-image {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    margin-right: 12px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.search-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-product-img-placeholder {
    width: 100%;
    height: 100%;
    background: #eee;
}

.search-product-info {
    flex: 1;
    min-width: 0;
}

.search-product-name {
    display: block;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-product-name mark {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

.search-product-price {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-price-old {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.search-price-current {
    font-size: 14px;
    font-weight: 600;
    color: #68a329;
}

/* Articles list */
.search-articles {
    display: flex;
    flex-direction: column;
}

.search-article-item {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: background 0.15s ease;
}

.search-article-item:hover,
.search-article-item.selected {
    background: #f8f8f8;
}

.search-article-title {
    font-size: 14px;
    font-style: italic;
}

.search-article-title mark {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
    font-style: normal;
}

/* Show all button */
.search-show-all {
    display: block;
    padding: 15px;
    text-align: center;
    background: #68a329;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    transition: background 0.2s ease;
}

.search-show-all:hover,
.search-show-all.selected {
    background: #5a9022;
    color: #fff;
}

/* =====================================================
   SEARCH RESULTS PAGE
   ===================================================== */

.search-results-header {
    text-align: left;
    margin-bottom: 20px;
    padding-top: 15px;
}

h1.search-results-title {
    font-size: 18px !important;
    font-weight: 400 !important;
    margin-bottom: 5px !important;
    margin-top: 0 !important;
    line-height: 1.4 !important;
}

h1.search-results-title strong {
    font-weight: 600 !important;
}

.search-results-count {
    color: #666;
    font-size: 13px;
}

/* Results sections */
.search-results-section {
    margin-bottom: 30px;
}

.search-results-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

/* Category tags on results page */
.search-results-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-results-category {
    display: inline-block;
    padding: 8px 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-results-category:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* Blog articles on results page */
.search-results-articles {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-results-article {
    display: block;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s ease;
}

.search-results-article:hover {
    background: #f0f0f0;
}

.search-results-article-title {
    font-size: 16px;
    font-weight: 500;
    font-style: italic;
}

/* No results message */
.search-no-results-page {
    text-align: center;
    padding: 60px 20px;
}

.search-no-results-page h2 {
    font-size: 20px;
    margin-bottom: 15px;
}

.search-no-results-page p {
    color: #666;
    margin-bottom: 15px;
}

/* =====================================================
   HIGHLIGHT MARK STYLING
   ===================================================== */

mark {
    background: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

/* =====================================================
   RESPONSIVE ADJUSTMENTS
   ===================================================== */

@media (max-width: 767px) {
    .search-results-header {
        padding: 10px 0;
    }

    .search-results-title {
        font-size: 16px;
    }
}
