/* ==========================================================================
   Imad Jewelry — Noir & Gold
   Mobile-first. Logical properties used so RTL flips automatically.
   ========================================================================== */

:root {
    --gold: #DFAC53;
    --gold-light: #F8D987;
    --gold-dark: #8C5D1D;
    --background: #0B0B0B;
    --surface: #161616;
    --text: #F5F0E6;
    --muted: #8A8478;
    --border: rgba(223, 172, 83, 0.25);
    --gold-gradient: linear-gradient(135deg, #8C5D1D, #F8D987 50%, #8C5D1D);

    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Jost', sans-serif;

    --container-width: 1200px;
    --radius: 2px;
}

html[lang="ar"] {
    --font-heading: 'Amiri', serif;
    --font-body: 'Tajawal', sans-serif;
}

* { box-sizing: border-box; }

/* ---------- Icon safety net: an <svg> with no explicit size renders at the
   browser default (300x150) — icon() always sets width/height, this is the
   belt-and-braces CSS layer so nothing can ever balloon again. ---------- */
svg { max-width: 100%; }

.icon {
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
    width: 1em;
    height: 1em;
    color: currentColor;
}

button .icon, a .icon { width: 18px; height: 18px; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
}

.icon-btn .icon { width: 18px; height: 18px; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body {
    font-size: 17px;
    line-height: 1.9;
}

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

a {
    color: var(--gold);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, a:focus-visible { color: var(--gold-light); }

h1, h2 {
    font-family: var(--font-heading);
    font-weight: 500;
    margin: 0 0 0.5em;
    letter-spacing: 0.02em;
    color: var(--gold); /* fallback for browsers without background-clip: text */
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3, h4 {
    font-family: var(--font-heading);
    font-weight: 500;
    margin: 0 0 0.5em;
    letter-spacing: 0.02em;
    color: var(--text);
}

html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4 {
    letter-spacing: 0;
    font-weight: 700;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; }

.container {
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: 20px;
}

/* Recurring diamond motif */
.diamond {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--gold);
    transform: rotate(45deg);
    box-shadow: 0 0 8px color-mix(in srgb, var(--gold) 60%, transparent);
    margin-inline: 10px;
}

.hairline {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: 1px solid var(--gold);
    color: var(--gold);
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
    border-radius: var(--radius);
}

html[lang="ar"] .btn {
    letter-spacing: 0;
    text-transform: none;
}

.btn:hover, .btn:focus-visible {
    background: var(--gold-gradient);
    color: var(--background);
    border-color: transparent;
}

.btn-whatsapp {
    background: var(--gold-gradient);
    color: var(--background);
    border: none;
    font-weight: 600;
}

.btn-whatsapp:hover { opacity: 0.9; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--background) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 14px;
    gap: 20px;
}

.logo img { height: 42px; }

.main-nav {
    display: none;
    gap: 28px;
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

html[lang="ar"] .main-nav { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }

.main-nav a { position: relative; padding-block: 4px; color: var(--text); }
.main-nav a:hover { color: var(--gold); }

.lang-switch {
    display: flex;
    gap: 6px;
    font-size: 0.8rem;
    align-items: center;
}

.lang-switch a { color: var(--muted); }
.lang-switch a.is-active { color: var(--gold); font-weight: 600; }
.lang-switch a:hover { color: var(--gold-light); }

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 22px;
    height: 1px;
    background: var(--gold);
}

.main-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    background: var(--surface);
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

@media (min-width: 860px) {
    .main-nav { display: flex; }
    .nav-toggle { display: none; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero--fallback { background: var(--background); }

.hero__bg {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    padding-block: 60px;
}

/* Sits over a photo: kept as solid text (not gradient-clipped) for legibility */
.hero__title {
    font-size: 2.4rem;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: var(--text);
}

.hero__text { max-width: 540px; margin-inline: auto; color: var(--text); opacity: 0.9; }

@media (min-width: 768px) {
    .hero__title { font-size: 3.4rem; }
}

/* ---------- Sections ---------- */
.section { padding-block: 60px; }
.section__title { text-align: center; margin-bottom: 40px; }
.section__title .diamond { vertical-align: middle; }

/* ---------- Product grid ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (min-width: 640px) {
    .grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

@media (min-width: 1024px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}

.product-card-wrap { position: relative; }

.product-card {
    position: relative;
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color 0.3s ease;
    color: var(--text); /* overrides the global gold link color: this is a card, not a text link */
}

.product-card:hover { border-color: var(--gold); }

.product-card__wa {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 3;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--background) 70%, transparent);
    border: 1px solid var(--gold);
    color: var(--gold);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.product-card__wa svg { width: 16px; height: 16px; }

.product-card__wa:hover, .product-card__wa:focus-visible {
    background: var(--gold-gradient);
    color: var(--background);
    border-color: transparent;
}

.product-card__media {
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s ease;
}

.product-card:hover .product-card__media img { transform: scale(1.08); }

.product-card__body { padding: 14px; }

.product-card__name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin: 0 0 4px;
    color: var(--text);
}

.product-card__price { color: var(--gold-light); font-size: 0.9rem; }
.product-card__price[dir="ltr"] { unicode-bidi: isolate; }

.badge {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    background: var(--background);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 10px;
    z-index: 2;
}

html[lang="ar"] .badge { letter-spacing: 0; text-transform: none; }

/* ---------- Category tiles ---------- */
.category-tile {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    background: var(--surface);
    color: var(--text);
}

.category-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s ease;
}

