/* ==========================================================================
   MAX3D theme
   Brand palette: Absolute Black #000000, Crisp White #FFFFFF,
   Steel Gray #A3A3A3, Digital Lavender #E2D4E5.
   Every colour used below comes from the tokens in :root / [data-theme].
   ========================================================================== */

:root {
    --black: #000000;
    --white: #ffffff;
    --steel: #a3a3a3;
    --lavender: #e2d4e5;
    --lavender-deep: #cdb2da; /* deeper tint of the lavender, for accents on white */

    --font-head: "Poppins", "Segoe UI", system-ui, sans-serif;
    --font-body: "Red Hat Text", "Segoe UI", system-ui, sans-serif;
    --container: 1180px;
    --gutter: 24px;
    --radius: 14px;
    --radius-lg: 22px;
}

:root,
[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-soft: #f6f5f8;
    --surface: #ffffff;
    --text: #0a0a0b;
    --text-muted: #55555c;
    --border: #e3e1e8;
    --border-strong: #0a0a0b;
    --accent: #dcc8e4;
    --accent-hover: #cdb2da;
    --accent-text: #cdb2da;
    --on-accent: #0a0a0b;
    --shadow: 0 6px 18px rgba(20, 10, 30, .08);
    --hero-fade: #f6f5f8;
    --panel: linear-gradient(135deg, #f2f0f5 0%, #dedbe3 100%);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #000000;
    --bg-soft: #0b0b0d;
    --surface: #0b0b0d;
    --text: #ffffff;
    --text-muted: #a3a3a3;
    --border: #2b2b30;
    --border-strong: #ffffff;
    --accent: #e2d4e5;
    --accent-hover: #f0e6f2;
    --accent-text: #dcc8e8;
    --on-accent: #000000;
    --shadow: 0 6px 18px rgba(0, 0, 0, .6);
    --hero-fade: #050506;
    --panel: linear-gradient(135deg, #1b1a1e 0%, #2a2630 100%);
}

/* ---------- Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

button, input {
    font: inherit;
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 3px;
}

.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.icon {
    width: 22px;
    height: 22px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-lg {
    width: 30px;
    height: 30px;
}

/* Show only the asset that belongs to the active theme. */
[data-theme="light"] .theme-dark,
[data-theme="dark"] .theme-light {
    display: none !important;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .2s, transform .2s, color .2s;
}

    .btn .icon {
        width: 20px;
        height: 20px;
        transition: transform .2s;
    }

    .btn:hover .icon {
        transform: translateX(3px);
    }

.btn-primary {
    background: var(--accent);
    color: var(--on-accent);
}

    .btn-primary:hover {
        background: var(--accent-hover);
    }

.btn-outline {
    border-color: var(--border-strong);
    padding: 6px 16px;
    font-size: 12.5px;
}

    .btn-outline:hover {
        background: var(--text);
        color: var(--bg);
    }

.btn-lg {
    padding: 13px 28px;
    font-size: 16px;
    gap: 16px;
}

    .btn-lg .icon {
        width: 24px;
        height: 24px;
    }

.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    transition: background-color .2s;
}

    .icon-btn:hover {
        background: var(--bg-soft);
    }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 92px;
}

.logo img {
    height: 84px;
    width: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-inline: auto;
}

    .main-nav a {
        padding: 7px 19px;
        border-radius: 999px;
        font-family: var(--font-head);
        font-size: 15px;
        transition: background-color .2s;
    }

        .main-nav a:hover {
            background: var(--bg-soft);
        }

        .main-nav a.is-active {
            background: var(--accent);
            color: var(--on-accent);
            font-weight: 600;
        }

.header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 240px;
    height: 44px;
    margin-inline-end: 12px;
    padding-inline: 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-soft);
}

    .search input {
        width: 100%;
        border: 0;
        outline: 0;
        background: none;
        font-size: 13px;
    }

        .search input::placeholder {
            color: var(--text-muted);
        }

    .search:focus-within {
        border-color: var(--accent-text);
    }

.cart-count {
    position: absolute;
    top: -2px;
    inset-inline-end: -4px;
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

.nav-toggle {
    display: none;
    margin-inline-start: auto;
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--hero-fade);
    border-bottom: 1px solid var(--border);
}

