/* ============================================================
   STONE THEME — "لوح العيّنات" (The Sample Board)
   A catalog that behaves like a stone showroom's sample board:
   every product is a cut swatch with an engraved brass plaque.
   Palette: limestone ground / basalt ink / bronze accent.
   Display face: Reem Kufi (the script carved into stone).
   ============================================================ */

:root {
    --sand: #EAE3D6;        /* page ground — limestone dust */
    --plaster: #F7F3EC;     /* card faces */
    --basalt: #262220;      /* warm near-black ink & hero mass */
    --bronze: #96682B;      /* accent — overridable per tenant */
    --clay: #6F6457;        /* secondary text — weathered mortar */
    --strata: rgba(38, 34, 32, .14);  /* hairlines */
    /* accent-derived shades — recompute automatically from the tenant accent */
    --accent-light: color-mix(in srgb, var(--bronze) 55%, #fff);
    --plaque: linear-gradient(160deg,
        color-mix(in srgb, var(--bronze) 78%, #fff),
        var(--bronze) 55%,
        color-mix(in srgb, var(--bronze) 72%, #000));
    --radius: 14px;
    --dock-h: 64px;
    --font-display: 'Reem Kufi', 'Rubik', sans-serif;
    --font-body: 'Rubik', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.stone {
    margin: 0;
    background: var(--sand);
    color: var(--basalt);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--dock-h) + 24px);
}

.stone img { max-width: 100%; display: block; }
/* keep this at element specificity so single-class rules
   (.hero-cta, .view-all, .cta-wa …) can recolor links */
a { color: inherit; text-decoration: none; }
.stone h1, .stone h2, .stone h3 { margin: 0; }
.stone ul { margin: 0; padding: 0; list-style: none; }
.stone button { font-family: inherit; }

.wrap {
    max-width: 1100px;
    margin-inline: auto;
    padding-inline: 18px;
}

/* Reem Kufi initial-form glyphs (حـ, عـ …) carry a decorative swash
   that inks past the text origin; give display headings room for it */
.hero-title, .section-title, .product-title, .footer .brand-big {
    padding-inline-start: .42em;
}

/* ---------- top bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--sand) 82%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--strata);
}

.topbar-in {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 10px;
}

.brand strong {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.langs {
    margin-inline-start: auto;
    display: flex;
    gap: 6px;
}

.langs a {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    padding: 5px 10px;
    border: 1px solid var(--strata);
    border-radius: 999px;
    color: var(--clay);
    text-transform: uppercase;
}

.langs a.on {
    background: var(--basalt);
    border-color: var(--basalt);
    color: var(--plaster);
}

/* ---------- hero ---------- */
.hero {
    position: relative;
    min-height: 72vh;
    display: flex;
    align-items: flex-end;
    color: var(--plaster);
    isolation: isolate;
    overflow: hidden;
}

.hero-img {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::after {
    /* basalt veil rising from the base — text always readable */
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(to top,
        rgba(23, 20, 18, .92) 0%,
        rgba(23, 20, 18, .55) 42%,
        rgba(23, 20, 18, .12) 75%,
        rgba(23, 20, 18, .25) 100%);
}

.hero-in {
    width: 100%;
    padding-block: 40px 46px;
}

.hero-kicker {
    display: inline-block;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .14em;
    color: var(--accent-light);
    border: 1px solid color-mix(in srgb, var(--accent-light) 45%, transparent);
    border-radius: 999px;
    padding: 4px 14px;
    margin-bottom: 14px;
    animation: rise .7s .05s both;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.1rem, 8vw, 3.6rem);
    line-height: 1.25;
    max-width: 14ch;
    animation: rise .7s .18s both;
}

.hero-sub {
    margin-top: 10px;
    max-width: 46ch;
    color: rgba(247, 243, 236, .85);
    font-size: .95rem;
    animation: rise .7s .32s both;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
    background: var(--plaster);
    color: var(--basalt);
    font-weight: 600;
    font-size: .92rem;
    padding: 12px 22px;
    border-radius: 999px;
    animation: rise .7s .45s both;
    transition: transform .18s ease;
}

.hero-cta:active { transform: scale(.97); }

.hero-cta svg { width: 16px; height: 16px; }
[dir="ltr"] .hero-cta svg { transform: scaleX(-1); }

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- strata divider (signature motif) ----------
   three sediment lines of unequal length, like rock layers */
.strata {
    display: grid;
    gap: 4px;
    margin-block: 12px 18px;
    width: 96px;
}

.strata i {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--bronze);
    opacity: .9;
}

.strata i:nth-child(2) { width: 64%; opacity: .55; }
.strata i:nth-child(3) { width: 34%; opacity: .3; }

.strata.center { margin-inline: auto; }
.strata.center i { margin-inline: auto; }
.strata.light i { background: var(--accent-light); }

/* ---------- category scroller ---------- */
.quarry {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-block: 20px 8px;
    scrollbar-width: none;
}

.quarry::-webkit-scrollbar { display: none; }

.quarry a {
    flex: 0 0 auto;
    width: 86px;
    text-align: center;
}

.quarry .tile {
    width: 78px;
    height: 78px;
    margin-inline: auto;
    border-radius: 16px;
    overflow: hidden;
    background: var(--plaster);
    border: 1px solid var(--strata);
    transition: transform .18s ease, border-color .18s ease;
}

.quarry a:hover .tile,
.quarry a:focus-visible .tile {
    transform: translateY(-3px);
    border-color: var(--bronze);
}

.quarry .tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quarry span {
    display: block;
    margin-top: 7px;
    font-size: .76rem;
    font-weight: 500;
    color: var(--clay);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- sections ---------- */
.section { margin-top: 34px; }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.35rem;
    line-height: 1.4;
}

.view-all {
    flex: 0 0 auto;
    font-size: .8rem;
    font-weight: 600;
    color: var(--bronze);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding-bottom: 3px;
}

.view-all svg { width: 13px; height: 13px; }
[dir="ltr"] .view-all svg { transform: scaleX(-1); }

/* ---------- sample cards (signature element) ----------
   a product card as a physical stone swatch:
   chamfered corner cut + engraved bronze plaque + sample index */
.sample {
    position: relative;
    display: block;
    background: var(--plaster);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(38, 34, 32, .08);
    transition: transform .2s ease, box-shadow .2s ease;
}

[dir="rtl"] .sample { clip-path: polygon(22px 0, 100% 0, 100% 100%, 0 100%, 0 22px); }
[dir="ltr"] .sample { clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%); }

.sample:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(38, 34, 32, .16);
}

