/* ── Reset & base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --nav-bg:     #1a1a2e;
  --accent:     #e94560;
  --accent-h:   #c73652;
  --text:       #222;
  --text-light: #666;
  --bg:         #f5f6fa;
  --card-bg:    #fff;
  --border:     #e0e0e0;
  --sidebar-w:  220px;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,.08);
  --shadow-h:   0 8px 28px rgba(0,0,0,.14);
  --ease:       .2s ease;
}

html { font-family: 'Segoe UI', Arial, sans-serif; font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); min-height: 100vh; }

[dir="rtl"] { font-family: 'Segoe UI', Tahoma, Arial, sans-serif; }
[dir="rtl"] .nav-links    { margin-right: auto; margin-left: 0; }
[dir="rtl"] .sidebar      { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .modal-close  { right: auto; left: 1.25rem; }
[dir="rtl"] .gallery-close { right: auto; left: 1.25rem; }
[dir="rtl"] .filter-btn   { text-align: right; }

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  background: var(--nav-bg); position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .85rem 2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.nav-logo { color: #fff; font-size: 1.3rem; font-weight: 700; letter-spacing: .5px; text-decoration: none; white-space: nowrap; }
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; list-style: none; margin-left: auto; }
.nav-links a { color: #ccc; text-decoration: none; font-size: .95rem; transition: color var(--ease); }
.nav-links a:hover { color: #fff; }
.lang-switcher { display: flex; gap: .4rem; margin-left: 1rem; }
.lang-btn {
  background: transparent; border: 1px solid #555; color: #bbb;
  padding: .28rem .65rem; border-radius: 4px; font-size: .8rem;
  cursor: pointer; transition: all var(--ease);
}
.lang-btn:hover  { border-color: var(--accent); color: #fff; }
.lang-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Hero ────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 55%, #0f3460 100%);
  color: #fff; padding: 4.5rem 2rem 3.5rem; text-align: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: .6rem; }
.hero p  { font-size: 1.1rem; color: #a0b0c8; margin-bottom: 2rem; }

.search-wrap { max-width: 520px; margin: 0 auto; position: relative; }
.search-wrap input {
  width: 100%; padding: .9rem 1.2rem .9rem 3rem;
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--radius);
  font-size: 1rem; background: rgba(255,255,255,.12); color: #fff; outline: none;
  transition: background var(--ease), border-color var(--ease);
}
.search-wrap input::placeholder { color: rgba(255,255,255,.5); }
.search-wrap input:focus { background: rgba(255,255,255,.18); border-color: var(--accent); }
.search-icon {
  position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.55); pointer-events: none;
}
[dir="rtl"] .search-icon { left: auto; right: 1rem; }
[dir="rtl"] .search-wrap input { padding: .9rem 3rem .9rem 1.2rem; }

/* ── Layout ──────────────────────────────────────────────────────── */
.layout {
  display: flex; align-items: flex-start;
  max-width: 1400px; margin: 2rem auto; padding: 0 1.5rem; gap: 1.5rem;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.25rem 1rem;
  position: sticky; top: 72px;
}
.sidebar h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-light); margin-bottom: .75rem; }
.filter-btn {
  display: block; width: 100%; background: none; border: 1px solid transparent;
  text-align: left; padding: .55rem .75rem; border-radius: 6px; cursor: pointer;
  font-size: .92rem; color: var(--text); transition: all var(--ease); margin-bottom: .3rem;
}
.filter-btn:hover  { background: #f0f2f8; }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }

/* ── Product grid ────────────────────────────────────────────────── */
.products-section { flex: 1; min-width: 0; }
.results-info { font-size: .88rem; color: var(--text-light); margin-bottom: 1rem; padding-left: .25rem; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

/* ── Product card ────────────────────────────────────────────────── */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
  cursor: pointer; transition: box-shadow var(--ease), transform var(--ease);
}
.card:hover { box-shadow: var(--shadow-h); transform: translateY(-4px); }

.card-img-wrap { position: relative; width: 100%; height: 220px; overflow: hidden; background: #e8eaf0; }
.card-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease;
}
.card:hover .card-img-wrap img { transform: scale(1.05); }

.card-img-wrap .img-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #aaa; font-size: .85rem; gap: .5rem;
}
.card-img-wrap .img-placeholder svg { width: 48px; opacity: .4; }

/* Photo count badge */
.photo-badge {
  position: absolute; bottom: .6rem; right: .6rem;
  background: rgba(0,0,0,.58); color: #fff;
  font-size: .75rem; font-weight: 600;
  padding: .2rem .55rem; border-radius: 20px;
  backdrop-filter: blur(4px);
  display: flex; align-items: center; gap: .3rem;
  pointer-events: none;
}
.photo-badge::before { content: '⊞'; font-size: .8rem; }

