.mat-page {
    --p: 275 100% 25%;
    --p-fg: 0 0% 100%;
    --p-light: 274 74% 41%;
    --muted: 270 15% 45%;
    --fg: 270 50% 10%;
    --bg: 270 20% 98%;
    --card: 0 0% 100%;
    --accent: 267 75% 92%;
    --line: 270 20% 90%;
    min-height: 100vh;
    background: hsl(var(--bg));
    color: hsl(var(--fg));
    font-family: "Cairo", "Noto Kufi Arabic", "Traditional Arabic", "Segoe UI", sans-serif;
    line-height: 1.5;
}

.mat-page *,
.mat-page *::before,
.mat-page *::after {
    box-sizing: border-box;
}

.mat-page h1,
.mat-page h2,
.mat-page p {
    margin: 0;
}

.mat-page button,
.mat-page input,
.mat-page select,
.mat-page textarea {
    font: inherit;
}

.mat-hero {
    position: relative;
    overflow: hidden;
    color: white;
    background: linear-gradient(to bottom right, hsl(270 75% 20%), hsl(270 70% 25%), hsl(280 60% 30%));
}

.mat-hero::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 20rem;
    height: 20rem;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.1);
    filter: blur(48px);
    transform: translate(-50%, -50%);
}

.mat-wrap {
    width: min(1400px, 100%);
    margin-inline: auto;
    padding: 1.5rem 1rem 4rem;
}

.mat-hero .mat-wrap {
    position: relative;
    z-index: 1;
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.mat-crumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.mat-crumbs a {
    color: rgb(255 255 255 / 0.6);
    text-decoration: none;
}

.mat-crumbs a:hover {
    color: white;
}

.mat-crumbs span {
    color: rgb(255 255 255 / 0.9);
}

.mat-crumbs .sep {
    color: rgb(255 255 255 / 0.4);
}

.mat-hero h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 900;
}

.mat-hero-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgb(255 255 255 / 0.2);
    border-radius: 1rem;
    background: rgb(255 255 255 / 0.1);
    font-size: 1.5rem;
}

.mat-hero p {
    max-width: 36rem;
    margin-top: 0.75rem;
    color: rgb(255 255 255 / 0.7);
    font-size: 0.875rem;
}

.mat-body-wrap {
    display: grid;
    gap: 1.25rem;
}

.mat-banner {
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    background: hsl(var(--accent));
    color: hsl(var(--fg));
    font-size: 0.875rem;
}

.mat-banner.warn {
    background: hsl(0 72% 51% / 0.1);
    color: hsl(0 72% 40%);
}

.mat-filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mat-search {
    position: relative;
    flex: 1;
}

.mat-search .glyph {
    position: absolute;
    top: 50%;
    inset-inline-start: 0.75rem;
    color: hsl(var(--muted));
    font-size: 1rem;
    transform: translateY(-50%);
    pointer-events: none;
}

.mat-search input,
.mat-filters select,
.mat-field input,
.mat-field select,
.mat-field textarea {
    width: 100%;
    border: 1px solid hsl(var(--line));
    border-radius: 0.75rem;
    background: hsl(var(--card));
    color: hsl(var(--fg));
    padding: 0.625rem 0.9rem;
}

.mat-search input {
    padding-inline-start: 2.4rem;
}

.mat-search input:focus,
.mat-filters select:focus,
.mat-field input:focus,
.mat-field select:focus,
.mat-field textarea:focus {
    outline: 2px solid hsl(var(--p));
    outline-offset: 1px;
}

