/* ─── PAGINA ADVANCED SEARCH ─────────────────────────────────────────────────
   Dal Figma "Search":
   - Padding contenuto: 60px top (standard sito, non più 150px del Figma originale),
     100px laterali, 100px bottom
   - Titolo H2: Geologica 700 36px #2B75F5
   - Filtri: 3 gruppi in riga, gap 200px
   - Select: border 1px #323E48, border-radius 5px, Geologica 300 18px
   - Barra ricerca testo: border 1px #323E48, border-radius 30px, w 450px
   - Bottoni icona: 48x48px bg #323E48, border-radius 5px
   - Bottoni search bar: 100x40px bg #323E48, border-radius 30px
   - Tabella: stessa struttura di taxonomy-catalogue (dashed border-top, colonne fisse)
   - Bottone "Download results": border 1px #2B75F5, border-radius 50px, Geologica 700 16px #2B75F5
*/

/* Override box-shadow vecchio style.css */
.wrapper.search-results-wrap {
    box-shadow: none !important;
    padding-top: 0 !important;
}
/* Wrapper esterno (contiene il breadcrumb): 60px, stesso valore usato in tutto
   il sito (Markets, Contact, Footage, ecc.) per lo spazio tra header e breadcrumb.
   padding-bottom: 100px, stesso valore usato in Catalogue/New Releases/Serie ecc.
   per lo spazio tra la fine della pagina (paginazione) e il footer. */
#mainContent > .wrapper {
    box-shadow: none !important;
    padding-top: 70px !important;
    padding-bottom: 100px !important;
    /* Toglie il limite globale di 1728px (var(--max-width) in global.css), stesso
       motivo delle pagine categoria: la tabella dei risultati deve potersi
       allargare fino a riempire tutto lo schermo, non restare centrata e fissa */
    max-width: 100% !important;
}

/* ─── TITOLO ──────────────────────────────────────────────────────────────── */
.search-page-title {
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 36px;
    color: #2B75F5;
    /* Era 0 (attaccato al breadcrumb): ora 20px, così con i 10px del breadcrumb
       arriva a 30px totali, standard del sito */
    margin: 20px 0 50px 0;
    padding-right: 100px;
}

/* ─── FILTRI ──────────────────────────────────────────────────────────────── */
.search-filters {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
    margin-bottom: 50px;
    padding-right: 100px;
    box-sizing: border-box;
}

.search-filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.search-filter-label {
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 22px;
    color: #323E48;
    margin: 0;
    white-space: nowrap;
}

.search-filter-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
}

/* Select dropdown */
.search-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #FFFFFF url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%23323E48' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 15px center;
    border: 1px solid #323E48;
    border-radius: 5px;
    padding: 15px 40px 15px 20px;
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 22px;
    color: #323E48;
    width: 194px;
    height: 52px;
    cursor: pointer;
}

.search-select:focus {
    outline: none;
    border-color: #2B75F5;
}

/* Bottone icona search (per lingua e genere) — stessa dimensione della tendina accanto (52px) */
.search-icon-btn {
    width: 52px;
    height: 52px;
    background: #323E48;
    border: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.search-icon-btn:hover {
    background: #2B75F5;
}

/* ─── BARRA RICERCA TESTO ─────────────────────────────────────────────────── */
.search-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1px solid #323E48;
    border-radius: 30px;
    width: 400px;
    height: 40px;
    overflow: hidden;
    margin-top: 10px;
}

.search-bar-input-wrap {
    flex: 1;
    padding: 0 20px;
    background: transparent;
    border: none;
    outline: none;
}

.search-bar .search-bar-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 14px;
    color: rgba(50, 62, 72, 0.8);
    background: transparent !important;
    padding: 0 !important;
}

.search-bar-btn {
    width: 100px;
    height: 40px;
    background: #323E48;
    border: none;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.search-bar-btn:hover {
    background: #2B75F5;
}

/* ─── BOTTONE AWARDED ─────────────────────────────────────────────────────── */
.search-awarded-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 50px;
    padding-right: 100px;
}

/* Stile duplicato apposta da .btn-awarded (non condiviso): stesso aspetto, ma
   una classe propria per poter modificare uno dei due senza toccare l'altro */
.catalogue-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 25px;
    background: #FFFFFF;
    border: 1px solid #2B75F5;
    border-radius: 50px;
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
    color: #2B75F5;
    cursor: pointer;
}

.catalogue-download-btn:hover {
    background: #2B75F5;
    color: #FFFFFF;
}

.btn-awarded {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 25px;
    background: #FFFFFF;
    border: 1px solid #2B75F5;
    border-radius: 50px;
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
    color: #2B75F5;
    cursor: pointer;
}

.btn-awarded:hover {
    background: #2B75F5;
    color: #FFFFFF;
}

/* ─── TABELLA RISULTATI ───────────────────────────────────────────────────── */
.search-results-wrap {
    width: 100%;
    padding-right: 100px;
}

.search-table {
    width: 100%;
    border-collapse: collapse;
}

