/* =========================================================
   BIBLIOTEKA.KG SEARCH PAGE
   ========================================================= */

.search-page {
    position: relative;
    padding: 24px 0 52px;
    color: var(--text);
}

/* =========================================================
   ADS
   ========================================================= */

.search-ad-section {
    position: relative;
    overflow: hidden;
    background: rgba(var(--surface-rgb), var(--glass-alpha));
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: var(--shadow);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
}

.search-ad-item {
    padding: 10px;
}

.search-ad-item a,
.search-side-ad-item a {
    display: block;
    text-decoration: none;
}

.search-ad-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.search-side-ad-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* =========================================================
   BREADCRUMBS
   ========================================================= */

.search-breadcrumbs {
    padding: 13px 16px;
    color: var(--text);
    background: rgba(var(--surface-rgb), var(--glass-alpha));
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: var(--shadow);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
}

.search-breadcrumbs .breadcrumb {
    background: transparent;
}

.search-breadcrumbs .breadcrumb,
.search-breadcrumbs .breadcrumb-item,
.search-breadcrumbs .breadcrumb-item a {
    color: var(--muted);
    font-weight: 650;
    text-decoration: none;
}

.search-breadcrumbs .breadcrumb-item.active {
    color: var(--text);
}

.search-breadcrumbs .breadcrumb-item a:hover,
.search-breadcrumbs .breadcrumb-item a:focus {
    color: var(--accent);
}

/* =========================================================
   COMMON GLASS BLOCKS
   ========================================================= */

.search-hero-inner,
.search-hero-panel,
.search-summary,
.search-section,
.search-empty,
.search-sidebar-block,
.search-book-card,
.search-news-card,
.search-final-cta-inner {
    position: relative;
    overflow: hidden;
    color: var(--text);
    background: rgba(var(--surface-rgb), var(--glass-alpha));
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: var(--shadow);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.05);
}

.search-hero-inner::before,
.search-summary::before,
.search-section::before,
.search-empty::before,
.search-sidebar-block::before,
.search-book-card::before,
.search-news-card::before,
.search-final-cta-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(820px 320px at 2% -12%, rgba(103, 232, 249, .16), transparent 62%),
        radial-gradient(700px 280px at 108% 112%, rgba(var(--tint-rgb), .18), transparent 60%);
    pointer-events: none;
}

.search-hero-content,
.search-hero-panel > *,
.search-summary-main,
.search-summary-counters,
.search-section-head,
.search-active-filters,
.search-filter-form,
.search-empty > *,
.search-sidebar-block > *,
.search-book-card > *,
.search-news-card > *,
.search-final-cta-inner > * {
    position: relative;
    z-index: 2;
}

/* =========================================================
   KICKER / BUTTONS
   ========================================================= */

.search-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 7px 12px;
    color: var(--bg);
    background: var(--accent);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.search-primary-btn,
.search-outline-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
}

.search-primary-btn {
    color: var(--bg) !important;
    background: var(--accent);
    border: 1px solid var(--accent);
    box-shadow: 0 10px 24px rgba(103, 232, 249, .22);
}

.search-primary-btn:hover,
.search-primary-btn:focus {
    color: var(--accent) !important;
    background: var(--bg);
    border-color: var(--accent);
    box-shadow: 0 0 22px rgba(103, 232, 249, .42);
}

.search-outline-btn {
    color: var(--text) !important;
    background: transparent;
    border: 1px solid var(--border);
}

.search-outline-btn:hover,
.search-outline-btn:focus {
    color: var(--bg) !important;
    background: var(--text);
    border-color: var(--text);
}

/* =========================================================
   HERO
   ========================================================= */

.search-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: stretch;
    min-height: 500px;
    padding: 42px;
}

.search-hero h1 {
    max-width: 900px;
    margin: 0 0 16px;
    color: var(--text);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 950;
    line-height: 1.02;
    letter-spacing: -.03em;
}

.search-hero p {
    max-width: 860px;
    margin: 0 0 22px;
    color: var(--muted);
    font-size: clamp(17px, 2vw, 21px);
    line-height: 1.62;
}

.search-hero-form {
    max-width: 920px;
    margin-top: 24px;
}

.search-main-form {
    width: 100%;
}

.search-main-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px;
    gap: 12px;
}

.search-main-input {
    min-height: 56px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    font-size: 16px;
    font-weight: 650;
    box-shadow: none;
}

.search-main-input::placeholder {
    color: var(--muted);
}

.search-main-input:focus {
    color: var(--text);
    background: var(--input-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(103, 232, 249, .15);
}

.search-hero-hint {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.5;
}

.search-hero-hint strong {
    color: var(--text);
}

.search-hero-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
    padding: 28px;
    background:
        linear-gradient(180deg, rgba(103, 232, 249, .16), rgba(var(--surface-rgb), .74)),
        rgba(var(--surface-rgb), var(--glass-alpha));
}

.search-hero-panel-icon {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--bg);
    background: var(--accent);
    font-size: 32px;
    box-shadow: 0 18px 34px rgba(103, 232, 249, .22);
}

.search-hero-panel h2 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 27px;
    font-weight: 900;
    line-height: 1.12;
}

