:root {
  --primary-color: #3b4b94;
  --secondary-color: #8F6B6C;
  --dark-text: #171717;
  --light-text: #6B7280;
  --background-light: #F9FAFB;
  --white: #ffffff;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --transition: all 0.3s ease;
}

body {
  background-color: var(--background-light);
  color: var(--dark-text);
}

/* ================= Header Improvements ================= */
.top-bar {
  background: linear-gradient(90deg, #2c3e50, #3b4b94);
  color: #fff;
  padding: 8px 0;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.top-bar a {
  color: rgba(255, 255, 255, 0.9);
  transition: var(--transition);
}

.top-bar a:hover {
  color: #fff;
  text-decoration: none;
  opacity: 1;
}

.mg-header-outer {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 15px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.mg-menu-outer li a {
  font-weight: 600;
  color: var(--dark-text);
  padding: 10px 15px;
  border-radius: 6px;
  transition: var(--transition);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 1px;
}

.mg-menu-outer li a:hover {
  color: var(--primary-color);
  background-color: rgba(59, 75, 148, 0.05);
}

.header-icons-outer ul li img {
  transition: transform 0.3s ease;
}

.header-icons-outer ul li:hover img {
  transform: scale(1.1);
}

/* Badge for cart count */
.mg-header-icon-counter {
  background: var(--secondary-color) !important;
  top: -8px;
  right: -10px;
  left: auto;
  width: 20px;
  height: 20px;
  font-size: 11px;
  border: 2px solid white;
}

/* ================= Hero Slider Improvements ================= */
.mg-slider-section {
  position: relative;
  overflow: hidden;
}

.mg-slide {
  height: 600px;
  /* Better height for standard screens */
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #333;
}

.mg-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 1;
}

/* Specific heavy overlay for the 2nd image to make white-text readable */
.mg-slide.slide-dark-overlay::before {
  background: transparent;
}

.mg-slide.slide-dark-overlay {
  background-position: center;
}

/* Fix for potential huge logo */
.mg-logo {
  font-size: 24px !important;
  display: block;
  white-space: nowrap;
}

.mg-slider-text-box {
  position: relative;
  z-index: 2;
}

.mg-slide-text h2 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  text-transform: none;
  /* Sentence case is more premium */
  animation: fadeInUp 0.8s ease-out forwards;
}

.mg-slide-text p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 30px;
  max-width: 600px;
  animation: fadeInUp 0.8s ease-out 0.2s forwards;
  opacity: 0;
}

.mg-shop-btn {
  background: #ffffff !important;
  color: #000000 !important;
  border: none;
  padding: 14px 45px !important;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: 0;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  animation: fadeInUp 0.8s ease-out 0.4s forwards;
  opacity: 0;
  display: inline-block;
  overflow: hidden;
  position: relative;
}

.mg-shop-btn::after {
  content: '';
  position: absolute;
  bottom: 13px;
  left: 50%;
  width: 135px;
  /* Further widened to cover text perfectly */
  height: 2px;
  background-color: #000000;
  transform: translateX(-50%) scaleX(0);
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.mg-shop-btn:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* Category 'View All' Button - Exact CSS from inspector */
.mg-tp-btn a.btn.btn-lg {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-radius: 0 !important;
  padding: 10px 36px !important;
  font-size: 14px !important;
  font-family: 'Sora-Bold', sans-serif !important;
  text-transform: none !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 700 !important;
}

.mg-tp-btn a.btn.btn-lg:hover {
  background-color: var(--primary-color) !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(59, 75, 148, 0.3);
}

.mg-shop-btn:hover {
  background: #f0f0f0 !important;
  color: #000000 !important;
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= Product Cards ================= */
.mg-custome-section .mg-tab-grid-box {
  border: none;
  background: #ffffff;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.04);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.mg-custome-section .mg-tab-grid-box:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(59, 75, 148, 0.1);
}

.mg-tab-img-box {
  overflow: hidden;
  position: relative;
  background: #fdfdfd;
  padding: 20px;
  height: 380px;
  /* Further increased for maximum product impact */
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-tab-img-box img,
.mg-tabs-img img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.6s ease;
  display: block;
  margin: 0 auto;
}

.mg-tab-grid-box:hover img {
  transform: scale(1.08);
  /* Premium subtle zoom */
  filter: brightness(1) !important;
}

.mg-atc-overlay {
  position: absolute;
  bottom: -60px;
  /* Hide deeper */
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
  padding: 15px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  z-index: 2;
  border-top: 1px solid #eee;
}

.mg-tab-grid-box:hover .mg-atc-overlay {
  bottom: 0;
}

.mg-cart-box,
.add-to-cart {
  background: #111 !important;
  color: #fff !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  padding: 12px !important;
  text-transform: uppercase !important;
  font-size: 13px !important;
  border: none !important;
  transition: all 0.3s ease !important;
}

.add-to-cart:hover {
  background: var(--primary-color) !important;
  transform: scale(1.02);
}

.mg-tab-text {
  padding: 25px !important;
  /* Increased padding */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.mg-tab-text h5 {
  font-size: 18px;
  /* Slightly larger */
  font-weight: 700;
  margin-bottom: 20px;
  color: #1a1a1a;
  line-height: 1.4;
}

.mg-pricing {
  color: #3b4b94;
  font-size: 24px;
  /* More prominent */
  font-weight: 800;
}

/* Subsection Headings (Category names inside product lists) */
.mg-tp-heading h5 {
  font-size: 32px;
  /* Increased from 28px */
  font-weight: 800;
  color: #1a1a1a;
  position: relative;
  display: inline-block;
  padding-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.mg-tp-heading h5::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--secondary-color);
  border-radius: 2px;
}

.mg-tab-text h5 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  line-height: 1.4;
}

.mg-pricing {
  color: var(--primary-color);
  font-size: 18px;
}

/* ================= Features Section ================= */
.mg-feature-overlay-section {
  background: #f6f8ff;
  /* Premium subtle themed background */
  padding: 100px 0;
}

.mg-home2-feature-section-heading h5 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 15px;
}

