.searchLayout {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.findWinesInformation {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 520px;
    margin: 0 auto;
    align-items: stretch;
}

.findWinesRow {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    align-items: center;
    justify-items: start;
}

.findWinesRow label {
    text-align: left;
    font-weight: 600;
}

.findWinesRow input {
    width: 90%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}


.findWines{
    width: 100%;
    max-width: 600px;
    text-align: center;
}

#showAllButton {
    background-color: rgb(0, 0, 0);
}

.wineTypeSelection {
    width: 95.5%;
    height: 25px;
}


.wineResults {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1em;
    padding: 10px;
}

.searchPage {
    flex: 0 0 800px;
    position: sticky;
    top: 90px; 
    align-self: flex-start;

    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
}

.searchHint {
    margin-bottom: 20px;
    color: #555;
}


.resultsSectionHeader {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px;
}

.resultsSectionHeader h2 {
    margin: 0;
}

.sortWrapper {
    position: absolute;
    right: 0;
}

.sortButton {
    margin: 20px;
    background: none;
    border: 2px solid #9c0909;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 1.2rem;
    cursor: pointer;
    color: #9c0909;
    line-height: 1;
}

.sortButton:hover {
    background-color: #9c0909;
    color: white;
}

.sortDropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 180px;
    overflow: hidden;
}

.sortDropdown.open {
    display: block;
}

.sortOption {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
}

.sortOption:hover {
    background-color: #f5f5f5;
}

.sortOption.active {
    color: #9c0909;
    font-weight: 600;
}

.viewToggleWrapper {
    position: absolute;
    left: 0;
}

.viewToggleBtn {
    background: none;
    border: 2px solid #9c0909;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    color: #9c0909;
    line-height: 1;
}

.viewToggleBtn:hover,
.viewToggleBtn.active {
    background-color: #9c0909;
    color: white;
}

.paginationControls {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px 0 8px;
}

.paginationBtn {
    background: none;
    border: 2px solid #9c0909;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #9c0909;
}

.paginationBtn:hover:not(:disabled) {
    background-color: #9c0909;
    color: white;
}

.paginationBtn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pageIndicator {
    font-size: 0.9rem;
    color: #555;
    min-width: 100px;
    text-align: center;
}
 
/* ── Mobile & Responsive Styles ── */
@media (max-width: 768px) {

    .searchLayout {
        flex-direction: column;
        gap: 0;
    }

    .searchPage {
        flex: none;
        width: 100%;
        position: static;
        margin-top: 16px;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .findWines {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }

    .findWinesInformation {
        max-width: 100%;
    }

    .findWinesRow {
        grid-template-columns: 90px 1fr;
        gap: 8px;
    }

    .findWinesRow input {
        width: 100%;
        box-sizing: border-box;
    }

    .wineTypeSelection {
        width: 100%;
    }

    .resultsSection {
        width: 100%;
        padding: 0 16px;
        box-sizing: border-box;
    }

    .resultsSectionHeader {
        margin: 16px 0 8px;
    }

    .wineResults {
        flex-direction: column;
        align-items: center;
        padding: 0;
        gap: 12px;
    }

    /* Sort and toggle buttons stay in place but shrink */
    .sortButton,
    .viewToggleBtn {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .paginationControls {
        gap: 10px;
        padding: 12px 0;
    }

    .paginationBtn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}
