/**
 * MPT component system — Phase 2.
 */

/* ---------- Buttons ---------- */
.mpt-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: var(--mpt-touch-min, 44px);
    padding: 0.7rem 1.35rem;
    border: 1px solid transparent;
    border-radius: var(--mpt-radius-button);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color var(--mpt-transition), color var(--mpt-transition), border-color var(--mpt-transition), box-shadow var(--mpt-transition);
}

body.mpt-theme a.mpt-button,
body.mpt-theme a.mpt-button:link,
body.mpt-theme a.mpt-button:visited,
body.mpt-theme a.mpt-button:hover,
body.mpt-theme a.mpt-button:focus,
body.mpt-theme a.mpt-button:focus-visible,
body.mpt-theme a.mpt-button:active,
body.mpt-theme .mpt-button:hover,
body.mpt-theme .mpt-button:focus,
body.mpt-theme .mpt-button:focus-visible {
    text-decoration: none;
}

.mpt-button__icon {
    display: inline-flex;
    transition: transform var(--mpt-transition);
}

.mpt-button:hover .mpt-button__icon,
.mpt-button:focus-visible .mpt-button__icon {
    transform: translateX(3px);
}

body.mpt-theme .mpt-button--primary {
    background: var(--mpt-gradient-primary);
    color: var(--mpt-color-white);
    box-shadow: var(--mpt-shadow-soft);
    border-color: transparent;
}

body.mpt-theme .mpt-button--primary:hover,
body.mpt-theme .mpt-button--primary:focus,
body.mpt-theme .mpt-button--primary:focus-visible,
body.mpt-theme .mpt-button--primary:active {
    color: var(--mpt-color-white);
    background: var(--mpt-gradient-primary);
    border-color: transparent;
    filter: brightness(0.95);
}

body.mpt-theme .mpt-button--secondary {
    background: var(--mpt-color-deep);
    color: var(--mpt-color-white);
    border-color: transparent;
}

body.mpt-theme .mpt-button--secondary:hover,
body.mpt-theme .mpt-button--secondary:focus,
body.mpt-theme .mpt-button--secondary:focus-visible,
body.mpt-theme .mpt-button--secondary:active {
    color: var(--mpt-color-white);
    background: #004a68;
    border-color: transparent;
}

body.mpt-theme .mpt-button--outline {
    background: transparent;
    color: var(--mpt-color-deep);
    border-color: var(--mpt-color-deep);
}

body.mpt-theme .mpt-button--outline:hover,
body.mpt-theme .mpt-button--outline:focus,
body.mpt-theme .mpt-button--outline:focus-visible,
body.mpt-theme .mpt-button--outline:active {
    background: var(--mpt-color-surface-soft);
    color: var(--mpt-color-deep);
    border-color: var(--mpt-color-deep);
}

body.mpt-theme .mpt-button--ghost-light {
    background: rgba(255, 255, 255, 0.12);
    color: var(--mpt-color-white);
    border-color: rgba(255, 255, 255, 0.72);
}

body.mpt-theme .mpt-button--ghost-light:hover,
body.mpt-theme .mpt-button--ghost-light:focus,
body.mpt-theme .mpt-button--ghost-light:focus-visible,
body.mpt-theme .mpt-button--ghost-light:active {
    background: rgba(255, 255, 255, 0.22);
    color: var(--mpt-color-white);
    border-color: var(--mpt-color-white);
}

body.mpt-theme .mpt-button--light {
    background: var(--mpt-color-white);
    color: var(--mpt-color-deep);
    border-color: transparent;
}

body.mpt-theme .mpt-button--light:hover,
body.mpt-theme .mpt-button--light:focus,
body.mpt-theme .mpt-button--light:focus-visible,
body.mpt-theme .mpt-button--light:active {
    color: var(--mpt-color-deep);
    background: var(--mpt-color-surface-blue);
    border-color: transparent;
}

body.mpt-theme .mpt-button--light-outline {
    background: transparent;
    color: var(--mpt-color-white);
    border-color: rgba(255, 255, 255, 0.78);
}

