/*
 * Al-Noor Electrical & Lighting
 *
 * Two things shape this sheet.
 *
 * First, direction. The site's primary audience reads Arabic, so RTL is the
 * default case rather than an afterthought. Every inline offset uses logical
 * properties — margin-inline, padding-inline, inset-inline, border-inline —
 * which means the whole layout mirrors from the dir attribute alone. There is
 * no [dir="rtl"] override block anywhere in this file, and there should never
 * be one: the moment a `left` appears, somebody has to remember to write its
 * mirror, and eventually somebody will not.
 *
 * Second, the theme is not ours. --primary and --accent are set per page from
 * what the master pushed, so nothing here may hard-code a brand colour. Greys
 * are fixed because they are structure, not brand.
 */

:root {
    --primary: #101922;
    --accent: #f0a500;
    --font: 'Cairo', system-ui, sans-serif;

    /* Structure. Cold industrial greys, deliberately, so the single warm
       accent has something to be warm against. */
    --ink: #16202a;
    --ink-soft: #5a6672;
    --line: #dfe4e9;
    --paper: #ffffff;
    --paper-muted: #f4f6f8;

    --measure: 68ch;
    --wrap: 1180px;
    --radius: 4px;

    /* A 1.25 scale. Tight enough that a heading and its body still read as one
       block, wide enough that hierarchy is obvious without bolding everything. */
    --step-0: 1rem;
    --step-1: 1.25rem;
    --step-2: 1.563rem;
    --step-3: 1.953rem;
    --step-4: 2.441rem;
    --step-5: 3.052rem;

    --space: 1rem;
    --section-y: clamp(3rem, 7vw, 5.5rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--step-0);
    line-height: 1.65;
    color: var(--ink);
    background: var(--paper);
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.015em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }

a { color: inherit; }

/* Focus is visible everywhere and never removed. A keyboard user who cannot
   see where they are cannot use the site at all, and outline:none is the
   single commonest way that happens. */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 2px;
}

img { max-width: 100%; height: auto; display: block; }

.skip-link {
    position: absolute;
    inset-inline-start: -9999px;
    top: 0;
    z-index: 100;
    background: var(--primary);
    color: #fff;
    padding: 0.75rem 1.25rem;
}
.skip-link:focus { inset-inline-start: 0; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap.narrow { width: min(100% - 2.5rem, var(--measure)); }
.center { text-align: center; }

/* ---------- Header ---------- */

.site-header { position: sticky; top: 0; z-index: 40; background: var(--paper); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 72px;
}

.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; font-weight: 800; }
.brand-mark { max-height: 40px; width: auto; }
.brand-bolt { font-size: 1.5rem; }
.brand-name { font-size: var(--step-0); }

/*
 * The filament: one hairline under the header that carries the accent and
 * fades at both ends, like the glow along a lamp element.
 *
 * This is the site's one flourish and the only decorative rule in the sheet.
 * Everything else is structure. Spending the boldness in a single 2px line
 * lets the rest stay quiet.
 */
.filament {
    height: 2px;
    background: linear-gradient(
        to right,
        transparent,
        var(--accent) 20%,
        var(--accent) 80%,
        transparent
    );
    opacity: 0.85;
}

.site-nav { display: flex; align-items: center; gap: 1.25rem; margin-inline-start: auto; }
.site-nav ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; font-size: 0.95rem; padding-block: 0.35rem; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a.is-current { border-bottom-color: var(--accent); }

