/* Search Bar Styles */
.modern-search-section {
    position: absolute;
    z-index: 100;
    max-width: 1140px;
    width: 100%;
    left: 50%;
    top: 150px; /* Default position for other pages */
    transform: translateX(-50%);
}

/* Homepage specific positioning */
.search_section-home .modern-search-section {
    top: -120px; /* Homepage slider overlap positioning */
}

/* ================================================ */
/* CATEGORY TABS STYLES */
/* ================================================ */
.main-category-tabs {
    display: flex !important;
    justify-content: center;
    gap: 15px;
    margin-bottom: 60px; /* Gap between tabs and search */
    flex-wrap: wrap;
}

.cat-tab {
    background: #ffffff;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.03);
    border-bottom: none;
}

.cat-tab i {
    font-size: 1rem;
    color: #b01918;
}

.cat-tab.active {
    background: #b01918;
    color: #ffffff;
    box-shadow: 0 -5px 15px rgba(176, 25, 24, 0.2);
}

.cat-tab.active i {
    color: #ffffff;
}

.cat-tab:hover:not(.active) {
    background: #fdfdfd;
    transform: translateY(-2px);
}

/* ================================================ */
/* SEARCH FORM STYLES */
/* ================================================ */
.modern-search-container {
    background: #ffffff;
    border-radius: 100px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
    padding: 8px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.search-item {
    position: relative;
    flex: 1;
    min-width: 0;
    border-right: 1px solid #f0f0f0;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

.search-item:nth-last-of-type(2) {
    border-right: none;
}

.search-item i {
    color: #b01918;
    font-size: 1.1rem;
    margin-right: 12px;
    opacity: 0.8;
}

.search-item select {
    border: none !important;
    background: transparent !important;
    font-weight: 600;
    color: #333;
    width: 100%;
    height: 54px;
    padding: 0 20px 0 0;
    cursor: pointer;
    font-family: "Urbanist", sans-serif;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item select:focus {
    outline: none;
}

.search-item select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.search-item::after {
    content: "\f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 18px;
    color: #b0b0b0;
    pointer-events: none;
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.search-item:hover::after {
    color: #b01918;
}

.search-btn-wrapper {
    padding: 2px;
}

#search-button {
    background: #b01918;
    color: #fff;
    border: none;
    padding: 0 45px;
    height: 60px;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 20px rgba(176, 25, 24, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

#search-button:hover {
    background: #8e1413;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(176, 25, 24, 0.35);
}

#search-button i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

#search-button:hover i {
    transform: rotate(15deg) scale(1.1);
}

#search-form {
    display: none;
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================ */
/* RESPONSIVENESS */
/* ================================================ */

@media (max-width: 1199px) {
    /* Tablet / Smaller Desktop */
    .modern-search-section {
        position: relative;
        top: -120px; /* Reduced vertical displacement */
        padding: 0 15px;
        max-width: 95%;
    }
    .main-category-tabs {
        margin-bottom: 50px; /* Significantly reduced from 230px */
    }
    .modern-search-container {
        border-radius: 50px;
    }
}

@media (max-width: 991px) {
    /* Tablets and Large Mobile Landscape */
    .modern-search-section {
        top: -80px;
    }
    .main-category-tabs {
        padding-left: 0;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 15px;
        margin-bottom: 30px;
        -webkit-overflow-scrolling: touch;
    }
    .main-category-tabs::-webkit-scrollbar {
        height: 4px;
    }
    .main-category-tabs::-webkit-scrollbar-thumb {
        background: #eee;
        border-radius: 10px;
    }
    .cat-tab {
        flex: 0 0 auto;
        padding: 10px 20px;
        font-size: 0.85rem;
        border-radius: 30px; /* Simple pills for scroll */
    }
    .modern-search-container {
        border-radius: 30px;
        padding: 15px;
        flex-wrap: wrap;
    }
    .search-item {
        flex: 0 0 50%;
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
        padding: 12px 15px;
    }
    .search-item:nth-child(odd) {
        border-right: 1px solid #f0f0f0;
    }
    .search-item:nth-child(3),
    .search-item:nth-child(4) {
        border-bottom: none;
    }
    .search-btn-wrapper {
        flex: 0 0 100%;
        padding-top: 20px;
    }
    #search-button {
        width: 100%;
    }
}

@media (max-width: 767px) {
    /* Small Tablets and Large Mobile Portrait */
    .modern-search-section {
        top: -50px;
    }
    .search-item {
        flex: 0 0 100%;
        border-right: none !important;
        border-bottom: 1px solid #f0f0f0 !important;
    }
    .search-item:nth-child(4) {
        border-bottom: none !important;
    }
}

@media (max-width: 575px) {
    /* Small Smartphones */
    .main-category-tabs {
        margin-bottom: 20px;
    }
    .cat-tab {
        padding: 8px 15px;
        font-size: 0.8rem;
    }
    .modern-search-container {
        padding: 10px;
        border-radius: 20px;
    }
    .search-item {
        padding: 10px;
    }
    #search-button {
        padding: 0 20px;
        font-size: 0.8rem;
        letter-spacing: 1px;
    }
}