.hero-media {
    position: absolute;
    inset: 0 0 0 auto;
    width: 56%;
    -webkit-mask-image: linear-gradient(100deg, transparent 4%, #000 26%);
    mask-image: linear-gradient(100deg, transparent 4%, #000 26%);
}

    .hero-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

.hero-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-block: 56px 44px;
    min-height: 402px;
}

.hero h1 {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(38px, 5.2vw, 61px);
    line-height: 1.02;
    letter-spacing: -.02em;
}

[data-theme="dark"] .hero h1 {
    background: linear-gradient(180deg, #ffffff 55%, #cfcfcf 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

    .hero h1 .accent,
    [data-theme="dark"] .hero h1 .accent {
        color: var(--accent-text);
        -webkit-text-fill-color: var(--accent-text);
    }

.hero-lead {
    max-width: 25em;
    margin-top: 20px;
    font-size: clamp(16px, 1.7vw, 20px);
    line-height: 1.35;
}

.hero .btn {
    margin-top: 24px;
}

.hero-points {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 10px;
    margin-top: 26px;
    font-size: 13px;
}

    .hero-points li {
        display: flex;
        align-items: center;
        gap: 12px;
    }

        .hero-points li + li {
            margin-inline-start: 20px;
            padding-inline-start: 20px;
            border-inline-start: 1.5px solid var(--text);
        }

    .hero-points .icon {
        width: 28px;
        height: 28px;
        stroke-width: 1.6;
    }

.hero-dots {
    position: absolute;
    inset-inline-end: 36px;
    bottom: 18px;
    display: flex;
    gap: 11px;
}

    .hero-dots span {
        width: 14px;
        height: 14px;
        border-radius: 50%;
        background: var(--steel);
        opacity: .65;
    }

    .hero-dots .is-active {
        background: var(--accent);
        opacity: 1;
    }

/* ---------- Sections ---------- */
.section {
    padding-block: 22px 34px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(22px, 2.4vw, 28px);
    letter-spacing: -.01em;
}

    .section-title::before {
        content: "";
        width: 42px;
        height: 3px;
        border-radius: 2px;
        background: var(--accent-text);
    }

/* ---------- Product cards ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.product-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: transform .25s, border-color .25s;
}

    .product-card:hover {
        transform: translateY(-4px);
        border-color: var(--accent-text);
    }

.product-media {
    display: block;
    aspect-ratio: 13 / 10;
    overflow: hidden;
    background: var(--bg-soft);
}

    .product-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .4s;
    }

.product-card:hover .product-media img {
    transform: scale(1.04);
}

.product-info {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    padding-inline-start: 15px;
}

.product-name {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 13px;
}

.product-price {
    margin-top: 6px;
    font-family: var(--font-head);
    font-size: 16px;
}

.cart-add {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    cursor: pointer;
    transition: transform .2s, background-color .2s;
}

    .cart-add .icon {
        width: 16px;
        height: 16px;
    }

    .cart-add:hover {
        background: var(--accent-hover);
        transform: scale(1.1);
    }

    .cart-add:active {
        transform: scale(.94);
    }

/* ---------- How it works ---------- */
.how {
    position: relative;
    overflow: hidden;
}

.how-inner {
    position: relative;
    z-index: 1;
}

.how-main {
    width: 72%;
    padding-block: 12px 30px;
}

.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 6px;
}

    .steps li {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-inline: 18px;
        text-align: center;
        font-size: 14px;
        line-height: 1.25;
    }

        .steps li + li::before {
            content: "";
            position: absolute;
            inset-inline-start: -7px;
            top: 44px;
            width: 12px;
            height: 12px;
            border-top: 1.8px solid var(--text);
            border-inline-end: 1.8px solid var(--text);
            transform: rotate(45deg);
        }

.step-num {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 600;
}

.step-icon {
    width: 62px;
    height: 62px;
    margin-block: 4px 6px;
    stroke-width: 1.3;
}

[data-theme="dark"] .step-icon {
    color: var(--accent-text);
}

.steps p {
    max-width: 12em;
}

.how-panel {
    position: absolute;
    inset: 0 0 0 auto;
    width: 30%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 0 34px 60px;
    background: var(--panel);
    clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%);
    border-top-left-radius: 40px;
}

    .how-panel img {
        position: absolute;
        top: 8px;
        inset-inline-end: 22px;
        width: 58%;
        -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
        mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
    }

    .how-panel p {
        position: relative;
        font-family: var(--font-head);
        font-weight: 600;
        font-size: 18px;
        line-height: 1.2;
    }

        .how-panel p::after {
            content: "";
            display: block;
            width: 66px;
            height: 2px;
            margin-top: 8px;
            background: var(--text);
        }

/* ---------- Fixing printers banner ---------- */
.fix-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 30px;
    min-height: 118px;
    padding: 20px 38px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(90deg, color-mix(in srgb, var(--lavender) 22%, var(--bg-soft)) 0%, var(--bg-soft) 100%);
}

[data-theme="dark"] .fix-banner {
    border-color: #4a4750;
    background: linear-gradient(90deg, #0b0b0d 0%, #2b2633 100%);
}

.fix-media {
    position: absolute;
    inset: 0 0 0 auto;
    width: 50%;
    -webkit-mask-image: linear-gradient(105deg, transparent 6%, #000 30%);
    mask-image: linear-gradient(105deg, transparent 6%, #000 30%);
}

    .fix-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.fix-icon {
    position: relative;
    width: 66px;
    height: 66px;
    stroke-width: 1.2;
}

[data-theme="dark"] .fix-icon {
    color: var(--accent-text);
}

.fix-text {
    position: relative;
}

    .fix-text h2 {
        font-family: var(--font-head);
        font-weight: 600;
        font-size: 28px;
        line-height: 1.15;
    }

    .fix-text p {
        margin-top: 4px;
        font-size: 16px;
    }

.fix-banner .btn {
    position: relative;
    margin-inline-start: 4px;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 34px;
    border-top: 1px solid var(--border);
}

.footer-top {
    display: flex;
    align-items: center;
    gap: 50px;
    padding-block: 6px;
    border-bottom: 1px solid var(--border);
}

.logo-footer {
    padding-inline-end: 50px;
    border-inline-end: 1.5px solid var(--text);
}

    .logo-footer img {
        height: 70px;
    }

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 40px;
    font-family: var(--font-head);
    font-size: 15px;
}

    .footer-nav a:hover, .community a:hover {
        color: var(--accent-text);
    }

.community {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-inline-start: auto;
    font-family: var(--font-head);
    font-size: 15px;
}

    .community .icon {
        width: 24px;
        height: 24px;
    }

.copyright {
    padding-block: 18px;
    text-align: center;
    font-size: 11.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .search {
        width: 180px;
    }

    .main-nav a {
        padding-inline: 13px;
    }

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .how-main {
        width: 100%;
    }

    .how-panel {
        display: none;
    }
}

@media (max-width: 860px) {
    .header-inner {
        height: 72px;
        gap: 8px;
    }

    .logo img {
        height: 58px;
    }

    .nav-toggle {
        display: inline-grid;
    }

    .search {
        display: none;
    }

    .main-nav {
        position: absolute;
        top: 100%;
        inset-inline-start: 0;
        inset-inline-end: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin: 0;
        padding: 12px var(--gutter) 16px;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
    }

        .main-nav.is-open {
            display: flex;
        }

    .hero-media {
        width: 100%;
        opacity: .28;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .hero-inner {
        min-height: 0;
        padding-block: 44px 52px;
    }

    .hero-dots {
        inset-inline-end: var(--gutter);
    }

    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 26px;
    }

        .steps li:nth-child(odd)::before {
            display: none;
        }

    .fix-banner {
        flex-wrap: wrap;
        gap: 16px 20px;
        padding: 22px;
    }

    .fix-media {
        opacity: .3;
        width: 100%;
    }

    .footer-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding-block: 18px;
    }

    .logo-footer {
        padding-inline-end: 0;
        border-inline-end: 0;
    }

    .community {
        margin-inline-start: 0;
    }
}

@media (max-width: 560px) {
    :root {
        --gutter: 16px;
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .hero-points {
        gap: 10px 22px;
    }

        .hero-points li + li {
            margin-inline-start: 0;
            padding-inline-start: 0;
            border-inline-start: 0;
        }

    .section-head {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition: none !important;
    }
}

/* ---------- Projects page ---------- */
.page-head {
    padding-block: 34px 26px;
    background: var(--hero-fade);
    border-bottom: 1px solid var(--border);
}
.page-head .section-title { font-size: clamp(28px, 3.4vw, 40px); }
.page-lead { margin-top: 8px; color: var(--text-muted); font-size: 16px; }

.catalog { padding-block: 22px 10px; }

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px 24px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 7px 17px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-head);
    font-size: 13.5px;
    transition: background-color .2s, border-color .2s;
}
.chip:hover { border-color: var(--accent-text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }

.sort { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-muted); }
.sort select {
    height: 38px;
    padding-inline: 14px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text);
    font-size: 13.5px;
    cursor: pointer;
}