body.mpt-theme .mpt-button--light-outline:hover,
body.mpt-theme .mpt-button--light-outline:focus,
body.mpt-theme .mpt-button--light-outline:focus-visible,
body.mpt-theme .mpt-button--light-outline:active {
    background: rgba(255, 255, 255, 0.12);
    color: var(--mpt-color-white);
    border-color: rgba(255, 255, 255, 0.9);
}

body.mpt-theme .mpt-button--text {
    background: transparent;
    color: var(--mpt-color-deep);
    border-color: transparent;
    min-height: 40px;
    padding-inline: 0.25rem;
}

body.mpt-theme .mpt-button--text:hover,
body.mpt-theme .mpt-button--text:focus,
body.mpt-theme .mpt-button--text:focus-visible,
body.mpt-theme .mpt-button--text:active {
    background: transparent;
    color: var(--mpt-color-primary-dark);
}

.mpt-button--icon {
    width: 44px;
    padding-inline: 0;
}

/* ---------- Cards ---------- */
.mpt-card {
    display: flex;
    flex-direction: column;
    gap: var(--mpt-space-4);
    padding: var(--mpt-space-5);
    border: 1px solid var(--mpt-color-border);
    border-radius: var(--mpt-radius-card);
    background: var(--mpt-color-surface);
    box-shadow: var(--mpt-shadow-soft);
    transition: box-shadow var(--mpt-transition), border-color var(--mpt-transition);
}

.mpt-card:hover {
    box-shadow: var(--mpt-shadow-card);
    border-color: #c5dbe3;
}

.mpt-card__media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: var(--mpt-radius-sm);
    background: var(--mpt-color-surface-blue);
}

.mpt-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mpt-card__title {
    margin: 0;
    font-size: 1.2rem;
    color: var(--mpt-color-heading);
}

.mpt-card__text {
    margin: 0;
    color: var(--mpt-color-body);
}

.mpt-card__cta {
    margin-top: auto;
}

.mpt-card--category,
.mpt-card--solution,
.mpt-card--service,
.mpt-card--feature,
.mpt-card--contact,
.mpt-card--article {
    min-height: 100%;
}

.mpt-card--category {
    padding: 0;
    overflow: hidden;
    gap: 0;
}

.mpt-card--category__hit {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.mpt-card--category__hit:hover,
.mpt-card--category__hit:focus-visible {
    color: inherit;
    text-decoration: none;
}

.mpt-card--category .mpt-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 0;
}

.mpt-card--category__shade {
    display: none;
}

.mpt-card--category__body {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
    padding: var(--mpt-space-4) var(--mpt-space-5) var(--mpt-space-5);
}

.mpt-card--category__index {
    display: none;
}

.mpt-card--category .mpt-card__title {
    margin: 0;
}

.mpt-card--category__action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    color: var(--mpt-color-primary-dark);
    font-size: 0.88rem;
    font-weight: 800;
}

.mpt-card--category__count {
    margin: 0;
    color: var(--mpt-color-muted);
    font-size: 0.85rem;
}

/* ---------- Labels ---------- */
.mpt-eyebrow,
.mpt-badge,
.mpt-status,
.mpt-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
}

.mpt-eyebrow {
    color: var(--mpt-color-primary-dark);
    margin-bottom: var(--mpt-space-3);
}

.mpt-eyebrow--pill {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 var(--mpt-space-3);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--mpt-color-primary-dark);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.3;
}

.mpt-eyebrow--pill.mpt-eyebrow--on-dark,
.mpt-pattern--dark .mpt-eyebrow--pill,
.mpt-page-hero--dark .mpt-eyebrow--pill {
    border: 0;
    background: none;
    color: rgba(255, 255, 255, 0.88);
}

.mpt-badge,
.mpt-chip {
    padding: 0.35rem 0.7rem;
    border-radius: var(--mpt-radius-pill);
    background: var(--mpt-color-surface-blue);
    color: var(--mpt-color-deep);
}

.mpt-status {
    padding: 0.3rem 0.65rem;
    border-radius: var(--mpt-radius-sm);
    background: #e8f6f0;
    color: var(--mpt-color-success);
}

/* ---------- Sections ---------- */
.mpt-section {
    padding-block: var(--mpt-section-spacing);
}