.search-hero-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

/* =========================================================
   SUMMARY
   ========================================================= */

.search-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: center;
    padding: 28px;
}

.search-summary h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 950;
    line-height: 1.12;
}

.search-summary h2 span {
    color: var(--accent);
}

.search-summary-counters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.search-counter-card {
    padding: 16px 12px;
    text-align: center;
    background: rgba(var(--surface-rgb), .55);
    border: 1px solid var(--border);
}

.search-counter-card strong {
    display: block;
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 30px;
    font-weight: 950;
    line-height: 1;
}

.search-counter-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    text-transform: uppercase;
}

/* =========================================================
   ALERTS
   ========================================================= */

.search-alert {
    margin-top: 16px;
    padding: 14px 16px;
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 750;
    line-height: 1.55;
}

.search-alert-warning {
    background: rgba(245, 158, 11, .12);
    border-left: 4px solid #f59e0b;
}

/* =========================================================
   SECTIONS
   ========================================================= */

.search-section {
    padding: 30px;
}

.search-section-head {
    max-width: 940px;
    margin-bottom: 24px;
}

.search-section-head h2,
.search-empty h2,
.search-sidebar-block h3,
.search-final-cta h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: clamp(26px, 3vw, 40px);
    font-weight: 950;
    line-height: 1.08;
    letter-spacing: -.02em;
}

.search-section-head p,
.search-empty p,
.search-sidebar-block p,
.search-final-cta p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

.search-results-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.search-results-count {
    min-width: 72px;
    min-height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    background: var(--accent);
    font-size: 28px;
    font-weight: 950;
}

/* =========================================================
   FILTERS
   ========================================================= */

.search-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.search-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    color: var(--text);
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 750;
}

.search-filter-chip strong {
    color: var(--accent);
}

.search-filter-chip a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 18px;
    font-weight: 950;
    line-height: 1;
    text-decoration: none;
}

.search-filter-chip a:hover,
.search-filter-chip a:focus {
    color: #ef4444;
}

.search-reset-link {
    color: var(--accent);
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
}

.search-reset-link:hover,
.search-reset-link:focus {
    color: var(--text);
}

.search-filter-form .form-label {
    color: var(--text);
    font-size: 14px;
    font-weight: 850;
}

.search-filter-form .form-control,
.search-filter-form .form-select,
.search-filter-form select {
    min-height: 46px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    box-shadow: none;
}

.search-filter-form .form-control::placeholder {
    color: var(--muted);
}

.search-filter-form .form-control:focus,
.search-filter-form .form-select:focus,
.search-filter-form select:focus {
    color: var(--text);
    background: var(--input-bg);
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(103, 232, 249, .15);
}

.search-filter-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.search-empty {
    padding: 34px;
}

.search-empty-icon {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--bg);
    background: var(--accent);
    font-size: 30px;
    box-shadow: 0 18px 34px rgba(103, 232, 249, .22);
}

.search-empty ul {
    position: relative;
    z-index: 2;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.search-empty li {
    position: relative;
    margin: 0 0 10px;
    padding-left: 30px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.55;
}

.search-empty li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: 950;
}

.search-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

/* =========================================================
   BOOK RESULTS
   ========================================================= */

.search-results-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.search-book-card {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 22px;
    padding: 20px;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.search-book-card:hover {
    transform: translateY(-3px);
    border-color: rgba(103, 232, 249, .45);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .12);
}

.search-book-cover {
    display: block;
    width: 100%;
    min-height: 230px;
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
    text-decoration: none;
}

.search-book-cover img {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: contain;
}

.search-book-content {
    min-width: 0;
}

.search-book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 11px;
}

.search-book-meta span {
    display: inline-flex;
    align-items: center;
    padding: 6px 9px;
    color: var(--bg);
    background: var(--accent);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.search-book-content h3 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: clamp(21px, 2vw, 28px);
    font-weight: 950;
    line-height: 1.18;
}

.search-book-content h3 a {
    color: var(--text);
    text-decoration: none;
}

.search-book-content h3 a:hover,
.search-book-content h3 a:focus {
    color: var(--accent);
}

.search-book-author {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
}

.search-book-content p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.68;
}

.search-book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

/* =========================================================
   NEWS
   ========================================================= */

.search-news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.search-news-card {
    padding: 22px;
}

.search-news-date {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 850;
}

.search-news-card h3 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 22px;
    font-weight: 950;
    line-height: 1.18;
}

.search-news-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.search-news-card h3 a:hover,
.search-news-card h3 a:focus {
    color: var(--accent);
}

.search-news-card p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}

.search-news-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
}

.search-news-link:hover,
.search-news-link:focus {
    color: var(--text);
}

/* =========================================================
   HIGHLIGHT
   ========================================================= */

.search-highlight {
    padding: 0 .16rem;
    color: inherit;
    background: rgba(103, 232, 249, .35);
}

/* =========================================================
   PAGINATION
   ========================================================= */

.search-pagination {
    position: relative;
    z-index: 2;
    margin-top: 26px;
}

.search-pagination .pagination {
    gap: 6px;
    margin-bottom: 0;
}