.mat-go {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.mat-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.mat-count p,
.mat-count a {
    color: hsl(var(--muted));
    font-size: 0.875rem;
}

.mat-count a {
    text-decoration: none;
}

.mat-count a:hover {
    color: hsl(var(--p));
}

.mat-empty {
    padding: 4rem 1rem;
    border: 1px solid hsl(var(--line));
    border-radius: 1rem;
    background: hsl(var(--card));
    text-align: center;
}

.mat-empty .glyph {
    margin: 0 auto 0.75rem;
    color: hsl(var(--muted) / 0.45);
    font-size: 3rem;
}

.mat-empty strong {
    display: block;
}

.mat-empty p {
    margin-top: 0.25rem;
    color: hsl(var(--muted));
    font-size: 0.875rem;
}

.mat-list {
    display: grid;
    gap: 1rem;
}

.mat-card {
    overflow: hidden;
    border: 1px solid hsl(var(--line));
    border-radius: 0.75rem;
    background: hsl(var(--card));
}

.mat-card summary {
    display: block;
    padding: 1rem;
    list-style: none;
    cursor: pointer;
}

.mat-card summary::-webkit-details-marker {
    display: none;
}

.mat-card summary:hover {
    background: hsl(var(--accent) / 0.3);
}

.mat-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.mat-photo,
.mat-photo-empty {
    width: 4rem;
    height: 4rem;
    flex: none;
    border-radius: 0.75rem;
}

.mat-photo {
    object-fit: cover;
    border: 1px solid hsl(var(--line));
}

.mat-photo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--accent));
    color: hsl(var(--muted) / 0.45);
    font-size: 1.5rem;
}

.mat-copy {
    min-width: 0;
    flex: 1;
}

.mat-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.mat-title h2 {
    font-size: 0.875rem;
    font-weight: 700;
}

.mat-chevron {
    flex: none;
    color: hsl(var(--muted));
    font-size: 1rem;
    transition: transform 0.15s ease;
}

.mat-card[open] .mat-chevron {
    transform: rotate(180deg);
}

.mat-en {
    color: hsl(var(--muted));
    font-size: 10px;
}

.mat-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
}

.mat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    padding: 0.05rem 0.45rem;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.mat-badge.soft {
    background: hsl(var(--accent));
    color: hsl(var(--fg));
}

.mat-badge.line {
    border: 1px solid hsl(var(--line));
    color: hsl(var(--fg));
}

.mat-badge.solid {
    background: hsl(var(--p));
    color: white;
}

.mat-badge.danger {
    background: hsl(0 72% 51%);
    color: white;
}

.mat-badge .glyph {
    font-size: 0.65rem;
}

.mat-price {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.mat-price strong {
    color: hsl(var(--p));
    font-size: 1rem;
}

.mat-price span {
    color: hsl(var(--muted));
    font-size: 10px;
}

.mat-panel {
    border-top: 1px solid hsl(var(--line));
    padding: 1rem;
}

.mat-kicker {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    color: hsl(var(--muted));
    font-size: 0.75rem;
    font-weight: 600;
}

.mat-kicker .glyph {
    font-size: 0.875rem;
}

.mat-offers {
    display: grid;
    gap: 0.5rem;
}

.mat-offer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid hsl(var(--line));
    border-radius: 0.75rem;
    background: hsl(var(--accent) / 0.2);
}

.mat-offer.is-low {
    border-color: hsl(var(--p) / 0.3);
    background: hsl(var(--p) / 0.05);
}

.mat-logo,
.mat-logo-empty {
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    border: 1px solid hsl(var(--line));
    border-radius: 0.5rem;
    background: hsl(var(--card));
}

.mat-logo {
    object-fit: cover;
}

.mat-logo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--muted));
    font-size: 1rem;
}

.mat-offer-copy {
    min-width: 0;
    flex: 1 1 12rem;
}

.mat-offer-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.mat-offer-name .glyph {
    color: hsl(var(--p));
    font-size: 0.875rem;
}

.mat-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.125rem;
    color: hsl(var(--muted));
    font-size: 10px;
}

.mat-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
}

.mat-star {
    color: #f59e0b;
}

.mat-offer-price {
    flex: none;
    text-align: end;
}

.mat-offer-price strong {
    font-size: 1rem;
}

.mat-offer.is-low .mat-offer-price strong {
    color: hsl(var(--p));
}

.mat-offer-price span {
    margin-inline-start: 0.25rem;
    color: hsl(var(--muted));
    font-size: 10px;
}

.mat-offer-price em {
    color: hsl(var(--muted));
    font-size: 0.75rem;
    font-style: normal;
}

.mat-store {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: none;
    border-radius: 0.375rem;
    padding: 0.35rem 0.5rem;
    color: hsl(var(--fg));
    font-size: 0.75rem;
    text-decoration: none;
}

