/* ============================================
   DS Catalogo V5 — CSS
   Stile ispirato al vecchio dsdictator.it
   ============================================ */

:root {
    --ds-orange: #e87722;
    --ds-orange-dark: #c96118;
    --ds-black: #222222;
    --ds-white: #ffffff;
    --ds-gray-light: #f5f5f5;
    --ds-gray: #999999;
    --ds-gray-dark: #666666;
    --ds-border: #dddddd;
    --ds-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --ds-container-max: 1400px;
    --ds-header-height: 80px;
    --ds-navbar-height: 44px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--ds-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ds-black);
    background: var(--ds-white);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.ds-container {
    max-width: var(--ds-container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--ds-orange);
    color: var(--ds-white);
    padding: 8px 16px;
    z-index: 9999;
    font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ============================================
   HEADER
   ============================================ */
.ds-header {
    background: var(--ds-white);
    border-bottom: 1px solid var(--ds-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.ds-header__inner {
    max-width: var(--ds-container-max);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--ds-header-height);
}

.ds-header__logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    color: var(--ds-black);
}

.ds-header__logo img {
    height: 50px;
    width: auto;
}

.ds-header__tagline {
    display: block;
    font-size: 12px;
    color: var(--ds-gray);
    font-style: italic;
    margin-top: 2px;
}

.ds-header__catalogs {
    display: flex;
    gap: 2px;
    margin-left: auto;
    margin-right: 20px;
}

.ds-header__catalog-link {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-gray-dark);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s;
}

.ds-header__catalog-link:hover {
    background: var(--ds-orange);
    color: var(--ds-white);
}

.ds-header__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ds-header__flags {
    display: flex;
    gap: 6px;
}

.ds-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    border: 1px solid var(--ds-border);
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    color: var(--ds-gray);
    cursor: pointer;
}

.ds-flag--active {
    background: var(--ds-orange);
    color: var(--ds-white);
    border-color: var(--ds-orange);
}

.ds-header__search-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--ds-gray-light);
    border: 1px solid var(--ds-border);
    cursor: pointer;
    color: var(--ds-gray-dark);
    padding: 6px 14px 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-family: var(--ds-font);
    transition: all 0.15s;
}

.ds-header__search-toggle:hover {
    background: var(--ds-white);
    border-color: var(--ds-orange);
    color: var(--ds-orange);
}

.ds-header__menu-wrap {
    position: relative;
}

.ds-header__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.ds-header__hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--ds-black);
    transition: transform 0.3s;
}

/* Header dropdown (hamburger menu) */
.ds-header__dropdown[hidden] {
    display: none;
}

.ds-header__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--ds-white);
    border: 1px solid var(--ds-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    min-width: 240px;
    z-index: 200;
    overflow: hidden;
}

.ds-header__dropdown-flags {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ds-border);
}

.ds-header__dropdown-nav {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
}

.ds-header__dropdown-nav a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    transition: all 0.15s;
}

.ds-header__dropdown-nav a:hover {
    background: #fff5ee;
    color: var(--ds-orange);
}

.ds-header__dropdown-home {
    display: block;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ds-orange);
    border-top: 1px solid var(--ds-border);
    transition: background 0.15s;
}

.ds-header__dropdown-home:hover {
    background: #fff5ee;
}

/* ============================================
   NAVBAR (Barra arancione)
   ============================================ */
.ds-navbar {
    background: var(--ds-orange);
    position: sticky;
    top: var(--ds-header-height);
    z-index: 99;
}

.ds-navbar__inner {
    max-width: var(--ds-container-max);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: var(--ds-navbar-height);
    flex-wrap: wrap;
}