.mg-feature-box .card {
  border: 1px solid rgba(59, 75, 148, 0.05);
  background: #ffffff;
  border-radius: 20px;
  padding: 25px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.mg-feature-box .card:hover {
  background: white;
  box-shadow: var(--hover-shadow);
  transform: translateY(-5px);
}

.mg-feature-box .card-body {
  padding: 10px;
  box-shadow: none !important;
  /* Override existing */
  background: transparent !important;
}

.mg-feature-box .card-body:hover {
  background: transparent !important;
}

.mg-feature-box img {
  width: 55px;
  height: 55px;
  margin-bottom: 25px;
  filter: invert(24%) sepia(35%) saturate(1966%) hue-rotate(212deg) brightness(96%) contrast(87%);
  /* Sharper primary blue */
}

/* ================= Section Layouts ================= */
.mg-section-padding-large {
  padding: 80px 0;
  /* Reduced from 90px for tighter spacing */
}

/* Tighten the gap specifically between product category sections */
.mg-custome-section+.mg-custome-section {
  padding-top: 0;
}

.mg-bg-themed {
  background-color: #f6f8ff;
  /* Re-adjusted themed tint */
}

.mg-section-heading h5 {
  font-size: 38px;
  font-weight: 800;
  color: #111;
  letter-spacing: -1px;
}

.mg-section-heading span {
  font-size: 16px;
  color: #666;
  max-width: 600px;
  margin: 15px auto 0;
  line-height: 1.6;
}

.mg-tabs-box .nav-tabs .nav-link {
  border-radius: 30px;
  padding: 10px 25px;
  margin: 0 5px;
  border: 1px solid #eee;
  font-weight: 600;
  background: white;
  transition: var(--transition);
}

.mg-tabs-box .nav-tabs .nav-link.active {
  background: var(--dark-text);
  border-color: var(--dark-text);
  color: white;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* --- High-End Popular Categories Overhaul --- */
.mg-popular-categories-section,
.mg-best-selling-section {
  background-color: #f4f7ff;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(59, 75, 148, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(59, 75, 148, 0.03) 0%, transparent 50%);
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}

/* Subtle tech-mesh pattern */
.mg-popular-categories-section::after,
.mg-best-selling-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(59, 75, 148, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 75, 148, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.mg-tabs-img {
  height: 250px;
  /* Increased from 200px */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  position: relative;
  padding: 10px;
  /* Reduced from 15px */
  will-change: transform, background-color;
  backface-visibility: hidden;
}

/* Lens flare effect on image container */
.mg-tabs-img::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 40%);
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 2;
}

.mg-tab-grid-box.category-box:hover .mg-tabs-img::before {
  opacity: 0.2;
}

.mg-tabs-img img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.mg-tab-grid-box.category-box {
  text-align: left;
  background: #ffffff;
  padding: 0 !important;
  border-radius: 4px;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  height: 100%;
  /* Stretch to match the tallest card */
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  overflow: hidden;
  position: relative;
  will-change: transform, box-shadow;
  backface-visibility: hidden;
}

/* Left-edge brand accent */
.mg-tab-grid-box.category-box::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0px;
  background: var(--primary-color);
  transition: width 0.3s ease;
}

.mg-tab-grid-box.category-box:hover::after {
  width: 4px;
}

.mg-category-content-wrap {
  padding: 15px 25px 28px;
  /* Slightly tighter vertical padding */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  /* Expand to fill available height */
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.mg-tab-grid-box.category-box h5 {
  font-size: 17px;
  font-weight: 700;
  text-transform: capitalize !important;
  letter-spacing: 0px;
  margin: 0;
  color: #1a1a1a;
  transition: all 0.3s ease;
  line-height: 1.2;
}

.mg-category-explore {
  font-size: 11px;
  font-weight: 700;
  color: #666;
  text-transform: capitalize !important;
  letter-spacing: 1px;
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), color 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  will-change: transform, color;
}

.mg-category-explore::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 20px;
  height: 2px;
  background: var(--primary-color);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.5;
}

/* Premium Hover States */
.mg-tab-grid-box.category-box:hover {
  transform: translateY(-12px);
  border-color: rgba(59, 75, 148, 0.15);
  box-shadow: 0 30px 60px rgba(59, 75, 148, 0.12);
}

.mg-tab-grid-box.category-box:hover .mg-tabs-img {
  background: #fafbff;
}

.mg-tab-grid-box.category-box:hover .mg-tabs-img img {
  transform: scale(1.05) rotate(1deg);
}

.mg-tab-grid-box.category-box:hover .mg-category-explore {
  transform: translateX(8px);
  color: var(--primary-color);
}

.mg-tab-grid-box.category-box:hover .mg-category-explore::after {
  width: 100%;
  opacity: 1;
}

/* Utilities */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}