.mat-store:hover {
    background: hsl(var(--accent));
}

.mat-extra {
    flex: 1 1 100%;
    display: grid;
    gap: 0.35rem;
    color: hsl(var(--muted));
    font-size: 0.75rem;
}

.mat-extra a {
    color: hsl(var(--p));
}

.mat-install {
    width: 4rem;
    height: 4rem;
    object-fit: cover;
    border: 1px solid hsl(var(--line));
    border-radius: 0.5rem;
}

.mat-specs {
    margin-top: 0.75rem;
    border-radius: 0.75rem;
    background: hsl(var(--accent) / 0.3);
    padding: 0.75rem;
}

.mat-specs p {
    margin-bottom: 0.5rem;
    color: hsl(var(--muted));
    font-size: 10px;
    font-weight: 600;
}

.mat-spec-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.mat-spec-grid div {
    border-radius: 0.5rem;
    background: hsl(var(--card));
    padding: 0.5rem;
}

.mat-spec-grid span {
    display: block;
    color: hsl(var(--muted));
    font-size: 10px;
}

.mat-spec-grid strong {
    font-size: 0.75rem;
    font-weight: 500;
}

.mat-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.75rem;
    color: hsl(var(--muted));
}

.mat-tags .glyph {
    font-size: 0.75rem;
}

.mat-tags span {
    border-radius: 999px;
    background: hsl(var(--accent));
    padding: 0.05rem 0.5rem;
    font-size: 10px;
}

.mat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 1rem;
    border: 0;
    border-radius: 0.5rem;
    background: hsl(var(--p));
    color: white;
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.mat-send:hover {
    background: hsl(275 100% 20%);
}

.mat-check {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.mat-modal {
    display: none;
}

.mat-check:checked + .mat-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.mat-shade {
    position: absolute;
    inset: 0;
    background: hsl(var(--fg) / 0.4);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.mat-dialog {
    position: relative;
    z-index: 1;
    width: min(28rem, 100%);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid hsl(var(--line));
    border-radius: 1rem;
    background: hsl(var(--card));
    padding: 1.5rem;
}

.mat-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mat-dialog-head h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
}

.mat-dialog-head h3 .glyph {
    color: hsl(var(--p));
    font-size: 1.25rem;
}

.mat-x {
    border: 0;
    background: transparent;
    color: hsl(var(--muted));
    font-size: 1.125rem;
    cursor: pointer;
}

.mat-quote-card {
    margin-bottom: 1rem;
    border-radius: 0.75rem;
    background: hsl(var(--accent) / 0.5);
    padding: 0.75rem;
}

.mat-quote-card strong {
    font-size: 0.875rem;
}

.mat-quote-card p,
.mat-quote-meta {
    margin-top: 0.25rem;
    color: hsl(var(--muted));
    font-size: 11px;
}

.mat-quote-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mat-quote-meta .price {
    color: hsl(var(--p));
    font-weight: 600;
}

.mat-fields {
    display: grid;
    gap: 1rem;
}

.mat-field {
    display: grid;
    gap: 0.375rem;
}

.mat-field > span {
    font-size: 0.875rem;
    font-weight: 500;
}

.mat-field textarea {
    min-height: 4.5rem;
    resize: none;
}

.mat-missing {
    border-radius: 0.75rem;
    background: hsl(0 72% 51% / 0.1);
    color: hsl(0 72% 40%);
    padding: 0.75rem;
    font-size: 0.75rem;
}

.mat-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.mat-actions .mat-send {
    flex: 1;
    margin-top: 0;
}

.mat-actions .mat-send:disabled {
    opacity: 0.55;
    cursor: default;
}

.mat-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid hsl(var(--line));
    border-radius: 0.5rem;
    background: transparent;
    color: hsl(var(--fg));
    padding: 0.55rem 1rem;
    cursor: pointer;
}

@media (min-width: 640px) {
    .mat-filters {
        flex-direction: row;
    }

    .mat-filters select {
        width: 11rem;
    }

    .mat-hero h1 {
        font-size: 1.875rem;
    }

    .mat-spec-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
