/* Reference-inspired catalog redesign for iPodil. */

.catalog-hero-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 18px;
    margin: 12px 0 14px;
    padding: 24px 28px;
    border-radius: 22px;
    background:
        radial-gradient(circle at 82% 32%, rgba(35, 88, 246, .28), transparent 28%),
        linear-gradient(135deg, #0a0f18, #151b27 58%, #070b12);
    color: #fff;
    box-shadow: 0 16px 38px rgba(12, 18, 32, .16);
}

.catalog-hero-v2 .eyebrow {
    display: inline-flex;
    margin: 0 0 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .10);
    color: rgba(255, 255, 255, .78);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.catalog-hero-v2 h1 {
    margin: 0;
    max-width: 720px;
    font-size: clamp(32px, 4vw, 54px);
    line-height: .98;
    letter-spacing: -.055em;
}

.catalog-hero-v2 p:not(.eyebrow) {
    max-width: 680px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .74);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 700;
}

.catalog-layout-v2 {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.catalog-sidebar-v2 {
    position: sticky;
    top: calc(var(--ip-header-desktop, 96px) + 12px);
    display: grid;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(17, 26, 54, .06);
    box-shadow: 0 10px 26px rgba(17, 26, 54, .055);
}

.catalog-sidebar-v2 > h2 {
    margin: 0 0 4px;
    color: #111a36;
    font-size: 18px;
    letter-spacing: -.035em;
}

.catalog-sidebar-v2 .filter-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    padding: 8px 10px;
    border-radius: 12px;
    color: #2b3347;
    text-decoration: none;
    font-size: 13px;
    font-weight: 850;
}

.catalog-sidebar-v2 .filter-link:hover {
    background: #f4f6fb;
}

.catalog-sidebar-v2 .filter-link.active {
    background: #2358f6;
    color: #fff;
}

.catalog-filter-panel {
    margin-top: 8px;
}

.catalog-filter-backdrop,
.catalog-filter-close {
    display: none;
}

.catalog-filter-sheet {
    display: block;
}

.catalog-filter-head {
    display: none;
}

.catalog-filters-v2 {
    display: grid;
    gap: 9px;
}

.filter-field {
    display: grid;
    gap: 5px;
    color: #5f6b84;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: -.01em;
}

.filter-field input,
.filter-field select {
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid rgba(17, 26, 54, .08);
    border-radius: 12px;
    background: #f7f9fd;
    color: #111a36;
    font-size: 12px;
    font-weight: 750;
    outline: none;
}

.filter-field input:focus,
.filter-field select:focus {
    border-color: rgba(35, 88, 246, .36);
    box-shadow: 0 0 0 3px rgba(35, 88, 246, .10);
}

.filter-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.catalog-filter-actions {
    display: grid;
    gap: 8px;
    margin-top: 2px;
}

.filter-submit,
.filter-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.filter-submit {
    border: 0;
    background: #2358f6;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(35, 88, 246, .20);
}

.filter-reset {
    background: #f2f4f8;
    color: #5f6b84;
}

.catalog-content {
    min-width: 0;
}

.catalog-topline-v2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(17, 26, 54, .045);
}

.catalog-topline-v2 p {
    margin: 0;
    color: #111a36;
    font-size: 15px;
    font-weight: 900;
}

.catalog-topline-v2 span {
    margin-top: 2px;
    min-height: 0;
    padding: 0;
    background: transparent;
    color: #6a758d;
    font-size: 12px;
    font-weight: 800;
}

.mobile-filter-button {
    display: none;
}

.quick-filter-chips,
.active-filter-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 10px;
    margin-bottom: 2px;
    -webkit-overflow-scrolling: touch;
}

.quick-filter-chips a,
.active-filter-chips a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.quick-filter-chips a {
    background: #fff;
    color: #2b3347;
    box-shadow: 0 6px 16px rgba(17, 26, 54, .045);
}

.active-filter-chips a {
    background: rgba(35, 88, 246, .10);
    color: #2358f6;
}

.active-filter-chips__reset {
    background: #111a36 !important;
    color: #fff !important;
}

.pagination-wrap {
    margin-top: 18px;
}

.empty-state {
    padding: 26px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(17, 26, 54, .055);
}

.empty-state h2 {
    margin: 0 0 8px;
    color: #111a36;
    letter-spacing: -.035em;
}

