/* Modern Search Bar Styles */
.modern-search-wrapper {
    position: relative;
    flex-shrink: 0;
}

.modern-search-form {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #cccccc;
    border-radius: 25px;
    padding: 2px;
    box-shadow: 0 2px 8px rgba(71, 138, 201, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    /* Changed from hidden to allow expansion */
}

.search-input-wrapper:hover {
    box-shadow: 0 4px 12px rgba(71, 138, 201, 0.25);
    transform: translateY(-1px);
}

.search-input-wrapper:focus-within {
    box-shadow: 0 4px 16px rgba(71, 138, 201, 0.35);
    background: white;
    z-index: 1000;
    /* Ensure search bar appears above other elements */
}

.search-icon {
    position: absolute;
    left: 14px;
    color: #6c757d;
    transition: color 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.search-input-wrapper:focus-within .search-icon {
    color: #478ac9;
}

.header-center {
    display: flex;
    align-items: center;
}

.search-item {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: 16px;
}


.search-input {
    flex: 1;
    padding: 5px 42px 5px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #212529;
    outline: none;
    width: 270px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1001;
    /* Above the wrapper */
}

.search-input::placeholder {
    color: #6c757d;
    transition: color 0.3s ease;
}

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

.search-input:focus::placeholder {
    color: #adb5bd;
}

.search-btn {
    position: absolute;
    right: 16px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    color: white;
    background: none;
    flex-shrink: 0;
    z-index: 1002;

    /* Above input */
}

/*Search tabs*/
.search-tabs {
    display: flex;
    gap: 40px;
    border-bottom: 2px solid #e5e5e5;
    /* الخط الطويل */
    padding-bottom: 10px;
}

.search-tabs .tab {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: 500;
    color: #666;
    padding: 8px 0;
    position: relative;
    cursor: pointer;
    transition: color 0.25s ease;
}

/* underline (دايمًا موجود بس مخفي بالـ scale) */
.search-tabs .tab::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -12px;
    width: 100%;
    height: 3px;
    background: #2f5f9f;
    /* لون البراند */
    border-radius: 3px;

    transform: scaleX(0);
    /* مخفي */
    transform-origin: left;
    /* يبدأ من الشمال */
    transition: transform 0.25s ease;
    /* انتقال الخط */
}

/* Hover */
.search-tabs .tab:hover {
    color: #0054a6;
}

/* Active */
.search-tabs .tab.active {
    color: #0054a6;
}

/* الخط تحت الـ active */
.search-tabs .tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -12px;
    width: 100%;
    height: 3px;
    background: #0054a6;
    border-radius: 3px;
    transform: scaleX(1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}




/* Ensure nav items stay in one row */
.u-nav-container .u-nav-1 {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    margin-right: 40px;
}

/* Override default nav item behavior */
.u-nav-container .u-nav-item {
    flex-shrink: 0;
}

.search-results-section {

    min-height: 0;
    padding: 40px 20px;
}

.search-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Hero Header */
.search-hero {
    /*ackground: linear-gradient(135deg, #478ac9 0%, #2c5f8a 100%);*/
    background-image: linear-gradient(0deg, rgba(20, 29, 56, 0.85), rgba(20, 29, 56, 0.85)), url('../images/pattern-16.png');
    background-position: 50% 50%;
    display: flex;
    padding: 50px 40px;
    position: relative;

}

.search-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

.search-hero-content {
    position: relative;
    z-index: 1;
    align-items: center;
    margin: 0 auto;
    text-align: center;
}

.search-title {
    color: white;
    font-size: 2.25rem !important;
    font-weight: 700;
    margin: 0 !important;
    align-items: center;
    font-weight: 500 !important;
}

.title-icon {
    opacity: 0.9;
}

.search-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.3rem;
    margin: 0 0 30px 0;
    font-weight: 300;
}

.results-count,
.search-query {
    font-weight: 500;
    color: #7db1e1;
}

/* Enhanced Inline Search Bar */
.search-bar-inline {
    max-width: 700px;
    margin: 0 auto;
    width: 700px;
    display: flex;
    align-items: center;
}

.search-bar-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 6px 6px 6px 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    width: 100%;
}

