/* ── MMart Custom Homepage Overrides ─────────────────────────── */
/* All classes prefixed with mc- to avoid Tailwind conflicts       */

:root {
  --mc-primary: #1E3A8A;
  --mc-accent:  #7C3AED;
  --mc-gold:    #F59E0B;
  --mc-grad:    linear-gradient(135deg, #1E3A8A 0%, #7C3AED 100%);
  --mc-glass-bg:    rgba(255,255,255,0.7);
  --mc-glass-blur:  blur(12px);
  --mc-glass-border:rgba(255,255,255,0.5);
  --mc-shadow:  0 4px 24px rgba(30,58,138,0.10);
  --mc-shadow-hover:0 16px 48px rgba(30,58,138,0.18);
  --mc-radius:  18px;
  --mc-transition:all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* ── Section container ──────────────────────────────────────── */
#mc-all-products-section {
  padding: 56px 0 72px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.mc-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Section header ─────────────────────────────────────────── */
.mc-section-header {
  text-align: center;
  margin-bottom: 40px;
}

.mc-section-tag {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(30,58,138,0.10) 0%, rgba(124,58,237,0.10) 100%);
  color: var(--mc-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.mc-section-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--mc-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 12px;
  line-height: 1.2;
}

.mc-section-subtitle {
  color: #64748b;
  font-size: 15px;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Toolbar ────────────────────────────────────────────────── */
.mc-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 24px;
  gap: 12px;
}

.mc-count {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

/* ── Product Grid ───────────────────────────────────────────── */
.mc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (min-width: 640px)  { .mc-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 900px)  { .mc-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
@media (min-width: 1200px) { .mc-grid { grid-template-columns: repeat(5, 1fr); gap: 22px; } }

/* ── Product Card ───────────────────────────────────────────── */
.mc-card {
  background: var(--mc-glass-bg);
  backdrop-filter: var(--mc-glass-blur);
  -webkit-backdrop-filter: var(--mc-glass-blur);
  border: 1px solid var(--mc-glass-border);
  border-radius: var(--mc-radius);
  box-shadow: var(--mc-shadow);
  overflow: hidden;
  transition: var(--mc-transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  will-change: transform;
}

.mc-card:hover {
  transform: translateY(-8px) scale(1.012);
  box-shadow: var(--mc-shadow-hover);
  border-color: rgba(124,58,237,0.25);
}

/* ── Card image ─────────────────────────────────────────────── */
.mc-card-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #f1f5f9;
}

.mc-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}

.mc-card:hover .mc-card-img {
  transform: scale(1.08);
}

/* ── Badges ─────────────────────────────────────────────────── */
.mc-card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.mc-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1.4;
}

.mc-badge-sale    { background: linear-gradient(135deg,#ef4444,#dc2626); }
.mc-badge-new     { background: linear-gradient(135deg,#10b981,#059669); }
.mc-badge-trending{ background: linear-gradient(135deg,#f59e0b,#d97706); }
.mc-badge-best    { background: linear-gradient(135deg,#1E3A8A,#7C3AED); }

/* ── Wishlist button ─────────────────────────────────────────── */
.mc-wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #94a3b8;
  transition: var(--mc-transition);
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.mc-wishlist-btn:hover {
  color: #ef4444;
  background: #fff;
  transform: scale(1.15);
}

/* ── Quick View ─────────────────────────────────────────────── */
.mc-quick-view {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, rgba(30,58,138,0.92) 0%, rgba(124,58,237,0.92) 100%);
  color: #fff;
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  z-index: 2;
}

.mc-card:hover .mc-quick-view {
  transform: translateY(0);
}

/* ── Card body ──────────────────────────────────────────────── */
.mc-card-body {
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.mc-card-brand {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7C3AED;
  min-height: 14px;
}

.mc-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.mc-card-desc {
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* ── Rating ─────────────────────────────────────────────────── */
.mc-card-rating {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mc-stars {
  color: #f59e0b;
  font-size: 12px;
  letter-spacing: 1px;
  line-height: 1;
}

.mc-review-count {
  font-size: 11px;
  color: #94a3b8;
}

/* ── Pricing ─────────────────────────────────────────────────── */
.mc-card-pricing {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}

.mc-price {
  font-size: 15px;
  font-weight: 800;
  color: #1E3A8A;
}

.mc-orig-price {
  font-size: 11px;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 500;
}

/* ── Stock ──────────────────────────────────────────────────── */
.mc-card-stock {
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mc-card-stock.in-stock  { color: #10b981; }
.mc-card-stock.out-stock { color: #ef4444; }

.mc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Card action buttons ─────────────────────────────────────── */
.mc-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.mc-btn-cart, .mc-btn-buy {
  flex: 1;
  padding: 8px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--mc-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.mc-btn-cart {
  background: linear-gradient(135deg, rgba(30,58,138,0.08) 0%, rgba(124,58,237,0.08) 100%);
  color: var(--mc-primary);
  border: 1.5px solid rgba(30,58,138,0.18);
}

.mc-btn-cart:hover:not(:disabled) {
  background: var(--mc-grad);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(30,58,138,0.3);
}

.mc-btn-buy {
  background: var(--mc-grad);
  color: #fff;
}

.mc-btn-buy:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
}

.mc-btn-cart:disabled, .mc-btn-buy:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ── No results ─────────────────────────────────────────────── */
.mc-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
}

.mc-no-results-anim {
  font-size: 56px;
  margin-bottom: 16px;
  animation: mc-bounce 1.4s ease-in-out infinite;
}

@keyframes mc-bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}

.mc-no-results h3 {
  font-size: 22px;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 8px;
}

.mc-no-results p {
  color: #64748b;
  font-size: 15px;
  margin: 0 0 20px;
}

.mc-suggestions span {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 100px;
  background: var(--mc-grad);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--mc-transition);
}

.mc-suggestions span:hover { opacity: 0.85; }

/* ── Load more ──────────────────────────────────────────────── */
.mc-load-more-wrap {
  text-align: center;
  margin-top: 40px;
}

.mc-load-more-btn {
  padding: 14px 48px;
  border-radius: 100px;
  background: var(--mc-grad);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--mc-transition);
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px rgba(124,58,237,0.25);
}

.mc-load-more-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(124,58,237,0.35);
}

/* ── Real-time search overlay ────────────────────────────────── */
.mc-search-overlay {
  position: absolute;
  z-index: 99999;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid rgba(124,58,237,0.15);
  box-shadow: 0 20px 60px rgba(30,58,138,0.18), 0 4px 16px rgba(0,0,0,0.08);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px) scaleY(0.97);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  min-width: 320px;
  max-width: 560px;
}

.mc-search-overlay.visible {
  opacity: 1;
  transform: translateY(0) scaleY(1);
  pointer-events: auto;
}

.mc-search-results-wrap {
  max-height: 440px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,58,237,0.2) transparent;
}

.mc-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

.mc-search-item:hover {
  background: linear-gradient(90deg, rgba(30,58,138,0.04) 0%, rgba(124,58,237,0.04) 100%);
}

.mc-search-item:last-of-type { border-bottom: none; }

.mc-search-thumb {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: #f1f5f9;
}

.mc-search-info { flex: 1; min-width: 0; }

.mc-search-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-search-brand {
  font-size: 11px;
  color: #7C3AED;
  font-weight: 600;
  margin: 1px 0;
}

.mc-search-price {
  font-size: 13px;
  font-weight: 800;
  color: #1E3A8A;
}

.mc-search-view-all {
  display: block;
  text-align: center;
  padding: 12px 16px;
  color: #7C3AED;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(90deg, rgba(30,58,138,0.03) 0%, rgba(124,58,237,0.03) 100%);
  transition: background 0.15s ease;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.mc-search-view-all:hover {
  background: linear-gradient(90deg, rgba(30,58,138,0.07) 0%, rgba(124,58,237,0.07) 100%);
}

.mc-search-empty {
  padding: 40px 20px;
  text-align: center;
}

.mc-search-empty-icon { font-size: 36px; margin-bottom: 12px; }

.mc-search-empty p {
  color: #475569;
  font-size: 14px;
  margin: 0 0 6px;
}

.mc-search-hint {
  color: #94a3b8 !important;
  font-size: 12px !important;
}

/* ── Card entrance animation ─────────────────────────────────── */
@keyframes mc-fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mc-card {
  animation: mc-fade-up 0.45s ease both;
}

/* stagger the first 20 cards */
.mc-card:nth-child(1)  { animation-delay: 0.02s; }
.mc-card:nth-child(2)  { animation-delay: 0.04s; }
.mc-card:nth-child(3)  { animation-delay: 0.06s; }
.mc-card:nth-child(4)  { animation-delay: 0.08s; }
.mc-card:nth-child(5)  { animation-delay: 0.10s; }
.mc-card:nth-child(6)  { animation-delay: 0.12s; }
.mc-card:nth-child(7)  { animation-delay: 0.14s; }
.mc-card:nth-child(8)  { animation-delay: 0.16s; }
.mc-card:nth-child(9)  { animation-delay: 0.18s; }
.mc-card:nth-child(10) { animation-delay: 0.20s; }

/* ── Hide Account icon/link from header (desktop + mobile) ──── */
a[aria-label="Account"],
a[href="/account"] {
  display: none !important;
}

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 480px) {
  .mc-card-body  { padding: 10px 10px 12px; }
  .mc-card-title { font-size: 12px; }
  .mc-price      { font-size: 13px; }
  .mc-btn-cart, .mc-btn-buy { font-size: 10px; padding: 7px 4px; }
}
