/**
 * TurnKey Directories - Search Page Mobile Optimization
 * Optimized for modern mobile devices (320px - 768px)
 * 
 * UPDATED: Location dropdown mobile fix - Full screen with close button
 * Version: 2025-01-XX - Cache bust
 */

/* ============================================
   HERO SECTION MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    .tkd-hero-section {
        padding: 24px 0 !important;
        min-height: auto !important;
    }
    
    .tkd-hero-content {
        padding: 0 16px !important;
        max-width: 100% !important;
    }
    
    .tkd-hero-title {
        font-size: 24px !important;
        line-height: 1.3 !important;
        margin-bottom: 12px !important;
        text-align: center !important;
        padding: 0 !important;
    }
    
    .tkd-hero-subtitle {
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
        text-align: center !important;
        padding: 0 !important;
    }
}

/* ============================================
   SEARCH WIDGET MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    .tkd-search-widget {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .tkd-search-form {
        border-radius: 16px !important;
        padding: 16px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        margin: 0 16px !important;
    }
    
    .tkd-search-inputs {
        flex-direction: column !important;
        gap: 0 !important;
        min-height: auto !important;
    }
}

/* ============================================
   SEARCH FIELDS MOBILE LAYOUT
   ============================================ */

@media (max-width: 768px) {
    .tkd-search-field {
        width: 100% !important;
        min-height: 56px !important;
        padding: 12px 16px !important;
        border-radius: 12px !important;
        margin-bottom: 12px !important;
        border: none !important;
        background: #f7f7f7 !important;
        transition: background 0.2s ease !important;
    }
    
    .tkd-search-field:hover {
        background: #eeeeee !important;
    }
    
    .tkd-search-field:focus-within {
        background: #ffffff !important;
        box-shadow: 0 0 0 2px rgba(129, 215, 66, 0.3) !important;
    }
    
    /* Remove separators on mobile */
    .tkd-search-field::after {
        display: none !important;
    }
    
    .tkd-search-field:not(:last-child)::after {
        display: none !important;
    }
    
    /* Individual field styling */
    .tkd-field-business,
    .tkd-field-filters,
    .tkd-field-location {
        width: 100% !important;
        border-right: none !important;
        border-bottom: none !important;
    }
    
    .tkd-field-location {
        margin-bottom: 16px !important;
    }
}

/* ============================================
   SEARCH INPUTS OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    .tkd-search-field input {
        font-size: 16px !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
        width: 100% !important;
        color: #222222 !important;
    }
    
    .tkd-search-field input::placeholder {
        color: #717171 !important;
        font-size: 15px !important;
    }
    
    .tkd-search-field input:focus {
        outline: none !important;
    }
    
    /* Labels on mobile */
    .tkd-search-field label {
        font-size: 11px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        color: #222222 !important;
        margin-bottom: 4px !important;
        display: block !important;
    }
}

/* ============================================
   FILTERS SELECTOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* CRITICAL: Override ALL desktop styles for selectors on mobile */
    .tkd-filters-selector,
    .tkd-location-selector {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        cursor: pointer !important;
        padding: 0 !important;
        width: 100% !important;
        min-height: auto !important;
        box-sizing: border-box !important;
        position: relative !important;
        overflow: visible !important;
    }
    
    .tkd-filters-text,
    .tkd-location-text {
        font-size: 15px !important;
        color: #222222 !important;
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    .tkd-filters-selector i,
    .tkd-location-selector i {
        font-size: 12px !important;
        color: #717171 !important;
        margin-left: 8px !important;
        flex-shrink: 0 !important;
        display: inline-block !important;
    }
}

