.quality-page {
    padding-top: 0;
}

.quality-page main>section,
main.quality-page>section {
    margin-top: 0;
}

.quality-hero {
    position: relative;
    height: calc(70vh - 34px);
    min-height: 526px;
    max-height: 700px;
    margin: 0 0 72px;
    padding: 0;
    overflow: hidden;
}

.quality-hero-copy {
    max-width: 820px;
}

.quality-hero-copy p:last-child {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
    line-height: 1.72;
    max-width: 680px;
    margin: 0;
}

.quality-hero-media {
    display: none;
}

.quality-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center 48%;
    display: block;
}

.quality-hero-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 0 0 92px;
    background:
        linear-gradient(90deg, rgba(0, 18, 60, 0.72) 0%, rgba(0, 18, 60, 0.48) 42%, rgba(0, 18, 60, 0.12) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.42) 100%);
}

.quality-hero h1,
.quality-page h1 {
    color: var(--blue-1, #214ecd);
    font-size: 5.5rem;
    line-height: 1;
    font-weight: 800;
    margin: 0 0 28px;
}

.quality-hero h1 {
    color: #fff;
    margin: 0 0 18px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.24);
}

.quality-hero .quality-kicker {
    color: #fff !important;
}

.quality-content,
.quality-content.container {
    width: 100%;
    max-width: var(--container, 1536px);
    padding-bottom: 0;
}

.quality-content h2,
.quality-general-inner h2 {
    color: var(--blue-1, #214ecd);
    font-size: 3.5rem;
    line-height: 1.05;
    margin: 48px 0 18px;
    font-weight: 800;
}

.quality-content p,
.quality-general-inner p,
.quality-info-page p,
.quality-subpage-head p {
    color: #2f3338;
    font-size: 1.05rem;
    line-height: 1.72;
    max-width: 920px;
    margin-bottom: 18px;
}

.quality-general-section {
    width: 100%;
    margin: 0;
    padding: 0 0 88px;
    background: #fff;
}

.quality-general-inner,
.quality-general-inner.container {
    width: 100%;
    max-width: var(--container, 1536px);
}

.quality-two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 28px;
    width: 100%;
}

.quality-two-columns > div {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: clamp(24px, 3vw, 36px);
    border: 1px solid #e4e8f1;
    background: #fff;
}

.quality-two-columns p {
    max-width: none;
}

.quality-two-columns p:last-child {
    margin-bottom: 0;
}

.quality-resource-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
    gap: 28px;
    align-items: stretch;
    margin: 42px 0 62px;
}

.quality-resource-media img {
    width: 100%;
    height: 100%;
    min-height: 360px;
    object-fit: cover;
    display: block;
}

