/* ==========================================================================
   Telly Sow - Appareils Electroniques - Site vitrine
   ========================================================================== */

:root {
  --green: #1f7a3d;
  --green-dark: #155c2c;
  --green-light: #e8f5ec;
  --red: #d71920;
  --dark: #1c1f26;
  --gray: #6b7280;
  --gray-light: #f2f4f3;
  --border: #e5e7eb;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(20, 30, 25, 0.08);
  --container: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  color: var(--dark);
  background: var(--white);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
.ui-icon { width: 16px; height: 16px; flex: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.25; }

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

.section { padding: 64px 0; }
.section-alt { background: var(--gray-light); }

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 40px;
}
.section-head .eyebrow {
  color: var(--red);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 13px;
}
.section-head h2 { font-size: 32px; }
.section-head p { color: var(--gray); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
}
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); }
.btn-outline { border-color: var(--white); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,.15); }
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: #b5151b; }
.btn-line { border-color: var(--green); color: var(--green); }
.btn-line:hover { background: var(--green); color: var(--white); }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--dark);
  color: #cfd3da;
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar-contacts { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar-contacts span { display: inline-flex; align-items: center; gap: 6px; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.lang-switch { display: flex; gap: 4px; }
.lang-switch a {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #cfd3da;
  background: rgba(255,255,255,.06);
}
.lang-switch a:hover { background: rgba(255,255,255,.14); color: #fff; }
.lang-switch a.active { background: var(--green); color: #fff; }
.topbar-social { display: flex; gap: 12px; }
.topbar-social a {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  font-size: 12px;
}
.topbar-social a:hover { background: var(--green); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 52px; width: auto; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > ul { display: flex; align-items: center; }
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  display: block;
  padding: 14px 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
  white-space: nowrap;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li.active > a { color: var(--green); }

.has-dropdown > .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  min-width: 220px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all .18s ease;
}
.has-dropdown:hover > .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; font-size: 14px; }
.dropdown a:hover { background: var(--green-light); color: var(--green-dark); }
.dropdown .cat-icon { width: 20px; height: 20px; color: var(--green); flex: none; }

.header-cta { display: flex; align-items: center; gap: 14px; }

.search-box { position: relative; }
.search-toggle {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--dark);
  flex: none;
}
.search-toggle:hover { border-color: var(--green); color: var(--green); }
.search-toggle .ui-icon { width: 18px; height: 18px; }
.search-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 320px;
  max-width: 90vw;
  background: var(--white);
  border-radius: 50px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 4px 4px 4px 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all .18s ease;
  z-index: 50;
}
.search-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.search-panel input { flex: 1; border: none; outline: none; font-family: inherit; font-size: 14px; padding: 8px 0; }
.search-panel button {
  width: 36px; height: 36px; flex: none;
  border: none; border-radius: 50%;
  background: var(--green); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.search-panel button .ui-icon { width: 16px; height: 16px; }
[dir="rtl"] .search-panel { right: auto; left: 0; padding: 4px 18px 4px 4px; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--dark); margin: 4px auto; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(120deg, var(--green-dark), var(--green) 65%);
  color: var(--white);
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 40px;
  align-items: center;
  padding-top: 72px;
  padding-bottom: 72px;
}
.hero .eyebrow, .carousel-content .eyebrow {
  display: inline-block;
  background: rgba(255,255,255,.15);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1, .carousel-content h1 { font-size: 42px; margin-bottom: 18px; }
.hero p, .carousel-content p { font-size: 17px; color: rgba(255,255,255,.92); max-width: 560px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Hero carousel ---------- */
.hero-carousel {
  position: relative;
  height: 560px;
  overflow: hidden;
  background: var(--green-dark);
  color: var(--white);
}
.carousel-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .7s ease;
  display: flex;
  align-items: center;
}
.carousel-slide.active { opacity: 1; visibility: visible; }
.carousel-slide > .container { position: relative; z-index: 2; width: 100%; }
.carousel-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15,30,20,.72) 0%, rgba(15,30,20,.35) 55%, rgba(15,30,20,.12) 100%);
}
.carousel-content { position: relative; z-index: 2; max-width: 620px; }
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.25);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: background .2s ease;
}
.carousel-nav:hover { background: rgba(0,0,0,.45); }
.carousel-nav.prev { left: 22px; }
.carousel-nav.next { right: 22px; }
.carousel-dots { position: absolute; z-index: 3; bottom: 22px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.carousel-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.4); border: none; cursor: pointer; padding: 0; }
.carousel-dots .dot.active { background: #fff; width: 26px; border-radius: 6px; transition: width .2s ease; }

.hero-visual {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.hero-visual .tile {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual .tile:nth-child(2) { transform: translateY(-14px); }
.hero-visual .tile:nth-child(5) { transform: translateY(14px); }
.hero-visual .cat-icon { width: 44%; height: 44%; color: var(--white); }

.hero-strip {
  background: var(--white);
  color: var(--dark);
  border-top: 1px solid var(--border);
}
.hero-strip .container {
  display: flex;
  justify-content: space-between;
  padding-top: 22px;
  padding-bottom: 22px;
  flex-wrap: wrap;
  gap: 16px;
}
.hero-strip .item { display: flex; align-items: center; gap: 12px; }
.hero-strip .cat-icon { width: 30px; height: 30px; color: var(--green); }
.hero-strip strong { display: block; font-size: 18px; }
.hero-strip span { color: var(--gray); font-size: 13px; }

/* ---------- Category grid ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  transition: all .2s ease;
}
.cat-card:hover { border-color: var(--green); box-shadow: var(--shadow); transform: translateY(-4px); }
.cat-card .icon-wrap {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
}
.cat-card .cat-icon { width: 32px; height: 32px; color: var(--green); }
.cat-card h3 { font-size: 15px; margin: 0; }
.cat-card p { font-size: 12px; color: var(--gray); margin: 4px 0 0; }

/* ---------- Profile / about split ---------- */
.split {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 56px;
  align-items: center;
}
.split-visual {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.split-visual .stat {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.split-visual .stat strong { display: block; font-size: 28px; color: var(--green-dark); }
.split-visual .stat span { font-size: 13px; color: var(--gray); }
.split-text .eyebrow { color: var(--red); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; }
.split-text h2 { font-size: 30px; }
.split-text p { color: var(--gray); }
.check-list { margin: 20px 0; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.check-list .dot {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%; background: var(--green);
  color: var(--white); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Products ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .2s ease;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.product-thumb {
  aspect-ratio: 1;
  background: var(--gray-light);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb .cat-icon { width: 38%; height: 38%; color: var(--green); opacity: .55; }
.product-card .badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--red); color: var(--white);
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 50px;
}
.product-body { padding: 16px; }
.product-body .ref { color: var(--gray); font-size: 12px; margin-bottom: 4px; }
.product-body h3 { font-size: 15px; margin: 0 0 8px; }
.product-body a.more { color: var(--green-dark); font-weight: 600; font-size: 13px; }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.news-thumb { aspect-ratio: 16/9; background: var(--green-light); display: flex; align-items: center; justify-content: center; }
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-thumb .cat-icon { width: 28%; height: 28%; color: var(--green); }
.news-body { padding: 18px; }
.news-body .date { color: var(--red); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.news-body h3 { font-size: 17px; margin: 8px 0; }
.news-body p { color: var(--gray); font-size: 14px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.cta-band h2 { margin: 0 0 6px; font-size: 26px; }
.cta-band p { margin: 0; color: rgba(255,255,255,.75); }

/* ---------- Breadcrumb / page header ---------- */
.page-header {
  background: var(--green-dark);
  color: var(--white);
  padding: 50px 0;
  text-align: center;
}
.page-header h1 { font-size: 32px; margin-bottom: 8px; }
.page-header .crumbs { color: rgba(255,255,255,.75); font-size: 14px; }
.page-header .crumbs a { color: var(--white); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #b9beca; }
.footer-top { padding: 56px 0 30px; }
.footer-cols {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
  gap: 32px;
}
.footer-cols h4 { color: var(--white); font-size: 15px; margin-bottom: 16px; }
.footer-cols p { font-size: 14px; }
.footer-cols li { margin-bottom: 10px; font-size: 14px; }
.footer-cols a:hover { color: var(--white); }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.footer-social a {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.footer-social a:hover { background: var(--green); color: var(--white); }
.newsletter-form { display: flex; margin-top: 14px; border-radius: 50px; overflow: hidden; border: 1px solid rgba(255,255,255,.2); }
.newsletter-form input { flex: 1; border: none; background: transparent; padding: 11px 16px; color: var(--white); font-size: 14px; }
.newsletter-form input::placeholder { color: #9aa0ad; }
.newsletter-form button { border: none; background: var(--green); color: var(--white); padding: 0 18px; font-weight: 600; cursor: pointer; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 13px; }

/* ---------- Forms (contact) ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14px;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--green); }
.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #b7e2c4; }
.alert-error { background: #fdecec; color: #a91d22; border: 1px solid #f5c2c4; }

.info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 44px; }
.info-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-align: center; }
.info-card .icon-wrap { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--green-light); display: flex; align-items: center; justify-content: center; }
.info-card .cat-icon { width: 26px; height: 26px; color: var(--green); }

/* ---------- Branding video ---------- */
.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--dark);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.video-embed iframe,
.video-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Product detail ---------- */
.product-detail { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.product-detail .thumb { background: var(--gray-light); border-radius: var(--radius); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.product-detail .thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.product-detail .thumb .cat-icon { width: 34%; height: 34%; color: var(--green); opacity: .5; }
.gallery-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.gallery-thumb {
  padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  aspect-ratio: 1; background: var(--gray-light); cursor: pointer;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active,
.gallery-thumb:hover { border-color: var(--green); }
.product-detail .cat-link { color: var(--green-dark); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.product-detail h1 { font-size: 28px; margin: 8px 0 14px; }
.product-detail .ref { color: var(--gray); margin-bottom: 18px; }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 100px 0; }
.error-page .code { font-size: 96px; font-weight: 800; color: var(--green); margin: 0; }

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] body { font-family: 'Poppins', 'Segoe UI', Tahoma, Arial, sans-serif; }
[dir="rtl"] .has-dropdown > .dropdown { left: auto; right: 0; }
[dir="rtl"] .product-card .badge { left: auto; right: 10px; }
[dir="rtl"] .hero-actions,
[dir="rtl"] .topbar-contacts,
[dir="rtl"] .footer-contact li { direction: rtl; }
[dir="rtl"] .check-list li { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .hero-strip .item { flex-direction: row-reverse; }
[dir="rtl"] .carousel-slide::before { background: linear-gradient(270deg, rgba(15,30,20,.72) 0%, rgba(15,30,20,.35) 55%, rgba(15,30,20,.12) 100%); }
[dir="rtl"] .carousel-nav.prev { left: auto; right: 22px; }
[dir="rtl"] .carousel-nav.next { right: auto; left: 22px; }
[dir="rtl"] .carousel-content { text-align: right; margin-left: auto; margin-right: 0; }
[dir="rtl"] .info-card,
[dir="rtl"] .cat-card,
[dir="rtl"] .product-body,
[dir="rtl"] .section-head,
[dir="rtl"] .error-page,
[dir="rtl"] .page-header { text-align: center; }
[dir="rtl"] .split-text,
[dir="rtl"] .product-detail,
[dir="rtl"] .news-body p { text-align: right; }
@media (max-width: 768px) {
  [dir="rtl"] .main-nav { right: auto; left: -320px; box-shadow: 8px 0 24px rgba(0,0,0,.1); transition: left .25s ease; }
  [dir="rtl"] .main-nav.open { left: 0; }
  [dir="rtl"] .has-dropdown > .dropdown { padding-left: 0; padding-right: 10px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .cat-grid, .product-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .split, .product-detail { grid-template-columns: 1fr; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-carousel { height: 480px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .info-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .main-nav { position: fixed; top: 0; right: -320px; height: 100vh; width: 300px; background: var(--white); flex-direction: column; padding: 90px 20px 20px; box-shadow: -8px 0 24px rgba(0,0,0,.1); transition: right .25s ease; overflow-y: auto; }
  .main-nav.open { right: 0; }
  .main-nav > ul { flex-direction: column; width: 100%; align-items: stretch; }
  .main-nav > ul > li > a { padding: 12px 4px; }
  .has-dropdown > .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; display: none; padding-left: 10px; }
  .has-dropdown.open > .dropdown { display: block; }
  .nav-toggle { display: block; }
  .header-cta .btn-primary span { display: none; }
  .cat-grid, .product-grid { grid-template-columns: 1fr 1fr; }
  .gallery-strip { grid-template-columns: repeat(4, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .hero-carousel { height: 420px; }
  .carousel-content h1 { font-size: 26px; }
  .carousel-nav { width: 38px; height: 38px; font-size: 15px; }
}
