:root {
  --ink: #17212b;
  --muted: #6c7882;
  --paper: #f6f7f2;
  --white: #fff;
  --orange: #ef6c3d;
  --teal: #0d7770;
  --line: #e3e8e5;
  --shadow: 0 18px 45px rgba(23, 33, 43, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  width: min(1160px, calc(100% - 32px));
  margin: auto;
}

/* En-tête */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-size: 16px;
  white-space: nowrap;
}

.brand span:last-child span {
  color: var(--orange);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: white;
  font-size: 18px;
  letter-spacing: 0;
  flex-shrink: 0;
}

.site-logo-img {
  max-height: 42px;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.main-nav {
  display: flex;
  gap: 20px;
  font-size: 14px;
  align-items: center;
}

.main-nav a {
  padding: 6px 0;
  transition: color .2s ease;
}

.main-nav a:hover,
.footer a:hover {
  color: var(--orange);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fafbf9;
  align-items: center;
}

.search input {
  border: 0;
  background: transparent;
  padding: 8px 12px;
  width: 180px;
  outline: none;
  font-family: inherit;
  font-size: 13px;
}

.search button {
  border: 0;
  background: transparent;
  font-size: 18px;
  padding: 0 10px;
  cursor: pointer;
}

.icon-link {
  font-size: 22px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
}

.icon-link small {
  background: var(--orange);
  color: white;
  border-radius: 12px;
  padding: 2px 6px;
  font: bold 11px Arial;
  position: absolute;
  top: -2px;
  right: -4px;
}

.account-link {
  font-size: 14px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  background: #f3f4f6;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 22px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
}

.menu-icon,
.menu-icon span {
  display: block;
}

.menu-icon {
  width: 22px;
  height: 18px;
  position: relative;
}

.menu-icon span {
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 2px;
  position: absolute;
  left: 0;
  transition: transform .2s ease, opacity .2s ease, top .2s ease;
}

.menu-icon span:nth-child(1) { top: 0; }
.menu-icon span:nth-child(2) { top: 8px; }
.menu-icon span:nth-child(3) { top: 16px; }

.menu-toggle.is-open .menu-icon span:nth-child(1) {
  top: 8px;
  transform: rotate(45deg);
}

.menu-toggle.is-open .menu-icon span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open .menu-icon span:nth-child(3) {
  top: 8px;
  transform: rotate(-45deg);
}

.flash {
  margin-top: 18px;
  padding: 13px 17px;
  border-left: 4px solid var(--teal);
  background: #e7f3ee;
  border-radius: 4px;
  font-size: 14px;
}

.flash.error {
  border-color: #c74b48;
  background: #fae9e5;
}

.flash.success {
  border-color: var(--teal);
  background: #e7f3ee;
}

/* Hero Section */
.hero {
  padding: 70px 0 65px;
  background: linear-gradient(118deg, #e5f1ea 0%, #f8f3e9 62%, #f8dfd1 100%);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 40px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--orange);
  font: 700 12px Arial, sans-serif;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 64px);
  line-height: 1.08;
  margin: 16px 0;
  color: var(--ink);
  font-weight: 700;
}

.hero h1 em {
  color: var(--teal);
  font-style: normal;
}

.hero p {
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 520px;
}

.buttons {
  display: flex;
  gap: 12px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: var(--orange);
  color: white;
  padding: 12px 22px;
  font: 700 14px Arial, sans-serif;
  cursor: pointer;
  text-align: center;
  transition: opacity .2s ease, transform .1s ease;
  min-height: 44px;
}

.btn:active {
  transform: scale(0.98);
}

.btn.secondary {
  background: var(--teal);
}

.btn.outline {
  background: transparent;
  color: var(--teal);
  border: 1px solid var(--teal);
}

.small-btn {
  border: 0;
  border-radius: 4px;
  background: var(--teal);
  color: white;
  padding: 8px 14px;
  font: 700 12px Arial, sans-serif;
  cursor: pointer;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hero-art {
  min-height: 300px;
  display: grid;
  place-items: center;
  position: relative;
}

.hero-card {
  background: var(--white);
  width: min(320px, 100%);
  padding: 24px;
  box-shadow: var(--shadow);
  transform: rotate(3deg);
  border-radius: 6px;
}

.hero-card .product-art {
  height: 160px;
  border-radius: 4px;
}

.hero-sticker {
  position: absolute;
  right: 0;
  bottom: 10px;
  background: var(--orange);
  color: #fff;
  border-radius: 50%;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  text-align: center;
  font: bold 12px Arial, sans-serif;
  transform: rotate(-8deg);
  box-shadow: 0 8px 20px rgba(239, 108, 61, .35);
}

/* Sections */
.section {
  padding: 55px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  gap: 15px;
  flex-wrap: wrap;
}

.section h2 {
  font-size: clamp(24px, 3.5vw, 32px);
  margin: 4px 0 0;
  font-weight: 700;
}

.muted {
  color: var(--muted);
}

.text-link {
  color: var(--teal);
  font: 700 13px Arial, sans-serif;
}

/* Grilles */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.category {
  background: white;
  padding: 20px 10px;
  text-align: center;
  border-radius: 6px;
  border-bottom: 3px solid transparent;
  transition: .2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,.03);
}

.category:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
}