.empty-state p {
    margin: 0;
    color: #6a758d;
    font-weight: 750;
}

@media (max-width: 900px) {
    .catalog-hero-v2 {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 14px;
        margin-top: 10px;
        padding: 20px;
        border-radius: 20px;
    }

    .catalog-hero-v2 h1 {
        font-size: 32px;
    }

    .catalog-hero-v2 p:not(.eyebrow) {
        font-size: 13px;
    }

    .catalog-layout-v2 {
        display: block;
    }

    .catalog-sidebar-v2 {
        position: static;
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .catalog-sidebar-v2 > h2,
    .catalog-sidebar-v2 > .filter-link,
    .catalog-sidebar-v2 > .mobile-filter-button {
        display: none;
    }

    .mobile-filter-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 36px;
        padding: 0 13px;
        border: 0;
        border-radius: 12px;
        background: #2358f6;
        color: #fff;
        font-size: 12px;
        font-weight: 900;
        cursor: pointer;
        box-shadow: 0 8px 18px rgba(35, 88, 246, .18);
    }

    .catalog-filter-panel {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 255;
        margin: 0;
    }

    .catalog-filter-panel.is-open {
        display: block;
    }

    .catalog-filter-backdrop {
        display: block;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(8, 13, 21, .46);
        backdrop-filter: blur(5px);
    }

    .catalog-filter-sheet {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: min(86dvh, 720px);
        overflow: auto;
        padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0;
        background: #fff;
        box-shadow: 0 -18px 48px rgba(8, 13, 21, .24);
    }

    .catalog-filter-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 12px;
    }

    .catalog-filter-head h2 {
        margin: 0;
        color: #111a36;
        font-size: 20px;
        letter-spacing: -.035em;
    }

    .catalog-filter-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border: 0;
        border-radius: 13px;
        background: #f2f4f8;
        color: #111a36;
        font-size: 24px;
    }

    .catalog-filters-v2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .filter-field--wide,
    .catalog-filter-actions {
        grid-column: 1 / -1;
    }

    .catalog-topline-v2 {
        margin-top: 10px;
        padding: 10px 12px;
        border-radius: 15px;
    }

    .catalog-topline-v2 p {
        font-size: 14px;
    }

    .catalog-topline-v2 span {
        font-size: 11px;
    }
}

@media (max-width: 767px) {
    .catalog-hero-v2 {
        margin-top: 8px;
        padding: 18px;
        border-radius: 18px;
    }

    .catalog-hero-v2 .button {
        width: 100%;
    }

    .quick-filter-chips,
    .active-filter-chips {
        margin-right: -10px;
        margin-left: -10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .quick-filter-chips a,
    .active-filter-chips a {
        min-height: 30px;
        padding: 0 10px;
        font-size: 11px;
    }

    .catalog-filter-sheet {
        max-height: 88dvh;
    }

    .filter-field input,
    .filter-field select {
        min-height: 40px;
        font-size: 12px;
    }

    .catalog-content,
    .catalog-products,
    .catalog-products .product-card-v2,
    .catalog-products .product-card-v2 * {
        box-sizing: border-box;
        min-width: 0;
    }

    .catalog-products {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .catalog-products .product-card-v2 {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .catalog-products .product-card-v2__photo {
        width: 100% !important;
        height: 112px !important;
    }

    .catalog-products .product-card-v2__body {
        width: 100% !important;
        min-width: 0 !important;
    }

    .catalog-products .product-card-v2__top {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        min-width: 0 !important;
    }

    .catalog-products .status-inline,
    .catalog-products .product-code,
    .catalog-products .product-card-v2__chips span {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .catalog-products .product-card-v2__title {
        display: -webkit-box !important;
        min-height: 32px !important;
        overflow: hidden !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 2 !important;
        font-size: 13px !important;
    }

    .catalog-products .product-card-v2__chips {
        overflow: hidden !important;
    }

    .catalog-products .product-card-v2__bottom {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 7px !important;
    }

    .catalog-products .product-card-v2__bottom form,
    .catalog-products .product-card-v2__bottom .button {
        width: 100% !important;
    }

    .catalog-products .card-price strong {
        font-size: 15px !important;
        white-space: nowrap !important;
    }

    body.catalog-filter-open {
        overflow: hidden;
    }
}