.result-line { margin-block: 16px 14px; font-size: 13.5px; color: var(--text-muted); }
.clear-link { margin-inline-start: 10px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.clear-link:hover { color: var(--accent-text); }

.product-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 56px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text-muted);
}
.empty .icon { width: 54px; height: 54px; stroke-width: 1.2; color: var(--accent-text); }
.empty h2 { font-family: var(--font-head); font-weight: 600; font-size: 20px; color: var(--text); }
.empty .btn { margin-top: 12px; }

@media (max-width: 1100px) { .product-grid-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .product-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---------- Search inside the phone menu ---------- */
.main-nav .nav-search { display: none; }

@media (max-width: 860px) {
    .main-nav .nav-search { display: flex; width: 100%; margin: 8px 0 0; }
    .main-nav .nav-search input { font-size: 16px; } /* 16px stops iOS zooming in on focus */
}

/* ---------- Login and register pages ---------- */
[data-theme="light"] .auth-page { --auth-link: #7a4fa3; }
[data-theme="dark"] .auth-page { --auth-link: #dcc8e8; }

.auth-page {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    background: var(--bg-soft);
}

.auth-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: center;
    width: min(1000px, 100%);
    min-height: 640px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--hero-fade);
    box-shadow: var(--shadow);
}

/* Printer photo behind the left half, fading out towards the form */
.auth-art {
    position: absolute;
    inset: 0 auto 0 0;
    width: 62%;
    -webkit-mask-image: linear-gradient(90deg, #000 45%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 45%, transparent 100%);
}
.auth-art img { width: 100%; height: 100%; object-fit: cover; object-position: 100% center; opacity: .75; }
[data-theme="dark"] .auth-art img { opacity: .8; }

/* The left padding keeps the text clear of the printed vase in the photo */
.auth-intro { position: relative; align-self: start; padding: 64px 20px 40px; padding-inline-start: 262px; }
.auth-logo {
    display: inline-block;
    margin-inline-start: 60px;
    margin-top: 50px;
    margin-bottom: 10px;
}
.auth-logo img { height: 140px; width: auto; }
.auth-intro h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.01em; }
.auth-intro p { max-width: 15em; margin-top: 10px; font-size: 18px; line-height: 1.3; }

.auth-panel {
    position: relative;
    margin: 36px;
    margin-inline-start: 0;
    padding: 22px 30px 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 26px; }
.auth-tabs a {
    padding: 10px 4px 12px;
    border-bottom: 2px solid transparent;
    font-family: var(--font-head);
    font-size: 17px;
    text-align: center;
    transition: color .2s, border-color .2s;
}
.auth-tabs a:hover { color: var(--auth-link); }
.auth-tabs a.is-active { border-color: var(--auth-link); color: var(--auth-link); font-weight: 600; }

.auth-form { display: grid; gap: 12px; }

.auth-field { position: relative; }
.auth-field > .icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 16px;
    transform: translateY(-50%);
    pointer-events: none;
}
.auth-field input {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0;
    padding-inline: 52px 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    font-size: 15px;
    transition: border-color .2s, box-shadow .2s;
}
.auth-field input::placeholder { color: var(--text-muted); }
.auth-field input:focus {
    outline: 0;
    border-color: var(--auth-link);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent);
}
.auth-field input.input-validation-error { border-color: var(--text); border-width: 2px; }

.auth-eye {
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    transform: translateY(-50%);
    cursor: pointer;
}
.auth-eye:hover { background: var(--border); }