.category-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.category label {
  font-size: 13px;
  font-weight: 600;
  display: block;
  cursor: pointer;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.product-card {
  background: var(--white);
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}

.product-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.product-image {
  height: 200px;
  background: #edf1ed;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-art {
  font-size: 64px;
  display: grid;
  place-items: center;
  height: 100%;
  width: 100%;
  background: linear-gradient(145deg, #d9e9e1, #f8e4d8);
}

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--orange);
  color: white;
  padding: 4px 7px;
  font: 700 10px Arial, sans-serif;
  border-radius: 3px;
}

.product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-info h3 {
  font-size: 16px;
  margin: 4px 0 8px;
  font-weight: 600;
  line-height: 1.35;
}

.rating {
  color: #e89a2c;
  font: 12px Arial, sans-serif;
}

.price {
  font: bold 18px Arial, sans-serif;
  margin-top: 8px;
}

.old-price {
  font: 13px Arial, sans-serif;
  color: #9ba3a4;
  text-decoration: line-through;
  margin-left: 6px;
}

.product-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
}

.heart {
  font-size: 20px;
  color: var(--teal);
}

/* Bandeau CTA */
.band {
  background: var(--teal);
  color: white;
  padding: 35px 0;
}

.band-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.band h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
}

/* Footer */
.footer {
  background: #17212b;
  color: #c5d0ce;
  padding: 50px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 30px;
}

.footer h4 {
  color: white;
  margin: 0 0 15px;
  font-size: 16px;
}

.footer a,
.footer p {
  display: block;
  color: #c5d0ce;
  line-height: 1.8;
  font-size: 13px;
}

.footer .brand {
  color: #fff;
  margin-bottom: 12px;
}

.footer-bottom {
  margin-top: 40px;
  padding: 16px 0;
  border-top: 1px solid #30404a;
  font: 12px Arial, sans-serif;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Pages formulaires & Layouts */
.page-head {
  padding: 40px 0 25px;
  background: #e8f0ea;
}

.page-head h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin: 8px 0 0;
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.filters input,
.filters select,
.form-control {
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: white;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  border-radius: 4px;
  min-height: 42px;
}

.filters input {
  max-width: 320px;
}

.filters select {
  max-width: 220px;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
  align-items: start;
}

.sidebar {
  background: #fff;
  padding: 18px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
}

.sidebar h3 {
  font-size: 16px;
  margin-top: 0;
}

.sidebar a {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  border-left: 3px solid transparent;
  margin-bottom: 4px;
  border-radius: 3px;
}

.sidebar a.active,
.sidebar a:hover {
  color: var(--teal);
  border-left-color: var(--teal);
  background: #f9fbf9;
  font-weight: 600;
}

.form-page {
  max-width: 650px;
  margin: 40px auto;
  background: white;
  padding: 30px;
  box-shadow: var(--shadow);
  border-radius: 6px;
}

.form-page h1 {
  margin-top: 0;
  font-size: 26px;
}

.form-group {
  margin: 14px 0;
}

.form-group label {
  display: block;
  font: 700 12px Arial, sans-serif;
  margin-bottom: 6px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Tables & Panier */
.cart-table {
  width: 100%;
  background: white;
  border-collapse: collapse;
  border-radius: 6px;
  overflow: hidden;
}

.cart-table th,
.cart-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.cart-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 25px;
  align-items: start;
}

.summary {
  background: white;
  padding: 22px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
}

.summary div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
}

.summary .total {
  border-top: 1px solid var(--line);
  font: bold 18px Arial, sans-serif;
  margin-top: 8px;
  padding-top: 14px;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  background: white;
  border-radius: 6px;
}