.category-tile:hover img { transform: scale(1.06); }

.category-tile__label {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 16px;
    background: linear-gradient(to top, color-mix(in srgb, var(--background) 80%, transparent), transparent);
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--text);
}

/* ---------- Filters / forms ---------- */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

select, input[type="text"], input[type="email"], textarea {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    font-family: var(--font-body);
    border-radius: var(--radius);
}

select:focus, input[type="text"]:focus, input[type="email"]:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 25%, transparent);
}

label { display: block; margin-bottom: 6px; font-size: 0.85rem; color: var(--muted); }

form .field { margin-bottom: 18px; }

/* ---------- Product page ---------- */
.product-page {
    display: grid;
    gap: 30px;
    padding-block: 40px;
}

@media (min-width: 900px) {
    .product-page { grid-template-columns: 1.1fr 1fr; align-items: start; }
}

.gallery__main {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: zoom-in;
}

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

.gallery__thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    overflow-x: auto;
}

.gallery__thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 1px solid transparent;
    cursor: pointer;
    opacity: 0.6;
}

.gallery__thumbs img.is-active { border-color: var(--gold); opacity: 1; }

.product-info__ref {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.product-info__price {
    font-size: 1.6rem;
    color: var(--gold-light);
    font-family: var(--font-heading);
    margin-bottom: 10px;
}

.product-info__material { color: var(--muted); margin-bottom: 20px; }

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--gold);
    color: var(--gold-light);
    margin-bottom: 16px;
}

html[lang="ar"] .status-pill { letter-spacing: 0; text-transform: none; }

.status-pill.is-sold { border-color: var(--muted); color: var(--muted); }

.product-order { margin: 24px 0; }

.btn-order-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--gold-gradient);
    color: var(--background);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--radius);
    transition: opacity 0.25s ease;
}

html[lang="ar"] .btn-order-whatsapp { letter-spacing: 0; text-transform: none; }

.btn-order-whatsapp:hover, .btn-order-whatsapp:focus-visible { opacity: 0.9; color: var(--background); }

.btn-order-whatsapp svg { width: 22px; height: 22px; flex-shrink: 0; }

.product-order-similar { margin: 24px 0; }
.product-order-similar a { color: var(--gold); }
.product-order-similar a:hover { color: var(--gold-light); }

@media (max-width: 640px) {
    .product-sticky-cta {
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 60;
        margin: 0;
        padding: 12px 16px;
        background: color-mix(in srgb, var(--background) 94%, transparent);
        backdrop-filter: blur(6px);
        border-top: 1px solid var(--border);
    }

    .product-sticky-cta .btn-order-whatsapp { width: 100%; justify-content: center; }

    /* Reserve space so the sticky bar never covers the page's own content */
    body:has(.product-sticky-cta) { padding-bottom: 84px; }
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 40px;
    margin-top: 60px;
    background: var(--surface);
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.site-footer__nav a { color: var(--gold); }
.site-footer__nav a:hover { color: var(--gold-light); }

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-size: 0.85rem;
}

.site-footer__copy { color: var(--muted); font-size: 0.8rem; }

/* ---------- Social icons (footer + contact page) ---------- */
.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    color: var(--gold);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.social-icon svg { width: 18px; height: 18px; }

.social-icon:hover, .social-icon:focus-visible {
    background: var(--gold-gradient);
    color: var(--background);
    border-color: transparent;
}

/* Contact page: icon + network name side by side */
.social-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.social-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.social-list__item:hover { color: var(--gold); }
.social-list__item:hover .social-icon { background: var(--gold-gradient); color: var(--background); border-color: transparent; }

/* ---------- Fade-up on scroll ---------- */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-up.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Contact ---------- */
.contact-grid {
    display: grid;
    gap: 40px;
}

@media (min-width: 768px) {
    .contact-grid { grid-template-columns: 1fr 1fr; }
}

.contact-list a { display: block; margin-bottom: 14px; color: var(--gold); }
.contact-list a:hover { color: var(--gold-light); }

.alert {
    padding: 14px 18px;
    border: 1px solid var(--gold);
    margin-bottom: 20px;
}

/* Success/error are semantic status colors, intentionally distinct from the brand gold palette
   so visitors can tell a success message from a failure at a glance. */
.alert-error { border-color: #e07a5f; color: #e07a5f; }
.alert-success { border-color: #6fae6f; color: #a8d5a8; }

/* ---------- Pagination / empty state ---------- */
.empty-state {
    text-align: center;
    color: var(--muted);
    padding-block: 60px;
}

/* dir=ltr isolate helper for prices/phone numbers inside RTL pages */
[dir="ltr"].isolate { unicode-bidi: isolate; }
