/**
 * Madmoon Home Plugin Stylesheet (assets/madmoon-home.css)
 * Version 2.3.0
 * 1. تصميم احترافي لكارت المنتج مع زر أضف للسلة وشارة عسلية وهيكلة خطوط دقيقة
 * 2. تصغير السعر قبل التخفيض وجعله هادئاً بدون التهام المساحة
 * 3. حل مشكلة اختفاء الصفحة وإلزام العرض الفوري
 * 4. حذف كود الشات
 */

:root {
  --mh-ink: #151412;
  --mh-honey: #f2b21c;
  --mh-honey-hover: #d99a06;
  --mh-beige: #f6f0e4;
  --mh-card-bg: #ffffff;
  --mh-border: #e8e2d5;
  --mh-radius: 16px;
}

/* إلزام الصفحة بالظهور الفوري بنسبة 100% دون انتظار أي تفاعل أو تمرير */
html, body, .mh, .mh-wrap, .mh-section, .mh-hero, .mh-slider, .mh-track {
  opacity: 1 !important;
  visibility: visible !important;
}

.mh {
  direction: rtl;
  text-align: right;
  font-family: 'Cairo', system-ui, -apple-system, sans-serif;
  color: var(--mh-ink);
  padding-bottom: 50px;
  min-height: 100vh;
  box-sizing: border-box;
}

.mh-wrap {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.mh-section {
  margin-top: 48px;
  margin-bottom: 48px;
  position: relative;
}

.mh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  border-bottom: 2px solid var(--mh-beige);
  padding-bottom: 12px;
}

.mh-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
  color: var(--mh-ink);
  position: relative;
}

.mh-title::after {
  content: '';
  position: absolute;
  bottom: -14px;
  right: 0;
  width: 48px;
  height: 3px;
  background: var(--mh-honey);
  border-radius: 2px;
}

.mh-more {
  font-size: 14px;
  font-weight: 700;
  color: #685e50;
  text-decoration: none;
}

.mh-more:hover {
  color: var(--mh-honey-hover);
}

/* ==========================================================================
 * أزرار التقليب: أسهم واضحة بارزة جداً غير قابلة للإخفاء
 * ========================================================================== */
.mh-slider {
  position: relative;
  width: 100%;
}

.mh-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0;
  padding: 10px 4px 18px;
  list-style: none;
}

.mh-track::-webkit-scrollbar {
  display: none;
}

.mh-arrow {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 46px !important;
  height: 46px !important;
  min-width: 46px !important;
  min-height: 46px !important;
  border-radius: 50% !important;
  background-color: #ffffff !important;
  border: 2px solid #d4cdbd !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  cursor: pointer !important;
  z-index: 30 !important;
  transition: all 0.22s ease !important;
  color: #151412 !important;
}

.mh-arrow:hover {
  background-color: var(--mh-honey) !important;
  border-color: var(--mh-honey) !important;
  transform: translateY(-50%) scale(1.1) !important;
  box-shadow: 0 6px 20px rgba(242, 178, 28, 0.45) !important;
}

.mh-arrow svg,
.mh-arrow .mh-ico,
.mh-hero__nav svg {
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  stroke: #151412 !important;
  stroke-width: 3.2px !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  fill: none !important;
  color: #151412 !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: none !important;
}

.mh-arrow polyline {
  stroke: #151412 !important;
  stroke-width: 3.2px !important;
  fill: none !important;
}

.mh-arrow--prev {
  right: -22px !important;
  left: auto !important;
}

.mh-arrow--next {
  left: -22px !important;
  right: auto !important;
}

@media (max-width: 1200px) {
  .mh-arrow--prev { right: 4px !important; }
  .mh-arrow--next { left: 4px !important; }
}

/* ==========================================================================
 * بطاقات المنتجات الاحترافية (Product Card)
 * ========================================================================== */
.mh-card {
  flex: 0 0 270px;
  scroll-snap-align: start;
  list-style: none;
}

.mh-card__box {
  background: var(--mh-card-bg);
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.mh-card__box:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(21, 20, 18, 0.12);
  border-color: #f2b21c;
}

.mh-card__media {
  position: relative;
  display: block;
  background: #faf8f5;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-bottom: 1px solid #f0eae1;
}

.mh-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
  box-sizing: border-box;
  transition: transform 0.35s ease;
}

.mh-card__box:hover .mh-card__img {
  transform: scale(1.06);
}

/* شارة العروض بلون المتجر العسلي الفخم (بدون أي لون أحمر شاذ) */
.mh-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.mh-badge--honey {
  background: linear-gradient(135deg, #f2b21c, #d99a06);
  color: #151412;
}

.mh-badge--out {
  background: #78716c;
  color: #ffffff;
}

.mh-card__brand-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #78716c;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.06);
  z-index: 5;
}

.mh-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
  gap: 12px;
}

/* عنوان المنتج: حجم متناسق لا يطغى */
.mh-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mh-card__title a {
  color: var(--mh-ink);
  text-decoration: none;
  transition: color 0.2s;
}

.mh-card__title a:hover {
  color: var(--mh-honey-hover);
}