.auth-group .field-validation-error,
.auth-error { display: block; margin-top: 5px; font-size: 12.5px; font-weight: 600; }
.auth-error ul { margin: 0; padding: 0; list-style: none; }
.auth-error.validation-summary-errors {
    padding: 10px 14px;
    border: 1px solid var(--text);
    border-radius: 12px;
}
.auth-hint { display: block; margin-top: 5px; font-size: 12px; color: var(--text-muted); }

.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block: 4px; }
.auth-check { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
.auth-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--auth-link); }
.auth-link { color: var(--auth-link); font-size: 13.5px; font-weight: 500; }
.auth-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.auth-submit { justify-content: center; width: 100%; height: 48px; margin-top: 6px; font-size: 15px; }

.auth-or { display: flex; align-items: center; gap: 14px; margin-block: 4px; font-size: 13px; color: var(--text-muted); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.auth-social { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.auth-social button {
    display: grid;
    place-items: center;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
}
.auth-social button:disabled { cursor: not-allowed; }

.auth-switch { margin-top: 4px; font-size: 13.5px; text-align: center; }

@media (max-width: 820px) {
    .auth-page { padding: 16px 12px; }
    .auth-card { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .auth-art {
        inset: 0 0 auto 0;
        width: 100%;
        height: 210px;
        -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
        mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
    }
    .auth-intro { padding: 150px 20px 6px; text-align: center; }
    .auth-logo { margin-bottom: 12px; }
    .auth-logo img { height: 84px; }
    .auth-intro p { max-width: none; font-size: 15px; }
    .auth-panel { margin: 14px 12px 12px; padding: 16px 18px 20px; }
    .auth-field input { font-size: 16px; } /* 16px stops iOS zooming in on focus */
}

/* ---------- Account menu in the header ---------- */
.account { position: relative; }

/* Small dot on the icon while someone is signed in */
.account-btn.is-signed-in::after {
    content: "";
    position: absolute;
    top: 6px;
    inset-inline-end: 6px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--bg);
    border-radius: 50%;
    background: var(--accent-hover);
}
.account-btn[aria-expanded="true"] { background: var(--bg-soft); }

.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    z-index: 40;
    display: grid;
    gap: 2px;
    min-width: 220px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.account-menu[hidden] { display: none; }

.account-hello {
    margin-bottom: 6px;
    padding: 6px 12px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-muted);
}
.account-hello strong {
    display: block;
    overflow: hidden;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    font-family: var(--font-head);
    font-size: 14px;
    white-space: nowrap;
    transition: background-color .2s;
}
.account-menu a:hover,
.account-menu a:focus-visible { background: var(--accent); color: var(--on-accent); }
.account-menu a .icon { width: 20px; height: 20px; }

@media (max-width: 560px) {
    /* Keep the menu on screen: the cart icon sits to the right of the account icon. */
    .account-menu { inset-inline-end: -50px; max-width: calc(100vw - 32px); }
}

/* ---------- Profile pages ---------- */
.profile-page {
    display: grid;
    justify-items: center;
    padding: 40px 24px 20px;
    background: var(--bg-soft);
    --auth-link: var(--accent-text);
}

.profile-card {
    width: min(720px, 100%);
    padding: 28px 30px 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.profile-notice {
    margin-bottom: 20px;
    padding: 12px 16px;
    border: 1px solid var(--accent-text);
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 35%, var(--surface));
    font-size: 14px;
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}
.profile-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 600;
}
.profile-head > div { min-width: 0; }
.profile-head h1 {
    overflow: hidden;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 24px;
    text-overflow: ellipsis;
}
.profile-head p { margin-top: 2px; overflow: hidden; color: var(--text-muted); font-size: 14.5px; text-overflow: ellipsis; }
.profile-edit { margin-inline-start: auto; }

.profile-list { margin: 0; }
.profile-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-block: 16px;
    border-bottom: 1px solid var(--border);
}
.profile-list dt { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 14px; }
.profile-list dt .icon { width: 20px; height: 20px; }
.profile-list dd { margin: 0; overflow: hidden; font-family: var(--font-head); font-size: 15px; text-align: end; text-overflow: ellipsis; }

.profile-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.profile-links a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: var(--font-head);
    font-size: 14px;
    transition: background-color .2s, border-color .2s;
}
.profile-links a:hover { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.profile-links .icon { width: 19px; height: 19px; }

.profile-form { margin-top: 22px; gap: 16px; }
.profile-form label { display: block; margin-bottom: 6px; font-family: var(--font-head); font-size: 13px; font-weight: 500; }
.profile-form input[readonly] { color: var(--text-muted); cursor: not-allowed; }
.profile-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.profile-actions .btn { padding: 10px 24px; font-size: 14px; }

@media (max-width: 560px) {
    .profile-page { padding: 16px 12px; }
    .profile-card { padding: 20px 18px 22px; }
    .profile-head { flex-wrap: wrap; }
    .profile-edit { margin-inline-start: 0; width: 100%; justify-content: center; }
    .profile-list > div { flex-direction: column; align-items: flex-start; gap: 4px; }
    .profile-list dd { text-align: start; }
    .profile-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- Address pages ---------- */
.address-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.address-list { display: grid; gap: 12px; }
.address-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
}
.address-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent);
    color: var(--on-accent);
}
.address-text { flex: 1; min-width: 0; }
.address-text h2 { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.address-text p { margin-top: 3px; font-size: 14px; overflow-wrap: anywhere; }
.address-text .address-place { color: var(--text-muted); font-size: 13px; }

.address-delete {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
}
.address-delete:hover { border-color: var(--text); background: var(--text); color: var(--bg); }
.address-delete .icon { width: 19px; height: 19px; }

.address-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-align: center;
}
.address-empty .icon { width: 48px; height: 48px; stroke-width: 1.2; color: var(--accent-text); }
.address-empty h2 { font-family: var(--font-head); font-weight: 600; font-size: 18px; color: var(--text); }