.quality-resource-panel {
    background: #f4f6fb;
    padding: clamp(24px, 4vw, 42px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
}

.quality-link-group h3 {
    color: var(--blue-1, #214ecd);
    font-size: 1.35rem;
    margin: 0 0 12px;
    font-weight: 800;
}

.quality-link-group ul {
    list-style: disc;
    padding-left: 20px;
    margin: 0;
}

.quality-link-group li {
    margin: 8px 0;
    color: #2f3338;
}

.quality-link-group a {
    color: #163caa;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.quality-info-page,
.safety-sheets-page {
    padding-top: 132px;
    padding-bottom: 88px;
}

.quality-subpage {
    max-width: 1180px;
}

.quality-subpage-head {
    max-width: 820px;
}

.quality-page-head .quality-subpage-head {
    max-width: none;
}

.quality-kicker {
    color: var(--blue-1, #214ecd) !important;
    font-size: 0.82rem !important;
    line-height: 1.1 !important;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
    margin: 0 0 14px !important;
}

.quality-subpage-head h1 {
    margin-bottom: 18px;
}

.quality-subpage-head p:last-child {
    margin-bottom: 0;
}

.quality-symbols-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: start;
    gap: 28px;
    margin: 40px 0 28px;
}

.quality-symbols-image {
    padding: clamp(18px, 3vw, 32px);
    border: 1px solid #e4e8f1;
    background: #fff;
}

.quality-symbols-image img {
    width: 100%;
    height: auto;
    display: block;
}

.quality-note-panel {
    background: #f4f6fb;
    padding: clamp(24px, 4vw, 36px);
}

.quality-note-panel h2 {
    color: var(--blue-1, #214ecd);
    font-size: 1.45rem;
    line-height: 1.12;
    font-weight: 800;
    margin: 0 0 14px;
}

.quality-note-panel p {
    margin: 0;
}

.quality-footnote {
    padding-top: 22px;
    border-top: 1px solid #e4e8f1;
}

.quality-page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: end;
    gap: 28px;
    margin-bottom: 38px;
}

.safety-search {
    display: flex;
    align-items: center;
    height: 48px;
    border: 1px solid #d8dce7;
    background: #fff;
}

.safety-search:focus-within {
    border-color: var(--blue-1, #214ecd);
    box-shadow: 0 0 0 3px rgba(24, 99, 255, 0.14);
}

.safety-search input {
    width: 100%;
    min-width: 0;
    height: 100%;
    border: 0;
    padding: 0 14px;
    font: inherit;
    color: #20242a;
    outline: none;
}

.safety-search span {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--blue-1, #214ecd);
}

.quality-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2f3338;
    font-weight: 700;
    min-height: 80px;
}

.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #dfe5f5;
    border-top-color: var(--blue-1, #214ecd);
    border-radius: 50%;
    animation: quality-spin 0.8s linear infinite;
}

.safety-list-head {
    display: grid;
    grid-template-columns: minmax(82px, 0.2fr) minmax(104px, 0.22fr) minmax(0, 1fr) 36px;
    align-items: center;
    gap: 16px;
    min-height: 42px;
    padding: 0 16px;
    background: var(--blue-1, #214ecd);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.safety-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.safety-list-item a {
    display: grid;
    grid-template-columns: minmax(82px, 0.2fr) minmax(104px, 0.22fr) minmax(0, 1fr) 36px;
    align-items: center;
    gap: 16px;
    min-height: 58px;
    padding: 12px 16px;
    border: 1px solid #e4e8f1;
    border-top: 0;
    background: #fff;
    color: #20242a;
    text-decoration: none;
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.safety-list-item a:hover,
.safety-list-item a:focus-visible {
    border-color: var(--blue-1, #214ecd);
    background: #f7f9ff;
    outline: none;
}

.safety-code {
    color: var(--blue-1, #214ecd);
    font-weight: 800;
}

.safety-date {
    color: #5f6673;
    font-size: 0.95rem;
}

.safety-name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.safety-icon {
    color: var(--blue-1, #214ecd);
    text-align: right;
}

.quality-message {
    padding: 22px 0;
    color: #2f3338;
    font-weight: 700;
}

.quality-message-error {
    color: #b00020;
}

@keyframes quality-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .quality-hero {
        height: 520px;
        min-height: 520px;
        margin-bottom: 52px;
    }

    .quality-hero-image {
        min-height: 0;
    }

    .quality-hero-overlay {
        padding-bottom: 62px;
        background:
            linear-gradient(90deg, rgba(0, 18, 60, 0.78) 0%, rgba(0, 18, 60, 0.54) 62%, rgba(0, 18, 60, 0.22) 100%),
            linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.46) 100%);
    }

    .quality-resource-layout,
    .quality-page-head,
    .quality-symbols-layout,
    .quality-two-columns {
        grid-template-columns: 1fr;
    }

    .quality-resource-media img {
        min-height: 260px;
    }

    .safety-list-item a {
        grid-template-columns: 1fr 36px;
        gap: 6px 14px;
    }

    .safety-list-head {
        display: none;
    }

    .safety-code,
    .safety-date,
    .safety-name {
        grid-column: 1;
    }

    .safety-icon {
        grid-column: 2;
        grid-row: 1 / span 3;
    }
}

@media (max-width: 560px) {
    .quality-info-page,
    .safety-sheets-page {
        padding-top: 104px;
    }

    .quality-hero h1,
    .quality-page h1 {
        font-size: 3rem;
    }

    .quality-content h2 {
        font-size: 2.25rem;
    }

    .quality-hero-image {
        min-height: 0;
    }

    .quality-hero {
        height: 480px;
        min-height: 480px;
        margin-bottom: 44px;
    }

    .quality-hero-overlay {
        padding-bottom: 44px;
    }
}

/* =====================================================
   Quality page aligned with Leone Italia quality layout
===================================================== */

.quality-hero {
    min-height: 75vh;
    height: auto;
    max-height: none;
    margin: 0;
    background: #071225;
}

.quality-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(6, 16, 42, 0.84) 0%, rgba(6, 16, 42, 0.62) 38%, rgba(6, 16, 42, 0.2) 68%, rgba(6, 16, 42, 0) 100%),
        linear-gradient(180deg, rgba(6, 16, 42, 0.12) 0%, rgba(6, 16, 42, 0.44) 100%);
}

.quality-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 96px;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.16));
}

