@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,700&family=Poppins:wght@300;400;500;600;700;800&family=Bebas+Neue&display=swap');

:root {
  --pink: #ff1e88;
  --magenta: #c1186b;
  --purple: #4a1a6a;
  --orange: #ff7a3d;
  --ink: #0e0e0e;
  --muted: #8a8a8a;
  --line: #ececec;
  --gradient: linear-gradient(90deg, #ff7a3d 0%, #ff1e88 45%, #8e1b8e 80%, #2d0a4a 100%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* RTL Support */
html.is-rtl { direction: rtl; }
html.is-rtl body { font-family: 'Cairo', 'Tajawal', 'Poppins', sans-serif; }
html.is-rtl .nav-center a::after { right: 0; left: auto; }
html.is-rtl .back-arrow svg { transform: scaleX(-1); }
html.is-rtl .logo img { direction: ltr; }
html.is-rtl .hero-label { right: 36px; left: auto; }
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Tajawal:wght@400;500;700;900&display=swap');

/* Language switch button */
.lang-switch {
  background: var(--gradient); color: #fff !important; border: 0; padding: 6px 10px;
  border-radius: 999px; font-weight: 700; font-size: 11px; letter-spacing: 1px;
  cursor: pointer; margin: 0 6px;
}
.lang-switch:hover { opacity: .9; }
html, body {
  font-family: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ===== NAV ===== */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px); z-index: 100;
}
.logo { display: inline-flex; align-items: center; }
.logo img { height: 48px; width: auto; display: block; }
.nav-center a, .nav-right a {
  margin: 0 14px; font-size: 12px; letter-spacing: 2px; font-weight: 600;
  text-transform: uppercase; position: relative; padding: 6px 0;
}
#cart-link, .nav-right a[href="panier.html"] {
  display: inline-flex; align-items: center; gap: 6px;
}
.cart-icon {
  width: 20px; height: 20px; vertical-align: middle;
  stroke: var(--ink); fill: none; stroke-width: 2;
  transition: stroke .2s;
}
#cart-link:hover .cart-icon, .nav-right a[href="panier.html"]:hover .cart-icon {
  stroke: var(--pink);
}
.nav-center a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 2px;
  background: var(--gradient); transition: width .3s;
}
.nav-center a:hover::after { width: 100%; }

/* ===== HOME HERO ===== */
.home-hero {
  position: relative; padding: 70px 20px 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  background: radial-gradient(ellipse at top, #fff5f9 0%, #fff 70%);
  overflow: hidden;
}
.home-hero .logo-big {
  max-width: 640px; width: 90%; margin: 0 auto 24px; display: block;
  filter: drop-shadow(0 10px 40px rgba(255,30,136,.18));
}
.home-hero .tagline {
  width: 100%;
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: 22px; color: var(--purple); margin: 0 auto 10px;
  text-align: center;
}
.home-hero .subtagline {
  width: 100%;
  font-size: 12px; letter-spacing: 4px; color: var(--muted);
  text-transform: uppercase; margin: 0 auto 10px;
  text-align: center;
}

.hero-split {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px;
  min-height: 75vh; padding: 0 4px 4px;
}
.hero-tile { position: relative; overflow: hidden; background: #111; }
.hero-tile img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease, opacity .4s;
  opacity: .92;
}
.hero-tile:hover img { transform: scale(1.08); opacity: 1; }
.hero-tile::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.5) 100%);
  z-index: 1;
}
.hero-label {
  position: absolute; bottom: 36px; left: 36px; right: 36px; z-index: 2;
  color: #fff;
}
.hero-label .cat-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 68px; letter-spacing: 6px; line-height: 1;
}
.hero-label .cat-cta {
  display: inline-block; margin-top: 10px;
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  padding-bottom: 3px; border-bottom: 2px solid #fff;
}
@media (max-width: 800px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-tile { min-height: 55vh; }
  .hero-label .cat-name { font-size: 52px; }
}

.promo {
  text-align: center; padding: 80px 20px;
  background: var(--gradient); color: #fff; margin-top: 0;
}
.promo h2 {
  font-family: 'Playfair Display', serif; font-weight: 900; font-style: italic;
  font-size: 38px; letter-spacing: 1px; margin-bottom: 14px;
}
.promo p { font-size: 14px; letter-spacing: 2px; text-transform: uppercase; opacity: .9; }

