/* ================================
   Search Bar Layout
================================ */

.search-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ================================
   Search Input
================================ */

.search-input {
    flex: 0 1 800px;           /* prefers 800px, shrinks if needed */
    width: auto;
    max-width: 800px;

    margin: 0;
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-desktop);
    outline: none;
    background-color: var(--text-color);
    color: var(--background-color);
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);

    height: 36px;
    font-size: 18px;
}

.search-input:focus {
    background-color: var(--text-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 30%, transparent);
}

/* The dark/light pair above is inverted on purpose (bg = --text-color,
   text = --background-color), which in light mode would flip the pill to
   solid black with light text. Keep it a normal light field with a
   border instead. */
:root[data-theme="light"] .search-input {
    background-color: var(--background-color-lighter);
    color: var(--text-color);
    border: 1.5px solid #C7C9D1;
}

:root[data-theme="light"] .search-input:focus {
    background-color: var(--background-color-lighter);
    border-color: var(--primary-color);
}

@media (min-width: 768px) and (max-width: 1999px) {
    .search-input {
        flex: 0 1 580px;
        max-width: 580px;
        height: 31px;
        font-size: 17px;
    }
}

/* ================================
   Button Row
================================ */

.search-button-row {
    display: flex;
    gap: 12px;
    flex: 1 1 auto;            /* fill remaining space */
    min-width: 0;
}

/* ================================
   Buttons
================================ */

.search-bar-button {
    flex: 1;
    min-width: 172px;
    border: none;
    margin: 0;
    border-radius: var(--radius-desktop);
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);

    height: 36px;
    font-size: 18px;
    transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) and (max-width: 1999px) {
    .search-bar-button {
        flex: 0 0 158px;
        min-width: 158px;
        width: 158px;
        height: 31px;
        font-size: 17px;
    }
}

.search-bar-button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.show-all-button,
.show-all-button:hover {
    /* Fixed dark text on the gold background, same in both themes. */
    color: #1F2024;
}

/* ================================
   Mobile Layout
================================ */

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

    .search-input {
        flex: none;
        width: 100%;
        max-width: 100%;
        font-size: 18px;
        height: 36px;
    }

    .search-button-row {
        width: 100%;
    }

    .search-bar-button {
        flex: 0 0 120px;
        min-width: 120px;
        max-width: 120px;
        height: 35px;
        font-size: 18px;
    }
}

/* Zusätzliche Stufe für sehr schmale Screens (< 366px), siehe site.css. */
@media (max-width: 365px) {
    .search-input {
        font-size: 17px;
        height: 34px;
    }

    .search-bar-button {
        flex: 0 0 112px;
        min-width: 112px;
        max-width: 112px;
        height: 33px;
        font-size: 17px;
    }
}