/* Badges de statut */
.status-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
  font: 700 11px Arial, sans-serif;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-new { background: #e0f2fe; color: #0369a1; }
.status-confirmed { background: #e0e7ff; color: #4338ca; }
.status-preparing { background: #fef3c7; color: #b45309; }
.status-shipped { background: #ede9fe; color: #6d28d9; }
.status-delivery { background: #ffedd5; color: #c2410c; }
.status-delivered { background: #dcfce7; color: #15803d; }
.status-cancelled { background: #fee2e2; color: #b91c1c; }
.status-returned, .status-failed { background: #f3f4f6; color: #4b5563; }

.order-card {
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 18px;
  border-radius: 6px;
  overflow: hidden;
}

.order-header {
  background: #f9fafb;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 10px;
}

.order-body {
  padding: 18px;
}

.order-items-list {
  list-style: none;
  padding: 0;
  margin: 0 0 15px;
}

.order-items-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  gap: 10px;
}

.order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  flex-wrap: wrap;
  gap: 10px;
}

.logo-preview-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: #f9fafb;
  border: 1px dashed var(--line);
  margin-bottom: 14px;
  border-radius: 4px;
  flex-wrap: wrap;
}

.logo-preview-box img {
  max-height: 48px;
  max-width: 160px;
  object-fit: contain;
}

/* Sélecteur de langue */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 6px;
  background: #edf1ed;
  border-radius: 4px;
}

.lang-btn {
  color: var(--muted);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 2px;
  transition: all .2s;
}

.lang-btn:hover,
.lang-btn.active {
  color: var(--teal);
  background: #fff;
}

.lang-sep {
  color: #cbd5e1;
  font-size: 9px;
}

/* Support RTL complet pour l'Arabe */
body.rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl h4,
body.rtl .brand,
body.rtl .btn,
body.rtl input,
body.rtl select,
body.rtl textarea {
  font-family: 'Cairo', Arial, sans-serif;
}

body.rtl .brand {
  letter-spacing: 0;
}

body.rtl .sidebar a {
  border-left: 0;
  border-right: 3px solid transparent;
}

body.rtl .sidebar a.active,
body.rtl .sidebar a:hover {
  border-right-color: var(--teal);
}

body.rtl .cart-table th,
body.rtl .cart-table td {
  text-align: right;
}

body.rtl .badge {
  left: auto;
  right: 10px;
}

body.rtl .flash {
  border-left: 0;
  border-right: 4px solid var(--teal);
}

body.rtl .flash.error {
  border-right-color: #c74b48;
}

body.rtl .old-price {
  margin-left: 0;
  margin-right: 6px;
}

body.rtl .hero-card {
  transform: rotate(-3deg);
}

body.rtl .hero-sticker {
  right: auto;
  left: 0;
  transform: rotate(8deg);
}

/* =========================================================================
   RESPONSIVE MOBILE & TABLETTE (MOBILE-FIRST ADAPTATIONS)
   ========================================================================= */

@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 35px;
    text-align: center;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
  }

  .buttons {
    justify-content: center;
  }

  .layout,
  .cart-wrap {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .nav-wrap {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .menu-toggle {
    display: flex;
    order: 1;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
  }

  .brand {
    order: 2;
  }

  .nav-actions {
    order: 3;
    margin-left: auto;
  }

  body.rtl .nav-actions {
    margin-left: 0;
    margin-right: auto;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 2px solid var(--line);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
    z-index: 1000;
    width: 100%;
  }

  .main-nav.open,
  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 10px 0;
    border-bottom: 1px solid #f0f3f1;
    font-size: 15px;
    font-weight: 600;
  }

  .account-link span {
    display: none;
  }

  .account-link {
    padding: 6px;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - 24px);
  }

  .site-header {
    padding: 4px 0;
  }

  .nav-wrap {
    min-height: 60px;
    gap: 8px;
  }

  .brand {
    font-size: 14px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .search input {
    width: 110px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .hero {
    padding: 45px 0 35px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero p {
    font-size: 15px;
  }

  .btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .category {
    padding: 12px 6px;
  }

  .category-icon {
    font-size: 26px;
    margin-bottom: 4px;
  }

  .category label {
    font-size: 11px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .product-image {
    height: 140px;
  }

  .product-info {
    padding: 10px;
  }

  .product-info h3 {
    font-size: 13px;
    margin: 2px 0 4px;
  }

  .price {
    font-size: 15px;
  }

  .old-price {
    font-size: 11px;
    display: block;
    margin-left: 0;
  }

  body.rtl .old-price {
    margin-right: 0;
  }

  .product-action .small-btn {
    padding: 6px 8px;
    font-size: 11px;
    width: 100%;
  }

  .product-action .heart {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .form-page {
    padding: 20px 16px;
    margin: 20px auto;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .cart-table th,
  .cart-table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .page-head {
    padding: 28px 0 18px;
  }

  .page-head h1 {
    font-size: 24px;
  }

  /* Support des tableaux responsives en scroll horizontal */
  .summary, .form-page {
    overflow-x: auto;
  }
}

@media (max-width: 380px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search {
    display: none;
  }
}