/* Dropdown and text area on the profile forms, matching the text inputs */
.profile-form select,
.profile-form textarea {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background-color: var(--bg-soft);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color .2s, box-shadow .2s;
}
.profile-form select {
    height: 52px;
    padding-block: 0;
    padding-inline-end: 42px;
    background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%), linear-gradient(135deg, var(--text) 50%, transparent 50%);
    background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    appearance: none;
    cursor: pointer;
}
.profile-form select option, .profile-form select optgroup { background: var(--bg); color: var(--text); }
.profile-form textarea { resize: vertical; min-height: 110px; }
.profile-form textarea::placeholder { color: var(--text-muted); }
.profile-form select:focus,
.profile-form textarea:focus {
    outline: 0;
    border-color: var(--auth-link);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent);
}
.profile-form select.input-validation-error,
.profile-form textarea.input-validation-error { border-color: var(--text); border-width: 2px; }

@media (max-width: 560px) {
    .address-head .btn { width: 100%; justify-content: center; }
}

/* ---------- "Admin panel" button in the header (admins only) ---------- */
.main-nav a.nav-admin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1.5px solid var(--border-strong);
    font-weight: 500;
    white-space: nowrap;
}
.main-nav a.nav-admin .icon { width: 18px; height: 18px; }
.main-nav a.nav-admin:hover { background: var(--text); color: var(--bg); }

/* Mid-width screens: keep only the icon so the header does not overflow. */
@media (min-width: 861px) and (max-width: 1180px) {
    .main-nav a.nav-admin span { display: none; }
    .main-nav a.nav-admin { padding-inline: 10px; }
}

/* ---------- Home page product sections ---------- */
.product-media { position: relative; }
.product-noimage { display: grid; place-items: center; width: 100%; height: 100%; color: var(--text-muted); }
.product-noimage .icon { width: 40px; height: 40px; stroke-width: 1.2; }
.product-badge {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-family: var(--font-head);
    font-size: 11px;
    font-weight: 500;
}
.cart-add:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.cart-add:disabled:hover { background: var(--accent); transform: none; }
.home-empty { padding: 30px 10px; color: var(--text-muted); text-align: center; }

/* ---------- Product details page ---------- */
.product-name a:hover { color: var(--accent-text); }

[data-theme="light"] .pd { --pd-accent: #8b5fbf; }
[data-theme="dark"] .pd { --pd-accent: #d9c2e8; }

.pd { padding-block: 26px 40px; }

/* Left: pictures, details and tabs. Right: delivery box and suggestions. */
.pd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 44px; align-items: start; }

.pd-top { display: grid; grid-template-columns: 100px minmax(0, 1fr) minmax(0, 1fr); gap: 16px 18px; align-items: start; }

/* Small pictures in a column; the column scrolls when there are many */
.pd-thumbs { display: flex; flex-direction: column; gap: 10px; max-height: 345px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.pd-thumbs button {
    flex: none;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    cursor: pointer;
    transition: border-color .2s;
}
.pd-thumbs button:hover { border-color: var(--pd-accent); }
.pd-thumbs button.is-active { border-color: var(--pd-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pd-accent) 35%, transparent); }
.pd-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.pd-image {
    position: relative;
    aspect-ratio: 5 / 4;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-soft);
}
.pd-image-wide { grid-column: 1 / 3; }
.pd-image img { width: 100%; height: 100%; object-fit: cover; }

.pd-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--on-accent);
    font-family: var(--font-head);
    font-size: 13px;
    font-weight: 500;
}
.pd-badge .icon { width: 15px; height: 15px; }
.pd-info h1 { margin-top: 10px; font-family: var(--font-head); font-weight: 600; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -.01em; }
.pd-lead { margin-top: 12px; font-size: 16.5px; line-height: 1.4; }

.pd-features { display: flex; flex-wrap: wrap; gap: 14px 26px; margin-top: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.pd-features li { display: flex; align-items: center; gap: 12px; font-size: 13.5px; line-height: 1.25; }
.pd-features .icon { width: 32px; height: 32px; stroke-width: 1.4; }
.pd-features small { display: block; font-size: 12.5px; color: var(--text-muted); }

.pd-price { margin-top: 16px; font-family: var(--font-head); font-weight: 600; font-size: 32px; color: var(--pd-accent); }

.pd-buy { display: flex; align-items: flex-start; gap: 18px; margin-top: 14px; }
.pd-stepper { display: flex; align-items: center; gap: 4px; height: 44px; }
.pd-stepper button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s;
}
.pd-stepper button:hover:not(:disabled) { border-color: var(--pd-accent); }
.pd-stepper button .icon { width: 18px; height: 18px; }
.pd-stepper input {
    width: 52px;
    border: 0;
    background: none;
    font-family: var(--font-head);
    font-size: 19px;
    font-weight: 500;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
.pd-stepper input::-webkit-outer-spin-button,
.pd-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pd-stepper input:focus { outline: 0; }
.pd-stepper :disabled { opacity: .45; cursor: not-allowed; }

.pd-actions { flex: 1; display: grid; gap: 10px; min-width: 0; }
.pd-actions .btn { justify-content: center; height: 44px; font-size: 14.5px; }
.pd-actions .btn:hover .icon { transform: none; }
.pd-actions .btn:disabled { opacity: .5; cursor: not-allowed; }

/* Tabs */
.pd-tabs { display: flex; gap: 6px; margin-top: 26px; border-bottom: 1px solid var(--border); }
.pd-tabs button {
    padding: 9px 20px 11px;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    font-family: var(--font-head);
    font-size: 15px;
    color: var(--text);
    cursor: pointer;
}
.pd-tabs button:hover { color: var(--pd-accent); }
.pd-tabs button.is-active { border-color: var(--pd-accent); color: var(--pd-accent); font-weight: 600; }
.pd-panel { padding-top: 16px; font-size: 15px; line-height: 1.6; }
.pd-muted { color: var(--text-muted); }

.pd-specs { margin: 0; max-width: 520px; }
.pd-specs > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 10px; border-bottom: 1px solid var(--border); }
.pd-specs dt { color: var(--text-muted); }
.pd-specs dd { margin: 0; font-family: var(--font-head); text-align: end; }
.pd-swatch { display: block; width: 26px; height: 26px; border: 1px solid var(--border-strong); border-radius: 50%; }