/* Intestazione colonne */
.search-table thead tr {
    border-bottom: none;
}

.search-table th {
    text-align: left;
    padding: 0 20px 25px 0;
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 17px;
    text-transform: uppercase;
    color: #2B75F5;
}

.search-table th.col-eps {
    white-space: nowrap;
}

/* Bottone sort */
.sort-btn {
    background: none;
    border: 1px solid #2B75F5;
    border-radius: 3px;
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: #2B75F5;
    font-size: 10px;
    line-height: 1;
    margin-left: 8px;
}

/* Rotazione icona: giù = ascendente (stato iniziale), su = discendente (dopo click) */
.sort-btn .sort-arrow svg {
    transition: transform 0.15s ease;
}
.sort-btn.is-desc .sort-arrow svg {
    transform: rotate(180deg);
}

/* Righe tabella — generate da JS in #tableBody */
.search-table tbody tr.search-row {
    border-top: 1px dashed #323E48;
    cursor: pointer;
}

.search-table tbody tr.search-row:hover {
    background: rgba(43, 117, 245, 0.04);
}

.search-table td {
    padding: 10px 20px 10px 0;
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 22px;
    color: #323E48;
    font-feature-settings: 'ss01' on;
    vertical-align: top;
}

/* ─── TENDINA DI DETTAGLIO (al click sulla riga) ────────────────────────── */
/* La riga cliccata, quando è aperta, non deve avere il bordo inferiore verso
   la sua stessa anteprima (catalogues.css ha una regola generica
   "table tr { border-bottom: ... }" su OGNI riga, va tolta qui per farla
   risultare "attaccata" al contenuto sotto) */
.search-table tbody tr.catalogue-row-clickable.is-open {
    border-bottom: none;
}

.search-table tbody tr.catalogue-row-detail {
    border-top: none;
    /* stessa regola generica di catalogues.css applicata anche qui: va tolta
       solo sopra, il bordo sotto (verso il contenuto successivo) resta */
    border-bottom: 1px dashed #323E48;
}

.search-table tbody tr.catalogue-row-detail td {
    padding: 30px 0;
}

.catalogue-detail {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 30px;
}

/* Colonna immagine + "Find out more" sotto */
.catalogue-detail__media {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    flex: 0 0 350px;
    max-width: 350px;
}

.catalogue-detail__media img {
    width: 100%;
    aspect-ratio: 437.4 / 239.64;
    object-fit: cover;
    border-radius: 20px;
}

.catalogue-detail__more {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-family: 'Geologica', sans-serif;
    font-weight: 700;
    font-size: 18px;
    line-height: 22px;
    color: #2B75F5;
    text-decoration: none;
}

.catalogue-detail__more:hover {
    text-decoration: underline;
}

/* Colonna sinossi */
.catalogue-detail__synopsis {
    flex: 1 1 400px;
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 18px;
    line-height: 22px;
    color: #323E48;
    font-feature-settings: 'ss01' on;
}

.catalogue-detail__synopsis strong {
    font-weight: 700;
    margin-right: 4px;
}

/* Colonna scheda tecnica (Genre, Total episodes, Directed by, ecc.) */
.catalogue-detail__info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 300px;
    max-width: 300px;
}

.catalogue-detail__info p {
    margin: 0;
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 16px;
    line-height: 20px;
    color: #323E48;
}

.catalogue-detail__info p strong {
    font-weight: 700;
    margin-right: 4px;
}

/* ─── PAGINAZIONE ─────────────────────────────────────────────────────────── */
.search-pagination {
    margin-top: 30px;
}

.search-pagination ul {
    list-style: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    padding: 0;
    margin: 0;
}

.search-pagination ul li a,
.search-pagination ul li strong {
    font-family: 'Geologica', sans-serif;
    font-weight: 300;
    font-size: 16px;
    color: #323E48;
    text-decoration: none;
}

.search-pagination ul li strong {
    font-weight: 700;
}

.search-pagination ul li a:hover {
    text-decoration: underline;
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media screen and (max-width: 1200px) {
    .search-filters { gap: 60px; }
    .search-page-title,
    .search-filters,
    .search-awarded-wrap,
    .search-results-wrap { padding-right: 60px; }
}

@media screen and (max-width: 900px) {
    .search-filters { flex-direction: column; gap: 30px; }
    .search-bar { width: 100%; }
    .search-page-title,
    .search-filters,
    .search-awarded-wrap,
    .search-results-wrap { padding-right: 40px; }
}

@media screen and (max-width: 600px) {
    .search-page-title,
    .search-filters,
    .search-awarded-wrap,
    .search-results-wrap { padding-right: 16px; }
}

/* Sotto i 900px, invece di nascondere le colonne, la tabella (intestazione +
   righe insieme, in sincrono) diventa scorrevole lateralmente col dito —
   stessa soluzione già usata per le pagine "vedi tutti" delle categorie. */
@media screen and (max-width: 900px) {
    .search-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .search-table-scroll::-webkit-scrollbar {
        display: none;
    }
    .search-table {
        min-width: 1250px;
    }
}