/* ===== CATEGORY BANNER ===== */
.category-banner {
  display: flex; justify-content: center; align-items: center;
  padding: 30px 20px 10px; background: #fff;
}
.category-banner img { max-height: 240px; width: auto; object-fit: contain; }
@media (max-width: 600px) { .category-banner img { max-height: 160px; } }

/* ===== BACK ARROW ===== */
.back-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600;
  color: var(--ink); background: #fff; cursor: pointer; transition: all .2s;
  margin: 20px 40px 0;
}
.back-arrow:hover { border-color: var(--pink); color: var(--pink); }
.back-arrow svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; }

/* ===== CATEGORY HEADER ===== */
.category-header {
  padding: 20px 40px 16px; display: flex; justify-content: space-between; align-items: baseline;
}
.category-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px; letter-spacing: 6px;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.category-header .filters select {
  padding: 10px 14px; border: 1px solid #ddd; font-size: 12px;
  letter-spacing: 1.5px; background: #fff; font-family: inherit;
  text-transform: uppercase; cursor: pointer;
}

.subnav {
  padding: 0 40px 20px; display: flex; gap: 28px; border-bottom: 1px solid var(--line);
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase; flex-wrap: wrap;
}
.subnav a { padding-bottom: 14px; border-bottom: 2px solid transparent; font-weight: 500; transition: all .2s; }
.subnav a.active { border-color: var(--pink); color: var(--pink); font-weight: 700; }
.subnav a:hover { border-color: var(--pink); }

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 24px;
}
@media (max-width: 1000px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }

.product-card { display: block; cursor: pointer; position: relative; }
.product-card .img-wrap {
  position: relative; overflow: hidden; background: #f8f4f6;
  aspect-ratio: 3/4; border-radius: 2px;
}
.product-card img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s, opacity .3s;
}
.product-card:hover img { transform: scale(1.04); }
.product-card .info { padding: 14px 4px 30px; }
.product-card h3 { font-size: 14px; font-weight: 500; margin-bottom: 6px; letter-spacing: .3px; }
.product-card .price { font-size: 14px; font-weight: 600; color: var(--pink); }

