/**
 * BC Search Modal — fullscreen popup with AJAX search.
 */

/* ===========================================
   Overlay
   =========================================== */
.bc-search-modal__overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0s 0.3s;
}

#bc-search-modal.is-open .bc-search-modal__overlay {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s, visibility 0s;
}

/* ===========================================
   Content panel (drops down from top)
   =========================================== */
.bc-search-modal__content {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    background: #fff;
    padding: 40px 20px 30px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s ease, opacity 0.4s ease, visibility 0s 0.4s;
    max-height: 90vh;
    overflow-y: auto;
}

#bc-search-modal.is-open .bc-search-modal__content {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    transition: transform 0.4s ease, opacity 0.4s ease, visibility 0s;
}

body.bc-search-open {
    overflow: hidden;
}

/* ===========================================
   Close button
   =========================================== */
.bc-search-modal__close {
    position: absolute;
    top: 15px;
    right: 20px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: #222;
    transition: color 0.3s;
}

.bc-search-modal__close:hover {
    color: #999;
}

.bc-search-modal__close svg {
    width: 1em;
    height: 1em;
}

/* ===========================================
   Inner container
   =========================================== */
.bc-search-modal__inner {
    max-width: 800px;
    margin: 0 auto;
}

/* ===========================================
   Heading
   =========================================== */
.bc-search-form__heading {
    font-family: var(--bc-font-heading);
    font-size: 28px;
    text-align: center;
    margin-bottom: 24px;
    color: var(--bc-black);
}

/* ===========================================
   Search input row
   =========================================== */
.bc-search-form__row {
    display: flex;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.bc-search-form__row:focus-within {
    border-color: var(--bc-pink);
}

.bc-search-form__input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.bc-search-form__input {
    width: 100%;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-family: var(--bc-font-body);
    font-size: 16px;
    color: #222;
    background: transparent;
}

.bc-search-form__input::placeholder {
    color: #999;
}

.bc-search-form__clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 14px;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.bc-search-form__clear:hover {
    color: #222;
}

.bc-search-form__submit {
    background: none;
    border: none !important;
    border-left: 1px solid #ddd;
    padding: 14px 18px;
    cursor: pointer;
    color: #222;
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s;
}

.bc-search-form__submit:hover {
    background-color: var(--bc-pink) !important;
    border: none !important;
}

/* ===========================================
   Trending tags
   =========================================== */
.bc-search-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
    font-size: 13px;
}

.bc-search-tags__title {
    color: #999;
}

.bc-search-tags a {
    color: #222;
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid #e1e1e1;
    border-radius: 20px;
    transition: all 0.2s;
}

.bc-search-tags a:hover {
    border-color: var(--bc-pink);
    color: var(--bc-pink);
}

/* ===========================================
   Results
   =========================================== */
.bc-search-results {
    margin-top: 24px;
}

.bc-search-results__heading {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e1e1;
}

.bc-search-results__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.bc-search-result {
    text-align: center;
}

.bc-search-result__image {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 8px;
    background: #f8f8f8;
}

.bc-search-result__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.bc-search-result:hover .bc-search-result__image img {
    transform: scale(1.05);
}

.bc-search-result__title {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.bc-search-result__title a {
    color: #222;
    text-decoration: none;
}

.bc-search-result__title a:hover {
    color: var(--bc-pink);
}

.bc-search-result__title strong {
    color: var(--bc-pink);
}

/* ===========================================
   Loading / No results
   =========================================== */
.bc-search-loading {
    text-align: center;
    padding: 30px 0;
}

.bc-search-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #e1e1e1;
    border-top-color: var(--bc-pink);
    border-radius: 50%;
    animation: bc-spin 0.7s linear infinite;
}

@keyframes bc-spin {
    to { transform: rotate(360deg); }
}

.bc-search-no-results {
    text-align: center;
    padding: 30px 0;
    color: #999;
    font-size: 15px;
}

/* ===========================================
   Responsive
   =========================================== */
@media (max-width: 600px) {
    .bc-search-form__heading {
        font-size: 22px;
    }

    .bc-search-results__grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
}