/* Right column */
.pd-box { padding: 20px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pd-box h2, .pd-also h2 { font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.pd-box h2::after { content: ""; display: block; width: 36px; height: 2px; margin-top: 8px; border-radius: 2px; background: var(--pd-accent); }
.pd-promises { display: grid; gap: 20px; margin-top: 22px; }
.pd-promises li { display: flex; align-items: center; gap: 16px; font-family: var(--font-head); font-size: 14px; line-height: 1.3; }
.pd-promises .icon { width: 34px; height: 34px; stroke-width: 1.3; }
.pd-promises small { display: block; margin-top: 2px; font-family: var(--font-body); font-size: 13px; color: var(--text-muted); }

.pd-also { margin-top: 34px; }
.pd-also-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.pd-also-grid a { display: block; }
.pd-also-grid img, .pd-also-grid .product-noimage {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-soft);
    object-fit: cover;
    transition: border-color .2s;
}
.pd-also-grid a:hover img { border-color: var(--pd-accent); }
.pd-also-name { display: block; margin-top: 6px; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1150px) {
    .pd-layout { grid-template-columns: minmax(0, 1fr); gap: 30px; }
    .pd-also-grid { grid-template-columns: repeat(3, minmax(0, 160px)); }
}

@media (max-width: 800px) {
    .pd-top { grid-template-columns: minmax(0, 1fr); }
    .pd-image, .pd-image-wide { grid-column: auto; order: -1; }
    .pd-thumbs { flex-direction: row; max-height: none; overflow-x: auto; overflow-y: hidden; }
    .pd-thumbs button { width: 84px; }
    .pd-buy { flex-wrap: wrap; }
    .pd-actions { flex-basis: 100%; }
}

/* ---------- Cart page ---------- */
[data-theme="light"] .cart-page { --pd-accent: #8b5fbf; }
[data-theme="dark"] .cart-page { --pd-accent: #d9c2e8; }

.cart-page { padding-block: 30px 44px; }
.cart-head h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(28px, 3vw, 36px); letter-spacing: -.01em; }
.cart-head p { margin-top: 4px; font-size: 16px; }

.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; margin-top: 24px; }

.cart-list { display: grid; gap: 12px; }
.cart-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 18px;
    padding: 14px;
    padding-inline-end: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.cart-thumb { display: block; width: 96px; height: 96px; overflow: hidden; border-radius: 12px; background: var(--bg-soft); }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }

.cart-text h2 { font-family: var(--font-head); font-weight: 600; font-size: 17px; }
.cart-text h2 a:hover { color: var(--pd-accent); }
.cart-unit { margin-top: 4px; font-size: 13.5px; color: var(--text-muted); }
.cart-custom { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--text-muted); }
.cart-swatch { width: 16px; height: 16px; border: 1px solid var(--border-strong); border-radius: 50%; }
.cart-warn { margin-top: 6px; font-size: 13px; font-weight: 600; }

.cart-qty { display: flex; align-items: center; gap: 6px; }
.cart-qty form { margin: 0; }
.cart-qty button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s;
}
.cart-qty button:hover:not(:disabled) { border-color: var(--pd-accent); }
.cart-qty button:disabled { opacity: .4; cursor: not-allowed; }
.cart-qty button .icon { width: 16px; height: 16px; }
.cart-qty > span { min-width: 30px; font-family: var(--font-head); font-size: 17px; font-weight: 500; text-align: center; }

.cart-subtotal { min-width: 92px; font-family: var(--font-head); font-weight: 600; font-size: 17px; text-align: end; white-space: nowrap; }

.cart-remove { margin: 0; }
.cart-remove button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color .2s, color .2s;
}
.cart-remove button:hover { background: var(--bg-soft); color: var(--text); }
.cart-remove .icon { width: 19px; height: 19px; }

.cart-summary {
    position: sticky;
    top: 110px;
    padding: 22px 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.cart-summary h2 { font-family: var(--font-head); font-weight: 600; font-size: 18px; }
.cart-summary dl { margin: 16px 0 0; }
.cart-summary dl > div { display: flex; justify-content: space-between; gap: 16px; padding-block: 8px; font-size: 15px; }
.cart-summary dd { margin: 0; font-variant-numeric: tabular-nums; }
.cart-later { color: var(--text-muted); font-size: 13.5px; }
.cart-summary .cart-total {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 45%, var(--surface));
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 18px;
}
.cart-summary .btn { width: 100%; justify-content: center; height: 46px; margin-top: 12px; font-size: 14.5px; }
.cart-checkout { margin-top: 18px !important; }
.cart-checkout:disabled { opacity: .5; cursor: not-allowed; }
.cart-checkout:disabled:hover .icon { transform: none; }
.cart-back .icon { transform: rotate(180deg); }
.cart-back:hover .icon { transform: rotate(180deg) translateX(3px); }

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding: 60px 20px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    text-align: center;
}
.cart-empty > .icon { width: 56px; height: 56px; stroke-width: 1.2; color: var(--pd-accent); }
.cart-empty h2 { font-family: var(--font-head); font-weight: 600; font-size: 20px; color: var(--text); }
.cart-empty .btn { margin-top: 14px; }

