/* Products Page Styling */

/* =========================================
   Global Page Overrides
   ========================================= */
main>section {
    margin-top: 0 !important;
}

main>section.container {
    padding-left: max(var(--page-gutter, 20px), env(safe-area-inset-left));
    padding-right: max(var(--page-gutter, 20px), env(safe-area-inset-right));
}

body:has(.catalog-head) {
    overflow-x: hidden;
}

video {
    display: block;
}

/* =========================================
   Banner / Hero Section
   ========================================= */
.cat-banner {
    display: block;
    width: 100%;
    background-color: #fff !important;
    position: relative;
    z-index: 5;
    overflow: hidden;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    height: calc(70vh - 34px);
    min-height: 526px !important;
}

.banner-inner,
.cat-banner .banner-inner.container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start !important;
    width: 100%;
    height: 100%;
    min-height: 526px;
    overflow: visible;
    position: static;
}

.cat-banner .banner-inner.container::after {
    content: none;
}

.banner-text {
    flex-shrink: 0;
    z-index: 20;
    padding-left: 0 !important;
    margin-left: 0 !important;
    align-self: center;
    margin-top: 0 !important;
    visibility: visible;
    opacity: 1;
    position: relative;
    text-align: left;
    max-width: 560px;
}

.banner-text h1,
.cat-banner .container h1 {
    font-size: 5.5rem;
    font-weight: 700;
    color: var(--blue-1) !important;
    line-height: 0.95;
    margin: 0;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.banner-text p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #666;
    max-width: 560px;
    margin-top: 1rem;
    font-weight: 400;
}

.banner-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    width: 90%;
    display: flex;
    justify-content: flex-end;
    align-items: stretch;
    padding: 0;
    background: transparent;
    visibility: visible;
    opacity: 1;
}

.banner-image video {
    width: 100%;
    max-width: 100%;

    object-fit: contain;
    background: transparent;
    transform: none;
    transform-origin: center right;
    margin-bottom: 0;
    border-radius: 0;
}

/* =========================================
   Product Grid & Cards
   ========================================= */
.catalog-head {
    padding-top: 92px;
}

.catalog-title.page-hero-title {
    margin: 0 !important;
}

.catalog-toolbar {
    display: grid;
    grid-template-columns: minmax(120px, 360px) 1fr;
    align-items: center;
    gap: 18px;
    margin: 70px 0 24px;
    width: 100%;
    min-width: 0;
}