.mpt-section--soft { background: var(--mpt-color-surface-soft); }
.mpt-section--blue { background: var(--mpt-color-surface-blue); }
.mpt-section--dark {
    background: var(--mpt-color-deep);
    color: var(--mpt-color-white);
}
.mpt-section--dark h1,
.mpt-section--dark h2,
.mpt-section--dark h3,
.mpt-section--dark h4 { color: var(--mpt-color-white); }
.mpt-section--gradient {
    background: var(--mpt-gradient-primary);
    color: var(--mpt-color-white);
}
.mpt-section--gradient h1,
.mpt-section--gradient h2,
.mpt-section--gradient h3 { color: var(--mpt-color-white); }

.mpt-section__heading { margin-bottom: var(--mpt-space-3); }
.mpt-section__intro {
    max-width: 40rem;
    margin-bottom: var(--mpt-space-6);
    color: inherit;
    opacity: 0.95;
}

/* ---------- Content blocks ---------- */
.mpt-answer-block {
    padding: var(--mpt-space-5);
    border-left: 4px solid var(--mpt-color-primary);
    background: var(--mpt-color-surface-soft);
    border-radius: 0 var(--mpt-radius-card) var(--mpt-radius-card) 0;
}

.mpt-answer-block__question {
    margin: 0 0 var(--mpt-space-3);
    font-size: 1.25rem;
}

.mpt-answer-block__answer {
    margin: 0;
    color: var(--mpt-color-body);
}

.mpt-trust-strip {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mpt-space-5);
    align-items: center;
}

.mpt-stat {
    display: flex;
    flex-direction: column;
    gap: var(--mpt-space-2);
}

.mpt-stat__value {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    color: var(--mpt-color-deep);
    line-height: 1;
}

.mpt-stat__label {
    color: var(--mpt-color-muted);
    font-size: var(--mpt-font-size-sm);
}

.mpt-icon-list,
.mpt-check-list,
.mpt-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: var(--mpt-space-3);
}

.mpt-check-list li {
    position: relative;
    padding-left: 1.5rem;
}

.mpt-check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--mpt-color-primary);
}

.mpt-breadcrumbs {
    font-size: var(--mpt-font-size-sm);
    color: var(--mpt-color-muted);
    margin-bottom: var(--mpt-space-4);
}

.mpt-breadcrumbs a { color: inherit; }
.mpt-breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
}

.mpt-breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 0.35rem;
    opacity: 0.6;
}

/* ---------- Page hero ---------- */
.mpt-page-hero {
    position: relative;
    padding-block: clamp(2.5rem, 5vw, 4rem);
    background: var(--mpt-color-surface-blue);
    overflow: hidden;
}

.mpt-page-hero--dark {
    background: var(--mpt-color-deep);
    color: var(--mpt-color-white);
}

.mpt-page-hero--dark .mpt-page-hero__title,
.mpt-page-hero--dark .mpt-eyebrow { color: var(--mpt-color-white); }

.mpt-page-hero--dark .mpt-page-hero__intro,
.mpt-page-hero--dark .mpt-breadcrumbs { color: rgba(255, 255, 255, 0.85); }

.mpt-page-hero__title { margin-bottom: var(--mpt-space-4); }
.mpt-page-hero__intro {
    max-width: 40rem;
    margin: 0;
    font-size: var(--mpt-font-size-md);
}

.mpt-page-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mpt-space-3);
    margin-top: var(--mpt-space-5);
}

/* ---------- CTA band ---------- */
.mpt-cta-band {
    position: relative;
    padding-block: clamp(2.75rem, 5vw, 4.5rem);
    background: var(--mpt-gradient-primary);
    color: var(--mpt-color-white);
    overflow: hidden;
}

.mpt-cta-band__grid {
    display: grid;
    gap: var(--mpt-space-6);
    align-items: center;
}

@media (min-width: 900px) {
    .mpt-cta-band__grid {
        grid-template-columns: minmax(0, 1.4fr) auto;
        justify-content: space-between;
        column-gap: var(--mpt-space-8, 2.5rem);
    }
}

.mpt-cta-band__copy {
    max-width: 48rem;
    min-width: 0;
}

.mpt-cta-band__eyebrow {
    color: rgba(255, 255, 255, 0.92);
}

