/* MoreMarket - Main CSS */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@700;800&display=swap');

:root {
  --mm-primary: #1565c0;
  --mm-primary-light: #e3f2fd;
  --mm-secondary: #f57f17;
  --mm-dark: #1a1a2e;
  --mm-gray: #6c757d;
  --mm-light: #f8f9fa;
  --mm-border: #dee2e6;
  --mm-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --mm-radius: 0.5rem;
  --mm-transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', sans-serif;
  color: #212529;
}

/* ── LOGO ── */
.logo-text {
  font-family: 'Poppins', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  color: #1a1a2e;
  letter-spacing: -0.5px;
}

.header-logo {
  height: 45px;
  width: auto;
  object-fit: contain;
  transition: height 0.2s ease-in-out;
}

@media (max-width: 576px) {
  .header-logo {
    height: 35px;
  }
}

/* ── TOP BAR ── */
.topbar {
  font-size: 0.8rem;
}

.topbar select option {
  background: #0d47a1;
}

/* ── MAIN HEADER ── */
.main-header {
  z-index: 1030;
}

/* ── MM MEGA MENU ── */
.mm-mega-container {
  position: relative !important;
  display: inline-block !important;
  /* Ensure it wraps the button correctly */
}


.mm-mega-menu {
  display: flex !important;
  flex-direction: row !important;
  position: absolute !important;
  width: 1100px !important;
  left: 0 !important;
  right: 0 !important;
  height: 520px;
  max-height: 85vh;
  margin: 0 !important;
  padding: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0 !important;
  transform: translateY(10px);
  transition: var(--mm-transition);
  top: 100%;
  border-radius: 0;
  border-top: 3px solid var(--mm-secondary) !important;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4) !important;
  z-index: 999999 !important;
  background-color: #ffffff !important;
  pointer-events: none;
}

/* Removed .mm-mega-menu::before causing unwanted widespread hover triggers */

.mm-mega-menu.show,
.mm-mega-container:hover .mm-mega-menu {
  visibility: visible !important;
  opacity: 1 !important;
  transform: translateY(0);
  pointer-events: auto !important;
}

.mm-mega-container .mega-sidebar {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  background: #fdfdfd !important;
  border-right: 1px solid #eee;
  padding: 1rem 0;
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  overflow-y: auto;
}

.mm-mega-container .mega-sidebar-item {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.5rem !important;
  color: #333333 !important;
  text-decoration: none !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  transition: all 0.2s;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  background: transparent;
}

.nav-mega-link {
  display: inline-flex !important;
  align-items: center;
  padding: 10px 16px !important;
  color: rgba(255, 255, 255, 0.85) !important;
  text-decoration: none !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  white-space: nowrap !important;
  transition: color 0.2s, background 0.2s;
}

.nav-mega-link:hover {
  color: #ffd54f !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.mm-mega-container .mega-sidebar-item:hover,
.mm-mega-container .mega-sidebar-item.active {
  background: #ffffff !important;
  color: var(--mm-primary) !important;
}

.mega-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background-color: #ffffff !important;
  min-height: 100%;
  position: relative;
  z-index: 10;
}

.mega-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.5rem;
}

.mega-subcategory-card {
  text-align: center;
  text-decoration: none;
  color: #333;
  transition: transform 0.2s;
}

.mega-subcategory-card:hover {
  transform: translateY(-3px);
}

.mega-subcategory-card img {
  width: 100%;
  height: 120px;
  /* Constrain height */
  object-fit: contain;
  margin-bottom: 0.5rem;
  background: #f1f1f1;
  border-radius: 8px;
  padding: 10px;
}

.mega-subcategory-card span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

@media (max-width: 992px) {
  .mm-mega-menu {
    display: none !important;
  }

  .navbar-mega {
    display: none !important;
  }

  .main-header {
    padding: 0.5rem 0;
  }

  .logo-text {
    font-size: 1.4rem;
  }
}

/* ── MOBILE SEARCH ACCESSIBILITY ── */
#mobileSearch {
  background: #f8f9fa;
  padding: 1rem;
  border-top: 1px solid var(--mm-border);
}

/* ── OFF-CANVAS STYLES ── */
.offcanvas .list-group-item {
  font-size: 0.95rem;
  transition: background 0.2s;
}

.offcanvas .list-group-item:active {
  background-color: var(--mm-primary-light);
  color: var(--mm-primary);
}

.offcanvas .collapse .list-group-item {
  background-color: #fdfdfd;
}

/* ── HERO ── */
.hero-section {
  padding: 1.5rem 0;
  background: #f0f4fa;
}

.hero-banner {
  min-height: 300px;
}

/* ── CATEGORY CARDS ── */
.category-card {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

.category-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
}

/* ── PRODUCT CARDS ── */
.product-card {
  transition: transform 0.2s, box-shadow 0.2s;
  border-radius: var(--mm-radius) !important;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12) !important;
}

