/* ====== Reset & Base ====== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, Noto Sans, sans-serif;
  color: #0f172a; background: #ffffff; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.hidden { display: none !important; }
.muted { color: #6b7280; }

/* ====== Header ====== */
.site-header { border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; background: #fff; z-index: 50; }
.topbar { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; gap: 12px; }
.logo { width: 50%; border-radius: 10px;}
.brand-text strong { font-size: 1.05rem; }
.contact { display: flex; align-items: center; gap: 12px; }
.tel { font-weight: 600; }
.whatsapp { padding: 6px 10px; border: 1px solid #059669; border-radius: 10px; }
.lang-btn { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; cursor: pointer; }
.lang-btn:hover { background: #f9fafb; }

.nav { max-width: 1200px; margin: 0 auto; display: flex; gap: 14px; padding: 10px 16px;}
.nav a { padding: 8px 12px; border-radius: 10px; background: #f9fafb; border: 1px solid #e5e7eb; }
.nav a:hover { background: #eef2ff; border-color: #c7d2fe; }

/* ====== Banner Slider ====== */
.banner { max-width: 1200px; margin: 18px auto; padding: 0 16px; }
.slider { position: relative; overflow: hidden; border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.slides { display: flex; transition: transform .6s ease; }
.slide { min-width: 100%; height: 280px; display: grid; place-items: center; background: #111827; color: #fff; font-size: 1.6rem; }
.slide img, .slide svg { width: 100%; height: 280px; object-fit: cover; }
.slider-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: #e5e7eb; border: 1px solid #cbd5e1; }
.dot.active { background: #111827; }

/* ====== Sections ====== */
.section { max-width: 1200px; margin: 22px auto; padding: 0 16px; }
.section h2 { font-size: 1.4rem; margin-bottom: 12px; }
.lead { color: #475569; margin-bottom: 16px; }

/* ====== Categories ====== */
.cat-row { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(190px,1fr); gap:14px; overflow-x:auto; padding-bottom:6px; scroll-snap-type:x mandatory; }
.cat-card { scroll-snap-align: center; border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden; background: #fff; display: flex; flex-direction: column; cursor: pointer; }
.cat-img { background: #f8fafc; display: grid; place-items: center; }
.cat-img img { width: 100%; height: 100%; object-fit: cover; } /* NEW: show mainImage nicely */
.cat-body { padding: 10px 12px; display: grid; gap: 6px; }
.cat-title { font-weight: 700; line-height: 1.3; }
.cat-price { font-size: .9rem; color: #059669; }
.cat-card:hover { transform: translateY(-2px); transition: transform .15s ease; }

/* Vertical scroll on small screens */
@media (max-width: 720px) {
  .cat-row { grid-auto-flow: row; grid-template-columns: 1fr; grid-auto-rows: 110px; overflow-y: auto; max-height: 68vh; padding-right: 6px; }
  .cat-card { flex-direction: row; }
  .cat-img { width: 34%; height: auto; }
}

/* CLIENTS (Infinite Carousel) */
#clients { padding: 2rem 1rem; background: #f7f7f7; }
#clients h2 { text-align: center; margin-bottom: 1rem; }
.clients-wrapper { display: flex; align-items: center; gap: .5rem; max-width: 1200px; margin: 0 auto; }
.clients-viewport { overflow: hidden; flex: 1; }
.clients-track { display: flex; align-items: center; gap: 2rem; will-change: transform; }
.client-card { flex: 0 0 auto; text-align: center; width: 140px; }
.client-card img { width: 100px; height: 100px; object-fit: contain; display: block; margin: auto; border-radius: 10px;}
.client-card p { margin-top: .5rem; font-size: .9rem; color: #374151; }
.client-nav { background: #222; color: #fff; border: none; font-size: 2rem; line-height: 1; padding: 0.3rem 0.7rem; cursor: pointer; border-radius: 12px; }
.client-nav:hover { background: #111; }

/* ====== Detail Page ====== */
.detail { max-width: 1100px; margin: 0 auto; padding: 0 16px 32px; display: grid; gap: 18px; }
.breadcrumbs { display: flex; gap: 8px; font-size: .95rem; }
.detail-card { border: 1px solid #e5e7eb; border-radius: 16px; padding: 16px; display: grid; gap: 10px; }

/* NEW: big hero image for category main image */
.detail-hero { border: 1px solid #e5e7eb; border-radius: 16px; overflow: hidden; }
.detail-hero img { width: 100%; max-height: 420px; object-fit: cover; }

/* Gallery grid with captions */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gitem { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; background: linear-gradient(135deg,#f1f5f9,#e2e8f0); border: 1px solid #e5e7eb; overflow: hidden; }
.gitem img, .gitem svg { width: 100%; height: 100%; object-fit: cover; }
.gitem .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.9); color: #0f172a; font-size: .88rem; padding: 6px 8px; border-top: 1px solid #e5e7eb; }

/* CTAs */
.btn-primary { display: inline-block; padding: 10px 14px; border-radius: 12px; background: #111827; color: #fff; border: 1px solid #0b1220; cursor: pointer; text-align: center; }
.btn-primary:hover { background: #0b1220; }

/* ====== Footer ====== */
.site-footer { border-top: 1px solid #e5e7eb; margin-top: 24px; background: linear-gradient(135deg, #333333, #08b626);}
.foot-cols { max-width: 1200px; margin: 0 auto; padding: 22px 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.foot-cats { display: grid; gap: 6px; }
.copyright { border-top: 1px solid #e5e7eb; padding: 12px 16px; text-align: center; color: #64748b; }

@media (max-width: 860px) {
  .foot-cols { grid-template-columns: 1fr; }
}

/* ====== RTL adjustments ====== */
/* :root[dir="rtl"] .nav { justify-content: flex-end; } */
:root[dir="rtl"] .breadcrumbs { direction: rtl; }
:root[dir="rtl"] .brand-text { text-align: right; }
