/* =========================================================================
   Design tokens — Arabic/English Data Marketplace
   Professional SaaS aesthetic (Stripe/Gumroad-like), per brand brief.
   ========================================================================= */
:root {
    --color-bg: #F8FAFC;
    --color-surface: #FFFFFF;
    --color-primary: #2563EB;
    --color-primary-dark: #1D4ED8;
    --color-primary-light: #EFF6FF;
    --color-text: #0F172A;
    --color-text-muted: #64748B;
    --color-border: #E2E8F0;
    --color-success: #16A34A;
    --color-danger: #DC2626;
    --color-warning: #D97706;
    --radius: 10px;
    --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
    --shadow-md: 0 4px 16px -4px rgb(15 23 42 / 0.10), 0 2px 6px -2px rgb(15 23 42 / 0.06);
    --shadow-lg: 0 20px 40px -12px rgb(15 23 42 / 0.16);
    --font-ar: 'Cairo', sans-serif;
    --font-en: 'IBM Plex Sans Arabic', sans-serif;
}

html[dir="rtl"] body { font-family: 'Cairo', 'IBM Plex Sans Arabic', sans-serif; }
html[dir="ltr"] body { font-family: 'IBM Plex Sans Arabic', 'Cairo', sans-serif; }

html {
    overflow-x: hidden;
    height: 100%;
}
body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: 16px;
    overflow-x: hidden;
    max-width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
main {
    flex: 1 0 auto;
}
.site-header, .site-footer {
    flex-shrink: 0;
}

img, svg { max-width: 100%; height: auto; }

a { text-decoration: none; }

/* ---- Signature pattern: a faint "dataset grid" watermark used sparingly
   on the hero and section dividers — nods to rows/columns of a dataset
   without leaning on generic gradient-blob hero art. ---- */
.data-grid-bg {
    background-image:
        linear-gradient(var(--color-border) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 40%, transparent 90%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 40%, transparent 90%);
    opacity: .55;
}

/* ---- Announcement bar ---- */
.announcement-bar {
    background: var(--color-text);
    color: #fff;
    font-size: .875rem;
    overflow: hidden;
    white-space: nowrap;
}
.announcement-bar__track {
    display: inline-block;
    padding-inline-start: 100%;
    animation: marquee 22s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
    .announcement-bar__track { animation: none; padding-inline-start: 1rem; }
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
html[dir="rtl"] .announcement-bar__track { animation-name: marquee-rtl; }
@keyframes marquee-rtl {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

/* ---- Navbar ---- */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1030;
}
.brand-mark {
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--color-text) !important;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.brand-mark .dot { color: var(--color-primary); }

.nav-link-custom {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: .95rem;
    white-space: nowrap;
}
.nav-link-custom:hover, .nav-link-custom.active { color: var(--color-primary); }

.header-search {
    flex: 1 1 180px;
    min-width: 120px;
    max-width: 240px;
}

.site-header .btn,
.site-header .icon-btn,
.site-header .switcher-select {
    white-space: nowrap;
    flex-shrink: 0;
}

.switcher-group { flex-shrink: 0; }

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--color-primary-light); color: var(--color-primary); }

