/* ============================================================
   Ababoa — Design System
   هوية بصرية موحدة لكل صفحات الموقع
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --ink: #1B2A44;
    --ink-soft: #57667D;
    --paper: #F3F5F8;
    --card: #FFFFFF;
    --brand: #3F66B1;
    --brand-dark: #2C4A85;
    --brand-tint: #E8EDF7;
    --teal: #58C1C7;
    --teal-tint: #E4F6F7;
    --accent: #F37521;
    --accent-tint: #FDEADD;
    --gray: #A9A7A8;
    --urgent: #C1443F;
    --line: #DFE3E9;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --shadow: 0 2px 10px rgba(27, 42, 68, 0.07);
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.container, .page-narrow { flex: 1 0 auto; width: 100%; }
footer { flex-shrink: 0; }

a { color: inherit; }

/* ===== Top Bar ===== */
.topbar {
    position: sticky; top: 0; z-index: 10;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 14px 24px;
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.logo {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 20px; color: var(--brand-dark);
    text-decoration: none;
}
.logo svg { width: 26px; height: 26px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 11px 22px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: transparent; color: var(--brand-dark); border: 1.5px solid var(--brand); }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn:disabled { background: #B7BEB9; cursor: not-allowed; transform: none; }

/* ===== Layout ===== */
.container { max-width: 1000px; margin: 0 auto; padding: 24px; }
.page-narrow { max-width: 550px; margin: 0 auto; padding: 30px 20px; }

/* ===== Cards / Grid ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.card {
    background: var(--card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.15s ease;
    display: block;
}
.card:hover { transform: translateY(-3px); }
.card-body { padding: 14px; }
.card-title { font-weight: 600; font-size: 15px; margin: 6px 0; }

.thumb { width: 100%; height: 160px; object-fit: cover; background: var(--paper); display: block; }
.thumb.placeholder {
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-soft); font-size: 13px; font-family: 'IBM Plex Mono', monospace;
}

/* ===== Hover Overlay: كشف "المطلوب في المقابل" عند الهوفر ===== */
.thumb-wrap { position: relative; overflow: hidden; }
.hover-overlay {
    position: absolute; inset: 0;
    background: rgba(27, 42, 68, 0.88);
    color: #fff;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 14px;
    opacity: 0; transition: opacity 0.2s ease;
    gap: 6px;
}
.hover-reveal:hover .hover-overlay { opacity: 1; }
.overlay-icon { font-size: 28px; }
.overlay-text { font-size: 13.5px; font-weight: 600; line-height: 1.4; }

/* ===== Badges ===== */
.badge {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.badge-specific { background: var(--accent-tint); color: #A64A0F; }
.badge-open { background: var(--teal-tint); color: #2D7A7F; }

/* ===== Forms ===== */
form.panel {
    background: var(--card);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}
label { display: block; margin-top: 16px; font-weight: 600; font-size: 14px; }
input[type=text], input[type=email], select, textarea {
    width: 100%;
    padding: 11px 12px;
    margin-top: 6px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14.5px;
    background: var(--paper);
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand);
}
small { color: var(--ink-soft); font-size: 12.5px; }
.error-box { color: var(--urgent); background: #FBEAEA; padding: 12px; border-radius: var(--radius-sm); font-size: 14px; }
.success-banner {
    background: var(--brand-tint); color: var(--brand-dark);
    padding: 14px; border-radius: var(--radius-md);
    margin-bottom: 20px; text-align: center; font-weight: 600;
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center; color: var(--ink-soft);
    padding: 70px 20px; font-size: 15px;
}

/* ===== Slideshow (product-view) ===== */
.slideshow {
    position: relative; width: 100%; height: 350px;
    border-radius: var(--radius-lg); overflow: hidden; background: var(--paper);
}
.slideshow img {
    position: absolute; top: 0; right: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0; transition: opacity 0.4s ease;
}
.slideshow img.active { opacity: 1; }
.nav-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(27,42,68,0.55); color: #fff; border: none;
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px;
}
.nav-arrow.prev { left: 10px; }
.nav-arrow.next { right: 10px; }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); cursor: pointer; border: none; }
.dot.active { background: var(--brand); }

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container { padding: 16px; }
    .topbar { padding: 12px 16px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .thumb { height: 120px; }
}