.ds-navbar__link {
    color: var(--ds-white);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    transition: background 0.2s;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.ds-navbar__link:hover,
.ds-navbar__link:focus {
    background: var(--ds-orange-dark);
}

.ds-navbar__link + .ds-navbar__link {
    border-left: 1px solid rgba(255,255,255,0.3);
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.ds-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
}

.ds-search-overlay[hidden] { display: none; }

.ds-search-overlay__inner {
    display: flex;
    align-items: center;
    width: 90%;
    max-width: 700px;
    gap: 12px;
}

.ds-search-overlay__input {
    flex: 1;
    padding: 16px 20px;
    font-size: 18px;
    border: none;
    border-radius: 4px;
    outline: none;
    font-family: var(--ds-font);
}

.ds-search-overlay__close {
    background: none;
    border: none;
    color: var(--ds-white);
    font-size: 36px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

.ds-search-overlay__results {
    width: 90%;
    max-width: 700px;
    margin-top: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.ds-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--ds-white);
    border-bottom: 1px solid var(--ds-border);
    color: var(--ds-black);
    transition: background 0.15s;
}

.ds-search-result:first-child { border-radius: 4px 4px 0 0; }
.ds-search-result:last-child { border-radius: 0 0 4px 4px; border-bottom: none; }

.ds-search-result:hover { background: var(--ds-gray-light); }

.ds-search-result__img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    flex-shrink: 0;
}

.ds-search-result__info { flex: 1; }
.ds-search-result__title { font-weight: 600; font-size: 14px; display: block; }
.ds-search-result__meta { font-size: 12px; color: var(--ds-gray-dark); display: block; }

/* ============================================
   HOMEPAGE — 3 colonne con sottocategorie
   ============================================ */
.ds-homepage {
    padding: 30px 20px;
    max-width: var(--ds-container-max);
    margin: 0 auto;
}

.ds-homepage__columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.ds-homepage__column {
    border: 1px solid var(--ds-border);
    background: var(--ds-white);
}

.ds-homepage__column-title {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 16px 12px;
    border-bottom: 3px solid var(--ds-orange);
    margin: 0;
    position: sticky;
    top: calc(var(--ds-header-height) + var(--ds-navbar-height));
    z-index: 10;
    background: var(--ds-white);
}

.ds-homepage__column-title a {
    color: var(--ds-black);
}

.ds-homepage__column-title a:hover {
    color: var(--ds-orange);
}

/* Chapter group within a column */
.ds-homepage__chapter {
    padding: 0 12px;
    border-bottom: 1px solid var(--ds-border);
}

.ds-homepage__chapter:last-child {
    border-bottom: none;
}

.ds-homepage__chapter-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ds-orange);
    padding: 10px 4px 4px;
    margin: 0;
    letter-spacing: 0.3px;
}

.ds-homepage__chapter-title a {
    color: var(--ds-orange);
}

.ds-homepage__chapter-title a:hover {
    color: var(--ds-orange-dark);
}

.ds-homepage__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    padding: 8px 0 12px;
}

.ds-homepage__product {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 6px;
    border: 1px solid var(--ds-border);
    border-radius: 2px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ds-homepage__product:hover {
    border-color: var(--ds-orange);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ds-homepage__product-img {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-gray-light);
    margin-bottom: 4px;
    overflow: hidden;
}

.ds-homepage__product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
}

.ds-homepage__product-placeholder {
    width: 100%;
    height: 100%;
    background: var(--ds-gray-light);
}

.ds-homepage__product-name {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ds-black);
    max-height: 2.4em;
    overflow: hidden;
}

/* ============================================
   CATALOGO VIEWER — Pagine JPG
   ============================================ */
.ds-catalogo-viewer {
    padding: 30px 0;
}

.ds-catalogo-viewer__title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--ds-orange);
}

.ds-catalogo-viewer__layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
    align-items: start;
}

/* Sidebar indice */
.ds-catalogo-viewer__sidebar {
    position: sticky;
    top: calc(var(--ds-header-height) + var(--ds-navbar-height) + 20px);
    max-height: calc(100vh - var(--ds-header-height) - var(--ds-navbar-height) - 40px);
    overflow-y: auto;
}

.ds-catalogo-viewer__index h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    color: var(--ds-orange);
}

.ds-catalogo-viewer__index ul {
    list-style: none;
}