/* Language + currency switcher group */
.switcher-group {
    display: flex;
    align-items: stretch;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
}
.switcher-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    padding: 0 1.6rem 0 .75rem;
    font-size: .82rem;
    font-weight: 700;
    color: var(--color-text);
    cursor: pointer;
    height: 100%;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2364748B' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left .6rem center;
}
html[dir="rtl"] .switcher-select {
    padding: 0 .75rem 0 1.6rem;
    background-position: right .6rem center;
}
.switcher-select:focus { outline: none; background-color: var(--color-primary-light); }
.switcher-group form:not(:last-child) .switcher-select {
    border-inline-end: 1px solid var(--color-border);
}
.icon-badge {
    position: absolute;
    top: -6px;
    inset-inline-end: -6px;
    background: var(--color-primary);
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ---- Buttons ---- */
.btn-primary-custom {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 700;
    border-radius: var(--radius);
    padding: .65rem 1.4rem;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}
.btn-primary-custom:hover { background: var(--color-primary-dark); color: #fff; box-shadow: var(--shadow-md); }
.btn-outline-custom {
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 700;
    border-radius: var(--radius);
    padding: .65rem 1.4rem;
    white-space: nowrap;
}
.btn-outline-custom:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ---- Cards ---- */
.card-custom {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .18s ease, transform .18s ease;
}
.card-custom:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.product-card__thumb { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: var(--radius) var(--radius) 0 0; }
.product-card__badge {
    position: absolute;
    top: .75rem;
    inset-inline-start: .75rem;
    background: var(--color-primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    padding: .25rem .6rem;
    border-radius: 999px;
}
.product-card__meta { font-size: .8rem; color: var(--color-text-muted); line-height: 1.5; }
.product-card__title {
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.5em * 2);
}
.product-card__title a { transition: color .15s ease; }
.product-card__footer {
    margin-top: .9rem;
    padding-top: .9rem;
    border-top: 1px solid var(--color-border);
}
.product-card__price { color: var(--color-primary); font-weight: 800; font-size: 1.05rem; }
.product-card__price-old { color: var(--color-text-muted); text-decoration: line-through; font-size: .85rem; }

.category-pill {
    display: flex;
    align-items: center;
    gap: .6rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: .9rem 1.1rem;
    color: var(--color-text);
    font-weight: 700;
    transition: all .15s ease;
}
.category-pill:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-light); }
.category-pill .icon-wrap {
    width: 38px; height: 38px; border-radius: 8px;
    background: var(--color-primary-light); color: var(--color-primary);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.category-pill span:not(.icon-wrap) {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-card { text-align: center; padding: 1.5rem 1rem; }
.stat-card .value { font-size: 2.25rem; font-weight: 800; color: var(--color-primary); }
.stat-card .label { color: var(--color-text-muted); font-weight: 600; }

.section-eyebrow {
    color: var(--color-primary);
    font-weight: 700;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.section-title { font-weight: 800; font-size: 1.9rem; }

/* ---- Forms ---- */
.form-control, .form-select {
    border-radius: var(--radius);
    border-color: var(--color-border);
    padding: .65rem .9rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 .2rem rgb(37 99 235 / .15);
}
label.form-label { font-weight: 700; font-size: .9rem; }

/* ---- Loading skeletons ---- */
.skeleton {
    background: linear-gradient(90deg, #EEF2F7 25%, #E4EAF2 37%, #EEF2F7 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: var(--radius);
}
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---- Footer ---- */
.site-footer { background: var(--color-text); color: #CBD5E1; }
.site-footer a { color: #CBD5E1; }
.site-footer a:hover { color: #fff; }
.site-footer h6 { color: #fff; font-weight: 800; }

/* Sticky filters sidebar (shop page) */
.filters-sticky { position: sticky; top: 90px; }

/* Floating WhatsApp button */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    width: 56px;
    height: 56px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, .45);
    z-index: 1040;
    transition: transform .15s ease;
    animation: whatsapp-pulse 2.4s ease infinite;
}
.whatsapp-float:hover { transform: scale(1.08); color: #fff; }
.whatsapp-float i { width: 28px; height: 28px; }
@keyframes whatsapp-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(37, 211, 102, .45); }
    50% { box-shadow: 0 8px 24px rgba(37, 211, 102, .75), 0 0 0 8px rgba(37, 211, 102, .12); }
}
@media (max-width: 575.98px) {
    .whatsapp-float { width: 50px; height: 50px; bottom: 16px; inset-inline-end: 16px; }
    .whatsapp-float i { width: 24px; height: 24px; }
}

@media (max-width: 767.98px) {
    .section-title { font-size: 1.5rem; }
}