/* Small message after pressing Add to Cart */
.cart-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 60;
    transform: translateX(-50%);
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--text);
    color: var(--bg);
    font-family: var(--font-head);
    font-size: 14px;
    box-shadow: var(--shadow);
}
.cart-toast[hidden] { display: none; }
.cart-toast.is-error { background: var(--accent); color: var(--on-accent); }

@media (max-width: 1000px) {
    .cart-layout { grid-template-columns: minmax(0, 1fr); }
    .cart-summary { position: static; }
}

@media (max-width: 640px) {
    .cart-item { grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; padding: 12px; }
    .cart-thumb { width: 76px; height: 76px; }
    .cart-qty { grid-column: 2; justify-self: start; }
    .cart-subtotal { grid-column: 3; grid-row: 2; min-width: 0; }
    .cart-remove { grid-column: 3; grid-row: 1; justify-self: end; }
}

/* ---------- Checkout and order confirmation ---------- */
.co-steps { display: grid; gap: 16px; min-width: 0; }
.co-box {
    min-width: 0;
    margin: 0;
    padding: 20px 22px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.co-box legend, .co-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
}
.co-box legend { float: inline-start; width: 100%; margin-bottom: 14px; }
.co-box legend + * { clear: both; }
.co-num {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 13.5px;
}
.co-options { display: grid; gap: 10px; }
.co-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.co-option:hover { border-color: var(--border-strong); }
.co-option input { position: absolute; opacity: 0; pointer-events: none; }
.co-dot {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
}
.co-option:has(input:checked) { border-color: var(--pd-accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.co-option:has(input:checked) .co-dot { border-color: var(--pd-accent); background: radial-gradient(circle, var(--pd-accent) 0 45%, transparent 50%); }
.co-option:has(input:focus-visible) { outline: 2px solid var(--pd-accent); outline-offset: 2px; }
.co-text { display: grid; gap: 2px; flex: 1; min-width: 0; font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }
.co-text strong { font-family: var(--font-head); font-weight: 600; font-size: 15.5px; color: var(--text); }
.co-price { font-family: var(--font-head); font-weight: 600; font-size: 15px; white-space: nowrap; }
.co-none { font-size: 14.5px; color: var(--text-muted); }
.co-add { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--pd-accent); }
.co-add:hover { text-decoration: underline; }
.co-add .icon { width: 16px; height: 16px; }

.co-items { display: grid; gap: 8px; margin: 14px 0 0; padding: 0 0 12px; border-bottom: 1px solid var(--border); list-style: none; font-size: 14px; }
.co-items li { display: flex; justify-content: space-between; gap: 14px; }
.co-items li > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.co-items em { font-style: normal; color: var(--text-muted); }
.co-items-wide { margin-top: 14px; padding-bottom: 0; border-bottom: 0; font-size: 15px; }

.co-facts { margin: 14px 0 0; }
.co-facts > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding-block: 8px; font-size: 15px; }
.co-facts dt { color: var(--text-muted); }
.co-facts dd { display: grid; gap: 2px; margin: 0; overflow-wrap: anywhere; }

.co-done { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-block: 10px 6px; text-align: center; }
.co-done > .icon { width: 56px; height: 56px; stroke-width: 1.4; color: var(--pd-accent); }
.co-done h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.01em; }
.co-done p { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-size: 15.5px; }
.co-status { padding: 3px 12px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; }

