/* =========================================================
   El3omda - public stylesheet
   Mobile-first, professional, brand: black + gold + white
   ========================================================= */

:root {
    --bg:        #f7f7f8;
    --surface:   #ffffff;
    --ink:       #161616;
    --ink-soft:  #4a4a4a;
    --muted:     #7a7a7a;
    --line:      #e6e6e6;

    --brand:     #0b0b0b;     /* logo black */
    --brand-2:   #1f1f1f;
    --gold:      #c9a24a;     /* logo gold */
    --gold-2:    #b08a31;

    --danger:    #c0392b;
    --warn:      #d68b18;
    --ok:        #1f8a4c;

    --radius:    14px;
    --radius-sm: 10px;
    --shadow:    0 4px 16px rgba(0,0,0,.06);
    --shadow-lg: 0 12px 30px rgba(0,0,0,.12);

    --max:       1200px;
    --gap:       16px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans",
                 sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
body.is-rtl {
    font-family: "Cairo", "Segoe UI", "Tahoma", "Arial", sans-serif;
}

/* Language switcher (both LTR and RTL) */
.lang-switch { display: inline-flex; gap: 6px; align-items: center; }
.lang-switch .lang-link {
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 600;
    color: inherit;
    opacity: .8;
    text-decoration: none;
}
.lang-switch .lang-link:hover { opacity: 1; }
.lang-switch .lang-link.is-active {
    background: var(--gold);
    color: #fff;
    border-color: var(--gold);
    opacity: 1;
}
.lang-switch-admin .lang-link {
    border-color: var(--line);
    color: var(--ink);
}
.hide-mobile { display: none; }
@media (min-width: 768px) { .hide-mobile { display: inline; } }

/* secondary nav links (Register, Client login) */
.nav-secondary { font-size: .92rem; opacity: .9; }
.nav-secondary:hover { color: var(--gold); }

/* radio inline (payment type) */
.radio-inline { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 16px; font-weight: 500; }
.radio-inline input { width: auto; }

/* payment fieldset */
.payment-fs { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; margin: 8px 0; }
.payment-fs legend { padding: 0 6px; font-weight: 700; color: var(--ink); }

/* quick-client details */
.quick-client { margin: 4px 0 12px; }
.quick-client summary { cursor: pointer; font-size: .9rem; }

/* form-inline-grid (used inside unit edit) */
.form-inline-grid {
    display: grid; gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.form-inline-grid label { margin: 0; font-weight: 500; font-size: .88rem; }
.form-inline-grid input, .form-inline-grid select, .form-inline-grid textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); background: #fff; font-family: inherit; font-size: .92rem;
}
.form-inline-grid .form-actions { grid-column: 1 / -1; }

/* wider auth card for register form */
.auth-card-wide { max-width: 540px; }
.auth-card-wide label { display: block; text-align: start; }

/* product card: installment badge */
.installment-tag {
    display: inline-block; background: #fff3df; color: var(--gold-2);
    font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
    margin-inline-start: 4px;
}