.ds-catalogo-viewer__index li {
    margin-bottom: 2px;
}

.ds-catalogo-viewer__index-link {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 5px 8px;
    font-size: 12px;
    color: var(--ds-gray-dark);
    border-left: 2px solid transparent;
    transition: all 0.15s;
    line-height: 1.3;
}

.ds-catalogo-viewer__index-link:hover {
    color: var(--ds-orange);
    border-left-color: var(--ds-orange);
    background: var(--ds-gray-light);
}

.ds-catalogo-viewer__index-link.is-active {
    color: var(--ds-orange);
    border-left-color: var(--ds-orange);
    font-weight: 600;
    background: var(--ds-gray-light);
}

.ds-catalogo-viewer__index-num {
    flex-shrink: 0;
    font-weight: 700;
    min-width: 20px;
}

.ds-catalogo-viewer__index-name {
    flex: 1;
}

/* Chapter section */
.ds-catalogo-viewer__chapter {
    margin-bottom: 40px;
    scroll-margin-top: calc(var(--ds-header-height) + var(--ds-navbar-height) + 20px);
}

.ds-catalogo-viewer__chapter-title {
    font-size: 20px;
    font-weight: 700;
    padding: 12px 16px;
    background: var(--ds-gray-light);
    border-left: 4px solid var(--ds-orange);
    margin-bottom: 20px;
    position: sticky;
    top: calc(var(--ds-header-height) + var(--ds-navbar-height));
    z-index: 10;
}

.ds-catalogo-viewer__chapter-pages {
    font-size: 13px;
    font-weight: 400;
    color: var(--ds-gray);
}

.ds-catalogo-viewer__chapter-current-page {
    float: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--ds-orange);
    font-variant-numeric: tabular-nums;
}

/* Page images */
.ds-catalogo-viewer__pages {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ds-catalogo-viewer__page {
    position: relative;
    scroll-margin-top: calc(var(--ds-header-height) + var(--ds-navbar-height) + 10px);
}

.ds-catalogo-viewer__page-wrapper {
    width: 100%;
    aspect-ratio: 210 / 297; /* A4 proportions */
    background: var(--ds-gray-light);
    border: 1px solid var(--ds-border);
    overflow: hidden;
}

.ds-catalogo-viewer__page-wrapper.ds-loaded {
    aspect-ratio: auto;
    background: none;
}

.ds-catalogo-viewer__page-img {
    width: 100%;
    height: auto;
    display: block;
    clip-path: inset(2.5% 2.3% 2.5% 2.3%);
}

.ds-catalogo-viewer__page-num {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.6);
    color: var(--ds-white);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
}

/* ============================================
   PAGINA STANDARD
   ============================================ */
.ds-page {
    padding: 30px 0;
    min-height: 60vh;
}

.ds-page__title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--ds-orange);
}

.ds-page__content {
    line-height: 1.7;
}

.ds-page__content h2 { font-size: 22px; margin: 24px 0 12px; }
.ds-page__content h3 { font-size: 18px; margin: 20px 0 10px; }
.ds-page__content p { margin-bottom: 12px; }
.ds-page__content ul, .ds-page__content ol { margin: 12px 0 12px 24px; }
.ds-page__content a { color: var(--ds-orange); text-decoration: underline; }
.ds-page__content a:hover { color: var(--ds-orange-dark); }

/* PDF Documents section */
.ds-page__documents {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--ds-orange);
}

.ds-page__documents-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
}

.ds-page__documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.ds-page__document-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fafafa;
    border: 1px solid var(--ds-border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--ds-black);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ds-page__document-card:hover {
    border-color: var(--ds-orange);
    box-shadow: 0 2px 8px rgba(232, 119, 34, 0.12);
}

.ds-page__document-icon {
    flex-shrink: 0;
    color: #cc0000;
}

.ds-page__document-info {
    flex: 1;
    min-width: 0;
}

.ds-page__document-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ds-page__document-size {
    font-size: 12px;
    color: var(--ds-gray);
}