.sample-img {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--sand);
}

.sample-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.sample:hover .sample-img img { transform: scale(1.05); }

.sample-idx {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--plaster);
    background: rgba(23, 20, 18, .55);
    backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: 999px;
}

.sample-price {
    position: absolute;
    top: 8px;
    inset-inline-start: 14px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--basalt);
    background: rgba(247, 243, 236, .9);
    padding: 3px 9px;
    border-radius: 999px;
}

.sample-price s {
    font-weight: 400;
    color: var(--clay);
    font-size: .68rem;
    margin-inline-start: 4px;
}

.sample-plaque {
    /* the engraved brass plaque */
    background: var(--plaque);
    color: #fdf6e8;
    padding: 9px 12px 10px;
}

.sample-plaque h3 {
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 1px rgba(60, 38, 5, .55);
}

.sample-plaque p {
    margin: 1px 0 0;
    font-size: .7rem;
    color: rgba(253, 246, 232, .78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* horizontal strip of samples (home) */
.strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 46%;
    gap: 12px;
    overflow-x: auto;
    padding-block: 16px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.strip::-webkit-scrollbar { display: none; }
.strip .sample { scroll-snap-align: start; }

/* grid of samples (products page) */
.sample-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding-block: 16px;
}

/* ---------- products page controls ---------- */
.filters {
    position: sticky;
    top: 58px;
    z-index: 40;
    background: color-mix(in srgb, var(--sand) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding-block: 10px 4px;
    border-bottom: 1px solid var(--strata);
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--plaster);
    border: 1px solid var(--strata);
    border-radius: 999px;
    padding: 9px 16px;
}

.search svg { width: 16px; height: 16px; color: var(--clay); flex: 0 0 auto; }

.search input {
    border: 0;
    outline: 0;
    background: none;
    width: 100%;
    font-family: inherit;
    font-size: .9rem;
    color: var(--basalt);
}

.search input::placeholder { color: var(--clay); }

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-block: 10px 8px;
    scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
    flex: 0 0 auto;
    border: 1px solid var(--strata);
    background: var(--plaster);
    color: var(--clay);
    font-size: .82rem;
    font-weight: 500;
    padding: 7px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.chip.on {
    background: var(--basalt);
    border-color: var(--basalt);
    color: var(--plaster);
}

.chips.sub .chip.on {
    background: var(--bronze);
    border-color: var(--bronze);
}

.no-results {
    display: none;
    text-align: center;
    color: var(--clay);
    padding-block: 48px;
}

.no-results.show { display: block; }

/* ---------- product detail ---------- */
.gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    background: var(--basalt);
}

