/* ========================================
   SEARCH POPUP - MODERN FULL SCREEN DESIGN
   ======================================== */

.search_page_div {
    display: none;
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    overflow: hidden;
}

.recent_page_grid {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Search Header */
.search_page_div .top_nav {
    background: linear-gradient(135deg, #1e5799 0%, #2989d8 50%, #207cca 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search_page_div .top_nav i {
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search_page_div .top_nav i:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.search_page_div .top_nav i:active {
    transform: translateX(-2px) scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

/* Search Input Container */
#search_form {
    flex: 1;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.search_page_div #search_service {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    outline: none;
    transition: all 0.3s ease;
}

.search_page_div #search_service:focus {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.search_page_div #search_service::placeholder {
    color: #999;
    font-size: 15px;
}

/* Search Results Container */
.search_scroll_div {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f8f9fa;
    padding: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.search_ajax_div {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    box-sizing: border-box;
    justify-content: flex-start !important;
}

/* Apply same product card styles as main grid */
.search_ajax_div .product_item {
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    margin: 0 !important;
    border-radius: 8px !important;
    border: 1px solid #e5e5e5 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    width: calc(50% - 6px) !important;
    padding: 0 !important;
}

.search_ajax_div .product_item:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px) !important;
    border-color: #d0d0d0 !important;
}

.search_ajax_div .product_item .product_img {
    width: 100% !important;
    height: 160px !important;
    overflow: hidden !important;
    background: #fafafa !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.search_ajax_div .product_item .product_img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 8px !important;
}

.search_ajax_div .product_item .product_detail {
    padding: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    flex: 1 !important;
}

/* Empty State */
.search_div_1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.search_div_1::before {
    content: "🔍";
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.search_div_2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.search_div_3 {
    font-size: 14px;
    color: #999;
}

/* No Results Found */
.no_found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.no_found::before {
    content: "😕";
    font-size: 72px;
    margin-bottom: 20px;
}

/* Loading Indicator */
.custom-loader-container-9x7a1 {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.dot-loader-9x7a1 {
    display: flex;
    gap: 8px;
}

.dot-loader-9x7a1 span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2989d8;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.dot-loader-9x7a1 span:nth-child(1) {
    animation-delay: -0.32s;
}

.dot-loader-9x7a1 span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dotBounce {

    0%,
    80%,
    100% {
        transform: scale(0);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Search Results Grid - Use same styling as main product grid */
/* Product items inherit all styles from product-grid-responsive.css */

/* Scrollbar Styling */
.search_scroll_div::-webkit-scrollbar {
    width: 8px;
}

.search_scroll_div::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.search_scroll_div::-webkit-scrollbar-thumb {
    background: #2989d8;
    border-radius: 4px;
}

.search_scroll_div::-webkit-scrollbar-thumb:hover {
    background: #1e5799;
}

/* Tablet Responsive */
@media (min-width: 768px) {
    .search_page_div .top_nav {
        padding: 20px 40px;
    }

    .search_scroll_div {
        padding: 30px 40px;
    }

    .search_page_div #search_service {
        font-size: 18px;
        padding: 16px 24px;
    }

    .search_ajax_div .product_item {
        width: calc(33.333% - 8px) !important;
    }

    .search_ajax_div .product_item .product_img {
        height: 180px !important;
    }
}

/* Desktop Responsive */
@media (min-width: 1024px) {
    .search_page_div .top_nav {
        padding: 24px 60px;
    }

    .search_scroll_div {
        padding: 40px 60px;
    }

    .search_ajax_div .product_item {
        width: calc(25% - 10.5px) !important;
    }

    .search_ajax_div .product_item .product_img {
        height: 220px !important;
    }
}

@media (min-width: 1400px) {
    .search_ajax_div .product_item {
        width: calc(20% - 12px) !important;
    }

    .search_ajax_div .product_item .product_img {
        height: 200px !important;
    }
}

@media (min-width: 1600px) {
    .search_ajax_div .product_item {
        width: calc(16.666% - 13px) !important;
    }
}

/* Animation for search popup */
@keyframes searchSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Back Button Responsive Styles */
@media (max-width: 480px) {
    .search_page_div .top_nav i {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .search_page_div .top_nav {
        padding: 12px 16px;
        gap: 12px;
    }
}

@media (min-width: 1024px) {
    .search_page_div .top_nav i {
        width: 48px;
        height: 48px;
        font-size: 26px;
    }
}

/* Accessibility improvements for back button */
.search_page_div .top_nav i:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* Touch feedback for mobile */
@media (max-width: 768px) {
    .search_page_div .top_nav i:active {
        transform: translateX(-1px) scale(0.9);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .search_page_div .top_nav i {
        transition: background-color 0.2s ease;
    }

    .search_page_div .top_nav i:hover {
        transform: none;
    }

    .search_page_div .top_nav i:active {
        transform: none;
    }
}

/* Ensure search popup appears above all other elements including sliders */
.search_page_div .top_nav {
    z-index: 9999 !important;
    position: relative !important;
}

/* Force search popup to be on top of everything */
.search_page_div {
    z-index: 9999 !important;
}

/* Override any conflicting z-index from other components */
.search_page_div * {
    position: relative;
}

.search_page_div .recent_page_grid {
    z-index: 9999 !important;
    position: relative !important;
}

/* Desktop/Laptop specific fixes - ensure popup appears above header and categories */
@media (min-width: 769px) {
    .search_page_div {
        z-index: 999 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
    }

    .search_page_div .recent_page_grid {
        z-index: 9999 !important;
        position: relative !important;
    }

    .search_page_div .top_nav {
        z-index: 999 !important;
        position: relative !important;
    }

    .search_scroll_div {
        z-index: 999 !important;
        position: relative !important;
    }
}

/* Ensure search popup is always on top */
body .search_page_div {
    z-index: 999 !important;
}

/* Override any potential conflicts from desktop styles */
@media (min-width: 1024px) {
    .search_page_div {
        z-index: 9999 !important;
        position: fixed !important;
        inset: 0 !important;
    }
}

/* Ultimate z-index override - ensure search popup is always visible */
.search_page_div[style*="display: block"],
.search_page_div.show {
    /* Maximum z-index value */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #fff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: unset;
}

/* Ensure all child elements also have high z-index */
.search_page_div[style*="display: block"] * {
    z-index: inherit !important;
}

/* Force popup to be above any desktop elements */