.ds-page__document-download {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--ds-orange);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@media (max-width: 767px) {
    .ds-page__documents-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.ds-footer {
    background: var(--ds-black);
    color: var(--ds-white);
    padding: 30px 0;
    margin-top: 40px;
}

.ds-footer__inner {
    max-width: var(--ds-container-max);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: start;
}

.ds-footer__company {
    font-size: 13px;
    line-height: 1.7;
}

.ds-footer__links {
    display: flex;
    gap: 20px;
}

.ds-footer__links a {
    font-size: 13px;
    color: var(--ds-gray);
    transition: color 0.15s;
}

.ds-footer__links a:hover { color: var(--ds-white); }

.ds-footer__copy {
    grid-column: 1 / -1;
    font-size: 11px;
    color: var(--ds-gray);
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================================
   ELEMENTS HIDDEN BY DEFAULT (shown in media queries)
   ============================================ */
.ds-mobile-tabs {
    display: none;
}

.ds-navbar__flags-mobile {
    display: none;
}

.ds-homepage__chips {
    display: none;
}

.ds-homepage__chapter-indicator {
    display: none;
}

.ds-homepage__product-count {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet + Mobile (<=1023px) */
@media (max-width: 1023px) {
    :root {
        --ds-mobile-header: 60px;
        --ds-mobile-tabs: 40px;
    }

    /* Header: compact with hamburger */
    .ds-header__inner { height: 60px; }
    .ds-header__tagline { display: none; }
    .ds-header__catalogs { display: none; }
    .ds-header__flags { display: none; }
    .ds-header__hamburger { display: flex; }

    /* Search: show icon only */
    .ds-header__search-toggle {
        display: flex;
        padding: 6px;
        margin-left: 4px;
    }
    .ds-header__search-toggle span { display: none; }

    /* Column title redundant with tabs */
    .ds-homepage__column-title { display: none; }

    /* Navbar: hidden on mobile (replaced by header dropdown) */
    .ds-navbar {
        display: none;
    }

    /* Catalog tabs — sticky below header */
    .ds-mobile-tabs {
        display: flex;
        position: sticky;
        top: 60px;
        z-index: 98;
        background: var(--ds-white);
        border-bottom: 1px solid var(--ds-border);
        height: var(--ds-mobile-tabs);
    }

    .ds-mobile-tabs__tab {
        flex: 1;
        padding: 10px 4px;
        text-align: center;
        font-size: 13px;
        font-weight: 600;
        color: #767676;
        background: none;
        border: none;
        border-bottom: 3px solid transparent;
        cursor: pointer;
        font-family: var(--ds-font);
        transition: color 0.15s, border-color 0.15s;
    }

    .ds-mobile-tabs__tab.is-active {
        color: var(--ds-orange);
        border-bottom-color: var(--ds-orange);
        font-weight: 700;
    }

    /* Homepage: single catalog at a time with tab switch */
    .ds-homepage {
        padding: 12px 16px;
    }


    .ds-homepage__columns {
        grid-template-columns: 1fr;
    }

    .ds-homepage__column {
        display: none;
        border: none;
        border-bottom: 2px solid var(--ds-border);
        min-width: 0;
    }

    .ds-homepage__column.is-active {
        display: block;
    }

    /* Fallback: show first column only if JS hasn't initialized tabs */
    .ds-homepage__columns:not(.js-tabs-init) > .ds-homepage__column:first-child {
        display: block;
    }

    /* Chip navigation */
    .ds-homepage__chips {
        display: flex;
        position: sticky;
        top: calc(var(--ds-mobile-header) + var(--ds-mobile-tabs));
        z-index: 97;
        background: var(--ds-white);
        padding: 12px 0 8px;
        border-bottom: 1px solid #f0f0f0;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-left: 16px;
        padding-right: 32px;
        -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
        mask-image: linear-gradient(to right, black calc(100% - 32px), transparent);
    }

    .ds-homepage__chips::-webkit-scrollbar {
        display: none;
    }

    .ds-homepage__chip {
        flex-shrink: 0;
        padding: 6px 14px;
        border-radius: 16px;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        border: none;
        cursor: pointer;
        font-family: var(--ds-font);
        background: var(--ds-gray-light);
        color: #555;
        transition: background 0.15s, color 0.15s;
    }

    .ds-homepage__chip.is-active {
        background: var(--ds-orange);
        color: var(--ds-white);
    }

    .ds-homepage__chip:focus-visible {
        outline: 2px solid var(--ds-orange);
        outline-offset: 2px;
    }

    /* Chapter indicator */
    .ds-homepage__chapter-indicator {
        display: block;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--ds-orange);
        letter-spacing: 0.5px;
        padding: 10px 16px 0;
        margin-bottom: 10px;
    }

    /* Mobile: hide chapter titles (replaced by chips + indicator) */
    .ds-homepage__chapter-title {
        display: none;
    }

    /* Mobile: chapters hidden by default, shown via JS */
    .ds-homepage__chapter {
        display: none;
        padding: 0;
        border-bottom: none;
    }

    .ds-homepage__chapter.is-active {
        display: block;
    }

    /* Mobile: improved grid */
    .ds-homepage__grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 8px 12px 16px;
    }

    /* Mobile: improved card */
    .ds-homepage__product {
        border-radius: 8px;
        border: 1px solid #e5e5e5;
        padding: 0;
        overflow: hidden;
        flex-direction: column;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(232, 119, 34, 0.15);
        touch-action: manipulation;
    }

    .ds-homepage__product:hover,
    .ds-homepage__product:active {
        border-color: var(--ds-orange);
    }

    .ds-homepage__product-img {
        height: 90px;
        background: #f8f8f8;
        padding: 6px;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ds-homepage__product-img img {
        max-height: 100%;
        width: auto;
        object-fit: contain;
    }

    .ds-homepage__product-name {
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
        color: var(--ds-black);
        max-height: none;
        padding: 8px 10px 0;
    }

    .ds-homepage__product-count {
        display: block;
        font-size: 10px;
        color: #767676;
        padding: 3px 10px 10px;
    }

    /* Catalog viewer (non-interactive page) */
    .ds-catalogo-viewer__layout {
        grid-template-columns: 1fr;
    }

    .ds-catalogo-viewer__sidebar {
        position: static;
        max-height: none;
        border-bottom: 1px solid var(--ds-border);
        padding-bottom: 16px;
        margin-bottom: 20px;
    }

    .ds-catalogo-viewer__index ul {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .ds-catalogo-viewer__index-link {
        border-left: none;
        border: 1px solid var(--ds-border);
        border-radius: 3px;
        padding: 4px 8px;
    }

    .ds-catalogo-viewer__index-link.is-active {
        border-color: var(--ds-orange);
        background: var(--ds-orange);
        color: var(--ds-white);
    }

    /* Search overlay */
    .ds-search-overlay {
        padding-top: 40px;
    }
}

/* Mobile — size overrides only (layout already in <=1023px block) */
@media (max-width: 767px) {
    .ds-homepage {
        padding: 8px 12px;
    }

    .ds-mobile-tabs__tab {
        font-size: 12px;
    }

    .ds-catalogo-viewer__chapter-title {
        font-size: 16px;
        padding: 10px 12px;
    }

    .ds-catalogo-viewer__page-wrapper {
        border: none;
    }

    .ds-footer__inner {
        grid-template-columns: 1fr;
    }

    .ds-footer__links {
        flex-direction: column;
        gap: 8px;
    }

    .ds-search-overlay {
        padding-top: 20px;
    }

    .ds-search-overlay__input {
        font-size: 16px;
        padding: 14px 16px;
    }

    .ds-search-overlay__results {
        max-width: 100%;
        padding: 0 12px;
        max-height: calc(100vh - 100px);
    }

    .ds-search-result__img {
        width: 40px;
        height: 40px;
    }
}