.lang-switch { display: flex; gap: 0.4rem; }
.lang-switch form { margin: 0; }
.lang-switch button {
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.25rem 0.6rem;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.lang-switch button:hover { border-color: var(--accent); }

.header-phone { font-weight: 600; text-decoration: none; white-space: nowrap; }

.nav-toggle { display: none; background: none; border: 0; padding: 0.5rem; cursor: pointer; margin-inline-start: auto; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .site-nav {
        display: none;
        position: absolute;
        inset-inline: 0;
        top: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        background: var(--paper);
        padding: 1.5rem;
        border-bottom: 1px solid var(--line);
    }
    .site-nav.is-open { display: flex; }
    .site-nav ul { flex-direction: column; gap: 0.75rem; }
}

/* ---------- Blocks ---------- */

.block { padding-block: var(--section-y); }
.block.tone-muted { background: var(--paper-muted); }
.block.tone-dark { background: var(--primary); color: #fff; }
.block.tone-dark a { color: #fff; }
.block.tone-accent { background: var(--accent); color: var(--primary); }

.eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.lead { font-size: var(--step-1); color: var(--ink-soft); max-width: var(--measure); }
.tone-dark .lead { color: rgba(255, 255, 255, 0.82); }
.section-intro { max-width: var(--measure); color: var(--ink-soft); }

.hero { background: var(--primary); color: #fff; position: relative; }
.hero h1 { font-size: var(--step-5); max-width: 20ch; }
.hero .lead { color: rgba(255, 255, 255, 0.82); }

.hero.has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--hero-image);
    background-size: cover;
    background-position: center;
    /* Dimmed rather than shown at full strength: the headline has to stay
       readable over whatever photograph gets uploaded, and no upload rule can
       guarantee a dark one. */
    opacity: 0.28;
}
.hero-inner { position: relative; }

.prose { max-width: none; }
.prose .wrap { max-width: var(--measure); }
.prose h2 { margin-top: 1.5em; }

.buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}
.btn-primary { background: var(--accent); color: var(--primary); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: currentColor; }
.btn-ghost:hover { background: rgba(127, 127, 127, 0.1); }

.grid { display: grid; gap: 1.5rem; list-style: none; padding: 0; margin: 2rem 0 0; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.tone-muted .card { background: var(--paper); }
.card h3 { margin-bottom: 0.4rem; }
.card p { margin: 0; color: var(--ink-soft); }

/* Specs read as label over value, borrowed from a datasheet rather than a
   marketing page — which is what the audience actually reads. */
.spec-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 2rem 0 0; }
.spec-list.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.spec-list.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.spec-list.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
.spec { background: var(--paper); padding: 1rem 1.25rem; }
.spec dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.spec dd { margin: 0.25rem 0 0; font-weight: 600; font-size: var(--step-1); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 1.5rem; }
.steps li { counter-increment: step; padding-inline-start: 3.25rem; position: relative; }
.steps li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    font-weight: 800;
    font-size: var(--step-1);
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

.stat-row { display: flex; flex-wrap: wrap; gap: 3rem; list-style: none; padding: 0; margin: 0; }
.stat-value { display: block; font-size: var(--step-4); font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { display: block; font-size: 0.9rem; opacity: 0.8; }

.accordion { margin-top: 2rem; border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary { padding: 1.1rem 0; font-weight: 600; cursor: pointer; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; float: inline-end; color: var(--accent); font-weight: 800; }
.accordion details[open] summary::after { content: '−'; }
.accordion .answer { padding-bottom: 1.1rem; color: var(--ink-soft); max-width: var(--measure); }

.quote blockquote { font-size: var(--step-2); line-height: 1.4; margin: 0; border-inline-start: 3px solid var(--accent); padding-inline-start: 1.5rem; }
.quote figcaption { margin-top: 1rem; color: var(--ink-soft); font-size: 0.9rem; }

.table-scroll { overflow-x: auto; margin-top: 2rem; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; }
th, td { text-align: start; padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--paper-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

.cert-row { display: flex; flex-wrap: wrap; gap: 0.75rem; list-style: none; padding: 0; margin: 2rem 0 0; }
.cert-row li { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem 1rem; font-weight: 600; font-size: 0.9rem; }

.contact-list { display: grid; gap: 1.25rem; margin: 2rem 0 0; }
.contact-list dt { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); }
.contact-list dd { margin: 0.2rem 0 0; font-weight: 600; }

.map-frame { margin-top: 2rem; aspect-ratio: 16 / 9; }
.map-frame iframe { width: 100%; height: 100%; border: 0; }

.block-divider { border: 0; border-top: 1px solid var(--line); margin: 0; }

.article-list { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: 2rem; }
.article-list time { display: block; font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 0.4rem; }

/* ---------- Products ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 0; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 1rem; text-decoration: none; font-size: 0.9rem; }
.chip.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.product-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); display: flex; flex-direction: column; }
.product-card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.product-body { padding: 1.25rem; display: flex; flex-direction: column; flex: 1; }
.product-card h3 { font-size: var(--step-0); margin-bottom: 0.3rem; }
.product-card h3 a { text-decoration: none; }
.product-card h3 a:hover { text-decoration: underline; }

.sku { font-size: 0.78rem; letter-spacing: 0.08em; color: var(--ink-soft); margin: 0 0 0.6rem; font-variant-numeric: tabular-nums; }
.summary { color: var(--ink-soft); font-size: 0.92rem; }

.price { font-weight: 800; font-size: var(--step-1); margin: auto 0 0; color: var(--primary); }
.price.large { font-size: var(--step-3); margin: 1rem 0; }

/* Visually quieter than a price, because it is not one. Styling it like a
   figure would suggest the number is being withheld rather than that it
   depends on the order. */
.price-on-request { margin: auto 0 0; color: var(--ink-soft); font-size: 0.92rem; font-style: italic; }

.media-placeholder {
    aspect-ratio: 4 / 3;
    display: grid;
    place-items: center;
    font-size: 2.5rem;
    background: var(--paper-muted);
    color: var(--line);
}

.mini-specs { display: grid; gap: 0.3rem; margin: 0.75rem 0; font-size: 0.85rem; }
.mini-specs div { display: flex; gap: 0.5rem; justify-content: space-between; border-bottom: 1px dotted var(--line); padding-bottom: 0.2rem; }
.mini-specs dt { color: var(--ink-soft); }
.mini-specs dd { margin: 0; font-weight: 600; }

.product-layout { display: grid; gap: 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); margin-top: 2rem; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.5rem; font-size: 0.85rem; color: var(--ink-soft); }
.breadcrumb a { text-decoration: none; }
.breadcrumb a::after { content: '/'; margin-inline-start: 0.5rem; opacity: 0.5; }
.trade-terms { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: 0.9rem; color: var(--ink-soft); }
.category-card a { text-decoration: none; display: block; text-align: center; }
.cat-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.empty { margin-top: 2rem; color: var(--ink-soft); }

/* ---------- Forms ---------- */

.lead-form { margin-top: 2rem; display: grid; gap: 1.25rem; }
.field { display: grid; gap: 0.4rem; }
.field-row { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input, .field textarea {
    font: inherit;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    /* Inherits the document direction, so an Arabic form is right-aligned and
       an English one is not, without a rule for either. */
    width: 100%;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field-note { font-size: 0.85rem; color: var(--ink-soft); margin: -0.5rem 0 0; }

/* Off-screen rather than display:none. Some automated submitters skip hidden
   inputs, and the point is that they fill this one. */
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-errors { border-inline-start: 3px solid #c0392b; background: #fdf2f0; padding: 1rem 1.25rem; margin-top: 1.5rem; }
.form-errors ul { margin: 0; padding-inline-start: 1.2rem; }

.flash {
    background: var(--primary);
    color: #fff;
    padding: 1rem 1.5rem;
    text-align: center;
}

/* ---------- Footer ---------- */

.site-footer { background: var(--primary); color: rgba(255, 255, 255, 0.78); padding-block: var(--section-y) 2rem; margin-top: var(--section-y); }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.footer-mark { max-height: 44px; margin-bottom: 1rem; }
.footer-name { color: #fff; font-weight: 800; font-size: var(--step-1); margin-bottom: 0.3rem; }
.footer-tagline { font-size: 0.9rem; }
.footer-address { font-style: normal; font-size: 0.9rem; margin-bottom: 1rem; }
.footer-contact { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; font-size: 0.9rem; }
.footer-col h2 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; font-size: 0.92rem; }
.footer-base { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, 0.15); font-size: 0.85rem; }
.social { display: flex; gap: 1rem; list-style: none; padding: 0; margin: 0; }
.footer-note { margin-top: 1rem; font-size: 0.82rem; opacity: 0.7; }

/* ---------- WhatsApp bubble ---------- */

.wa-bubble {
    position: fixed;
    bottom: 1.25rem;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: #25d366;
    color: #fff;
    padding: 0.85rem 1.25rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
}
/* Physical properties here, deliberately: the operator picks a side in the
   Site Builder and that choice must hold whichever way the text runs. */
.wa-left { left: 1.25rem; }
.wa-right { right: 1.25rem; }
.wa-bubble:hover { filter: brightness(1.06); }

@media (max-width: 600px) {
    /* The icon is enough on a phone, and a label wide enough to read is wide
       enough to cover the content behind it. */
    .wa-label { display: none; }
    .wa-bubble { padding: 0.9rem; }
}

@media print {
    .site-header, .site-footer, .wa-bubble, .buttons, .skip-link { display: none; }
    body { color: #000; }
}
