/* ======================================================
   FIXED TITLE SECTION - RESPONSIVE WITHOUT GAPS
   ====================================================== */
.fixed-title {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    background-color: var(--bg-color-1);
    z-index: 20;
    padding: 8px 10px;
    box-sizing: border-box;
    margin: 0;
    border: none;
    line-height: 1;
}

.products-title-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.products-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin: 0;
    padding: 0;
    line-height: 1.5rem;
}

/* Dropdown toggle button */
.dropdown-toggle {
    background: var(--bg-color-2);
    color: var(--text-color-1);
    border: 2px solid var(--btns-border);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
    text-transform: capitalize;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0; /* Remove any margin */
}

.dropdown-toggle:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.dropdown-toggle i {
    transition: transform 0.3s ease;
}

.dropdown-toggle i.rotate {
    transform: rotate(180deg);
}

/* ======================================================
   NAV2 FILTER SECTION - ALIGNED WITHOUT GAPS
   ====================================================== */
.nav2 {
    position: fixed;
    top: 100px;
    left: 0;
    right: 0;
    background-color: var(--bg-color-1);
    z-index: 15;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    border-bottom: 1px solid var(--border-bottom);
    padding: 0 10px;
    box-sizing: border-box;
    margin: 0;
}

.nav2.show {
    max-height: 800px;
    opacity: 1;
    visibility: visible;
    padding: 15px 10px;
}

/* Category section styling */
.category-section {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 15px;
    margin-bottom: 15px;
    align-items: stretch;
}

.category-dropdown {
    flex: 1;
    min-width: 140px;
}

.category-dropdown select {
    width: 100%;
    padding: 6px;
    border: 2px solid var(--inputs-border);
    border-radius: 25px;
    background: var(--input-bg);
    color: var(--text-color-1);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--cards-shadow);
}

.category-dropdown select:focus {
    outline: none;
    border-color: var(--inputs-focus-border);
    box-shadow: 0 0 0 3px rgba(255, 165, 0, 0.1);
}

/* Search bar */
.search-bar {
    display: flex;
    flex: 1;
    background: var(--bg-color-2);
    border-radius: 25px;
    box-shadow: var(--cards-shadow);
    overflow: hidden;
    border: 2px solid var(--inputs-border);
    transition: all 0.3s ease;
    min-width: 0;
    min-height: 40px;
    margin-bottom: 5px;
}

.search-bar:focus-within {
    border-color: var(--inputs-focus-border);
}

.search-input {
    flex: 1;
    padding: 5px 10px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-color-1);
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--lighter-text);
}

.search-button {
    background: var(--orange-btn-bg);
    color: white;
    border: none;
    padding: 5px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 60px;
    font-size: 14px;
}

.search-button:hover {
    transform: scale(1.02);
}

.search-button i {
    font-size: 16px;
}

/* Contents adjustment */
.contents {
    padding-top: 110px;
    margin-bottom: 100px;
    transition: padding-top 0.4s ease;
}

.contents.expanded {
    padding-top: 240px;
}

/* ======================================================
   RESPONSIVE ADJUSTMENTS FOR MOBILE GAPS
   ====================================================== */

/* Tablet view (741px to 1024px) */
@media (max-width: 1024px) and (min-width: 741px) {
    .fixed-title {
        top: 52px;
        padding: 10px 15px;
    }

    .products-heading {
        font-size: 1.45rem;
        line-height: 1.45rem;
    }

    .nav2 {
        top: 99px;
    }

    .contents {
        padding-top: 115px;
    }

    .contents.expanded {
        padding-top: 240px;
    }

    .dropdown-toggle {
        padding: 8px 14px;
        font-size: 13.5px;
    }

    .search-bar {
        min-height: 40px;
    }

    .search-input {
        padding: 5px 12px;
        font-size: 14px;
    }

    .search-button {
        padding: 5px 20px;
        min-width: 60px;
    }

    .search-button i {
        font-size: 17px;
    }

    .category-dropdown {
        min-width: 160px;
    }

    .category-dropdown select {
        padding: 5px 12px;
        min-height: 40px;
    }
}

/* Small tablet and large mobile (481px to 740px) */
@media (max-width: 740px) and (min-width: 481px) {
    .fixed-title {
        top: 50px;
        padding: 9px 12px;
    }

    .products-heading {
        font-size: 1.35rem;
        line-height: 1.35rem;
    }

    .nav2 {
        top: 88px;
    }

    .contents {
        padding-top: 110px;
    }

    .contents.expanded {
        padding-top: 220px;
    }

    .dropdown-toggle {
        padding: 7px 12px;
        font-size: 13px;
        border-radius: 18px;
    }

    .search-bar {
        border-radius: 22px;
        min-height: 36px;
        margin-bottom: 12px;
    }

    .search-input {
        padding: 4px 10px;
        font-size: 13px;
    }

    .search-button {
        padding: 4px 18px;
        min-width: 55px;
    }

    .search-button i {
        font-size: 16px;
    }

    .category-dropdown {
        min-width: 140px;
    }

    .category-dropdown select {
        padding: 4px 10px;
        font-size: 13px;
        min-height: 36px;
        border-radius: 22px;
    }
}

