/*
Theme Name: MR Market
Theme URI: https://mrmarket.dz
Author: MR Market
Author URI: https://mrmarket.dz
Description: Thème boutique pour MR Market, spécialiste du sac à main en Algérie. Mise en avant dynamique des catégories et produits disponibles, livraison 24H sur les 69 wilayas, et bouton WhatsApp flottant sur toutes les pages. Compatible WooCommerce.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
Text Domain: mr-market
Tags: e-commerce, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* =========================================================
   MR MARKET — DESIGN TOKENS
   Palette:
     --mm-cream    : #F7F2EC  (base background, atelier paper)
     --mm-bordeaux : #5C1A2B  (brand / primary — deep leather bordeaux)
     --mm-caramel  : #B08655  (leather tan — secondary accent)
     --mm-ink      : #2B2420  (charcoal ink — text)
     --mm-gold     : #A6842D  (foil gold — small details only)
     --mm-line     : #E4DACB  (hairline borders)
   Type:
     Display: 'Fraunces' — warm, leathery slab-serif for headlines
     Body/UI: 'Work Sans' — clean grotesque for body & interface
   ========================================================= */

:root{
  --mm-cream: #F7F2EC;
  --mm-cream-2: #FBF8F4;
  --mm-bordeaux: #5C1A2B;
  --mm-bordeaux-dark: #451420;
  --mm-caramel: #B08655;
  --mm-caramel-light: #E9D9C3;
  --mm-ink: #2B2420;
  --mm-gold: #A6842D;
  --mm-line: #E4DACB;
  --mm-white: #FFFFFF;
  --mm-radius: 2px;
  --mm-max: 1240px;
  --mm-whatsapp: #25D366;
}

*,*::before,*::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--mm-cream);
  color: var(--mm-ink);
  font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img{ max-width: 100%; display: block; height: auto; }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin: 0; padding: 0; }
h1,h2,h3,h4{
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  color: var(--mm-bordeaux-dark);
}
p{ margin: 0 0 1em; max-width: 62ch; }
.mm-container{
  max-width: var(--mm-max);
  margin: 0 auto;
  padding: 0 24px;
}
.mm-btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  background: var(--mm-bordeaux);
  color: var(--mm-cream-2);
  font-family: 'Work Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--mm-bordeaux);
  border-radius: var(--mm-radius);
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.mm-btn:hover{ background: var(--mm-bordeaux-dark); }
.mm-btn.mm-btn--ghost{
  background: transparent;
  color: var(--mm-bordeaux);
}
.mm-btn.mm-btn--ghost:hover{ background: var(--mm-bordeaux); color: var(--mm-cream-2); }

/* Skip link */
.mm-skip-link{
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: var(--mm-bordeaux); color: #fff; padding: 12px 18px;
}
.mm-skip-link:focus{ left: 12px; top: 12px; }

/* =========================================================
   TOP BAR — livraison 24H / 69 wilayas
   ========================================================= */
.mm-topbar{
  background: var(--mm-bordeaux);
  color: var(--mm-cream-2);
  overflow: hidden;
  border-bottom: 1px solid var(--mm-gold);
}
.mm-topbar__track{
  display: flex;
  white-space: nowrap;
  animation: mm-scroll 22s linear infinite;
  width: max-content;
}
.mm-topbar__item{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 40px;
  font-size: 13.5px;
  letter-spacing: .02em;
}
.mm-topbar__item svg{ width: 15px; height: 15px; flex: none; }
@keyframes mm-scroll{
  from{ transform: translateX(0); }
  to{ transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce){
  .mm-topbar__track{ animation: none; }
}

/* =========================================================
   HEADER — grand logo bien visible
   ========================================================= */
.mm-header{
  background: var(--mm-cream-2);
  border-bottom: 1px solid var(--mm-line);
  position: sticky;
  top: 0;
  z-index: 999;
  transition: box-shadow .25s ease, padding .25s ease;
}
.mm-header.is-scrolled{ box-shadow: 0 6px 24px rgba(43,36,32,.08); }
.mm-header__inner{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  transition: padding .25s ease;
}
.mm-header.is-scrolled .mm-header__inner{ padding: 12px 24px; }
.mm-logo{
  display: flex;
  align-items: center;
  flex: none;
}
.mm-logo img{
  height: 92px;
  width: auto;
  max-width: 340px;
  object-fit: contain;
  transition: height .25s ease;
}
.mm-header.is-scrolled .mm-logo img{ height: 58px; }
.mm-logo .mm-logo__text{
  font-family: 'Fraunces', serif;
  font-size: 30px;
  font-weight: 600;
  color: var(--mm-bordeaux);
}
.mm-nav{ flex: 1; display: flex; justify-content: center; }
.mm-nav ul{ display: flex; gap: 34px; }
.mm-nav a{
  font-size: 15px;
  font-weight: 500;
  color: var(--mm-ink);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color .2s ease, color .2s ease;
}
.mm-nav a:hover, .mm-nav .current-menu-item > a{
  color: var(--mm-bordeaux);
  border-color: var(--mm-caramel);
}
.mm-header__actions{ display: flex; align-items: center; gap: 18px; flex: none; }
.mm-header__phone{
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--mm-bordeaux);
}
.mm-header__phone svg{ width: 17px; height: 17px; }
.mm-menu-toggle{
  display: none;
  background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 8px;
}
.mm-menu-toggle span{ width: 24px; height: 2px; background: var(--mm-ink); display: block; }