/* ===== PRODUCT DETAIL ===== */
.product-detail { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; padding: 20px 40px 80px; }
@media (max-width: 900px) { .product-detail { grid-template-columns: 1fr; } }
.product-images { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.product-images img { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #f4f4f4; }
.product-info { padding: 40px 20px; position: sticky; top: 90px; align-self: start; }
.product-info h1 {
  font-family: 'Playfair Display', serif;
  font-size: 32px; font-weight: 700; margin-bottom: 10px;
}
.product-info .ref { color: var(--muted); font-size: 12px; letter-spacing: 2px; margin-bottom: 24px; text-transform: uppercase; }
.product-info .price-big {
  font-size: 22px; font-weight: 700; margin-bottom: 24px;
  color: var(--pink);
}
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.size-btn {
  padding: 13px 20px; border: 1.5px solid #ddd; background: #fff; cursor: pointer;
  font-size: 13px; letter-spacing: 1px; min-width: 62px; font-weight: 500;
  transition: all .2s;
}
.size-btn.active {
  border-color: var(--pink); background: var(--pink); color: #fff;
}
.size-btn:hover:not([disabled]) { border-color: var(--pink); }
.size-btn[disabled] { opacity: .4; cursor: not-allowed; }

.add-to-cart {
  width: 100%; padding: 18px; background: var(--ink); color: #fff; border: 0;
  cursor: pointer; font-size: 13px; letter-spacing: 3px; font-weight: 700;
  text-transform: uppercase; margin-bottom: 12px;
  position: relative; overflow: hidden; transition: all .3s;
}
.add-to-cart::before {
  content: ''; position: absolute; inset: 0; background: var(--gradient);
  opacity: 0; transition: opacity .3s;
}
.add-to-cart span { position: relative; z-index: 1; }
.add-to-cart:hover:not([disabled])::before { opacity: 1; }
.product-desc { margin-top: 30px; font-size: 14px; line-height: 1.8; color: #555; }

/* ===== CART ===== */
.cart-wrap { padding: 40px; max-width: 1100px; margin: 0 auto; }
.cart-wrap h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px; letter-spacing: 5px; margin-bottom: 30px;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.cart-item {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 20px;
  padding: 20px 0; border-bottom: 1px solid var(--line); align-items: center;
}
.cart-item img { width: 120px; aspect-ratio: 3/4; object-fit: cover; }
.cart-item .meta h3 { font-size: 16px; margin-bottom: 6px; font-weight: 600; }
.cart-item .meta p { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.cart-item .remove { background: none; border: 0; color: var(--pink); cursor: pointer; text-decoration: underline; font-size: 12px; font-weight: 500; }
.cart-summary {
  margin-top: 30px; padding-top: 20px; border-top: 2px solid var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}
.cart-summary .total { font-size: 24px; font-weight: 700; color: var(--pink); }
.checkout-btn {
  background: var(--gradient); color: #fff; border: 0; padding: 18px 44px;
  letter-spacing: 3px; font-weight: 700; cursor: pointer; text-transform: uppercase;
  font-size: 13px;
}
.empty-cart { text-align: center; padding: 80px 20px; color: var(--muted); }

/* ===== FOOTER ===== */
.footer {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
  padding: 60px 40px; border-top: 1px solid var(--line); margin-top: 80px;
  background: #fafafa;
}
.footer h4 {
  font-size: 12px; letter-spacing: 3px; margin-bottom: 18px;
  font-weight: 700; color: var(--ink);
}
.footer a { display: block; color: #666; font-size: 13px; margin-bottom: 10px; transition: color .2s; }
.footer a:hover { color: var(--pink); }
.footer form { display: flex; gap: 8px; }
.footer input { flex: 1; padding: 11px; border: 1px solid #ddd; font-size: 13px; font-family: inherit; }
.footer button {
  padding: 11px 18px; background: var(--ink); color: #fff; border: 0; cursor: pointer;
  font-size: 11px; letter-spacing: 2px; font-weight: 600;
}
.copy { text-align: center; padding: 20px; color: #aaa; font-size: 11px; letter-spacing: 2px; border-top: 1px solid var(--line); background: #fafafa; }

/* ======================================================
   MOBILE RESPONSIVE (≤ 768px)
   ====================================================== */
@media (max-width: 768px) {
  /* NAV */
  .nav {
    padding: 12px 14px; flex-wrap: wrap; gap: 8px;
  }
  .nav-left { order: 1; flex: 0 0 auto; }
  .nav-right { order: 2; flex: 1; justify-content: flex-end; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
  .nav-center {
    order: 3; width: 100%; display: flex; justify-content: space-around;
    border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px;
  }
  .nav-center a { margin: 0; font-size: 11px; letter-spacing: 1.5px; }
  .nav-right a, .nav-right span {
    margin: 0 4px; font-size: 10px; letter-spacing: 1px; padding: 4px 0;
  }
  .nav-right .cart-icon { width: 16px; height: 16px; }
  .logo img { height: 32px; }

  .back-arrow { margin: 14px 14px 0; padding: 8px 14px; font-size: 11px; }

  /* HOME HERO */
  .home-hero { padding: 30px 14px 20px; }
  .home-hero .logo-big { max-width: 320px; margin-bottom: 14px; }
  .home-hero .tagline { font-size: 16px; }
  .home-hero .subtagline { font-size: 10px; letter-spacing: 3px; }

  .hero-split { grid-template-columns: 1fr; gap: 4px; min-height: auto; padding: 4px; }
  .hero-tile { min-height: 260px; }
  .hero-label { bottom: 20px; left: 20px; right: 20px; }
  .hero-label .cat-name { font-size: 44px; letter-spacing: 4px; }
  .hero-label .cat-cta { font-size: 10px; letter-spacing: 2px; }

  .promo { padding: 40px 18px; }
  .promo h2 { font-size: 24px; }
  .promo p { font-size: 11px; letter-spacing: 1.5px; }

  /* CATEGORY */
  .category-banner { padding: 18px 14px 4px; }
  .category-banner img { max-height: 110px; }
  .category-header {
    padding: 16px 14px 10px; flex-direction: column; align-items: flex-start; gap: 12px;
  }
  .category-header h1 { font-size: 34px; letter-spacing: 4px; }
  .category-header .filters { width: 100%; }
  .category-header .filters select { width: 100%; padding: 12px; }

  .subnav {
    padding: 0 14px 14px; gap: 14px; overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  .subnav a { white-space: nowrap; font-size: 11px; padding-bottom: 10px; }

  /* GRID */
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 10px; }
  .product-card h3 { font-size: 12px; }
  .product-card .price { font-size: 12px; }
  .product-card .info { padding: 8px 2px 18px; }

  /* PRODUCT DETAIL */
  .product-detail { grid-template-columns: 1fr; gap: 20px; padding: 14px 14px 40px; }
  .product-images { grid-template-columns: 1fr; gap: 4px; }
  .product-info { padding: 14px 4px; position: static; }
  .product-info h1 { font-size: 24px; }
  .product-info .price-big { font-size: 18px; }
  .size-btn { min-width: 48px; padding: 12px 14px; font-size: 12px; }
  .add-to-cart { padding: 16px; font-size: 12px; letter-spacing: 2px; }

  /* CART */
  .cart-wrap { padding: 20px 14px; }
  .cart-wrap h1 { font-size: 28px; letter-spacing: 3px; }
  .cart-item { grid-template-columns: 80px 1fr; gap: 12px; padding: 14px 0; }
  .cart-item img { width: 80px; }
  .cart-item .meta h3 { font-size: 13px; }
  .cart-item .meta p { font-size: 12px; }
  .cart-item .price {
    grid-column: 2; text-align: right; font-weight: 700; font-size: 14px; color: var(--pink);
  }
  .cart-summary { flex-direction: column; gap: 8px; align-items: flex-start; }
  .cart-summary .total { font-size: 20px; }
  .checkout-btn { width: 100%; padding: 16px; font-size: 12px; letter-spacing: 2px; }

  /* FOOTER */
  .footer { grid-template-columns: 1fr; gap: 26px; padding: 40px 20px; margin-top: 40px; }
  .footer h4 { margin-bottom: 10px; }
  .copy { font-size: 10px; letter-spacing: 1px; padding: 16px; }

  /* Hide admin/pos nav items behind a more compact display */
  .nav-right a[href="admin.html"],
  .nav-right a[href="pos.html"] { font-size: 9px; opacity: .5; }

  /* TOAST */
  .toast { left: 20px; right: 20px; bottom: 20px; padding: 14px 18px; font-size: 12px; text-align: center; }

  /* INPUTS touch-friendly */
  input, select, textarea, button { font-size: 16px !important; } /* iOS zoom fix */
  button { min-height: 44px; }
}

  /* Admin-style pages wrappers */
  .admin-wrap, .cash-wrap, .ck-wrap, .cmd-wrap, .fid-wrap, .auth-wrap { padding: 0 14px; margin: 20px auto; }
  .fid-wrap { grid-template-columns: 1fr; gap: 30px; }
  .cash-grid { grid-template-columns: 1fr; }
  .cash-stats { grid-template-columns: repeat(2, 1fr); }
  .cash-form-card { position: static; }
  .tx-row { grid-template-columns: 1fr auto; gap: 8px; padding: 12px; font-size: 12px; }
  .tx-row .tx-date { grid-column: 1 / -1; }
  .tx-row.head { display: none; }
  .mode-options { grid-template-columns: 1fr; }
  .cust-dialog { width: 94vw; max-height: 92vh; }
  .receipt-paper { width: 94vw; padding: 18px; }
  .card, .card-back { max-width: 100%; }
  .member-row { grid-template-columns: 1fr; gap: 8px; }
  .fid-title, .cash-title, .cmd-title, .ck-title { font-size: 30px; letter-spacing: 3px; }

  /* POS mobile tweaks */
  .pos-topbar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .pos-topbar .search { order: 3; flex: 1 1 100%; font-size: 14px; padding: 11px 14px; }
  .pos-topbar .brand { font-size: 11px; }
  .pos-btn-client { padding: 10px 14px; font-size: 11px; }
  .pos-filters { padding: 10px 12px; }
  .chip { padding: 10px 16px; font-size: 11px; }
  .pos-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px; }

@media (max-width: 480px) {
  .category-header h1 { font-size: 28px; }
  .home-hero .logo-big { max-width: 260px; }
  .hero-label .cat-name { font-size: 36px; }
  .product-grid { gap: 4px; padding: 6px; }
  .back-arrow { margin: 10px; padding: 6px 12px; font-size: 10px; }
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 30px; right: 30px;
  background: var(--ink); color: #fff;
  padding: 16px 26px; font-size: 13px; letter-spacing: 1.5px; font-weight: 500;
  transform: translateY(100px); opacity: 0; transition: all .3s; z-index: 200;
  border-left: 3px solid var(--pink);
}
.toast.show { transform: translateY(0); opacity: 1; }
