/* Prezzomania V2 - Category page */
.category-page {
    background: var(--pm-white);
}

.category-page .pm-main,
.pm-category-main {
    background: var(--pm-white);
    padding-top: 0;
}

/* Breadcrumb */
.category-page .breadcrumb-box {
    width: 100%;
    margin: 0;
    padding: 1rem 0 0.35rem;
}

.category-page .breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--pm-text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.category-page .breadcrumb-list li {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 0;
}

.category-page .breadcrumb-list li + li::before {
    content: "/";
    margin-right: 0.35rem;
    color: var(--pm-gray-400);
}

.category-page .breadcrumb-list a {
    color: var(--pm-text-secondary);
    text-decoration: none;
}

.category-page .breadcrumb-list a:hover {
    color: var(--pm-primary);
}

.category-page .breadcrumb-list .active,
.category-page .breadcrumb-list .active a {
    color: var(--pm-text);
    font-weight: 500;
}

.category-page .breadcrumb-list .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.category-page .breadcrumb-list li:first-child a[aria-label="Home"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: var(--pm-text-secondary);
}

.category-page .breadcrumb-list li:first-child a[aria-label="Home"] .fa-home {
    display: none !important;
}

.category-page .breadcrumb-list li:first-child a[aria-label="Home"]::before {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 1.4 1.4 7v7.6h4.1v-4.5h5v4.5h4.1V7L8 1.4Zm5.2 11.8h-1.3V8.7H4.1v4.5H2.8V7.7L8 3.3l5.2 4.4v5.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='black' d='M8 1.4 1.4 7v7.6h4.1v-4.5h5v4.5h4.1V7L8 1.4Zm5.2 11.8h-1.3V8.7H4.1v4.5H2.8V7.7L8 3.3l5.2 4.4v5.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.category-page .breadcrumb-list li:first-child a[aria-label="Home"]:hover {
    color: var(--pm-primary);
    background: rgba(var(--pm-primary-rgb), 0.08);
}

/* Category intro */
.pm-category-head {
    padding: 0.7rem 0 1.2rem;
    border-bottom: 1px solid var(--pm-border);
}

.pm-category-title {
    margin: 0;
    font-size: clamp(1.55rem, 3.1vw, 2.35rem);
    letter-spacing: -0.025em;
}

.pm-category-subtitle {
    margin: 0.5rem 0 0;
    color: var(--pm-text-secondary);
    font-size: clamp(0.95rem, 1.6vw, 1.08rem);
    font-weight: 600;
}

.pm-category-intro {
    max-width: 920px;
    margin: 0.65rem 0 0;
    color: var(--pm-text-secondary);
    font-size: 0.92rem;
    line-height: 1.65;
}

/* Toolbar */
.pm-category-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}

.pm-category-count {
    color: var(--pm-text-secondary);
    font-size: 0.86rem;
}

.pm-category-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.pm-category-sort label {
    color: var(--pm-text-secondary);
    font-size: 0.82rem;
    white-space: nowrap;
}

.pm-category-sort select {
    min-width: 190px;
    min-height: 42px;
    padding: 0.55rem 2.2rem 0.55rem 0.8rem;
    border: 1px solid var(--pm-border-strong);
    border-radius: 0.55rem;
    background: var(--pm-white);
    color: var(--pm-text);
    font-size: 0.86rem;
    cursor: pointer;
}

.pm-category-sort select:focus {
    border-color: var(--pm-primary);
    outline: 0;
    box-shadow: var(--pm-focus-ring);
}

/* Product grid */
.pm-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem 0.85rem;
    padding-bottom: 1.5rem;
}

.pm-category-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--pm-white);
}

.pm-category-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--pm-border);
    border-radius: 0.75rem;
    background: var(--pm-white);
    text-decoration: none;
}

.pm-category-card__media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    padding: 0.55rem;
    transition: transform 180ms ease;
}

.pm-category-card:hover .pm-category-card__media img {
    transform: scale(1.025);
}