@media (max-width: 900px){
  .mm-nav{ display: none; }
  .mm-menu-toggle{ display: flex; }
  .mm-header__phone{ display: none; }
  .mm-logo img{ height: 64px; }
  .mm-nav.is-open{
    display: flex; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--mm-cream-2); border-top: 1px solid var(--mm-line);
    padding: 12px 24px 20px;
  }
  .mm-nav.is-open ul{ flex-direction: column; gap: 4px; width: 100%; }
  .mm-nav.is-open a{ display: block; padding: 12px 0; border-bottom: 1px solid var(--mm-line); }
}

/* =========================================================
   HERO
   ========================================================= */
.mm-hero{
  background: linear-gradient(180deg, var(--mm-cream-2) 0%, var(--mm-cream) 100%);
  border-bottom: 1px solid var(--mm-line);
}
.mm-hero__inner{
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
  padding: 72px 24px;
}
.mm-hero__eyebrow{
  font-size: 14px; color: var(--mm-caramel); font-weight: 600; margin-bottom: 14px;
}
.mm-hero h1{
  font-size: clamp(38px, 5vw, 58px);
  margin-bottom: 22px;
  max-width: 14ch;
}
.mm-hero p.mm-lead{
  font-size: 18px; color: #514840; max-width: 46ch; margin-bottom: 30px;
}
.mm-hero__ctas{ display: flex; gap: 14px; flex-wrap: wrap; }
.mm-hero__badges{ display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.mm-hero__badge{ font-size: 13px; color: var(--mm-ink); display: flex; align-items: center; gap: 8px; }
.mm-hero__badge svg{ width: 16px; height: 16px; color: var(--mm-bordeaux); flex: none; }
.mm-hero__visual{
  position: relative;
  aspect-ratio: 4/5;
  background: var(--mm-caramel-light);
  border: 1px solid var(--mm-line);
  border-radius: var(--mm-radius);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.mm-hero__visual img{ width: 100%; height: 100%; object-fit: cover; }
.mm-hero__visual .mm-hero__placeholder{
  color: var(--mm-caramel); font-family: 'Fraunces', serif; font-size: 22px; text-align: center; padding: 20px;
}
@media (max-width: 860px){
  .mm-hero__inner{ grid-template-columns: 1fr; padding: 48px 24px; }
  .mm-hero__visual{ order: -1; aspect-ratio: 16/10; }
}

/* =========================================================
   SECTION HEADINGS
   ========================================================= */
.mm-section{ padding: 68px 0; }
.mm-section--tight{ padding: 44px 0; }
.mm-section__head{
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 34px; border-bottom: 1px solid var(--mm-line); padding-bottom: 18px;
}
.mm-section__head h2{ font-size: 30px; margin: 0; }
.mm-section__head p{ margin: 0; color: #6b6157; font-size: 14.5px; }

/* =========================================================
   CATEGORIES — étagère (shelf) horizontale
   ========================================================= */
.mm-shelf{
  display: flex;
  gap: 26px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
}
.mm-shelf::-webkit-scrollbar{ height: 6px; }
.mm-shelf::-webkit-scrollbar-thumb{ background: var(--mm-line); border-radius: 4px; }
.mm-cat{
  flex: none; width: 190px; scroll-snap-align: start; text-align: center;
}
.mm-cat__img{
  width: 190px; height: 190px; border-radius: 50%;
  border: 1px solid var(--mm-line); background: var(--mm-cream-2);
  overflow: hidden; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
}
.mm-cat__img img{ width: 100%; height: 100%; object-fit: cover; }
.mm-cat__img .mm-cat__initial{ font-family: 'Fraunces', serif; font-size: 34px; color: var(--mm-caramel); }
.mm-cat__name{ font-weight: 600; font-size: 15.5px; margin-bottom: 4px; }
.mm-cat__count{ font-size: 12.5px; color: #8a8074; }
.mm-cat:hover .mm-cat__img{ border-color: var(--mm-caramel); }

.mm-empty-note{
  border: 1px dashed var(--mm-line); border-radius: var(--mm-radius);
  padding: 26px; color: #6b6157; font-size: 14.5px; background: var(--mm-cream-2);
}

/* =========================================================
   TRUST STRIP (3 items, not a sequence — no numbering)
   ========================================================= */
.mm-trust{
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1px;
  background: var(--mm-line); border: 1px solid var(--mm-line);
}
.mm-trust__item{
  background: var(--mm-cream-2); padding: 30px 26px; display: flex; gap: 16px; align-items: flex-start;
}
.mm-trust__item svg{ width: 26px; height: 26px; color: var(--mm-bordeaux); flex: none; margin-top: 2px; }
.mm-trust__item h3{ font-size: 17px; margin: 0 0 6px; }
.mm-trust__item p{ font-size: 14px; color: #6b6157; margin: 0; }
@media (max-width: 760px){ .mm-trust{ grid-template-columns: 1fr; } }

/* =========================================================
   PRODUCTS GRID
   ========================================================= */
.mm-products{
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 22px;
}
@media (max-width: 1000px){ .mm-products{ grid-template-columns: repeat(3,1fr); } }
@media (max-width: 700px){ .mm-products{ grid-template-columns: repeat(2,1fr); gap: 20px 14px; } }
.mm-card{
  border: 1px solid var(--mm-line); background: var(--mm-cream-2);
  display: flex; flex-direction: column;
}
.mm-card__img{
  aspect-ratio: 1/1; background: var(--mm-caramel-light); overflow: hidden; position: relative;
}
.mm-card__img img{ width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.mm-card:hover .mm-card__img img{ transform: scale(1.04); }
.mm-card__stock{
  position: absolute; top: 10px; left: 10px;
  background: var(--mm-bordeaux); color: #fff; font-size: 11px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px; letter-spacing: .02em;
}
.mm-card__body{ padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mm-card__cat{ font-size: 12px; color: var(--mm-caramel); font-weight: 600; }
.mm-card__title{ font-size: 15.5px; font-weight: 600; margin: 0; }
.mm-card__title a{ color: var(--mm-ink); }
.mm-card__price{ margin-top: auto; font-family: 'Fraunces', serif; font-size: 18px; color: var(--mm-bordeaux-dark); }

/* =========================================================
   FOOTER
   ========================================================= */
.mm-footer{
  background: var(--mm-ink); color: #E9E2D8; margin-top: 40px;
}
.mm-footer__top{
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 40px; padding: 60px 24px 40px;
}
.mm-footer h4{ color: #fff; font-size: 16px; margin-bottom: 16px; }
.mm-footer__about p{ color: #C7BEB2; font-size: 14px; }
.mm-footer__logo{ height: 48px; width: auto; margin-bottom: 16px; }
.mm-footer ul li{ margin-bottom: 10px; }
.mm-footer a{ color: #C7BEB2; font-size: 14px; transition: color .2s ease; }
.mm-footer a:hover{ color: #fff; }
.mm-footer__social{ display: flex; gap: 12px; margin-top: 6px; }
.mm-footer__social a{
  width: 38px; height: 38px; border: 1px solid #4a4137; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mm-footer__social a:hover{ border-color: var(--mm-caramel); background: rgba(176,134,85,.12); }
.mm-footer__social svg{ width: 17px; height: 17px; }
.mm-footer__bottom{
  border-top: 1px solid #423a31; padding: 20px 24px; text-align: center;
  font-size: 13px; color: #9a9186;
}
@media (max-width: 860px){
  .mm-footer__top{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px){
  .mm-footer__top{ grid-template-columns: 1fr; }
}

/* =========================================================
   WHATSAPP FLOATING BUTTON — sticky on every page
   ========================================================= */
.mm-whatsapp{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--mm-whatsapp);
  color: #fff;
  padding: 14px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(37,211,102,.4);
  font-weight: 600;
  font-size: 14px;
  transition: box-shadow .2s ease, transform .2s ease;
  animation: mm-wa-pulse 2.6s ease-in-out infinite;
}
.mm-whatsapp:hover{ transform: translateY(-2px); box-shadow: 0 10px 28px rgba(37,211,102,.55); }
.mm-whatsapp svg{ width: 26px; height: 26px; flex: none; }
.mm-whatsapp__text{ white-space: nowrap; }
@keyframes mm-wa-pulse{
  0%, 100%{ box-shadow: 0 8px 24px rgba(37,211,102,.4); }
  50%{ box-shadow: 0 8px 24px rgba(37,211,102,.4), 0 0 0 10px rgba(37,211,102,.14); }
}
@media (prefers-reduced-motion: reduce){ .mm-whatsapp{ animation: none; } }
@media (max-width: 600px){
  .mm-whatsapp__text{ display: none; }
  .mm-whatsapp{ padding: 15px; }
}

/* =========================================================
   GENERIC PAGE / SINGLE CONTENT
   ========================================================= */
.mm-page{ padding: 60px 0; }
.mm-page h1{ font-size: 36px; margin-bottom: 24px; }
.mm-content-narrow{ max-width: 780px; }

/* Focus visibility */
a:focus-visible, button:focus-visible{ outline: 2px solid var(--mm-bordeaux); outline-offset: 2px; }
