/* ==========================================================================
   Faia Store - public storefront
   --------------------------------------------------------------------------
   Same palette as the admin panel and the mobile app, sampled from the logo:
     charcoal #0E0E0E, gold #D4AC78, white #F8F8F8.

   Single stylesheet, no build step, no framework. Gold is an accent only.
   ========================================================================== */

:root {
    --ink: #0e0e0e;
    --ink-2: #161616;
    --ink-3: #242424;

    --gold: #d4ac78;
    --gold-strong: #c09560;
    --gold-deep: #a87c42;
    --gold-ink: #8a6534;
    --gold-wash: #faf4ea;

    --bg: #f7f7f5;
    --surface: #ffffff;
    --surface-2: #fbfbf9;
    --border: #e7e5e0;
    --text: #1a1a1a;
    --muted: #6b6b6b;

    --success: #2e7d5b;
    --danger: #c0392b;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(14,14,14,.04), 0 10px 30px rgba(14,14,14,.07);
    --shadow-sm: 0 1px 3px rgba(14,14,14,.06);

    --container: 1200px;
    --font: "Tajawal", "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

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

h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 4px; }

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

/* Skip link for keyboard and screen-reader users. */
.skip-link {
    position: absolute; inset-inline-start: -9999px; top: 0;
    background: var(--ink); color: #fff; padding: 12px 20px; z-index: 200;
}
.skip-link:focus { inset-inline-start: 0; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header__bar {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 74px;
}

.site-header__logo { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.site-header__logo img { width: 42px; height: 42px; border-radius: 11px; }
.site-header__name { font-size: 19px; font-weight: 700; line-height: 1.15; }
.site-header__tag { font-size: 10.5px; letter-spacing: .18em; color: var(--gold); }

.site-nav { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; }
.site-nav a {
    padding: 8px 14px; border-radius: 9px; font-size: 15px; font-weight: 500; color: #d6d6d6;
    transition: background .15s, color .15s;
}
.site-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-nav a.is-active { color: #fff; background: rgba(212,172,120,.16); }

.site-search { flex: 1 1 260px; max-width: 380px; position: relative; }
.site-search input {
    width: 100%; padding: 10px 40px 10px 14px;
    border-radius: 999px; border: 1px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.07); color: #fff;
    font-family: inherit; font-size: 14.5px; min-height: 42px;
}
.site-search input::placeholder { color: #9a9a9a; }
.site-search input:focus { outline: none; border-color: var(--gold); background: rgba(255,255,255,.12); }
.site-search button {
    position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
    background: none; border: 0; color: var(--gold); cursor: pointer; padding: 6px;
    display: flex; align-items: center;
}

.header-toggle {
    display: none; background: none; border: 1px solid rgba(255,255,255,.2);
    color: #fff; border-radius: 9px; width: 42px; height: 42px;
    align-items: center; justify-content: center; cursor: pointer;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 22px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
    min-height: 46px; transition: background .15s, border-color .15s;
}
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--gold:hover { background: var(--gold-strong); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--ink-3); }
.btn--outline { border-color: var(--border); background: var(--surface); }
.btn--outline:hover { background: var(--surface-2); border-color: var(--gold-deep); }
.btn--light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.22); }
.btn--whatsapp { background: #1fa855; color: #fff; }
.btn--whatsapp:hover { background: #188544; }
.btn--sm { padding: 7px 14px; min-height: 38px; font-size: 14px; }
.btn--block { width: 100%; }

/* ==========================================================================
   Hero / banners
   ========================================================================== */

.hero {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--ink);
    margin: 26px 0;
    min-height: 300px;
    display: flex;
    align-items: flex-end;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.hero__body {
    position: relative; padding: 34px; color: #fff; max-width: 620px;
    background: linear-gradient(to top, rgba(14,14,14,.92), rgba(14,14,14,0));
    width: 100%;
}
.hero__title { font-size: clamp(24px, 4vw, 38px); margin-bottom: 8px; }
.hero__sub { color: #ddd; font-size: 17px; margin-bottom: 18px; }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { margin: 44px 0; }
.section__head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.section__title { font-size: 22px; position: relative; padding-inline-start: 14px; }
.section__title::before {
    content: ""; position: absolute; inset-inline-start: 0; top: 50%;
    transform: translateY(-50%); width: 4px; height: 22px;
    background: var(--gold); border-radius: 3px;
}
.section__link { margin-inline-start: auto; font-size: 14.5px; font-weight: 600; color: var(--gold-ink); }
.section__link:hover { text-decoration: underline; }

/* ==========================================================================
   Product cards
   ========================================================================== */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 18px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .18s ease, transform .18s ease;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.product-card__media { position: relative; background: var(--surface-2); }
.product-card__media img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.product-card__badge {
    position: absolute; top: 10px; inset-inline-start: 10px;
    background: var(--gold); color: var(--ink);
    font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.product-card__badge--out { background: var(--ink); color: #fff; }

.product-card__body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.product-card__cat { font-size: 12.5px; color: var(--muted); }
.product-card__name {
    font-size: 15px; font-weight: 600; margin: 3px 0 9px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 45px;
}
.product-card__prices { margin-top: auto; display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }

.price { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.price--old { font-size: 13.5px; color: var(--muted); text-decoration: line-through; font-weight: 500; }

/* ==========================================================================
   Product detail
   ========================================================================== */

.product-layout { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; margin: 28px 0; }

.gallery__main {
    border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--border); background: var(--surface);
}
.gallery__main img { width: 100%; aspect-ratio: 1; object-fit: cover; }

.gallery__thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.gallery__thumb {
    width: 74px; height: 74px; border-radius: var(--radius-sm); overflow: hidden;
    border: 2px solid var(--border); cursor: pointer; background: var(--surface); padding: 0;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb.is-active { border-color: var(--gold-deep); }

.product-detail__cat { color: var(--muted); font-size: 14.5px; }
.product-detail__title { font-size: clamp(22px, 3vw, 30px); margin: 6px 0 14px; }

.price-row {
    display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
    padding: 18px 0; border-block: 1px solid var(--border); margin-bottom: 18px;
}
.price-row .price { font-size: 30px; color: var(--ink); }
.price-row .price--old { font-size: 17px; }

.discount-pill {
    background: var(--gold-wash); color: var(--gold-ink);
    border: 1px solid rgba(168,124,66,.26);
    padding: 4px 13px; border-radius: 999px; font-weight: 700; font-size: 14px;
}

.stock-pill {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 14.5px; font-weight: 600; padding: 5px 13px; border-radius: 999px;
}
.stock-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock-pill--in { background: #e8f5ef; color: var(--success); }
.stock-pill--low { background: #fdf3e0; color: #b07d12; }
.stock-pill--out { background: #fdeceb; color: var(--danger); }

.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: 9px 20px; font-size: 15px; }
.spec-list dt { color: var(--muted); }
.spec-list dd { margin: 0; font-weight: 500; }

.prose { line-height: 1.95; }
.prose p { margin-bottom: 1.1rem; }

/* The "open in the app" call to action: the web page exists mostly for
   discovery, ordering happens in the Android app. */
.app-cta {
    background: var(--ink); color: #fff; border-radius: var(--radius);
    padding: 22px; margin-top: 22px;
    border-inline-start: 4px solid var(--gold);
}
.app-cta__title { color: var(--gold); font-size: 16px; margin-bottom: 6px; }
.app-cta__text { color: #cfcfcf; font-size: 14.5px; margin-bottom: 14px; }

/* ==========================================================================
   Categories
   ========================================================================== */

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 16px; }

.category-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 14px; text-align: center;
    transition: border-color .18s, box-shadow .18s;
}
.category-card:hover { border-color: var(--gold-deep); box-shadow: var(--shadow-sm); }
.category-card img, .category-card__icon {
    width: 62px; height: 62px; border-radius: 17px; object-fit: cover;
    margin: 0 auto 12px; background: var(--gold-wash);
    display: flex; align-items: center; justify-content: center; color: var(--gold-ink);
}
.category-card__name { font-weight: 600; font-size: 15px; }
.category-card__count { font-size: 12.5px; color: var(--muted); }

/* ==========================================================================
   Breadcrumb, filters, pagination, states
   ========================================================================== */

.breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a:hover { color: var(--gold-ink); }
.breadcrumb span[aria-current] { color: var(--text); font-weight: 500; }

.toolbar {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 18px; margin-bottom: 22px;
}
.toolbar select, .toolbar input {
    padding: 9px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border);
    font-family: inherit; font-size: 14.5px; background: var(--surface); min-height: 42px;
}

.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 32px 0; }
.pagination a, .pagination span {
    min-width: 40px; height: 40px; padding: 0 13px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface);
    display: inline-flex; align-items: center; justify-content: center; font-size: 14.5px;
}
.pagination a:hover { border-color: var(--gold-deep); }
.pagination .is-current { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .is-disabled { opacity: .45; }

.empty-state { text-align: center; padding: 70px 20px; }
.empty-state__icon {
    width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 19px;
    background: var(--gold-wash); color: var(--gold-ink);
    display: flex; align-items: center; justify-content: center;
}
.empty-state__title { font-size: 19px; margin-bottom: 7px; }
.empty-state__text { color: var(--muted); max-width: 420px; margin: 0 auto 20px; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--ink); color: #c9c9c9; margin-top: 64px; padding: 48px 0 26px; }
.site-footer a:hover { color: var(--gold); }

.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 34px; }
.footer-title { color: #fff; font-size: 15.5px; margin-bottom: 14px; }
.footer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; font-size: 14.5px; }

.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand img { width: 46px; height: 46px; border-radius: 12px; }
.footer-brand__name { color: #fff; font-size: 18px; font-weight: 700; }
.footer-brand__tag { font-size: 10.5px; letter-spacing: .18em; color: var(--gold); }

.social-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.social-row a {
    width: 40px; height: 40px; border-radius: 11px;
    border: 1px solid rgba(255,255,255,.14);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: #d0d0d0;
}
.social-row a:hover { border-color: var(--gold); color: var(--gold); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1); margin-top: 34px; padding-top: 20px;
    display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 13.5px;
}

/* Floating WhatsApp button - the store's only "checkout" channel. */
.wa-float {
    position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 90;
    width: 56px; height: 56px; border-radius: 50%; background: #1fa855; color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 22px rgba(31,168,85,.38);
}
.wa-float:hover { background: #188544; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .product-layout { grid-template-columns: 1fr; gap: 26px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 820px) {
    .header-toggle { display: flex; }
    .site-nav {
        display: none; position: absolute; top: 74px; inset-inline: 0;
        background: var(--ink-2); flex-direction: column; padding: 12px;
        border-top: 1px solid rgba(255,255,255,.1); gap: 2px;
    }
    .site-nav.is-open { display: flex; }
    .site-nav a { padding: 12px 14px; }
    .site-search { order: 3; flex-basis: 100%; max-width: none; margin-bottom: 12px; }
    .site-header__bar { flex-wrap: wrap; height: auto; padding: 14px 0; }
}

@media (max-width: 640px) {
    body { font-size: 15px; }
    .container { padding: 0 16px; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
    .category-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
    .hero { min-height: 230px; }
    .hero__body { padding: 22px; }
    .footer-grid { grid-template-columns: 1fr; }
    .section { margin: 32px 0; }
    .price-row .price { font-size: 25px; }
    .spec-list { grid-template-columns: 1fr; gap: 2px 0; }
    .spec-list dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