.mpt-cta-band__title {
    color: var(--mpt-color-white);
    margin-bottom: var(--mpt-space-3);
}

.mpt-cta-band__text {
    margin: 0;
    max-width: 46rem;
    color: rgba(255, 255, 255, 0.92);
}

.mpt-cta-band__contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1.15rem 0 0;
    padding: 0;
    list-style: none;
}

.mpt-cta-band__contacts > li {
    margin: 0;
    padding: 0;
}

body.mpt-theme .mpt-cta-band a.mpt-cta-band__contact,
body.mpt-theme .mpt-cta-band a.mpt-cta-band__contact:link,
body.mpt-theme .mpt-cta-band a.mpt-cta-band__contact:visited,
.mpt-cta-band a.mpt-cta-band__contact {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.75rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: rgba(1, 22, 32, 0.28);
    color: #fff;
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

body.mpt-theme .mpt-cta-band a.mpt-cta-band__contact:hover,
body.mpt-theme .mpt-cta-band a.mpt-cta-band__contact:focus,
body.mpt-theme .mpt-cta-band a.mpt-cta-band__contact:focus-visible,
body.mpt-theme .mpt-cta-band a.mpt-cta-band__contact:active,
.mpt-cta-band a.mpt-cta-band__contact:hover,
.mpt-cta-band a.mpt-cta-band__contact:focus-visible {
    background: rgba(1, 22, 32, 0.42);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    text-decoration: none;
    outline: none;
    transform: translateY(-1px);
}

.mpt-cta-band a.mpt-cta-band__contact:focus-visible {
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.95),
        0 0 0 4px rgba(0, 185, 181, 0.9);
}

.mpt-cta-band__contact-icon {
    flex: 0 0 auto;
    width: 1.05rem;
    height: 1.05rem;
    color: #b9e5fb;
}

.mpt-cta-band__contact-label {
    flex: 0 0 auto;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mpt-cta-band__contact-value {
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

/* Legacy single-phone selector kept as alias for older markup. */
.mpt-cta-band__phone {
    margin: var(--mpt-space-4) 0 0;
}

.mpt-cta-band__phone a {
    color: var(--mpt-color-white);
    font-weight: 700;
    text-decoration: none;
}

.mpt-cta-band__phone a:hover,
.mpt-cta-band__phone a:focus-visible {
    text-decoration: underline;
}

.mpt-cta-band__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mpt-space-3);
    align-items: center;
    justify-content: flex-start;
    margin-top: 0;
}

@media (min-width: 900px) {
    .mpt-cta-band__actions {
        justify-content: flex-end;
        justify-self: end;
    }
}

@media (max-width: 899px) {
    .mpt-cta-band__actions {
        width: 100%;
    }

    .mpt-cta-band__actions .mpt-button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .mpt-cta-band__contacts {
        flex-direction: column;
        align-items: stretch;
    }

    .mpt-cta-band a.mpt-cta-band__contact {
        width: 100%;
    }
}

.mpt-cta-band__btn-secondary {
    border-color: var(--mpt-color-white);
    color: var(--mpt-color-white);
}

.mpt-cta-band__btn-secondary:hover,
.mpt-cta-band__btn-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--mpt-color-white);
    color: var(--mpt-color-white);
}

/* ---------- Forms ---------- */
.mpt-form-field {
    display: grid;
    gap: 0.4rem;
    margin-bottom: var(--mpt-space-4);
}

.mpt-form-field label {
    font-weight: 700;
    color: var(--mpt-color-heading);
}

.mpt-form-field input,
.mpt-form-field select,
.mpt-form-field textarea {
    min-height: 48px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--mpt-color-border);
    border-radius: var(--mpt-radius-sm);
    font: inherit;
    color: var(--mpt-color-ink);
    background: var(--mpt-color-white);
}

.mpt-form-field textarea { min-height: 120px; }

.mpt-form-field__help { font-size: var(--mpt-font-size-sm); color: var(--mpt-color-muted); }
.mpt-form-field__error { font-size: var(--mpt-font-size-sm); color: var(--mpt-color-error); }

/* ---------- Tables ---------- */
.mpt-table-wrap { overflow-x: auto; }

