/* ==========================================================================
   RG Header Search
   Search icon in the header + clean overlay styled to match the theme
   ========================================================================== */

/* --- Header trigger icon ---------------------------------------------------- */
/* Color is hard-coded to match the site's beige (#f8eede), used consistently
   in wishlist/cart badges, footer, and drawer menu. */
.rg-header-search-trigger,
.rg-header-search-trigger:link,
.rg-header-search-trigger:visited,
.rg-header-search-trigger:hover,
.rg-header-search-trigger:focus,
.rg-header-search-trigger:active {
    color: #f8eede !important;
    text-decoration: none !important;
    cursor: pointer;
    background: transparent;
    border: none;
}

.rg-header-search-trigger svg {
    width: 22px;
    height: 22px;
    display: block;
    color: #f8eede !important;
    stroke: #f8eede !important;
    fill: none !important;
}

/* Mobile: slightly smaller SVG to match the smaller mobile header */
.header-main .mobile-col.right .rg-header-search-trigger svg {
    width: 20px;
    height: 20px;
}

/* --- Overlay --------------------------------------------------------------- */
.rg-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(58, 46, 30, 0.85);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.rg-search-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.rg-search-overlay-inner {
    position: relative;
    width: 90%;
    max-width: 600px;
    margin: 15vh auto 0 auto;
}

/* --- Close button ---------------------------------------------------------- */
.rg-search-close {
    position: absolute;
    top: -56px;
    right: 0;
    background: transparent;
    border: none;
    color: #f8eede;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.rg-search-close:hover,
.rg-search-close:focus {
    opacity: 0.75;
    outline: none;
}

/* --- Search form ----------------------------------------------------------- */
.rg-search-form {
    display: flex;
    align-items: center;
    background: #f8eede;
    border-radius: 4px;
    padding: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.rg-search-input {
    flex: 1 1 auto;
    background-color: #f8eede;
    background-image: none;
    border: none;
    outline: none;
    padding: 16px 20px;
    font-size: 16px;
    font-family: "Times New Roman", Times, serif;
    color: #3a2e1e;
    min-width: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: none;
    border-radius: 0;
}

.rg-search-input::placeholder {
    color: #7a1e2e;
    opacity: 0.55;
}

/* Kill browser-default search input chrome (the X clear button, decorations) */
.rg-search-input::-webkit-search-decoration,
.rg-search-input::-webkit-search-cancel-button,
.rg-search-input::-webkit-search-results-button,
.rg-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    display: none;
}

/* Override Chrome's autofill background (yellow/blue tint) */
.rg-search-input:-webkit-autofill,
.rg-search-input:-webkit-autofill:hover,
.rg-search-input:-webkit-autofill:focus,
.rg-search-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #f8eede inset !important;
    box-shadow: 0 0 0 1000px #f8eede inset !important;
    -webkit-text-fill-color: #3a2e1e !important;
    caret-color: #3a2e1e;
}

.rg-search-submit {
    flex: 0 0 auto;
    background: #7a1e2e;
    border: none;
    color: #f8eede;
    width: 56px;
    height: 56px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.rg-search-submit:hover,
.rg-search-submit:focus {
    background: #5e1622;
    outline: none;
}

/* --- Mobile adjustments ---------------------------------------------------- */
@media (max-width: 767px) {
    .rg-search-overlay-inner {
        width: 92%;
        margin-top: 10vh;
    }

    .rg-search-input {
        font-size: 14px;
        padding: 12px 14px;
    }

    .rg-search-submit {
        width: 48px;
        height: 48px;
    }

    .rg-search-close {
        top: -48px;
    }
}