.product-img-wrap {
  overflow: hidden;
  background: #f8f9fa;
}

.product-img {
  height: 220px;
  object-fit: cover;
  width: 100%;
  transition: transform 0.3s;
}

.product-card:hover .product-img {
  transform: scale(1.04);
}

.product-img-placeholder {
  height: 220px;
}

.product-actions {
  opacity: 0;
  transition: opacity 0.2s;
  visibility: hidden;
}

.product-card:hover .product-actions {
  opacity: 1;
  visibility: visible;
}

.btn-white {
  background-color: #ffffff !important;
  color: var(--mm-dark) !important;
  transition: all 0.2s ease;
}

.btn-white:hover {
  background-color: var(--mm-primary) !important;
  color: #ffffff !important;
  transform: scale(1.1);
}

.product-name {
  font-size: 0.9rem;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  overflow: hidden;
}

.out-of-stock-overlay {
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--mm-radius);
}

.hover-lift {
  transition: transform 0.2s, box-shadow 0.2s;
}

.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
}

/* ── HEADER ICON ── */
.header-icon {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 8px;
  transition: color 0.2s;
}

.header-icon:hover {
  color: var(--mm-primary) !important;
}

/* ── CART ── */
.cart-item:hover {
  background: #f8f9fa;
}

/* ── PRODUCT DETAIL ── */
.product-gallery .thumbnail-img {
  transition: border-color 0.15s;
}

.product-gallery .thumbnail-img:hover {
  border-color: var(--bs-primary) !important;
}

.price-block {
  border-left: 4px solid var(--mm-primary);
}

.variant-btn {
  font-size: 0.85rem;
  padding: 6px 14px;
}

.variant-btn.active {
  background: var(--mm-primary);
  color: #fff;
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}

/* ── PROMO CARDS ── */
.promo-card {
  transition: transform 0.2s;
  cursor: pointer;
}

.promo-card:hover {
  transform: scale(1.02);
}

/* ── FORMS ── */
.form-control:focus,
.form-select:focus {
  border-color: var(--mm-primary);
  box-shadow: 0 0 0 0.2rem rgba(21, 101, 192, 0.15);
}

/* ── BADGES ── */
.badge {
  font-weight: 500;
}

/* ── FOOTER ── */
footer a:hover {
  color: #ffd54f !important;
}

/* ── ALERTS ── */
.alert {
  border-radius: var(--mm-radius);
}

/* ── TABLES ── */
.table th {
  font-weight: 600;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f8f9fa;
}

::-webkit-scrollbar-thumb {
  background: #ced4da;
  border-radius: 10px;
  border: 2px solid #f8f9fa;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--mm-primary);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .logo-text {
    font-size: 1.2rem;
  }

  .hero-banner {
    min-height: 180px;
  }

  .product-img {
    height: 140px;
  }

  .display-5 {
    font-size: 1.4rem;
  }

  /* Variant Selection Grid Optimization */
  .variant-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .variant-card {
    padding: 0.5rem !important;
  }
}

@media (max-width: 576px) {

  .logo-text {
    font-size: 1.1rem;
  }

  .variant-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .product-img {
    height: 120px;
  }
}

/* ── PRINT (Invoice) ── */
@media print {

  .main-header,
  footer,
  .btn,
  nav {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* ── BREADCRUMBS ── */
.breadcrumb {
  --bs-breadcrumb-divider: "›" !important;
}

.breadcrumb-item {
  display: flex !important;
  align-items: center !important;
}

.breadcrumb-item+.breadcrumb-item::before {
  font-size: 1.25rem !important;
  line-height: 1 !important;
  font-weight: 400 !important;
  padding-top: 1px !important;
}

/* ── LOADING SPINNER ── */
.spinner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* ── TOAST ── */
.toast-container {
  z-index: 9999;
}

/* ── WHATSAPP FLOAT ── */
.whatsapp-float-wrapper {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
}

.whatsapp-float-label {
  background-color: #ffffff;
  color: #1a1a2e;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid #eaeaea;
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-float-wrapper:hover .whatsapp-float-label {
  opacity: 1;
  transform: translateX(0);
}

.whatsapp-float {
  width: 64px;
  height: 64px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50%;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(37, 211, 102, 0.25);
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.whatsapp-float svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.whatsapp-float:hover {
  background-color: #20b858;
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2), 0 8px 16px rgba(37, 211, 102, 0.35);
  color: #fff;
}

@media (max-width: 768px) {
  .whatsapp-float-wrapper {
    bottom: 24px;
    right: 24px;
    gap: 10px;
  }

  .whatsapp-float {
    width: 56px;
    height: 56px;
  }

  .whatsapp-float svg {
    width: 28px;
    height: 28px;
  }
}