/* ============================================
   SEARCH SUBMIT BUTTON MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-search-submit {
        width: 100% !important;
        height: 56px !important;
        border-radius: 12px !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        background: var(--tkd-primary, #81d742) !important;
        border: none !important;
        color: white !important;
        cursor: pointer !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        -webkit-tap-highlight-color: transparent !important;
        box-shadow: 0 2px 8px rgba(129, 215, 66, 0.25) !important;
    }
    
    .tkd-search-submit:hover {
        box-shadow: 0 4px 12px rgba(129, 215, 66, 0.35) !important;
        transform: translateY(-1px) !important;
    }
    
    .tkd-search-submit:active {
        transform: scale(0.98) !important;
        background: var(--tkd-primary-dark, #70c033) !important;
        box-shadow: 0 1px 4px rgba(129, 215, 66, 0.2) !important;
    }
}

/* ============================================
   RESET SEARCH BUTTON MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-reset-search {
        position: absolute !important;
        right: 60px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 28px !important;
        height: 28px !important;
        border-radius: 8px !important;
        background: rgba(0, 0, 0, 0.05) !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        color: #666 !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
        opacity: 0.8 !important;
        box-shadow: none !important;
        outline: none !important;
    }
    
    .tkd-reset-search:hover {
        background: rgba(0, 0, 0, 0.09) !important;
        color: #333 !important;
        opacity: 1 !important;
        transform: translateY(-50%) scale(1.05) !important;
        box-shadow: none !important;
    }
    
    .tkd-reset-search:active {
        background: rgba(0, 0, 0, 0.12) !important;
        transform: translateY(-50%) scale(0.95) !important;
        box-shadow: none !important;
    }
    
    .tkd-reset-search:focus {
        outline: none !important;
        box-shadow: none !important;
    }
}

/* ============================================
   DROPDOWNS MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    /* Filters dropdown - keep existing bottom sheet style */
    .tkd-filters-dropdown {
        position: fixed !important;
        left: 16px !important;
        right: 16px !important;
        top: auto !important;
        bottom: 0 !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 70vh !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2) !important;
        z-index: 10000 !important;
    }
    
    /* Location dropdown - FULL SCREEN like filters dropdown in modern-niche.php */
    .tkd-location-dropdown {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        z-index: 99999 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
        flex-direction: column !important;
    }
    
    /* CRITICAL: Prevent any child from causing horizontal overflow */
    .tkd-location-dropdown * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .tkd-filters-dropdown.active {
        display: block !important;
        animation: slideUp 0.3s ease-out !important;
    }
    
    .tkd-location-dropdown.active {
        display: flex !important;
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(100%) !important;
        }
        to {
            transform: translateY(0) !important;
        }
    }
    
    /* Dropdown header mobile - only for filters */
    .tkd-filters-dropdown::before {
        content: '' !important;
        display: block !important;
        width: 40px !important;
        height: 4px !important;
        background: #dddddd !important;
        border-radius: 2px !important;
        margin: 12px auto 16px !important;
    }
    
    /* Remove handle for location dropdown */
    .tkd-location-dropdown::before {
        display: none !important;
    }
    
    /* Location dropdown header - show close button */
    .tkd-location-dropdown .tkd-dropdown-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 16px !important;
        border-bottom: 1px solid #f0f0f0 !important;
        background: white !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        z-index: 10 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .tkd-location-dropdown .tkd-dropdown-title {
        font-size: 16px !important;
        font-weight: 600 !important;
        color: #222 !important;
        margin: 0 !important;
    }
    
    .tkd-location-dropdown .tkd-dropdown-close {
        width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        border-radius: 50% !important;
        border: none !important;
        background: #f5f5f5 !important;
        color: #666 !important;
        font-size: 14px !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.2s ease !important;
        padding: 0 !important;
    }
    
    .tkd-location-dropdown .tkd-dropdown-close:active {
        background: #e8e8e8 !important;
        transform: scale(0.95) !important;
    }
}

/* ============================================
   FILTER CONTENT MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-filters-content {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        overflow-y: auto !important;
        max-height: calc(70vh - 120px) !important;
        padding: 0 20px 20px !important;
    }
    
    .tkd-filter-tabs {
        display: flex !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding: 0 20px 16px !important;
        border-bottom: 1px solid #eeeeee !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    
    .tkd-filter-tabs::-webkit-scrollbar {
        display: none !important;
    }
    
    .tkd-filter-tab {
        padding: 10px 16px !important;
        font-size: 14px !important;
        white-space: nowrap !important;
        border-radius: 20px !important;
        background: #f7f7f7 !important;
        border: none !important;
        color: #666666 !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
    }
    
    .tkd-filter-tab.active {
        background: #222222 !important;
        color: white !important;
    }
    
    .tkd-filter-tab i {
        font-size: 14px !important;
        margin-right: 6px !important;
    }
    
    .tkd-filter-tab span {
        display: inline !important;
    }
}

/* ============================================
   LOCATION DROPDOWN MOBILE
   ============================================ */