.card-body { padding: 1rem 1.1rem; flex: 1; display: flex; flex-direction: column; gap: .45rem; }
.card-category { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); font-weight: 600; }
.card-name     { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.card-desc     { font-size: .87rem; color: var(--text-light); line-height: 1.55; flex: 1; }
.card-cta      { display: flex; align-items: center; gap: .4rem; color: var(--accent); font-size: .82rem; font-weight: 600; margin-top: .25rem; }
.card-cta svg  { flex-shrink: 0; }

.empty-state { grid-column: 1/-1; text-align: center; padding: 4rem 2rem; color: var(--text-light); }
.empty-state svg { width: 64px; opacity: .3; margin-bottom: 1rem; }

/* ── Gallery Modal ───────────────────────────────────────────────── */
.gallery-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.75);
  align-items: center; justify-content: center;
  padding: 1rem;
}
.gallery-overlay.open { display: flex; }

.gallery-modal {
  background: #fff; border-radius: 12px;
  width: 100%; max-width: 860px; max-height: 92vh;
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  animation: modal-in .2s ease;
}
@keyframes modal-in { from { opacity:0; transform: translateY(16px) scale(.98); } to { opacity:1; transform: none; } }

.gallery-close {
  position: absolute; top: .9rem; right: 1rem; z-index: 10;
  background: rgba(0,0,0,.12); border: none; color: #333;
  width: 2rem; height: 2rem; border-radius: 50%; font-size: 1.3rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--ease), color var(--ease);
}
.gallery-close:hover { background: var(--accent); color: #fff; }

/* Image viewer */
.gallery-viewer {
  position: relative; background: #111;
  height: 420px; flex-shrink: 0;
  display: flex; align-items: center;
}
.gallery-img-wrap { flex: 1; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }

.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; color: #fff;
  width: 2.6rem; height: 2.6rem; border-radius: 50%; font-size: 1.8rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background var(--ease); z-index: 5; line-height: 1;
}
.gallery-arrow:hover { background: rgba(255,255,255,.35); }
.gallery-prev { left:  .75rem; }
.gallery-next { right: .75rem; }

/* Counter + thumbnails */
.gallery-footer {
  background: #1a1a2e; padding: .6rem 1.2rem;
  display: flex; flex-direction: column; gap: .5rem; flex-shrink: 0;
}
.gallery-counter { color: #aaa; font-size: .8rem; text-align: center; }

.gallery-thumbs {
  display: flex; gap: .5rem; overflow-x: auto;
  padding-bottom: .25rem; scroll-behavior: smooth;
}
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

.thumb {
  flex-shrink: 0; width: 62px; height: 48px;
  border: 2px solid transparent; border-radius: 5px;
  overflow: hidden; cursor: pointer; background: #333;
  padding: 0; transition: border-color var(--ease), opacity var(--ease);
  opacity: .6;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { opacity: .9; border-color: #aaa; }
.thumb.active { border-color: var(--accent); opacity: 1; }

/* Product info strip */
.gallery-info {
  padding: 1.1rem 1.4rem 1.4rem;
  display: flex; flex-direction: column; gap: .55rem;
  overflow-y: auto;
}
.gallery-cat  { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); font-weight: 600; }
.gallery-name { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.gallery-desc { font-size: .9rem; color: var(--text-light); line-height: 1.6; }

.gallery-quote-btn {
  align-self: flex-start; margin-top: .2rem;
  background: var(--nav-bg); color: #fff; border: none;
  padding: .65rem 1.5rem; border-radius: 6px;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: background var(--ease);
}
.gallery-quote-btn:hover { background: var(--accent); }

/* ── Quote Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 300;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff; border-radius: var(--radius);
  width: 100%; max-width: 480px; padding: 2rem; position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modal-in .2s ease;
}
.modal-close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: #999; line-height: 1;
}
.modal-close:hover { color: var(--accent); }
.modal h2 { font-size: 1.25rem; margin-bottom: 1.25rem; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: #444; }
.form-group input,
.form-group textarea {
  width: 100%; padding: .65rem .85rem;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: .95rem; font-family: inherit; outline: none;
  transition: border-color var(--ease);
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 90px; }

.submit-btn {
  width: 100%; background: var(--accent); color: #fff; border: none;
  padding: .8rem; border-radius: 6px; font-size: 1rem; font-weight: 700;
  cursor: pointer; transition: background var(--ease); margin-top: .5rem;
}
.submit-btn:hover { background: var(--accent-h); }

.success-msg { display: none; text-align: center; padding: 1.5rem; color: #2e7d32; font-weight: 600; }
.success-msg svg { width: 48px; margin-bottom: .75rem; }

/* ── Footer ──────────────────────────────────────────────────────── */
footer { background: var(--nav-bg); color: #888; text-align: center; padding: 1.5rem; font-size: .85rem; margin-top: 3rem; }
footer span { color: var(--accent); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .navbar { flex-wrap: wrap; padding: .75rem 1rem; }
  .nav-links { display: none; }
  .lang-switcher { margin-left: auto; }

  .layout { flex-direction: column; padding: 0 1rem; }
  .sidebar { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: .4rem; }
  .sidebar h3 { width: 100%; }
  .filter-btn { width: auto; display: inline-block; }

  .grid { grid-template-columns: 1fr; }

  .gallery-viewer { height: 260px; }
  .thumb { width: 48px; height: 38px; }
}