/* ---------- My Orders page ---------- */
.mo-layout { grid-template-columns: minmax(0, 1fr) 380px; }
.mo-card { grid-template-columns: 96px minmax(0, 1fr) auto auto; color: inherit; transition: border-color .15s, background .15s; }
.mo-card:hover { border-color: var(--border-strong); }
.mo-card.is-open { border-color: var(--pd-accent); background: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.mo-card .cart-text { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.mo-title { font-family: var(--font-head); font-weight: 600; font-size: 17px; overflow-wrap: anywhere; }
.mo-card .cart-unit { margin-top: 0; }
.mo-status { margin-top: 2px; }
.mo-arrow { width: 18px; height: 18px; color: var(--text-muted); }
.mo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; color: var(--text-muted); }
.mo-facts { padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.cart-summary .mo-facts > div { display: grid; grid-template-columns: 84px minmax(0, 1fr); justify-content: stretch; font-size: 14px; }
.mo-sub { margin-top: 16px; font-family: var(--font-head); font-weight: 600; font-size: 16px; }
.mo-sub + dl { margin-top: 6px; }
#order-details { scroll-margin-top: 110px; }

@media (max-width: 1000px) {
    .mo-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .mo-card { grid-template-columns: 76px minmax(0, 1fr) auto; }
    .mo-card .cart-subtotal { grid-column: 3; grid-row: 1; }
    .mo-arrow { display: none; }
}

/* ---------- Fixing request page ---------- */
.fx-icon { width: 22px; height: 22px; color: var(--pd-accent); }
.fx-form { max-width: none; margin-top: 16px; }
.fx-file {
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 12px;
    background: var(--bg-soft);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.fx-file::file-selector-button {
    margin-inline-end: 12px;
    padding: 7px 14px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.fx-none { margin-top: 12px; }
.fx-list { display: grid; margin: 8px 0 0; padding: 0; list-style: none; }
.fx-list li { padding-block: 14px; border-bottom: 1px solid var(--border); }
.fx-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.fx-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fx-top strong { font-family: var(--font-head); font-weight: 600; font-size: 15.5px; overflow-wrap: anywhere; }
.fx-top .co-status { flex: none; }
.fx-meta { margin-top: 2px; font-size: 13px; color: var(--text-muted); }
.fx-desc { margin-top: 6px; font-size: 14px; overflow-wrap: anywhere; }
.fx-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fx-photos img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--bg-soft); }

/* ---------- Paging under lists (wwwroot/js/paging.js) ---------- */
.pg-off { display: none !important; }
.pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-top: 16px;
}
.pager[hidden] { display: none; }
.pager-info { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.pager-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-inline-start: auto; }
.pager button {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.pager button:hover:not(:disabled):not(.is-current) { border-color: var(--border-strong); }
.pager button.is-current { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: default; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager-gap { padding-inline: 2px; color: var(--text-muted); }

/* ---------- Forgot password: "check your email" message ---------- */
.auth-done { display: grid; justify-items: center; gap: 8px; padding-block: 6px 4px; text-align: center; }
.auth-done > .icon { width: 44px; height: 44px; stroke-width: 1.4; }
.auth-done h2 { font-family: var(--font-head); font-weight: 600; font-size: 20px; }
.auth-done p { font-size: 14.5px; overflow-wrap: anywhere; }

/* ---------- Language button in the header ---------- */
.lang-form { display: flex; margin: 0; }
.lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 42px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--text);
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s;
}
.lang-btn:hover { background: var(--bg-soft); }
.lang-btn .icon { width: 21px; height: 21px; stroke-width: 1.6; }
.lang-btn[lang="ar"] span { font-family: "Tajawal", "Segoe UI", Tahoma, sans-serif; font-size: 17px; font-weight: 700; }

/* ---------- Right-to-left (Arabic) ----------
   Most rules above use start/end instead of left/right, so they follow the page direction by themselves.
   Only the things that cannot do that are listed here. */
html[dir="rtl"] {
    --font-head: "Tajawal", "Segoe UI", Tahoma, sans-serif;
    --font-body: "Tajawal", "Segoe UI", Tahoma, sans-serif;
}
/* Arabic letters join, so the tight letter spacing used for English headings is switched off. */
[dir="rtl"] * { letter-spacing: 0 !important; }

/* Arrows point the other way. "scale" flips the icon and still lets the hover animations work. */
[dir="rtl"] svg:has(> use[href="#i-arrow-right"]),
[dir="rtl"] svg:has(> use[href="#i-chevron-right"]) { scale: -1 1; }

/* How it works: the small arrow between the steps, and the slanted panel */
[dir="rtl"] .steps li + li::before { transform: rotate(-45deg); }
[dir="rtl"] .how-panel {
    inset: 0 auto 0 0;
    padding: 0 60px 34px 0;
    clip-path: polygon(0 0, 76% 0, 100% 100%, 0 100%);
    border-top-left-radius: 0;
    border-top-right-radius: 40px;
}

/* Fixing printers banner: the colour fades from the other side */
[dir="rtl"] .fix-banner { background: linear-gradient(270deg, color-mix(in srgb, var(--lavender) 22%, var(--bg-soft)) 0%, var(--bg-soft) 100%); }
[dir="rtl"][data-theme="dark"] .fix-banner { background: linear-gradient(270deg, #0b0b0d 0%, #2b2633 100%); }

/* Login and register: the printer photo moves to the right side, mirrored */
[dir="rtl"] .auth-art { inset: 0 0 0 auto; scale: -1 1; }

/* The small arrow of the dropdowns sits on the left */
[dir="rtl"] .profile-form select { background-position: 16px 50%, 22px 50%; }

/* Home page hero: the printer photo moves to the left side, mirrored, so the text stays clear of it */
[dir="rtl"] .hero-media { inset: 0 auto 0 0; scale: -1 1; }

/* Fixing printers banner: its photo moves to the left side too */
[dir="rtl"] .fix-media { inset: 0 auto 0 0; scale: -1 1; }

/* Login and register on a phone: the photo sits across the top, as in English */
@media (max-width: 820px) {
    [dir="rtl"] .auth-art { inset: 0 0 auto 0; }
}

/* Small notes after a product name (quantity, custom size) stay together when Arabic and English mix */
.co-items em, .cart-custom span { unicode-bidi: isolate; }

/* Phone, email and password boxes are typed left-to-right, but in Arabic their text still starts at the right edge */
[dir="rtl"] input[type="tel"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="password"] { text-align: right; }

/* ---------- About Us page ---------- */
.about { display: grid; gap: 40px; padding-block: 36px 54px; }
.about .section-title { margin-bottom: 16px; }
.about-intro p { max-width: 46em; font-size: 17px; line-height: 1.7; }
.about-intro p + p { margin-top: 10px; }
.about-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.about-why { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.about-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.about-card > .icon { width: 34px; height: 34px; stroke-width: 1.5; color: var(--accent-text); }
.about-card h3 { font-family: var(--font-head); font-weight: 600; font-size: 19px; }
.about-card p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
.about-card .btn { margin-top: auto; }

@media (max-width: 1000px) {
    .about-why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .about-cards, .about-why { grid-template-columns: minmax(0, 1fr); }
    .about-card { padding: 20px; }
}

/* ---------- Checkout: the fields a guest fills in ---------- */
.co-fields { margin-top: 0; }
.co-fields label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.co-have-account { margin-top: 14px; font-size: 14px; color: var(--text-muted); }
.co-box[hidden] { display: none; }