/* منطقة السعر: السعر الحالي كبير وعريض، والسعر السابق صغير وهادئ */
.mh-card__price {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f5efe6;
  font-size: 18px;
  font-weight: 900;
  color: var(--mh-ink);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

/* السعر قبل التخفيض: خط صغير، خافت ومشطوب بأناقة */
.mh-card__price del,
.mh-card__price del .amount {
  font-size: 12px !important;
  font-weight: 400 !important;
  color: #a8a29e !important;
  text-decoration: line-through !important;
  opacity: 0.85;
}

/* السعر بعد التخفيض: خط كبير وبارز */
.mh-card__price ins,
.mh-card__price ins .amount {
  font-size: 19px !important;
  font-weight: 900 !important;
  color: #151412 !important;
  text-decoration: none !important;
}

/* زر أضف للسلة الإلزامي والبارز */
.mh-card__cta {
  margin-top: 4px;
}

.mh-card__cta .button,
.mh-card__cta button,
.mh-card__cta .mh-btn-cart {
  width: 100% !important;
  background: var(--mh-ink) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 10px 14px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

.mh-card__cta .button:hover,
.mh-card__cta button:hover,
.mh-card__cta .mh-btn-cart:hover {
  background: var(--mh-honey) !important;
  color: #151412 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(242, 178, 28, 0.35) !important;
}

/* أيقونة السلة داخل الزر */
.mh-btn-cart svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

/* بطاقات الأقسام */
.mh-catitem {
  flex: 0 0 130px;
  scroll-snap-align: start;
}

.mh-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  gap: 10px;
}

.mh-cat__media {
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--mh-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mh-cat__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mh-cat__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--mh-ink);
}

/* سلايدر الهيرو */
.mh-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--mh-radius);
  margin-top: 16px;
}

.mh-hero__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  border-radius: var(--mh-radius);
}

.mh-hero__track::-webkit-scrollbar {
  display: none;
}

.mh-hero__slide {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  scroll-snap-align: start;
}

.mh-hero__slide picture,
.mh-hero__slide img {
  display: block;
  width: 100%;
  height: 100%;
}

.mh-hero__slide img {
  object-fit: cover;
  object-position: center;
}

.mh-hero__nav--prev { right: 18px !important; }
.mh-hero__nav--next { left: 18px !important; }

/* البانر العريض */
.mh-sbanner--full {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

.mh-sbanner--full picture,
.mh-sbanner--full img,
.mh-sbanner picture,
.mh-sbanner img {
  display: block;
  width: 100%;
  height: 100%;
}

.mh-sbanner--full img,
.mh-sbanner img {
  object-fit: cover;
  object-position: center;
}

.mh-sbanner:not(.mh-sbanner--full) {
  width: 100%;
  aspect-ratio: 4 / 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}

/* شبكة أشهر الماركات 4×4 */
.mh-brands-grid--4x4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 1.6vw, 18px);
  list-style: none;
  padding: 0;
  margin: 0;
}

.mh-brand-item {
  min-width: 0;
}

.mh-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 142px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--mh-border);
  border-radius: 14px;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.mh-brand__img {
  display: block;
  width: 100%;
  max-width: 190px;
  height: 88px;
  object-fit: contain;
  object-position: center;
}

.mh-brand__name {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 88px;
  color: var(--mh-ink);
  font-size: clamp(14px, 1.5vw, 18px);
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.mh-brand:hover {
  border-color: var(--mh-honey);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(21, 20, 18, 0.08);
}

@media (max-width: 640px) {
  .mh-hero__slide {
    aspect-ratio: 5 / 4;
  }

  .mh-sbanner--full,
  .mh-sbanner:not(.mh-sbanner--full) {
    aspect-ratio: 5 / 3;
  }

  .mh-brands-grid--4x4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .mh-brand {
    height: 116px;
    padding: 12px;
    border-radius: 12px;
  }

  .mh-brand__img,
  .mh-brand__name {
    height: 76px;
    min-height: 76px;
  }

  .mh-brand__img {
    max-width: 160px;
  }
}

/*الفئات*/
/* حاوية الفئات - التسنطير في المنتصف */
.mh-cats-row-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

/* الصف الذي يجمع صور الفئات */
.mh-cats-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 15px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
    max-width: 1200px;
}

/* الكارت الخاص بكل فئة */
.mh-cat-card-item {
    flex: 0 1 calc(20% - 12px); /* 5 كروت في الصف على الشاشات الكبيرة */
    min-width: 160px;
    max-width: 220px;
}

.mh-cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    background: #111111; /* خلفية داكنة تناسب تصميم البنرات المصممة */
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #222222;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.mh-cat-card:hover {
    transform: translateY(-5px);
    border-color: #f2b21c; /* لون المتجر العسلي عند التحويم */
    box-shadow: 0 8px 20px rgba(242, 178, 28, 0.15);
}

/* حاوية الصورة المربعة */
.mh-cat-card__media {
    width: 100%;
    aspect-ratio: 1 / 1; /* نسبة 1:1 مربعة تماماً مثل التصميم المرفق */
    overflow: hidden;
    position: relative;
    background-color: #000;
}

.mh-cat-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* تغطية المساحة بالكامل بصورة التصميم */
    display: block;
    transition: transform 0.3s ease;
}

.mh-cat-card:hover .mh-cat-card__img {
    transform: scale(1.04);
}

/* اسم الفئة أسفل الصورة (اختياري، يظهر في حالة لم يكن الاسم مكتوباً داخل التصميم نفسه) */
.mh-cat-card__title {
    padding: 10px 5px;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
}

/* تجاوب الشاشات الصغيرة والموبايل */
@media (max-width: 991px) {
    .mh-cat-card-item {
        flex: 0 1 calc(33.333% - 10px); /* 3 كروت في الصف */
    }
}

@media (max-width: 576px) {
    .mh-cats-row {
        gap: 10px;
    }
    .mh-cat-card-item {
        flex: 0 1 calc(48% - 5px); /* كارتين في الصف على الموبايل لتنسيق ممتاذ */
        min-width: unset;
    }
    .mh-cat-card__title {
        font-size: 12px;
    }
}
/*-------------*/
/*Footer*/

