/* ============================================================================
   MERCHANT SEARCH BOX STYLES - NopCommerce Default Theme Compatible
   ============================================================================ */

.merchant-search-box {
    position: relative;
    width: 100%;
}

.merchant-search-box form {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    gap: 0;
}

.merchant-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
}

.merchant-search-box .search-box-text {
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 8px 35px 8px 12px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.merchant-search-box .search-box-text:focus {
    outline: none;
    border-color: #4ab2f1;
    box-shadow: 0 0 0 2px rgba(74, 178, 241, 0.2);
}

.merchant-search-box .btn-clear-search {
    position: absolute;
    right: 45px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    width: 24px;
    height: 24px;
    line-height: 1;
}

.merchant-search-box .btn-clear-search i {
    font-size: 14px;
    color: #999;
    transition: color 0.2s ease;
}

.merchant-search-box .btn-clear-search:hover i {
    color: #666;
}

.merchant-search-box input.search-box-text:not(:placeholder-shown)~.btn-clear-search,
.merchant-search-box input.search-box-text[value]:not([value=""])~.btn-clear-search {
    display: flex;
}

.merchant-search-box .search-box-button {
    min-width: 86px;
    height: 36px;
    border: none;
    background-color: #4ab2f1;
    padding: 0 15px;
    text-align: center;
    color: #fff;
    text-transform: uppercase;
    margin: 0;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.merchant-search-box .search-box-button:hover,
.merchant-search-box .search-box-button:focus {
    background-color: #248ece;
}

/* Dropdown styles - NopCommerce autocomplete compatible */
.merchant-search-dropdown {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 9999;
    display: none;
    overflow: hidden;
    text-align: left;
    font: normal 14px Arial, Helvetica, sans-serif;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 10px;
}

.merchant-search-section {
    padding: 12px 15px;
    border-top: 1px solid #ddd;
}

.merchant-search-section:first-child {
    border-top: none;
}

.merchant-search-section-title {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    text-transform: uppercase;
}

.recent-searches,
.popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recent-tag-wrapper {
    display: inline-flex;
    align-items: center;
    background: #f6f6f6;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: #777;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.recent-tag-wrapper:hover,
.recent-tag-wrapper:focus {
    background-color: #f0f0f0;
    border-color: #bbb;
    text-decoration: none;
    color: #333;
}

.recent-tag-icon {
    margin-right: 6px;
    color: #999;
    font-size: 12px;
}

.recent-tag-text {
    flex-grow: 1;
}

.recent-tag-remove {
    margin-left: 8px;
    font-size: 16px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}

.recent-tag-remove:hover {
    color: #555;
}

.tag {
    display: inline-block;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    background: #f6f6f6;
    cursor: pointer;
    font-size: 13px;
    color: #777;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.tag:hover,
.tag:focus {
    background-color: #f0f0f0;
    border-color: #bbb;
    color: #333;
    text-decoration: none;
}

/* Loading state */
.merchant-search-box .search-box-text.ui-autocomplete-loading,
.merchant-search-box .search-box-text.search-loading {
    /* 3 Dots Loading SVG */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 24 24'%3E%3Ccircle cx='4' cy='12' r='2' fill='%23666'%3E%3Canimate attributeName='opacity' dur='1s' values='0;1;0' repeatCount='indefinite' begin='0.1'/%3E%3C/circle%3E%3Ccircle cx='12' cy='12' r='2' fill='%23666'%3E%3Canimate attributeName='opacity' dur='1s' values='0;1;0' repeatCount='indefinite' begin='0.2'/%3E%3C/circle%3E%3Ccircle cx='20' cy='12' r='2' fill='%23666'%3E%3Canimate attributeName='opacity' dur='1s' values='0;1;0' repeatCount='indefinite' begin='0.3'/%3E%3C/circle%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 70px center !important;
    background-size: 24px !important;
    padding-right: 100px !important;
    opacity: 1;
    cursor: text;
}

.merchant-search-box .search-box-text.search-loading:disabled {
    background-color: #f9f9f9;
}

.merchant-search-box .search-box-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Loading spinner for merchants wrapper */
.merchants-wrapper .ajax-products-busy {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.merchants-wrapper .loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4ab2f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.merchants-wrapper .ajax-products-busy p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Smooth transitions for merchants wrapper */
.merchants-wrapper {
    transition: opacity 0.2s ease-in-out;
}

/* Retry button styling */
.retry-search {
    margin-top: 10px;
    padding: 8px 16px;
    background: #4ab2f1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.retry-search:hover {
    background: #248ece;
}

/* Loading text in dropdown */
.loading-text,
.no-results-text,
.error-text {
    display: block;
    padding: 12px 15px;
    color: #999;
    font-size: 13px;
    text-align: center;
    font-style: italic;
}

.error-text {
    color: #e4444c;
}

/* ============================================================================
   SEARCH SUGGESTIONS DROPDOWN STYLES
   ============================================================================ */

.merchant-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 10000;
    display: none;
    overflow: hidden;
    text-align: left;
    font: normal 14px Arial, Helvetica, sans-serif;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.2s ease;
    border-radius: 10px;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.15s ease;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item:focus {
    background-color: #f0f7ff;
}

.suggestion-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.suggestion-desc {
    font-size: 12px;
    color: #777;
    line-height: 1.4;
}

.suggestion-loading,
.no-suggestions {
    padding: 15px;
    text-align: center;
    color: #999;
    font-style: italic;
    font-size: 13px;
}

.suggestion-loading {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24'%3E%3Cpath fill='%23999' d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z' opacity='.25'/%3E%3Cpath fill='%23999' d='M10.14,1.16a11,11,0,0,0-9.14,10.9A1.59,1.59,0,0,0,2.46,14,1.59,1.59,0,0,1,1,15.56a1.59,1.59,0,0,0,1.59,1.59h0A11,11,0,0,0,12.05,23a11,11,0,0,0,10.9-9.14,1.59,1.59,0,0,0-3.18,0A8,8,0,1,1,10.14,1.16Z'%3E%3CanimateTransform attributeName='transform' type='rotate' dur='0.75s' values='0 12 12;360 12 12' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") no-repeat center left 15px;
    padding-left: 45px;
    text-align: left;
}

/* Mobile responsiveness for suggestions */
@media (max-width: 768px) {
    .merchant-suggestions-dropdown {
        max-height: 250px;
    }

    .suggestion-item {
        padding: 10px 12px;
    }
}

/* Smooth transitions for tags */
.recent-tag-wrapper,
.tag {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth dropdown animation */
.merchant-search-dropdown {
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .merchant-search-box form {
        flex-direction: column;
    }

    .merchant-search-input-wrapper {
        width: 100%;
    }

    .merchant-search-box .search-box-button {
        width: 100%;
        margin-top: 5px;
    }

    .merchant-search-dropdown {
        left: 0;
        right: 0;
        max-width: 100%;
    }
}

/* Header integration styles */
.header-lower .merchant-search-box {
    flex: 1;
    max-width: 400px;
}

.header-lower .merchant-search-box form {
    justify-content: flex-start;
}

/* ============================================================================
   HEADER LAYOUT STYLES (existing)
   ============================================================================ */

.header-lower {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    z-index: 99;
}

.header-logo {
    flex-shrink: 0;
}

.search-location-wrap {
    flex: 0 0 auto;
    display: flex !important;
    align-items: center;
}

.search-location-wrap .location-select {
    display: flex;
    align-items: center;
}

.search-location-wrap .location-selected {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.2s ease;
    line-height: 1.2;
}

.search-location-wrap .location-selected:hover {
    background: #f5f5f5;
}

.search-location-wrap .location-selected .location-selected-text {
    margin: 0 !important;
    font-size: 12px;
    color: #333;
    line-height: 1.3;
    display: block;
    white-space: nowrap;
}

.search-location-wrap .location-selected .location-selected-text:first-child {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 2px !important;
}

.search-location-wrap .location-selected br {
    display: none;
}

.search-location-wrap .badge-open {
    display: inline-block;
    background-color: #e6f4ea;
    color: #34a853;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 4px;
    text-transform: uppercase;
}

.search-location-wrap .status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 4px;
    text-transform: uppercase;
}

.search-location-wrap .status-badge.closed {
    background-color: #dc3545;
    color: #fff;
}

.search-location-wrap .location-selected .location-selected-text:first-child::before {
    content: '\f041';
    font-family: 'FontAwesome';
    margin-right: 4px;
    color: #c09e6c;
    font-size: 12px;
}

@media (max-width: 768px) {
    .header-lower {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .header-logo {
        width: 100%;
        text-align: center;
    }

    .search-location-wrap {
        width: 100%;
        justify-content: center;
        order: 3;
    }

    .header-lower .merchant-search-box {
        width: 100%;
        max-width: 100%;
        order: 2;
    }
}


/* Rich Suggestion Styles */
.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.suggestion-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-logo i {
    font-size: 20px;
    color: #ccc;
}

.suggestion-details {
    flex-grow: 1;
    overflow: hidden;
}

.suggestion-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-rating {
    font-size: 13px;
    color: #666;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
}

.suggestion-rating i {
    color: #888;
    /* Gray star color */
    margin-right: 4px;
}

.suggestion-cuisines {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion-arrow {
    margin-left: 10px;
    color: #ccc;
    font-size: 14px;
}

.suggestion-item:hover {
    background-color: #f9f9f9;
}

.suggestion-item:hover .suggestion-arrow {
    color: #333;
}

/* Suggestion Footer (Search For...) */
.suggestion-footer {
    padding: 12px 15px;
    background-color: #f7faff;
    border-top: 1px solid #eef;
    cursor: pointer;
    color: #007bff;
    /* Link blue */
}

.suggestion-footer:hover {
    background-color: #eef5ff;
    text-decoration: underline;
}

.suggestion-search-btn {
    font-size: 14px;
    text-align: center;
    width: 100%;
    display: block;
}

.merchant-suggestions-dropdown .no-suggestions {
    padding: 20px;
    background: #fff;
    text-align: center;
    color: #666;
}

/* ============================================================================
   NO RESULTS FOUND STYLES
   ============================================================================ */

.no-result-found {
    text-align: center;
    padding: 40px 0;
}

.no-result-found h4 {
    margin-bottom: 20px;
    font-size: 18px;
    color: #333;
}

.no-result-found .image-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.no-result-found .no-result-icon {
    margin-bottom: 15px;
    color: #e91e63;
}

.no-result-found .no-result-text {
    font-size: 16px;
    font-weight: bold;
    color: #555;
    margin: 0;
}