.gallery::-webkit-scrollbar { display: none; }

.gallery img {
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    scroll-snap-align: center;
}

.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: -22px;
    position: relative;
    z-index: 2;
}

.gallery-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(247, 243, 236, .5);
    transition: background .15s ease, transform .15s ease;
}

.gallery-dots i.on { background: var(--plaster); transform: scale(1.25); }

.product-head { padding-block: 26px 4px; }

.product-cat {
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .1em;
    color: var(--bronze);
    margin-bottom: 6px;
}

.product-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.7rem;
    line-height: 1.35;
}

.product-price {
    margin-top: 8px;
    font-size: 1.15rem;
    font-weight: 700;
}

.product-price s {
    color: var(--clay);
    font-weight: 400;
    font-size: .9rem;
    margin-inline-start: 8px;
}

.prose {
    color: var(--clay);
    font-size: .95rem;
    padding-block: 10px 6px;
}

.prose p { margin: 0 0 10px; }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 8px 20px;
}

.tags span {
    font-size: .78rem;
    font-weight: 500;
    color: var(--basalt);
    background: var(--plaster);
    border: 1px solid var(--strata);
    padding: 5px 13px;
    border-radius: 999px;
}

.cta-wa {
    position: fixed;
    bottom: calc(var(--dock-h) + 14px);
    inset-inline: 18px;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 520px;
    margin-inline: auto;
    background: var(--basalt);
    color: var(--plaster);
    font-weight: 600;
    font-size: .95rem;
    padding: 15px 20px;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(23, 20, 18, .35);
    transition: transform .18s ease;
}

.cta-wa:active { transform: scale(.97); }
.cta-wa svg { width: 19px; height: 19px; color: #6fd06f; }

.page-pad-cta { padding-bottom: 90px; }

/* ---------- footer ---------- */
.footer {
    margin-top: 48px;
    background: var(--basalt);
    color: var(--plaster);
    padding-block: 40px 34px;
}

.footer .brand-big {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
}

.footer p { color: rgba(247, 243, 236, .72); font-size: .9rem; margin: 4px 0; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(247, 243, 236, .25);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: .84rem;
    transition: border-color .15s ease, background .15s ease;
}

.footer-links a:hover {
    border-color: var(--accent-light);
    background: color-mix(in srgb, var(--accent-light) 8%, transparent);
}
.footer-links a svg { width: 15px; height: 15px; }

/* ---------- bottom dock ---------- */
.dock {
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    z-index: 60;
    height: var(--dock-h);
    background: color-mix(in srgb, var(--plaster) 94%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--strata);
    padding-bottom: env(safe-area-inset-bottom);
}

.dock-in {
    max-width: 560px;
    height: 100%;
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
}

.dock a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: .66rem;
    font-weight: 500;
    color: var(--clay);
}

.dock a svg { width: 21px; height: 21px; }
.dock a.on { color: var(--basalt); }
.dock a.on svg { color: var(--bronze); }

.dock .fab {
    position: relative;
    top: -16px;
    width: 54px;
    height: 54px;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--plaque);
    color: #fdf6e8;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--bronze) 45%, transparent);
}

.dock .fab svg { width: 25px; height: 25px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    .hero-kicker, .hero-title, .hero-sub, .hero-cta { animation: none; }
    .sample, .sample-img img, .quarry .tile { transition: none; }
}

/* ---------- focus ---------- */
.stone a:focus-visible,
.stone button:focus-visible,
.stone input:focus-visible {
    outline: 2px solid var(--bronze);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
    body.stone { font-size: 16px; }
    .strip { grid-auto-columns: 30%; }
    .sample-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
    .hero { min-height: 60vh; }
}

@media (min-width: 960px) {
    .strip { grid-auto-columns: 22%; }
    .sample-grid { grid-template-columns: repeat(4, 1fr); }
    .quarry a { width: 104px; }
    .quarry .tile { width: 92px; height: 92px; }
}