@media (max-width: 768px) {
    /* Hide location search on mobile */
    .tkd-location-dropdown .tkd-location-search {
        display: none !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }
    
    /* Location filter tabs - horizontal scrollable - MUST FIT WIDTH */
    .tkd-location-dropdown .tkd-location-filters {
        display: flex !important;
        gap: 6px !important;
        padding: 8px 16px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        background: white !important;
        scrollbar-width: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    
    .tkd-location-dropdown .tkd-location-filters::-webkit-scrollbar {
        display: none !important;
    }
    
    .tkd-location-dropdown .tkd-filter-tab {
        padding: 8px 14px !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        border-radius: 18px !important;
        border: none !important;
        background: #f0f0f0 !important;
        color: #666 !important;
        white-space: nowrap !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        min-height: 36px !important;
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        flex-shrink: 0 !important;
    }
    
    .tkd-location-dropdown .tkd-filter-tab.active {
        background: var(--tkd-primary, #81d742) !important;
        color: white !important;
    }
    
    /* Location content - scrollable area */
    .tkd-location-dropdown .tkd-location-content {
        flex: 1 1 0% !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 12px 16px !important;
        -webkit-overflow-scrolling: touch !important;
        min-height: 0 !important;
        max-height: none !important;
        background: white !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .tkd-location-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
    }
    
    .tkd-location-item {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 14px !important;
        border-radius: 8px !important;
        border: 1px solid #e8e8e8 !important;
        background: white !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
        min-height: 44px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .tkd-location-item:active {
        background: #f5f5f5 !important;
    }
    
    .tkd-location-item.selected {
        background: var(--tkd-primary, #81d742) !important;
        border-color: var(--tkd-primary, #81d742) !important;
        color: white !important;
    }
    
    /* Location footer actions - fixed at bottom - MUST FIT */
    .tkd-location-dropdown .tkd-location-actions {
        position: relative !important;
        bottom: auto !important;
        left: 0 !important;
        right: 0 !important;
        background: white !important;
        padding: 12px 16px !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
        border-top: 1px solid #f0f0f0 !important;
        display: flex !important;
        gap: 10px !important;
        flex-shrink: 0 !important;
        flex: 0 0 auto !important;
        z-index: 100 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }
    
    .tkd-location-dropdown .tkd-location-clear,
    .tkd-location-dropdown .tkd-location-apply {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        max-width: 50% !important;
        padding: 12px 8px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        border: none !important;
        cursor: pointer !important;
        min-height: 44px !important;
        transition: all 0.15s ease !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        width: auto !important;
    }
    
    .tkd-location-dropdown .tkd-location-clear {
        background: #f5f5f5 !important;
        color: #333 !important;
    }
    
    .tkd-location-dropdown .tkd-location-clear:active {
        background: #e8e8e8 !important;
    }
    
    .tkd-location-dropdown .tkd-location-apply {
        background: var(--tkd-primary, #81d742) !important;
        color: white !important;
    }
    
    .tkd-location-dropdown .tkd-location-apply:active {
        opacity: 0.9 !important;
    }
}

/* ============================================
   CHECKBOX OPTIONS MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-checkbox-option {
        width: 100% !important;
        padding: 14px 16px !important;
        font-size: 15px !important;
        min-height: 48px !important;
        border-radius: 12px !important;
        background: #f7f7f7 !important;
        border: 2px solid transparent !important;
        transition: all 0.2s ease !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }
    
    .tkd-checkbox-option input[type="checkbox"] {
        width: 20px !important;
        height: 20px !important;
        border-radius: 4px !important;
        border: 2px solid #dddddd !important;
        margin: 0 !important;
    }
    
    .tkd-checkbox-option input[type="checkbox"]:checked {
        background: var(--tkd-primary, #81d742) !important;
        border-color: var(--tkd-primary, #81d742) !important;
    }
    
    .tkd-checkbox-option label {
        flex: 1 !important;
        margin: 0 !important;
        font-size: 15px !important;
        color: #222222 !important;
        cursor: pointer !important;
    }
}

/* ============================================
   RATING SELECTOR MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-quick-filters,
    .tkd-rating-selector,
    .tkd-distance-service,
    .tkd-sort-reviews {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    .tkd-rating-option,
    .tkd-distance-option,
    .tkd-sort-option {
        padding: 14px 16px !important;
        font-size: 15px !important;
        min-height: 48px !important;
        border-radius: 12px !important;
        background: #f7f7f7 !important;
        border: 2px solid transparent !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        transition: all 0.2s ease !important;
        cursor: pointer !important;
    }
    
    .tkd-rating-option:active,
    .tkd-distance-option:active,
    .tkd-sort-option:active {
        background: #eeeeee !important;
        transform: scale(0.98) !important;
    }
    
    .tkd-rating-option.active,
    .tkd-distance-option.active,
    .tkd-sort-option.active {
        background: #e8f5e9 !important;
        border-color: var(--tkd-primary, #81d742) !important;
        color: #2e7d32 !important;
        font-weight: 600 !important;
    }
}

/* ============================================
   FILTER CHIPS MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-filter-pills {
        padding: 10px 12px !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .tkd-filter-pills::-webkit-scrollbar {
        display: none !important;
    }
    
    .tkd-filter-pill {
        padding: 6px 10px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        border-radius: 16px !important;
        min-height: 32px !important;
        display: inline-flex !important;
        align-items: center !important;
        flex: 0 0 auto !important;
    }
}

/* Extra small screens - make pills even more compact */
@media (max-width: 480px) {
    .tkd-filter-pills {
        padding: 8px 10px !important;
        gap: 5px !important;
    }
    
    .tkd-filter-pill {
        padding: 5px 8px !important;
        font-size: 10px !important;
        border-radius: 14px !important;
        min-height: 28px !important;
    }
}

/* ============================================
   RESULTS SECTION MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-main-content {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .tkd-content-wrapper {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    .tkd-results-header {
        padding: 20px 16px !important;
        text-align: center !important;
    }
    
    .tkd-results-count h2 {
        font-size: 20px !important;
        margin-bottom: 4px !important;
    }
    
    .tkd-results-count p {
        font-size: 14px !important;
        color: #666666 !important;
    }
}

/* ============================================
   ZILLOW LAYOUT MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-zillow-layout {
        flex-direction: column !important;
        height: auto !important;
        min-height: auto !important;
        margin-top: 0 !important;
        border-radius: 0 !important;
    }
    
    /* HIDE MAP ON MOBILE - eliminates the grey gap */
    .tkd-map-panel {
        display: none !important;
    }
    
    .tkd-results-panel {
        min-width: 100% !important;
        border-left: none !important;
        border-bottom: none !important;
        max-height: none !important;
    }
    
    .tkd-map-container {
        display: none !important;
    }
}

/* ============================================
   LISTINGS GRID MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-listings-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 16px !important;
    }
    
    .tkd-listing-card {
        border-radius: 12px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    .tkd-card-image {
        height: 180px !important;
    }
    
    .tkd-card-header {
        padding: 14px 14px 0 !important;
    }
    
    .tkd-business-name {
        font-size: 17px !important;
        line-height: 1.3 !important;
    }
    
    .tkd-card-body {
        padding: 8px 14px !important;
    }
    
    .tkd-card-footer {
        padding: 10px 14px 14px !important;
    }
    
    .tkd-view-details {
        padding: 12px 16px !important;
        font-size: 14px !important;
    }
}

/* ============================================
   STICKY SEARCH ON MOBILE
   ============================================ */

@media (max-width: 768px) {
    .tkd-search-widget.tkd-sticky-search {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        background: white !important;
        padding: 12px 0 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
        animation: slideDown 0.3s ease-out !important;
    }
    
    @keyframes slideDown {
        from {
            transform: translateY(-100%) !important;
        }
        to {
            transform: translateY(0) !important;
        }
    }
    
    .tkd-sticky-search .tkd-search-form {
        margin: 0 12px !important;
        padding: 8px 12px !important;
        border-radius: 100px !important;
    }
    
    .tkd-sticky-search .tkd-search-inputs {
        flex-direction: row !important;
        gap: 4px !important;
        align-items: center !important;
    }
    
    .tkd-sticky-search .tkd-search-field {
        margin-bottom: 0 !important;
        padding: 6px 10px !important;
        min-height: auto !important;
        background: transparent !important;
    }
    
    .tkd-sticky-search .tkd-field-business {
        flex: 1 !important;
        position: relative !important;
        overflow: visible !important;
        min-width: 0 !important;
    }
    
    /* Hide location in sticky mode */
    .tkd-sticky-search .tkd-field-location {
        display: none !important;
    }
    
    /* Show filters as compact chip in sticky mode */
    .tkd-sticky-search .tkd-field-filters {
        display: flex !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
        margin: 0 4px !important;
        background: transparent !important;
        border: none !important;
        min-height: auto !important;
        width: auto !important;
        max-width: 120px !important;
    }
    
    .tkd-sticky-search .tkd-filters-selector {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        background: #f0f0f0 !important;
        border-radius: 16px !important;
        padding: 4px 10px !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        color: #333 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
        cursor: pointer !important;
        border: none !important;
    }
    
    .tkd-sticky-search .tkd-filters-text {
        font-size: 11px !important;
        max-width: 70px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    .tkd-sticky-search .tkd-filters-selector i {
        font-size: 10px !important;
        color: #666 !important;
        margin: 0 !important;
    }
    
    /* Hide the sliders icon, show as dropdown arrow or remove */
    .tkd-sticky-search .tkd-filters-selector i.fa-sliders-h {
        display: none !important;
    }
    
    /* Hide the filters dropdown in sticky mode */
    .tkd-sticky-search .tkd-filters-dropdown {
        display: none !important;
    }
    
    /* Reset/Clear X button - larger and more visible */
    .tkd-sticky-search .tkd-reset-search {
        all: unset !important;
        position: absolute !important;
        right: 4px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        /* Larger size for better touch target */
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
        max-width: 26px !important;
        max-height: 26px !important;
        padding: 0 !important;
        margin: 0 !important;
        /* Red/pink circle like desktop */
        border-radius: 50% !important;
        background: #ff6b6b !important;
        border: none !important;
        color: white !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
        z-index: 10 !important;
        box-shadow: none !important;
        outline: none !important;
        box-sizing: border-box !important;
    }
    
    .tkd-sticky-search .tkd-reset-search i {
        font-size: 11px !important;
        line-height: 1 !important;
        color: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .tkd-sticky-search .tkd-reset-search:active {
        background: #e55555 !important;
        transform: translateY(-50%) scale(0.95) !important;
    }
    
    /* Input padding to make room for the X button */
    .tkd-sticky-search .tkd-field-business input {
        padding-right: 32px !important;
    }
    
    .tkd-sticky-search .tkd-search-submit {
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        padding: 0 !important;
        font-size: 16px !important;
    }
    
    .tkd-sticky-search .tkd-search-submit span {
        display: none !important;
    }
}

/* ============================================
   TOUCH OPTIMIZATION
   ============================================ */

@media (max-width: 768px) {
    /* Increase touch targets */
    button,
    a,
    input,
    select,
    .tkd-filter-pill,
    .tkd-location-option,
    .tkd-checkbox-option {
        min-height: 44px !important;
        -webkit-tap-highlight-color: transparent !important;
    }
    
    /* Smooth scrolling */
    .tkd-filters-content,
    .tkd-location-content,
    .tkd-filter-pills,
    .tkd-filter-tabs {
        -webkit-overflow-scrolling: touch !important;
    }
    
    /* Prevent zoom on input focus */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

@media (max-width: 768px) {
    /* Focus states for keyboard navigation */
    button:focus,
    a:focus,
    input:focus,
    select:focus {
        outline: 2px solid var(--tkd-primary, #81d742) !important;
        outline-offset: 2px !important;
    }
    
    /* High contrast mode support */
    @media (prefers-contrast: high) {
        .tkd-search-field,
        .tkd-filter-pill,
        .tkd-location-option,
        .tkd-checkbox-option {
            border: 2px solid #000000 !important;
        }
    }
    
    /* Reduced motion support */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ============================================
   SMALL MOBILE DEVICES (≤480px)
   ============================================ */

@media (max-width: 480px) {
    .tkd-hero-title {
        font-size: 22px !important;
    }
    
    .tkd-hero-subtitle {
        font-size: 13px !important;
    }
    
    .tkd-search-form {
        padding: 12px !important;
        margin: 0 12px !important;
    }
    
    .tkd-search-field {
        min-height: 52px !important;
        padding: 10px 14px !important;
    }
    
    .tkd-search-submit {
        height: 52px !important;
    }
    
    .tkd-listings-grid {
        padding: 12px !important;
        gap: 12px !important;
    }
    
    .tkd-card-image {
        height: 160px !important;
    }
}

/* ============================================
   VERY SMALL DEVICES (≤375px)
   ============================================ */

@media (max-width: 375px) {
    .tkd-hero-title {
        font-size: 20px !important;
    }
    
    .tkd-search-form {
        margin: 0 8px !important;
        padding: 10px !important;
    }
    
    .tkd-filter-pill {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}