.search-bar-wrapper:focus-within {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.search-bar-icon {
    color: #6c757d;
    flex-shrink: 0;
}

.search-bar-input {
    flex: 1;
    border: none;
    padding: 14px 20px;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: #000000;
}

.search-bar-btn {
    background: linear-gradient(135deg, #478ac9 0%, #2c5f8a 100%);
    color: white;
    border: none;
    padding: 14px 36px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-bar-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(71, 138, 201, 0.4);
}

/* No Results State */
.no-results-state {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.no-results-icon {
    color: #dee2e6;
    margin-bottom: 30px;
}

.no-results-title {
    font-size: 2rem;
    color: #495057;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.no-results-text {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0 0 30px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.retry-search-btn {
    background: linear-gradient(135deg, #478ac9 0%, #2c5f8a 100%);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.retry-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(71, 138, 201, 0.3);
}

/* Section Headers */
.results-section {
    margin-bottom: 60px;
}

.section-header {
    margin-bottom: 30px;
}

.section-title {
    font-size: 2rem;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    border-bottom: 3px solid #478ac9;
    padding-bottom: 15px;
    margin: 0;
}

.section-icon {
    font-size: 2.2rem;
}

.section-count {
    color: #478ac9;
    font-size: 1.5rem;
    font-weight: 600;
}

@media (max-width: 767px) {
    .search-bar-inline
    {
        width: 100%;
    }

    .search-bar-btn
    {
        padding: 16px 10px;
        font-size: 14px;
    }
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(71, 138, 201, 0.25);
}

.product-image-container {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(71, 138, 201, 0.95);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.product-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #212529;
    line-height: 1.4;
}

.product-subtitle {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0 0 auto 0;
    line-height: 1.6;
}

.product-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.view-details {
    color: #478ac9;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.product-card:hover .view-details {
    color: #2c5f8a;
    transform: translateX(5px);
    display: inline-block;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.news-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(71, 138, 201, 0.25);
}

.news-image-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image {
    transform: scale(1.1);
}

.news-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.news-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    color: #478ac9;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    display: inline-block;
}

.news-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #212529;
    line-height: 1.4;
}

.news-excerpt {
    color: #6c757d;
    font-size: 0.95rem;
    margin: 0 0 auto 0;
    line-height: 1.6;
}

.read-more {
    color: #478ac9;
    font-weight: 600;
    margin-top: 16px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.news-card:hover .read-more {
    color: #2c5f8a;
    transform: translateX(5px);
    display: inline-block;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
}

.category-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(71, 138, 201, 0.2);
    border-color: #478ac9;
}

.category-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #478ac9 0%, #2c5f8a 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

.category-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #212529;
}

.category-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.category-count-label {
    color: #478ac9;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Brands Grid */
.brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.brand-card {
    background: white;
    border-radius: 16px;
    padding: 30px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    text-align: center;
    border: 2px solid transparent;
}

.brand-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(71, 138, 201, 0.2);
    border-color: #478ac9;
}

.brand-logo-container {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.brand-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.brand-card:hover .brand-logo {
    transform: scale(1.1);
}

.brand-placeholder {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #478ac9 0%, #2c5f8a 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #212529;
}

.brand-product-count {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Fix for mobile submenus */
@media (max-width: 991px) {

    /* Hide desktop search */
    .modern-search-wrapper {
        display: none !important;
    }

    /* Mobile submenu styling - Ultra high specificity to override nicepage.css */
    .u-nav-container-collapse .u-nav-popup,
    .u-nav-container-collapse .u-nav-item .u-nav-popup {
        position: static !important;
        left: auto !important;
        top: auto !important;
        right: auto !important;
        width: 100% !important;
        height: auto !important;
        max-height: 0 !important;
        overflow: hidden !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-left: 3px solid #478ac9 !important;
        margin-left: 15px !important;
        transition: max-height 0.3s ease-in-out !important;
        transform: none !important;
        box-shadow: none !important;
    }

    /* Show submenu when parent has submenu-open class */
    .u-nav-container-collapse .u-nav-item.submenu-open>.u-nav-popup {
        max-height: 500px !important;
        margin-top: 8px !important;
        margin-bottom: 8px !important;
    }

    /* Style submenu items in mobile */
    .u-nav-container-collapse .u-nav-popup .u-nav-item {
        padding-left: 10px !important;
    }

    .u-nav-container-collapse .u-nav-popup .u-nav-link {
        font-size: 14px !important;
        padding: 8px 10px !important;
    }
}

@media (min-width: 992px) and (max-width: 1200px) {
    .search-input {
        width: 140px;
    }

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

    /* Make nav items slightly more compact */
    .u-nav-link {
        padding: 10px 6px !important;
    }
}

@media (min-width: 1201px) and (max-width: 1400px) {
    .search-input {
        width: 160px;
    }

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

    @media (max-width: 768px) {
        .search-title {
            font-size: 2rem;
        }

        .search-subtitle {
            font-size: 1rem;
        }

        .search-hero {
            padding: 30px 24px;
        }

        .section-title {
            fontSize: 1.5rem;
        }

        .products-grid,
        .news-grid {
            grid-template-columns: 1fr;
        }

        .categories-grid,
        .brands-grid {
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        }
    }

    @media (max-width: 480px) {
        .search-bar-btn {
            padding: 14px 24px;
        }
    }
}

/* Prevent logo overlap - ensure header has enough z-index layering */
.u-header {
    position: relative;
    z-index: 999;
}

.u-logo {
    position: relative;
    z-index: 998;
}

/* Footer WhatsApp alignment fix - match icon positioning */
.u-btn-3 .u-icon {
    margin-left: 20px;
}

/* Footer WhatsApp icon size fix - match visual weight of other icons */
.u-btn-3 .u-icon svg {
    transform: scale(1.2);
    transform-origin: center;
}

/* Load More Button */
.load-more-wrapper {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 10px;
}

.load-more-btn {
    background: linear-gradient(135deg, #478ac9 0%, #2c5f8a 100%);
    color: white;
    border: none;
    padding: 12px 36px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(71, 138, 201, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Search Filters */
.search-filters {
display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 0;
    /* background: #f8f9fa; */
    border-radius: 12px;
    /* border: 1px solid #e9ecef; */
    margin-top: 24px;
}

.search-filters h4
{
    font-weight: 500;
    font-size: 16px;
}

.filter-select {
    position: relative;
  border: none;        /* لو عايزة تشيلي البوردر الخارجي */
  padding: 0;
}

.ts-wrapper.filter-select::after
{
content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #8a8a8a;
  pointer-events: none;
  z-index: 5;
}

.ts-control, .ts-control input, .ts-dropdown
{
    cursor: pointer;
}

.filter-select:focus {
    border-color: #478ac9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(71, 138, 201, 0.15);
}

.filter-reset-btn {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-reset-btn:hover {
    background: #dc3545;
    color: white;
}

/* Loading & Empty States */
.loading-state,
.no-filter-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 1.05rem;
}

/* Product Tags (Brand & Category) */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin:14px 0;
}

.product-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.tag-brand {
    background: rgba(71, 138, 201, 0.12);
    color: #2c5f8a;
}

.tag-category {
    background: rgba(82,178,221,0.18);
color:#2d9cd3;
}

@media (max-width: 768px) {
    .search-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-select {
        min-width: 100%;
    }
}