.pm-category-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 0.65rem 0.15rem 0;
}

.pm-category-card__brand {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    min-height: 1.15rem;
    color: var(--pm-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: color .18s ease;
}

.pm-category-card__brand:hover,
.pm-category-card__brand:focus-visible {
    color: var(--pm-orange);
    text-decoration: none;
}

.pm-category-card__brand--empty {
    pointer-events: none;
}

.pm-category-card__title {
    display: -webkit-box;
    min-height: 2.55rem;
    margin: 0.28rem 0 0;
    overflow: hidden;
    color: var(--pm-text);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.48;
    text-decoration: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.pm-category-card__title:hover {
    color: var(--pm-primary);
}

.pm-category-card__price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.7rem;
}

.pm-category-card__price {
    color: var(--pm-text);
    font-size: 1.12rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pm-category-card__available {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    color: var(--pm-success);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.pm-category-card__available::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Pagination */
.pm-category-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 1.25rem 0 2.25rem;
    padding: 0;
    list-style: none;
}

.pm-category-pagination a,
.pm-category-pagination span {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--pm-border);
    border-radius: 0.55rem;
    background: var(--pm-white);
    color: var(--pm-text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.pm-category-pagination a:hover {
    border-color: var(--pm-gray-400);
    color: var(--pm-text);
}

.pm-category-pagination .is-current {
    border-color: var(--pm-black);
    background: var(--pm-black);
    color: var(--pm-white);
}

.pm-category-pagination .is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* SEO / FAQ below products */
.pm-category-bottom {
    border-top: 1px solid var(--pm-border);
    padding: 2rem 0 0.5rem;
    color: var(--pm-text-secondary);
    font-size: 0.9rem;
    line-height: 1.75;
    content-visibility: auto;
    contain-intrinsic-size: 1px 600px;
}

.pm-category-bottom h2,
.pm-category-bottom h3,
.pm-category-bottom h4 {
    margin-top: 1.4rem;
    margin-bottom: 0.55rem;
    font-size: 1.05rem;
}

.pm-category-bottom a {
    color: var(--pm-text);
}

.pm-category-empty {
    padding: 4rem 1rem;
    text-align: center;
}

.pm-category-empty h1 {
    margin-bottom: 0.6rem;
    font-size: 1.7rem;
}

.pm-category-empty p {
    color: var(--pm-text-secondary);
}

.pm-category-empty a {
    display: inline-flex;
    margin-top: 1rem;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1.1rem;
    border-radius: 0.55rem;
    background: var(--pm-black);
    color: var(--pm-white);
    font-weight: 600;
    text-decoration: none;
}

@media (min-width: 576px) {
    .pm-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.4rem 1rem;
    }
}

@media (min-width: 992px) {
    .pm-category-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.8rem 1.25rem;
    }

    .pm-category-card__title {
        font-size: 0.9rem;
    }
}

@media (min-width: 1400px) {
    .pm-category-grid {
        gap-inline: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .pm-category-toolbar {
        align-items: flex-end;
    }

    .pm-category-count {
        font-size: 0.76rem;
    }

    .pm-category-sort {
        display: block;
    }

    .pm-category-sort label {
        display: block;
        margin-bottom: 0.25rem;
    }

    .pm-category-sort select {
        min-width: 150px;
        max-width: 52vw;
        min-height: 40px;
        font-size: 0.8rem;
    }

    .pm-category-card__media img {
        padding: 0.35rem;
    }

    .pm-category-card__brand {
        font-size: 0.66rem;
    }

    .pm-category-card__title {
        min-height: 2.45rem;
        font-size: 0.8rem;
    }

    .pm-category-card__price {
        font-size: 1rem;
    }

    .pm-category-card__available {
        display: none;
    }

    .pm-category-pagination a,
    .pm-category-pagination span {
        min-width: 36px;
        min-height: 36px;
        padding: 0.4rem 0.58rem;
        font-size: 0.75rem;
    }
}

/* =========================================================
   FIX 4 - Category content / FAQ
   ========================================================= */

/* La descrizione introduttiva sfrutta tutta la larghezza utile. */
.pm-category-intro {
    max-width: none;
    width: 100%;
    font-size: 0.96rem;
    line-height: 1.72;
}

/* Sezione editoriale sotto i prodotti: piu leggibile e ariosa. */
.pm-category-bottom {
    padding-top: 2.5rem;
    padding-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.78;
}

.pm-category-faq,
.pm-category-long-description {
    width: 100%;
    max-width: none;
}

.pm-category-long-description {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--pm-border);
}

.pm-category-bottom p,
.pm-category-long-description p,
.pm-category-faq p {
    max-width: none;
    margin-top: 0.65rem;
    margin-bottom: 0.9rem;
}

.pm-category-bottom h2,
.pm-category-bottom h3,
.pm-category-bottom h4 {
    color: var(--pm-text);
    line-height: 1.3;
}

.pm-category-bottom h2 {
    margin-top: 0;
    margin-bottom: 0.9rem;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.pm-category-bottom h3 {
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    font-size: clamp(1.08rem, 1.5vw, 1.25rem);
}

/* FAQ native <details>: aspetto da accordion, senza JS aggiuntivo. */
.pm-category-faq details {
    position: relative;
    margin: 0;
    border-top: 1px solid var(--pm-border);
    background: var(--pm-white);
}

.pm-category-faq details:last-of-type {
    border-bottom: 1px solid var(--pm-border);
}

.pm-category-faq summary {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 0.95rem 3.25rem 0.95rem 0;
    color: var(--pm-text);
    font-weight: 600;
    line-height: 1.45;
    cursor: pointer;
    list-style: none;
    transition: color 160ms ease;
}

.pm-category-faq summary::-webkit-details-marker {
    display: none;
}

.pm-category-faq summary::marker {
    content: "";
}

.pm-category-faq summary::before,
.pm-category-faq summary::after {
    content: "";
    position: absolute;
    right: 0.35rem;
    top: 50%;
    width: 15px;
    height: 1.5px;
    border-radius: 2px;
    background: var(--pm-text-secondary);
    transform: translateY(-50%);
    transition: transform 180ms ease, background-color 180ms ease;
}

.pm-category-faq summary::after {
    transform: translateY(-50%) rotate(90deg);
}

.pm-category-faq details[open] summary {
    color: var(--pm-primary);
}

.pm-category-faq details[open] summary::before,
.pm-category-faq details[open] summary::after {
    background: var(--pm-primary);
}

.pm-category-faq details[open] summary::after {
    transform: translateY(-50%) rotate(0deg);
}

.pm-category-faq details > :not(summary) {
    margin-left: 0;
    margin-right: 0;
}

.pm-category-faq details > p,
.pm-category-faq details > div,
.pm-category-faq details > ul,
.pm-category-faq details > ol {
    margin-top: 0;
    margin-bottom: 0;
    padding: 0 3.25rem 1.15rem 0;
    color: var(--pm-text-secondary);
    line-height: 1.75;
}

.pm-category-faq details[open] {
    background: linear-gradient(180deg, rgba(var(--pm-primary-rgb), 0.025), rgba(var(--pm-primary-rgb), 0));
}

.pm-category-faq summary:hover {
    color: var(--pm-primary);
}

@media (max-width: 575.98px) {
    .pm-category-intro {
        font-size: 0.9rem;
        line-height: 1.65;
    }

    .pm-category-bottom {
        padding-top: 2rem;
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .pm-category-faq summary {
        min-height: 54px;
        padding-right: 2.6rem;
        font-size: 0.94rem;
    }

    .pm-category-faq details > p,
    .pm-category-faq details > div,
    .pm-category-faq details > ul,
    .pm-category-faq details > ol {
        padding-right: 1rem;
        padding-bottom: 1rem;
    }

    .pm-category-long-description {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
}