/* live installment summary + schedule (sales form) */
.inst-summary {
    display: grid; gap: 8px; margin: 12px 0 6px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.inst-summary > div {
    background: #fafafa; border: 1px solid var(--line);
    border-radius: var(--radius-sm); padding: 8px 10px;
    display: flex; flex-direction: column; gap: 2px;
}
.inst-summary span {
    color: var(--muted); font-size: .72rem;
    text-transform: uppercase; letter-spacing: .04em;
}
.inst-summary strong { color: var(--brand); font-size: 1rem; }
.inst-summary .grand {
    background: linear-gradient(135deg, #fff3df, #faecc4);
    border-color: var(--gold);
}
.inst-summary .grand strong { color: var(--gold-2); }

.inst-schedule {
    margin-top: 8px; max-height: 320px; overflow: auto;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.inst-schedule:empty { display: none; }
.inst-table { margin: 0; font-size: .9rem; }
.inst-table th {
    position: sticky; top: 0; background: #fafafa; z-index: 1;
}
.inst-table td:first-child { color: var(--muted); width: 56px; }
.inst-table td:last-child  { font-weight: 700; }

/* purchase line items */
.purchase-line {
    position: relative;
    background: #fafafa;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 14px 8px;
    margin-bottom: 12px;
}
.purchase-line .line-remove {
    position: absolute; top: 6px; inset-inline-end: 8px;
    background: transparent; border: 0; cursor: pointer;
    width: 28px; height: 28px; border-radius: 50%;
    color: var(--danger); font-size: 1.1rem;
}
.purchase-line .line-remove:hover { background: #fde2e2; }
.purchase-line .row { grid-template-columns: 2fr 1fr 1fr 1fr; }
.purchase-line .serial-block { margin-top: 6px; }
.purchase-line .serial-block textarea { font-family: ui-monospace, "Cascadia Code", monospace; font-size: .85rem; }

/* print */
@media print {
    .admin-sidebar, .admin-topbar, .form-actions, .toolbar { display: none !important; }
    .admin-content { padding: 0 !important; }
    .card { border: 0 !important; box-shadow: none !important; }
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-2); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.section   { padding: 32px 0; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.kicker { letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; color: var(--gold); font-weight: 600; }

/* ========================== HEADER ========================== */
.site-header {
    background: var(--brand);
    color: #fff;
    position: sticky; top: 0; z-index: 50;
    box-shadow: var(--shadow);
}
.site-header .nav {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 800; font-size: 1.1rem; color: #fff;
}
.brand img { width: 36px; height: 36px; }
.brand-light { color: #fff; }

.nav-links {
    display: none;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--brand-2); padding: 12px 16px;
    flex-direction: column; gap: 4px;
    box-shadow: var(--shadow-lg);
}
.nav-links a {
    color: #fff; padding: 12px 4px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav-links a:last-child { border-bottom: 0; }
body.nav-open .nav-links { display: flex; }

.nav-toggle {
    background: transparent; border: 0; color: #fff;
    width: 40px; height: 40px; padding: 8px;
    display: inline-flex; flex-direction: column; gap: 5px; cursor: pointer;
}
.nav-toggle span {
    display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px;
}

/* ========================== BUTTONS ========================== */
.btn-primary, .btn-outline, .btn-outline-light, .btn-danger {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 999px;
    font-weight: 600; font-size: .95rem;
    border: 1px solid transparent; cursor: pointer; transition: .2s;
    text-decoration: none;
}
.btn-primary       { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-2); border-color: var(--gold-2); color: #fff; }
.btn-outline       { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-outline-light { background: transparent; border-color: #fff; color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--brand); }
.btn-danger        { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #a82e22; color: #fff; }
.btn-block { width: 100%; }
.link        { color: var(--gold-2); font-weight: 600; }
.link-danger { color: var(--danger); background: transparent; border: 0; cursor: pointer; padding: 0; font: inherit; }

/* ========================== HERO ========================== */
.hero {
    background:
        radial-gradient(1200px 400px at 20% 10%, rgba(201,162,74,.18), transparent),
        linear-gradient(135deg, #0b0b0b, #1f1f1f);
    color: #fff; padding: 56px 0 48px;
}
.hero-inner {
    display: grid; gap: 28px; align-items: center;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 6px 0 12px; }
.hero .lead { color: rgba(255,255,255,.78); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.hero-art { display: flex; justify-content: center; }
.hero-logo {
    width: min(280px, 60vw); filter: drop-shadow(0 10px 30px rgba(0,0,0,.45));
}

/* ========================== CATEGORY GRID ========================== */
.cat-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr));
    gap: 16px;
}
.cat-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; display: flex; flex-direction: column; gap: 10px;
    transition: .2s;
}
.cat-card:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--gold);
}
.cat-icon {
    width: 48px; height: 48px; border-radius: 12px; background: var(--brand);
    color: var(--gold); display: grid; place-items: center; font-weight: 800;
}
.cat-card h3 { margin: 0; }

/* ========================== PRODUCT GRID ========================== */
.product-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.product-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: .2s;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.product-thumb {
    position: relative; display: block; background: #f1f1f3;
    aspect-ratio: 4/3; overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.product-card:hover .product-thumb img { transform: scale(1.04); }

.ribbon {
    position: absolute; top: 10px; left: 10px;
    background: var(--gold); color: #fff;
    padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
}
.ribbon-dark { background: var(--brand); }
.ribbon-amber { background: var(--warn); }

.product-info { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.product-info h3 { margin: 4px 0 0; font-size: 1.02rem; line-height: 1.35; }
.product-info h3 a { color: var(--ink); }
.product-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 6px; }
.price { color: var(--brand); font-weight: 800; font-size: 1.05rem; }
.price small { color: var(--muted); font-weight: 500; }

/* ========================== PRODUCT DETAIL ========================== */
.crumbs { color: var(--muted); margin-bottom: 16px; }
.product-detail {
    display: grid; gap: 24px;
    grid-template-columns: 1fr;
}
.product-gallery img {
    width: 100%; aspect-ratio: 4/3; object-fit: cover;
    border-radius: var(--radius); border: 1px solid var(--line); background: #f1f1f3;
}
.product-body h1 { margin: 6px 0 8px; }
.price-block {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px; margin: 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
}
.price-main { font-size: 1.7rem; font-weight: 800; color: var(--brand); }
.price-rent { color: var(--gold-2); font-weight: 600; }
.status-badge {
    padding: 4px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
    text-transform: capitalize; letter-spacing: .02em;
    background: #eef0f2; color: var(--ink);
}
.status-badge.status-available { background: #e3f7eb; color: var(--ok); }
.status-badge.status-sold      { background: #f1f1f1; color: #444; }
.status-badge.status-reserved  { background: #fff3df; color: var(--warn); }
.status-badge.status-rented    { background: #ffeacd; color: var(--warn); }
.status-badge.status-hidden    { background: #fde2e2; color: var(--danger); }
.status-badge.status-active    { background: #e3f7eb; color: var(--ok); }
.status-badge.status-completed { background: #eef0f2; color: var(--ink); }
.status-badge.status-cancelled { background: #fde2e2; color: var(--danger); }

.description { white-space: pre-line; line-height: 1.65; color: var(--ink-soft); margin-top: 12px; }
.contact-cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.share-row {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
    padding-top: 16px; border-top: 1px solid var(--line);
}
.share-row a, .share-row .copy-btn {
    background: #f0f0f2; border: 1px solid var(--line); padding: 6px 12px;
    border-radius: 999px; font-size: .88rem; cursor: pointer; color: var(--ink);
}
.share-row a:hover, .share-row .copy-btn:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ========================== TRUST ========================== */
.trust { padding-bottom: 48px; }
.trust-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.trust-grid > div {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; display: flex; flex-direction: column; gap: 4px;
}
.trust-grid strong { color: var(--brand); }
.trust-grid span.muted { font-size: .92rem; }

/* ========================== EMPTY / ALERTS ========================== */
.empty {
    background: var(--surface); border: 1px dashed var(--line);
    border-radius: var(--radius); padding: 32px; text-align: center; color: var(--muted);
}
.alert {
    border-radius: var(--radius-sm); padding: 12px 16px; margin: 16px 0;
    border: 1px solid transparent;
}
.alert-success { background: #e7f7ee; border-color: #b6e6c7; color: #1c6e3a; }
.alert-error   { background: #fde7e7; border-color: #f3b6b6; color: #882020; }

/* ========================== FORM (public) ========================== */
.shop-head { align-items: center; }
.shop-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-filters input, .shop-filters select {
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
    padding: 8px 14px; font-size: .95rem;
}

/* ========================== AUTH ========================== */
.auth-page { padding: 48px 16px; display: grid; place-items: center; }
.auth-card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 28px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow);
    text-align: center;
}
.auth-logo { width: 80px; height: 80px; margin: 0 auto 8px; }
.auth-card h1 { margin: 4px 0; }
.auth-card label { display: block; text-align: left; font-weight: 600; margin: 12px 0 4px; }
.auth-card input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font-size: 1rem; background: #fafafa;
}
.auth-card input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }

/* ========================== FOOTER ========================== */
.site-footer {
    background: #0b0b0b; color: #cfcfcf; margin-top: 32px;
    padding: 36px 0 14px;
}
.footer-grid {
    display: grid; gap: 22px;
    grid-template-columns: 1fr;
}
.site-footer h4 { color: #fff; margin: 6px 0 12px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin-bottom: 6px; }
.site-footer a { color: #cfcfcf; }
.site-footer a:hover { color: var(--gold); }
.socials { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.socials a {
    width: 36px; height: 36px; display: grid; place-items: center;
    border: 1px solid #333; border-radius: 50%; font-size: .8rem; font-weight: 700;
    color: #fff;
}
.socials a:hover { background: var(--gold); border-color: var(--gold); color: #fff; }
.copyright { padding-top: 18px; border-top: 1px solid #1c1c1c; margin-top: 24px; color: #888; font-size: .88rem; }

/* WhatsApp float */
.wa-float {
    position: fixed; bottom: 18px; right: 18px;
    background: #25d366; color: #fff;
    width: 54px; height: 54px; border-radius: 50%;
    display: grid; place-items: center;
    box-shadow: 0 10px 24px rgba(0,0,0,.25);
    z-index: 60;
}
.wa-float:hover { background: #1eb558; color: #fff; }

/* contact / cards */
.contact-grid {
    display: grid; gap: 18px; grid-template-columns: 1fr;
}
.card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card.no-pad { padding: 0; }
.card h3 { margin-top: 0; }

/* ========================== RESPONSIVE ========================== */
@media (min-width: 768px) {
    .hero-inner { grid-template-columns: 1.2fr 1fr; }
    .nav-toggle { display: none; }
    .nav-links {
        position: static; display: flex !important; flex-direction: row;
        background: transparent; padding: 0; box-shadow: none; gap: 18px;
        align-items: center;
    }
    .nav-links a { padding: 8px 4px; border: 0; }
    .nav-links a.btn-primary, .nav-links a.btn-outline { padding: 8px 16px; }

    .product-detail   { grid-template-columns: 1.1fr 1fr; }
    .footer-grid      { grid-template-columns: 1.4fr 1fr 1fr; }
    .contact-grid     { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}