.mpt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.mpt-table th,
.mpt-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--mpt-color-border);
    text-align: left;
    vertical-align: top;
}

.mpt-table th {
    background: var(--mpt-color-surface-soft);
    color: var(--mpt-color-heading);
    font-weight: 700;
}

/* ---------- Patterns ---------- */
.mpt-pattern {
    position: relative;
}

.mpt-pattern::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.08;
    background-image: url("../images/brand/mpt-pulse-pattern.svg");
    background-repeat: no-repeat;
    background-size: 420px auto;
    z-index: 0;
}

.mpt-pattern > * { position: relative; z-index: 1; }

.mpt-pattern--subtle::before { opacity: 0.05; }
.mpt-pattern--corner::before {
    inset: auto -40px -40px auto;
    width: 280px;
    height: 280px;
    opacity: 0.12;
}
.mpt-pattern--full::before {
    background-size: cover;
    opacity: 0.06;
}
.mpt-pattern--dark::before { opacity: 0.14; filter: brightness(2); }

/* Brand pulse ribbon (section atmospheres) */
.mpt-pattern--brand-pulse::before {
    background-image: url("../images/brand/mpt-brand-pulse-wave.svg");
    background-size: min(720px, 90%) auto;
    background-position: right 8% center;
    opacity: 0.2;
}

/* ---------- FAQ visual ---------- */
.mpt-faq details {
    border: 1px solid var(--mpt-color-border);
    border-radius: var(--mpt-radius-card);
    padding: var(--mpt-space-4) var(--mpt-space-5);
    background: var(--mpt-color-surface);
}

.mpt-faq details + details { margin-top: var(--mpt-space-3); }

.mpt-faq summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--mpt-color-heading);
}

.mpt-faq details[open] summary { margin-bottom: var(--mpt-space-3); }

/* ---------- Design system notice ---------- */
.mpt-dev-notice {
    padding: var(--mpt-space-3) var(--mpt-space-4);
    background: #fff4e5;
    color: var(--mpt-color-warning);
    border-bottom: 1px solid #f0d7a8;
    font-size: var(--mpt-font-size-sm);
    font-weight: 700;
    text-align: center;
}

/* ---------- Colour swatches (design system) ---------- */
.mpt-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--mpt-space-4);
}

.mpt-swatch {
    border: 1px solid var(--mpt-color-border);
    border-radius: var(--mpt-radius-card);
    overflow: hidden;
    background: var(--mpt-color-white);
}

.mpt-swatch__chip { height: 72px; }
.mpt-swatch__meta { padding: var(--mpt-space-3); font-size: var(--mpt-font-size-sm); }

/* Catalogue */
.mpt-category-grid,
.mpt-product-grid,
ul.products {
    display: grid;
    gap: var(--mpt-space-5);
    grid-template-columns: repeat(var(--mpt-cat-cols, 4), minmax(0, 1fr));
    list-style: none;
    margin: 0;
    padding: 0;
}
ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; }
.mpt-card--product .mpt-card__cta { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mpt-catalogue-filters {
    margin: 0 0 var(--mpt-space-6);
    padding: var(--mpt-space-5);
    border: 1px solid var(--mpt-color-border);
    border-radius: var(--mpt-radius-card);
    background: var(--mpt-color-surface-soft);
}
.mpt-catalogue-filters__grid {
    display: grid;
    gap: var(--mpt-space-4);
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.mpt-catalogue-filters__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mpt-space-3);
    margin-top: var(--mpt-space-4);
}
.mpt-product-search { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.mpt-product-search input { min-height: 48px; flex: 1; min-width: 180px; }
.mpt-quote-context__product { display: flex; gap: 1rem; align-items: center; min-width: 0; max-width: 100%; }
.mpt-quote-context__product > div { min-width: 0; flex: 1 1 auto; }
.mpt-quote-context__product img { flex: 0 0 auto; max-width: 64px; height: auto; }
.mpt-product-quote-panel { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0 1.5rem; }
.mpt-catalogue-mode .price,
.mpt-hide-prices .price { display: none !important; }
@media (max-width: 1024px) {
    ul.products, .mpt-category-grid, .mpt-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    ul.products, .mpt-category-grid, .mpt-product-grid { grid-template-columns: 1fr; }
}
