/* =====================================================
   Matjari Blocks — Frontend CSS
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }
.mb-btn {
  display: inline-block; padding: 12px 28px; border-radius: 6px;
  font-weight: 700; font-size: 15px; text-decoration: none;
  cursor: pointer; border: none; transition: opacity .2s, transform .15s;
  text-align: center;
}
.mb-btn:hover { opacity: .88; transform: translateY(-1px); }
.mb-section-title {
  text-align: center; font-size: 26px; font-weight: 800;
  margin: 0 0 28px; color: #222;
}
.mb-placeholder { background: #f0f4ff; border: 2px dashed #aab; padding: 30px; text-align: center; border-radius: 8px; color: #667; }

/* --- Hero Slider --- */
.mb-hero-slider { position: relative; overflow: hidden; direction: rtl; }
.mb-hero-track { display: flex; transition: transform .5s cubic-bezier(.4,0,.2,1); }
.mb-hero-slide { min-width: 100%; position: relative; background-size: cover; background-position: center; background-repeat: no-repeat; }
.mb-hero-overlay { position: absolute; inset: 0; }
.mb-hero-content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 40px 20px; gap: 16px; }
.mb-hero-heading { font-size: clamp(24px,4vw,56px); font-weight: 900; color: #fff; margin: 0; line-height: 1.2; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.mb-hero-sub { font-size: clamp(14px,2vw,22px); color: #fff; margin: 0; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
.mb-hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.2); color: #fff; border: 2px solid rgba(255,255,255,.5); border-radius: 50%; width: 46px; height: 46px; font-size: 20px; cursor: pointer; z-index: 10; transition: background .2s; }
.mb-hero-arrow:hover { background: rgba(255,255,255,.4); }
.mb-hero-prev { right: 16px; }
.mb-hero-next { left: 16px; }
.mb-hero-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; }
.mb-hero-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.5); border: none; cursor: pointer; transition: background .2s, transform .2s; padding: 0; }
.mb-hero-dot.active { background: #fff; transform: scale(1.3); }

/* --- Quick Order --- */
.mb-quick-order { max-width: 560px; margin: 0 auto; direction: rtl; }
.mb-qo-product-img img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 10px; margin-bottom: 20px; }
.mb-qo-title { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.mb-qo-sub { color: #666; margin: 0 0 12px; }
.mb-qo-product-name { background: #f0f4ff; padding: 10px 14px; border-radius: 6px; margin-bottom: 20px; }
.mb-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.mb-field label { font-weight: 600; font-size: 14px; }
.mb-field input, .mb-field textarea, .mb-field select { padding: 12px 14px; border: 1.5px solid #e0e0e0; border-radius: 8px; font-size: 15px; font-family: inherit; width: 100%; transition: border-color .2s; }
.mb-field input:focus, .mb-field textarea:focus { outline: none; border-color: #e53e3e; }
.mb-field textarea { resize: vertical; min-height: 80px; }
.mb-qty-ctrl { display: flex; align-items: center; gap: 0; border: 1.5px solid #e0e0e0; border-radius: 8px; overflow: hidden; max-width: 130px; }
.mb-qty-ctrl input { border: none; text-align: center; width: 50px; font-weight: 700; font-size: 16px; }
.mb-qty-ctrl button { width: 38px; height: 42px; background: #f5f5f5; border: none; font-size: 20px; cursor: pointer; font-weight: 700; transition: background .2s; }
.mb-qty-ctrl button:hover { background: #e53e3e; color: #fff; }
.mb-qo-submit { width: 100%; padding: 16px; font-size: 17px; margin-top: 8px; }
.mb-qo-msg { margin-top: 12px; padding: 12px; border-radius: 8px; text-align: center; font-weight: 600; display: none; }
.mb-qo-msg.success { background: #e8f5e9; color: #2e7d32; display: block; }
.mb-qo-msg.error { background: #fde8e8; color: #c62828; display: block; }

/* --- Product Grid --- */
.mb-product-grid-wrap { direction: rtl; }
.mb-pg-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; justify-content: center; }
.mb-filter-btn { padding: 8px 20px; border-radius: 20px; border: 1.5px solid #e0e0e0; background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .2s; }
.mb-filter-btn.active, .mb-filter-btn:hover { background: #e53e3e; color: #fff; border-color: #e53e3e; }
.mb-product-grid { display: grid; grid-template-columns: repeat(var(--cols,3), 1fr); }
.mb-product-card { overflow: hidden; transition: transform .25s, box-shadow .25s; }
.mb-product-card:hover { transform: translateY(-4px); }
.mb-shadow { box-shadow: 0 4px 18px rgba(0,0,0,.1); }
.mb-shadow:hover { box-shadow: 0 10px 32px rgba(0,0,0,.16); }
.mb-card-img-wrap { display: block; position: relative; overflow: hidden; aspect-ratio: 1; }
.mb-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.mb-product-card:hover .mb-card-img-wrap img { transform: scale(1.05); }
.mb-sale-badge { position: absolute; top: 10px; right: 10px; background: #e53e3e; color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.mb-card-body { padding: 14px 16px 18px; }
.mb-card-title { font-size: 15px; margin: 0 0 8px; line-height: 1.4; }
.mb-card-title a { text-decoration: none; color: inherit; }
.mb-card-price { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.mb-card-price del { color: #999; font-weight: 400; font-size: 14px; margin-right: 6px; }
.mb-card-btn { width: 100%; font-size: 14px; padding: 10px; text-align: center; border-radius: 6px; }

/* --- Flash Deals --- */
.mb-flash-deals { direction: rtl; overflow: hidden; }
.mb-fd-title { font-size: 22px; font-weight: 800; margin-bottom: 20px; }
.mb-fd-slider { position: relative; overflow: hidden; }
.mb-fd-track { display: flex; gap: 16px; transition: transform .4s; }
.mb-fd-card { min-width: 200px; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.08); position: relative; flex-shrink: 0; }
.mb-fd-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.mb-fd-badge { position: absolute; top: 8px; right: 8px; color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.mb-fd-info { padding: 12px; }
.mb-fd-name { text-decoration: none; color: #222; font-weight: 700; font-size: 14px; display: block; margin-bottom: 8px; }
.mb-fd-price { font-weight: 800; margin-bottom: 10px; }
.mb-fd-price del { color: #999; font-size: 12px; }
.mb-fd-btn { font-size: 13px; padding: 8px 16px; width: 100%; text-align: center; }
.mb-fd-prev, .mb-fd-next { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.9); border: 1.5px solid #e0e0e0; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; font-size: 16px; z-index: 5; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.mb-fd-prev { right: 0; }
.mb-fd-next { left: 0; }

/* --- Categories Grid --- */
.mb-categories-grid { display: grid; grid-template-columns: repeat(var(--cols,4),1fr); direction: rtl; }
.mb-cat-item { position: relative; text-decoration: none; overflow: hidden; display: flex; align-items: flex-end; }
.mb-cat-item:hover .mb-cat-overlay { opacity: .7; }
.mb-cat-overlay { position: absolute; inset: 0; transition: opacity .3s; }
.mb-cat-label { position: relative; z-index: 2; padding: 12px; width: 100%; }
.mb-cat-name { display: block; font-weight: 700; font-size: 15px; }
.mb-cat-count { font-size: 12px; opacity: .8; }

/* --- Best Sellers --- */
.mb-best-sellers { direction: rtl; }
.mb-bs-grid { display: grid; grid-template-columns: repeat(var(--cols,4),1fr); gap: 20px; }
.mb-bs-card { position: relative; overflow: hidden; background: #fff; box-shadow: 0 3px 16px rgba(0,0,0,.08); }
.mb-bs-rank { position: absolute; top: 10px; right: 10px; color: #fff; padding: 4px 10px; border-radius: 20px; font-size: 13px; font-weight: 800; z-index: 2; }
.mb-bs-card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.mb-bs-info { padding: 14px; }
.mb-bs-name { text-decoration: none; color: #222; font-weight: 700; display: block; margin-bottom: 6px; }
.mb-bs-price { font-size: 18px; font-weight: 800; color: #e53e3e; margin-bottom: 4px; }
.mb-bs-sold { font-size: 12px; color: #4caf50; margin-bottom: 12px; }

/* --- Single Product Showcase --- */
.mb-showcase { display: flex; gap: 40px; align-items: center; padding: 40px; direction: rtl; }
.mb-showcase-image-right { flex-direction: row-reverse; }
.mb-showcase-img { flex: 1; }
.mb-showcase-img img { width: 100%; max-height: 420px; object-fit: cover; }
.mb-showcase-content { flex: 1; }
.mb-showcase-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.mb-showcase-badge { border: 1.5px solid; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.mb-showcase-title { font-size: clamp(20px,3vw,36px); font-weight: 900; margin: 0 0 12px; }
.mb-showcase-price { font-size: 28px; font-weight: 900; margin-bottom: 16px; }
.mb-showcase-desc { color: #555; line-height: 1.7; margin-bottom: 24px; }
.mb-showcase-btn { font-size: 17px; padding: 14px 36px; }

/* --- Bought Together --- */
.mb-bought-together { direction: rtl; background: #f9f9f9; border-radius: 12px; padding: 28px; }
.mb-bt-items { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.mb-bt-item { display: flex; align-items: center; gap: 10px; background: #fff; padding: 10px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.mb-bt-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.mb-bt-info a { text-decoration: none; color: #222; font-weight: 700; font-size: 14px; }
.mb-bt-plus { font-size: 24px; font-weight: 900; color: #999; }
.mb-bt-footer { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.mb-bt-savings { background: #e8f5e9; color: #2e7d32; padding: 10px 16px; border-radius: 8px; font-size: 15px; }

/* --- Post Grid --- */
.mb-post-grid-wrap { direction: rtl; }
.mb-post-grid { display: grid; grid-template-columns: repeat(var(--cols,3),1fr); gap: 24px; }
.mb-post-card { overflow: hidden; background: #fff; box-shadow: 0 3px 14px rgba(0,0,0,.08); }
.mb-post-img { display: block; overflow: hidden; aspect-ratio: 16/9; }
.mb-post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.mb-post-card:hover .mb-post-img img { transform: scale(1.05); }
.mb-post-body { padding: 18px; }
.mb-post-date { font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.mb-post-title { font-size: 17px; font-weight: 800; margin: 8px 0; line-height: 1.5; }
.mb-post-title a { text-decoration: none; color: #222; }
.mb-post-excerpt { color: #666; font-size: 14px; line-height: 1.6; margin-bottom: 12px; }
.mb-post-rm { text-decoration: none; font-weight: 700; font-size: 14px; }

/* Featured Post */
.mb-featured-post { display: flex; gap: 36px; align-items: center; padding: 32px; direction: rtl; border-radius: 12px; }
.mb-fp-image-right { flex-direction: row-reverse; }
.mb-fp-img { flex: 1; display: block; }
.mb-fp-img img { width: 100%; object-fit: cover; }
.mb-fp-content { flex: 1; }
.mb-fp-badge { display: inline-block; color: #fff; padding: 4px 14px; border-radius: 20px; font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.mb-fp-title { font-size: clamp(18px,2.5vw,30px); font-weight: 900; margin: 0 0 14px; }
.mb-fp-title a { text-decoration: none; color: #222; }
.mb-fp-excerpt { color: #666; line-height: 1.7; margin-bottom: 20px; }

/* --- News Ticker --- */
.mb-news-ticker { display: flex; align-items: center; height: 42px; overflow: hidden; direction: rtl; }
.mb-ticker-label { flex-shrink: 0; padding: 0 16px; height: 100%; display: flex; align-items: center; font-weight: 700; font-size: 14px; color: #fff; white-space: nowrap; }
.mb-ticker-wrap { flex: 1; overflow: hidden; height: 100%; display: flex; align-items: center; }
.mb-ticker-content { white-space: nowrap; display: inline-block; animation: mb-ticker linear infinite; font-size: 14px; font-weight: 500; }
@keyframes mb-ticker { from { transform: translateX(-50%); } to { transform: translateX(0); } }

/* --- Countdown Timer --- */
.mb-countdown { padding: 32px 20px; text-align: center; direction: rtl; }
.mb-countdown-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.mb-countdown-blocks { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.mb-cd-block { min-width: 90px; padding: 16px 12px; border: 2px solid; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mb-cd-num { font-size: 42px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.mb-cd-label { font-size: 13px; opacity: .8; }

/* --- Trust Badges --- */
.mb-trust-badges { display: flex; flex-wrap: wrap; justify-content: center; direction: rtl; }
.mb-trust-horizontal { flex-direction: row; }
.mb-trust-vertical { flex-direction: column; align-items: flex-start; }
.mb-trust-item { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 180px; }
.mb-trust-icon { font-size: 32px; flex-shrink: 0; }
.mb-trust-text { display: flex; flex-direction: column; gap: 3px; }
.mb-trust-text strong { font-size: 15px; }
.mb-trust-text span { font-size: 13px; opacity: .7; }

/* --- Comparison Table --- */
.mb-comparison-wrap { direction: rtl; overflow: hidden; }
.mb-comparison-scroll { overflow-x: auto; }
.mb-comparison-table { width: 100%; border-collapse: collapse; }
.mb-comparison-table th, .mb-comparison-table td { padding: 14px 20px; text-align: center; border-bottom: 1px solid #f0f0f0; font-size: 15px; }
.mb-comparison-table thead th { font-size: 16px; font-weight: 700; }
.mb-comp-badge { display: inline-block; color: #fff; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; margin-right: 6px; }
.mb-comp-price { font-size: 18px; font-weight: 900; margin-top: 6px; }
.mb-comp-feature { text-align: right; font-weight: 600; }
.mb-comparison-table tbody tr:hover td { background: #fafafa; }

/* --- Free Shipping Progress --- */
.mb-shipping-progress { direction: rtl; }
.mb-sp-text { font-size: 15px; color: #555; }
.mb-sp-done { font-weight: 700; font-size: 16px; }

/* --- Testimonials --- */
.mb-testimonials { direction: rtl; }
.mb-testi-track { display: flex; gap: 20px; flex-wrap: wrap; }
.mb-testi-slider .mb-testi-track { flex-wrap: nowrap; overflow: hidden; transition: transform .4s; }
.mb-testi-card { padding: 24px; flex: 1; min-width: 260px; }
.mb-testi-stars { font-size: 20px; margin-bottom: 12px; }
.mb-testi-text { font-size: 15px; line-height: 1.7; color: #555; margin-bottom: 20px; }
.mb-testi-author { display: flex; align-items: center; gap: 12px; }
.mb-testi-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid; }
.mb-testi-placeholder { display: flex; align-items: center; justify-content: center; background: #f0f4ff; color: #446; font-weight: 700; font-size: 20px; }
.mb-testi-author strong { display: block; font-size: 15px; }
.mb-testi-author span { font-size: 12px; color: #888; }
.mb-verified { font-size: 12px; font-weight: 600; }
.mb-testi-nav { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.mb-testi-prev, .mb-testi-next { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid #e0e0e0; background: #fff; cursor: pointer; font-size: 16px; }

/* --- FAQ Accordion --- */
.mb-faq { direction: rtl; }
.mb-faq-title { text-align: center; font-size: 24px; font-weight: 800; margin-bottom: 24px; }
.mb-faq-item { margin-bottom: 10px; overflow: hidden; border: 1.5px solid #eee; }
.mb-faq-q { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: #fff; border: none; cursor: pointer; font-size: 16px; font-weight: 700; font-family: inherit; text-align: right; color: #222; transition: background .2s; }
.mb-faq-q:hover { background: #fafafa; }
.mb-faq-q[aria-expanded="true"] { color: var(--accent,#e53e3e); }
.mb-faq-q[aria-expanded="true"] .mb-faq-icon { transform: rotate(45deg); }
.mb-faq-icon { font-size: 22px; font-weight: 400; transition: transform .25s; flex-shrink: 0; margin-right: 12px; }
.mb-faq-a { overflow: hidden; }
.mb-faq-a[hidden] { display: none; }
.mb-faq-a-inner { padding: 0 20px 18px; color: #555; line-height: 1.7; font-size: 15px; }

/* --- Features Icon Box --- */
.mb-features-wrap { direction: rtl; }
.mb-features { display: grid; grid-template-columns: repeat(var(--cols,4),1fr); }
.mb-feature-item { padding: 28px 20px; text-align: center; }
.mb-feature-icon { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; border-radius: 50%; margin: 0 auto 16px; }
.mb-feature-title { font-size: 16px; font-weight: 800; margin: 0 0 8px; }
.mb-feature-desc { color: #666; font-size: 14px; line-height: 1.6; margin: 0; }

/* --- Sales Notification --- */
.mb-sales-notif { position: fixed; z-index: 99999; min-width: 280px; max-width: 340px; box-shadow: 0 8px 32px rgba(0,0,0,.18); display: flex; align-items: center; gap: 12px; padding: 14px 16px; direction: rtl; }
.mb-sn-bottom-right { bottom: 24px; right: 24px; }
.mb-sn-bottom-left { bottom: 24px; left: 24px; }
.mb-sn-avatar { width: 48px; height: 48px; border-radius: 50%; border: 2px solid; flex-shrink: 0; background: #f0f4ff; overflow: hidden; }
.mb-sn-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mb-sn-content { flex: 1; }
.mb-sn-name { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.mb-sn-product { font-size: 13px; color: #555; margin-bottom: 3px; }
.mb-sn-time { font-size: 12px; color: #999; }
.mb-sn-close { background: none; border: none; cursor: pointer; font-size: 18px; color: #999; padding: 0; line-height: 1; flex-shrink: 0; }

/* --- CTA Banner --- */
.mb-cta-banner { direction: rtl; }
.mb-cta-heading { font-size: clamp(22px,3.5vw,44px); font-weight: 900; margin: 0 0 14px; line-height: 1.2; }
.mb-cta-sub { font-size: clamp(14px,2vw,20px); margin: 0 0 28px; opacity: .9; }
.mb-cta-btn { font-size: 17px; padding: 14px 40px; }

/* --- Brands Logo Grid --- */
.mb-brands-wrap { direction: rtl; }
.mb-brands-grid { display: grid; grid-template-columns: repeat(var(--cols,5),1fr); }
.mb-brand-item { display: flex; align-items: center; justify-content: center; transition: all .3s; }
.mb-brand-item a { display: flex; align-items: center; justify-content: center; width: 100%; }
.mb-grayscale img { filter: grayscale(1); opacity: .6; transition: filter .3s, opacity .3s; }
.mb-hover-color:hover img { filter: none; opacity: 1; }
.mb-brand-text { font-weight: 700; color: #666; text-align: center; }

/* --- Advanced Container --- */
.mb-advanced-container { width: 100%; }
.mb-ac-inner > * { min-width: 0; }

/* --- Spacer Divider --- */
.mb-spacer { position: relative; display: flex; align-items: center; justify-content: center; }
.mb-divider { position: relative; }
.mb-divider-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #fff; padding: 0 12px; font-size: 13px; }

/* Responsive visibility */
.mb-hide-desktop { display: none !important; }
@media (max-width: 1024px) and (min-width: 769px) {
  .mb-hide-tablet { display: none !important; }
}
@media (max-width: 768px) {
  .mb-hide-mobile { display: none !important; }
}

/* Full width override */
.mb-full-width { width: 100vw !important; max-width: 100vw !important; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; }

/* Editor preview image helpers */
.mb-editor-img-preview { max-width: 100%; height: auto; border-radius: 6px; margin-top: 8px; }
@media (max-width: 768px) {
  .mb-product-grid { grid-template-columns: repeat(var(--mobcols,2),1fr); }
  .mb-categories-grid { grid-template-columns: repeat(var(--mobcols,2),1fr); }
  .mb-bs-grid { grid-template-columns: repeat(var(--mobcols,2),1fr); }
  .mb-features { grid-template-columns: repeat(var(--mobcols,2),1fr); }
  .mb-post-grid { grid-template-columns: repeat(var(--mobcols,1),1fr); }
  .mb-brands-grid { grid-template-columns: repeat(var(--mobcols,3),1fr); }
  .mb-showcase { flex-direction: column !important; padding: 20px; }
  .mb-featured-post { flex-direction: column; padding: 20px; }
  .mb-bought-together .mb-bt-items { justify-content: center; }
  .mb-hero-heading { font-size: 24px; }
  .mb-countdown-blocks { gap: 10px; }
  .mb-cd-block { min-width: 70px; }
  .mb-cd-num { font-size: 30px; }
  .mb-testi-track { flex-wrap: wrap; }
  .mb-spacer-mobile { height: calc(var(--h,60px) * .6) !important; }
  .mb-ac-inner { grid-template-columns: 1fr !important; }
}