/* Mobile view (361px to 480px) */
@media (max-width: 480px) and (min-width: 361px) {
    .fixed-title {
        top: 48px;
        padding: 8px 10px;
    }

    .products-heading {
        font-size: 1.25rem;
        line-height: 1.25rem;
    }

    .nav2 {
        top: 82px;
    }

    .contents {
        padding-top: 110px;
        margin-bottom: 60px;
    }

    .contents.expanded {
        padding-top: 215px;
    }

    .dropdown-toggle {
        padding: 6px 10px;
        font-size: 12.5px;
        border-radius: 16px;
        gap: 6px;
    }

    .search-bar {
        border-radius: 20px;
        min-height: 35px;
        margin-bottom: 10px;
    }

    .search-input {
        padding: 4px 10px;
        font-size: 14px;
    }

    .search-button {
        padding: 4px 16px;
        min-width: 50px;
    }

    .search-button i {
        font-size: 16px;
    }

    .category-dropdown {
        min-width: 130px;
    }

    .category-dropdown select {
        padding: 4px 10px;
        font-size: 13px;
        min-height: 35px;
        border-radius: 20px;
    }
}

/* Small mobile (321px to 360px) */
@media (max-width: 360px) and (min-width: 321px) {
    .fixed-title {
        top: 48px;
        padding: 7px 8px;
    }

    .products-heading {
        font-size: 1.2rem;
        line-height: 1.2rem;
    }

    .nav2 {
        top: 80px;
    }

    .contents {
        padding-top: 100px;
    }

    .contents.expanded {
        padding-top: 210px;
    }

    .dropdown-toggle {
        padding: 5px 8px;
        font-size: 13px;
        border-radius: 20px;
        gap: 5px;
    }

    .search-bar {
        border-radius: 20px;
        min-height: 34px;
        margin-bottom: 10px;
    }

    .search-input {
        padding: 4px 8px;
        font-size: 14px;
    }

    .search-button {
        padding: 4px 14px;
        min-width: 48px;
    }

    .search-button i {
        font-size: 16px;
    }

    .category-dropdown {
        min-width: 120px;
    }

    .category-dropdown select {
        padding: 4px 8px;
        font-size: 13px;
        min-height: 34px;
        border-radius: 20px;
    }
}

/* Very small mobile (261px to 320px) */
@media (max-width: 320px) and (min-width: 261px) {
    .fixed-title {
        top: 44px;
        padding: 6px 6px;
    }

    .products-heading {
        font-size: 1.05rem;
        line-height: 1.05rem;
    }

    .nav2 {
        top: 68px;
    }

    .contents {
        padding-top: 90px;
    }

    .contents.expanded {
        padding-top: 190px;
    }

    .dropdown-toggle {
        padding: 4px 6px;
        font-size: 11.5px;
        border-radius: 12px;
        gap: 4px;
    }

    .search-bar {
        border-radius: 18px;
        min-height: 31px;
        margin-bottom: 8px;
    }

    .search-input {
        padding: 3px 8px;
        font-size: 13px;
    }

    .search-button {
        padding: 3px 12px;
        min-width: 45px;
    }

    .search-button i {
        font-size: 14px;
    }

    .category-dropdown {
        min-width: 110px;
    }

    .category-dropdown select {
        padding: 3px 6px;
        font-size: 12px;
        min-height: 31px;
        border-radius: 18px;
    }
    
}

/* Very very small mobile (up to 260px) */
@media (max-width: 260px) {
    .fixed-title {
        top: 38px;
        padding: 5px 4px;
    }

    .products-heading {
        font-size: 0.95rem;
        line-height: 0.95rem;
    }

    .nav2 {
        top: 56px;
    }

    .contents {
        padding-top: 78px;
    }

    .contents.expanded {
        padding-top: 170px;
    }

    .dropdown-toggle {
        padding: 3px 4px;
        font-size: 11px;
        border-radius: 10px;
        gap: 3px;
    }

    .search-bar {
        border-radius: 18px;
        min-height: 28px;
        margin-bottom: 6px;
    }

    .search-input {
        padding: 2px 6px;
        font-size: 11px;
    }

    .search-input::placeholder {
        font-size: 10px;
    }

    .search-button {
        padding: 2px 10px;
        min-width: 42px;
    }

    .search-button i {
        font-size: 12px;
    }

    .category-dropdown {
        min-width: 100px;
    }

    .category-dropdown select {
        padding: 2px 4px;
        font-size: 11px;
        min-height: 28px;
        border-radius: 18px;
    }
}