.catalog-filter-title {
    color: var(--blue-1, #092C80);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
}

.catalog-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

.catalog-filter-nav {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
}

.catalog-filters {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.catalog-filters::-webkit-scrollbar {
    display: none;
}

.catalog-filter-arrow {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: 0;
    background: var(--blue-1, #092C80);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    transition: background-color 180ms ease, opacity 180ms ease;
}

.catalog-filter-arrow:hover,
.catalog-filter-arrow:focus-visible {
    background: #163caa;
    outline: none;
}

.catalog-filter-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.catalog-filter-arrow[hidden] {
    display: none;
}

.catalog-filter {
    flex: 0 1 auto;
    min-width: 92px;
    height: 36px;
    padding: 0 14px;
    border: 0;
    background: var(--blue-1, #092C80);
    color: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background-color 180ms ease, transform 180ms ease;
}

.catalog-filter:hover,
.catalog-filter:focus-visible {
    background: #163caa;
    outline: none;
}

.catalog-filter.is-active {
    background: var(--blue-1, #092C80);
}

.catalog-actions .ps-search {
    flex: 0 0 auto;
    width: min(300px, 100%);
    box-sizing: border-box;
}

.catalog-actions .ps-searchbar {
    flex: 0 0 auto;
    box-sizing: border-box;
}

.catalog-actions .ps-search-input {
    min-width: 0;
    box-sizing: border-box;
}

.catalog-actions .ps-search-btn {
    background: var(--blue-1, #092C80);
}

.catalog-actions .ps-search-btn:hover {
    background: #163caa;
}

.catalog-grid {
    margin-top: 0;
}

.subcategory-section {
    grid-column: 1 / -1;
    margin-top: 32px;
}

.subcategory-section:first-child {
    margin-top: 0;
}

.subcategory-title {
    margin: 0 0 18px;
    color: var(--blue-1, #092C80);
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.15;
}

.subcategory-grid {
    width: 100%;
}

.prod-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

#products-section-title {
    margin-bottom: 3rem;
}

.prod-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    aspect-ratio: 1 / 1;
    padding: 1rem;
    text-decoration: none;
    position: relative;
    transition: box-shadow 200ms ease, background-color 200ms ease;
    border-radius: 0;
    border: 1px solid #f2f2f2;
}

.prod-card:hover {
    background-color: #fff;
    border-color: transparent;
    box-shadow: 0 0 0 1px var(--card-border, #214ecd);
}

.prod-card:focus-visible {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px rgba(24, 99, 255, 0.35);
}

.pc-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.pc-image img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
}

.pc-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--blue-1);
}

.catalog-category-card {
    justify-content: space-between;
}

.catalog-category-card .pc-title {
    font-size: 1.05rem;
    text-transform: uppercase;
}

.pc-meta {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: #666;
    font-weight: 600;
}

.pc-software-title {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(90deg, #0b2b85, #4caf50);
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    margin-top: auto;
    margin-bottom: auto;
    text-align: center;
}

.pc-software-logo {
    margin-top: auto;
    margin-bottom: auto;
}

.pc-software-logo img {
    max-width: 180px;
    max-height: 120px;
}

.prod-card.card-blue {
    background-color: var(--accent);
    align-items: center;
    justify-content: center;
    border: none;
}

.prod-card.card-blue .cta-text {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
}

.prod-card.card-blue:hover {
    background-color: var(--blue-1);
}

/* =========================================
   Category Specific Overrides
   ========================================= */
[data-category="implantologia"] {
    --prod-blue: #d32f2f;
    --blue-1: #d32f2f;
}

[data-category="implantologia"] .banner-text h1,
[data-category="implantologia"] .cat-banner .container h1 {
    color: #d32f2f !important;
}

[data-category="implantologia"] .prod-card.card-blue {
    background-color: #d32f2f;
    color: #fff;
}

[data-category="implantologia"] .prod-card.card-blue:hover {
    background-color: #b71c1c;
}

[data-category="digital"] {
    --prod-blue: #001b2e;
    --blue-1: #001b2e;
}

[data-category="digital"] .banner-text h1,
[data-category="digital"] .cat-banner .container h1 {
    color: #001b2e !important;
}

[data-category="digital"] .prod-card.card-blue {
    background-color: #001b2e;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 1024px) {
    .cat-banner {
        height: auto;
        min-height: auto !important;
    }

    .cat-banner .banner-inner.container {
        display: grid;
        grid-template-columns: 1fr;
        min-height: auto;
        gap: 2rem;
        padding-top: calc(var(--header-height, 64px) + 2rem);
        padding-bottom: 3rem;
    }

    .cat-banner .banner-inner.container::after {
        content: none;
    }

    .banner-text {
        max-width: 680px;
    }

    .banner-text h1,
    .cat-banner .container h1 {
        font-size: clamp(3.4rem, 8vw, 5rem);
    }

    .banner-text p {
        max-width: 560px;
    }

    .prod-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .catalog-toolbar {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 56px;
    }

    .catalog-filter-title {
        width: min(360px, 100%);
    }

    .catalog-actions,
    .catalog-filter-nav {
        justify-content: flex-start;
    }

    .banner-image {
        position: relative;
        width: 100%;
        height: 420px;
    }

    .banner-image video {
        height: 100%;
    }
}

@media (max-width: 768px) {
    .catalog-head {
        padding-top: 72px;
    }

    .catalog-toolbar {
        margin-top: 44px;
        width: 100%;
        max-width: 100%;
    }

    .catalog-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .catalog-filter-nav {
        width: 100%;
    }

    .catalog-filters {
        width: auto;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .catalog-filter {
        min-width: 68px;
        flex: 0 0 auto;
    }

    .catalog-actions .ps-searchbar,
    .catalog-actions .ps-search {
        width: 100%;
        max-width: 100%;
    }

    .catalog-actions .ps-search {
        flex: 0 1 auto;
        display: block;
        position: relative;
        width: calc(100% - 46px);
        padding-right: 46px;
    }

    .catalog-actions .ps-search-input {
        width: 100%;
    }

    .catalog-actions .ps-search-btn {
        position: absolute;
        top: 0;
        right: 46px;
        bottom: 0;
        height: auto;
    }

    .cat-banner .banner-inner.container {
        display: grid;
        min-height: min(78vh, 680px);
        padding-top: 0;
        padding-bottom: 0;
        position: relative;
    }

    .cat-banner .banner-inner.container::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 10;
        background: rgba(255, 255, 255, 0.58);
        pointer-events: none;
    }

    .banner-text {
        align-self: center;
        grid-area: 1 / 1;
        max-width: 100%;
        padding: calc(var(--header-height, 64px) + 1rem) 0 2rem;
        position: relative;
        z-index: 20;
    }

    .banner-text h1,
    .cat-banner .container h1 {
        font-size: clamp(2.8rem, 9vw, 4.4rem);
        line-height: 0.98;
    }

    .banner-text p {
        font-size: 1rem;
        line-height: 1.45;
        max-width: 92%;
        margin-top: 1rem;
    }

    .banner-image {
        grid-area: 1 / 1;
        height: 100%;
        min-height: min(78vh, 680px);
        width: calc(100% + (var(--page-gutter, 20px) * 2));
        margin-left: calc(var(--page-gutter, 20px) * -1);
        position: relative;
        z-index: 1;
        overflow: hidden;
    }

    .banner-image video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center right;
    }

    .prod-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .prod-card {
        aspect-ratio: 1 / 1;
        padding: 1rem;
    }

    .pc-image img {
        max-height: 180px;
    }

    .pc-title {
        font-size: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .catalog-head {
        padding-top: 84px;
    }

    .cat-banner .banner-inner.container {
        padding-top: 84px;
        padding-bottom: 56px;
    }

    .banner-text h1,
    .cat-banner .container h1 {
        font-size: clamp(2.15rem, 12vw, 3rem);
    }

    .banner-text p {
        font-size: 0.96rem;
        max-width: 100%;
    }

    .prod-grid {
        gap: 16px;
    }

    .pc-image img {
        max-height: 150px;
    }
}