.quality-hero__image {
    position: absolute;
    inset: 0;
    background: url("../img/1.webp") center right / cover no-repeat;
}

.quality-hero__content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 75vh;
    padding: calc(var(--header-height) + 4rem) 20px 4rem;
}

.quality-hero__content h1 {
    max-width: 12ch;
    margin: 0;
    color: #fff;
    font-size: var(--fs-h1);
    line-height: 0.98;
    letter-spacing: 0;
}

.quality-hero__content p {
    width: min(100%, 58ch);
    max-width: 58ch;
    margin: 1.25rem 0 0;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.65;
}

.quality-policy {
    margin: 0;
    padding: var(--site-section-gap, clamp(3rem, 5vw, 5rem)) 0;
}

.quality-policy__row {
    margin-bottom: 0;
}

.quality-policy .main-title {
    width: auto;
    max-width: none;
    margin: 0;
    color: #121212;
    font-size: 2rem;
    line-height: 1.1;
    font-weight: 700;
}

.quality-policy__copy p {
    margin: 1.1rem 0 0;
    color: #666;
}

.quality-policy__copy p + p {
    margin-top: 0.85rem;
}

.quality-policy__media img {
    width: 100%;
    height: 460px;
    object-fit: cover;
    display: block;
}

.quality-section {
    padding: var(--site-section-gap, clamp(3rem, 5vw, 5rem)) 0;
}

.quality-resources {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: start;
}

.quality-section h2 {
    margin: 0;
    color: #121212;
    font-size: clamp(2rem, 3vw, 2.7rem);
    line-height: 1.05;
}

.quality-resources > div:first-child p {
    max-width: 58ch;
    margin: 1rem 0 0;
    color: #4d5563;
    line-height: 1.7;
}

.quality-resource-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.quality-resource {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 160px;
    padding: 1.45rem;
    border: 1px solid #dfe6f2;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 31, 67, 0.06);
    color: inherit;
    text-decoration: none;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.quality-resource:hover,
.quality-resource:focus-visible {
    transform: translateY(-4px);
    border-color: var(--blue-1);
    box-shadow: 0 20px 44px rgba(10, 22, 48, 0.12);
}

.quality-resource h3 {
    margin: 0 0 0.85rem;
    color: var(--blue-1);
    font-size: 1.3rem;
    line-height: 1.08;
    font-weight: 700;
}

.quality-resource p {
    margin: 0;
    color: #4d5563;
    line-height: 1.7;
}

@media (max-width: 1024px) {
    .quality-hero__content,
    .quality-policy,
    .quality-section {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .quality-policy__media img {
        height: 320px;
    }

    .quality-resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .quality-hero {
        min-height: 75vh;
    }

    .quality-hero__image {
        background-position: center;
    }

    .quality-hero__content {
        min-height: 75vh;
        padding: 5.5rem 16px 4rem;
    }

    .quality-hero__content p {
        max-width: 31ch;
    }

    .quality-policy__media img {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .quality-resource-grid {
        grid-template-columns: 1fr;
    }
}