.search-pagination .page-link {
    color: var(--text);
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
    font-weight: 800;
    box-shadow: none;
}

.search-pagination .page-link:hover,
.search-pagination .page-link:focus {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
}

.search-pagination .active .page-link {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
}

/* =========================================================
   SIDEBAR
   ========================================================= */

.search-sidebar {
    position: sticky;
    top: 96px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.search-sidebar-block {
    padding: 22px;
}

.search-sidebar-ad {
    padding: 10px;
}

.search-sidebar-block h3 {
    margin-bottom: 12px;
    font-size: 23px;
}

.search-sidebar-block p {
    margin-bottom: 16px;
    font-size: 15px;
}

.search-subscribe-card {
    background:
        linear-gradient(180deg, rgba(103, 232, 249, .14), rgba(var(--surface-rgb), .72)),
        rgba(var(--surface-rgb), var(--glass-alpha));
}

.search-popular-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.search-popular-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    color: var(--text);
    text-decoration: none;
}

.search-popular-item:hover span,
.search-popular-item:focus span {
    color: var(--accent);
}

.search-popular-item img {
    width: 52px;
    height: 72px;
    object-fit: contain;
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
}

.search-popular-item span {
    color: var(--text);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.3;
}

.search-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-category-list a {
    display: inline-flex;
    padding: 7px 10px;
    color: var(--text);
    background: rgba(var(--surface-rgb), .58);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.search-category-list a:hover,
.search-category-list a:focus {
    color: var(--bg);
    background: var(--accent);
    border-color: var(--accent);
}

/* =========================================================
   FINAL CTA
   ========================================================= */

.search-final-cta-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: center;
    padding: 38px;
}

.search-final-cta p {
    margin: 0;
}

.search-final-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

/* =========================================================
   OWL FIXES
   ========================================================= */

.search-page .owl-carousel .owl-nav button.owl-prev,
.search-page .owl-carousel .owl-nav button.owl-next {
    color: var(--bg);
    background: var(--accent);
    border: 1px solid var(--accent);
    min-width: 34px;
    min-height: 34px;
}

.search-page .owl-carousel .owl-dots .owl-dot span {
    background: var(--muted);
}

.search-page .owl-carousel .owl-dots .owl-dot.active span,
.search-page .owl-carousel .owl-dots .owl-dot:hover span {
    background: var(--accent);
}

/* =========================================================
   NO RADIUS
   ========================================================= */

.search-ad-section,
.search-breadcrumbs,
.search-hero-inner,
.search-hero-panel,
.search-summary,
.search-counter-card,
.search-section,
.search-empty,
.search-sidebar-block,
.search-book-card,
.search-news-card,
.search-final-cta-inner,
.search-kicker,
.search-primary-btn,
.search-outline-btn,
.search-main-input,
.search-hero-panel-icon,
.search-results-count,
.search-filter-chip,
.search-filter-form .form-control,
.search-filter-form .form-select,
.search-filter-form select,
.search-empty-icon,
.search-book-cover,
.search-book-cover img,
.search-book-meta span,
.search-popular-item img,
.search-category-list a,
.search-pagination .page-link {
    border-radius: 0 !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1199.98px) {
    .search-hero-inner {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .search-hero-panel {
        min-height: 280px;
    }

    .search-summary {
        grid-template-columns: 1fr;
    }

    .search-summary-counters {
        max-width: 520px;
    }

    .search-sidebar {
        position: static;
        top: auto;
    }

    .search-news-grid {
        grid-template-columns: 1fr;
    }

    .search-final-cta-inner {
        grid-template-columns: 1fr;
    }

    .search-final-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .search-page {
        padding-top: 20px;
    }

    .search-sidebar {
        margin-top: 0;
    }

    .search-sidebar-block.search-sidebar-ad {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }

    .search-main-row {
        grid-template-columns: 1fr;
    }

    .search-main-row .search-primary-btn {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .search-book-card {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 16px;
    }

    .search-book-cover {
        min-height: 170px;
    }

    .search-book-cover img {
        height: 170px;
    }

    .search-book-meta span {
        font-size: 10px;
    }

    .search-book-actions {
        flex-direction: column;
    }

    .search-book-actions .btn {
        width: 100%;
    }

    .search-filter-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .search-hero-inner,
    .search-summary,
    .search-section,
    .search-empty,
    .search-final-cta-inner {
        padding: 24px 20px;
    }

    .search-hero h1 {
        font-size: 34px;
    }

    .search-summary-counters {
        grid-template-columns: 1fr;
    }

    .search-results-head {
        flex-direction: column;
    }

    .search-results-count {
        min-width: 58px;
        min-height: 58px;
        font-size: 22px;
    }

    .search-book-card {
        grid-template-columns: 1fr;
    }

    .search-book-cover {
        max-width: 180px;
        min-height: 240px;
        margin: 0 auto;
    }

    .search-book-cover img {
        height: 240px;
    }

    .search-empty-actions {
        flex-direction: column;
    }

    .search-empty-actions .btn,
    .search-final-actions .btn {
        width: 100%;
    }

    .search-final-actions {
        grid-template-columns: 1fr;
    }
}