:root {
  --mg-primary: #1a1a2e;
  --mg-secondary: #16213e;
  --mg-accent: #e94560;
  --mg-gold: #f5a623;
  --mg-light: #f8f9fa;
  --mg-dark: #0f3460;
  --mg-text: #2d3436;
  --mg-text-light: #636e72;
  --mg-white: #ffffff;
  --mg-shadow: 0 2px 15px rgba(0,0,0,0.08);
  --mg-shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
  --mg-radius: 12px;
  --mg-radius-sm: 8px;
  --mg-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--mg-light);
  color: var(--mg-text);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* Accessibility */
.mg-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mg-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--mg-accent);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  z-index: 10001;
  transition: top 0.2s;
}

.mg-skip-link:focus {
  top: 16px;
  outline: 3px solid var(--mg-gold);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--mg-accent);
  outline-offset: 2px;
}

.mg-nav {
  background: var(--mg-primary);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.mg-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.mg-logo {
  padding: 10px 0;
}

.mg-logo img {
  height: 50px;
  border-radius: 8px;
}

.mg-nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mg-nav-links a {
  display: block;
  padding: 20px 24px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: var(--mg-transition);
  position: relative;
}

.mg-nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--mg-accent);
  transition: var(--mg-transition);
  border-radius: 3px 3px 0 0;
}

.mg-nav-links a:hover,
.mg-nav-links a.active {
  color: var(--mg-white);
  background: rgba(255,255,255,0.08);
}

.mg-nav-links a:hover::after,
.mg-nav-links a.active::after {
  width: 60%;
}

.mg-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  padding: 12px;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--mg-transition);
}

.mg-nav-toggle:hover {
  background: rgba(255,255,255,0.1);
}

.mg-nav-actions {
  display: none;
  align-items: center;
  gap: 4px;
}

.mg-search-toggle,
.mg-cart-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: rgba(255,255,255,0.9);
  padding: 10px;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
  text-decoration: none;
  transition: var(--mg-transition);
}

.mg-search-toggle:hover,
.mg-cart-mobile:hover {
  background: rgba(255,255,255,0.1);
  color: white;
}

.mg-cart-mobile .mg-cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
}

.mg-mobile-search {
  background: var(--mg-secondary);
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.mg-mobile-search:not([hidden]) {
  display: block;
}

.mg-search-form--mobile {
  background: var(--mg-white);
  border-radius: 12px;
}

.mg-search-form--mobile .mg-search-input {
  color: var(--mg-text);
}

.mg-search-form--mobile .mg-search-btn {
  color: var(--mg-accent);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  white-space: nowrap;
}

.mg-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mg-filter-group label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mg-text-light);
}

.mg-filter-group select {
  padding: 8px 32px 8px 12px;
  border: 2px solid #e8e8e8;
  border-radius: var(--mg-radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--mg-text);
  background: var(--mg-white);
  cursor: pointer;
  transition: var(--mg-transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23636e72' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.mg-filter-group select:focus {
  outline: none;
  border-color: var(--mg-accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.12);
}

.mg-product-grid {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.mg-product-grid > * {
  min-width: 0;
}

.mg-product-card {
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  overflow: hidden;
  transition: var(--mg-transition);
  box-shadow: var(--mg-shadow);
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.mg-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--mg-shadow-hover);
  border-color: rgba(233, 69, 96, 0.12);
}

.mg-product-image {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
  background: #f0f0f0;
  flex-shrink: 0;
}

.mg-product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--mg-transition);
}

.mg-product-card:hover .mg-product-image img {
  transform: scale(1.08);
}

.mg-product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--mg-accent);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.mg-product-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 32px 12px 12px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.52) 100%);
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.mg-product-card:hover .mg-product-overlay,
.mg-product-card:focus-within .mg-product-overlay {
  transform: translateY(0);
}

.mg-product-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: 9px 14px;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mg-product-action--order {
  background: var(--mg-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(233, 69, 96, 0.35);
}

.mg-product-action--order:hover {
  background: #d63851;
  color: #fff;
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.42);
}

.mg-product-action--colors {
  background: rgba(255, 255, 255, 0.96);
  color: var(--mg-text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.mg-product-action--colors:hover {
  background: #fff;
  color: var(--mg-accent);
}

/* Legacy aliases — scoped to cards only */
.mg-product-card .mg-btn-order,
.mg-product-card .mg-btn-colors {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: 9px 14px;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mg-product-card .mg-btn-order {
  background: var(--mg-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(233, 69, 96, 0.35);
}

.mg-product-card .mg-btn-order:hover {
  background: #d63851;
  color: #fff;
  box-shadow: 0 6px 18px rgba(233, 69, 96, 0.42);
  transform: none;
}

.mg-product-card .mg-btn-colors {
  background: rgba(255, 255, 255, 0.96);
  color: var(--mg-text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  margin-top: 0;
}

.mg-product-card .mg-btn-colors:hover {
  background: #fff;
  color: var(--mg-accent);
}

@media (min-width: 900px) {
  .mg-product-overlay {
    padding: 36px 14px 14px;
  }

  .mg-product-action,
  .mg-product-card .mg-btn-order,
  .mg-product-card .mg-btn-colors {
    min-height: 40px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .mg-product-name {
    font-size: 15px;
  }
}

.mg-product-info {
  padding: 14px 14px 16px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.mg-product-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--mg-text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mg-product-sizes {
  font-size: 12px;
  color: var(--mg-text-light);
  margin: 0;
  font-weight: 500;
  line-height: 1.4;
}

.mg-product-price {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
}

.mg-price-current {
  font-size: 18px;
  font-weight: 800;
  color: var(--mg-accent);
}

.mg-price-old {
  font-size: 15px;
  color: var(--mg-text-light);
  text-decoration: line-through;
  font-weight: 500;
}

.mg-savings-badge {
  display: inline-block;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.mg-savings-badge--pdp {
  display: block;
  font-size: 13px;
  padding: 6px 12px;
  margin-top: 6px;
  border-radius: 8px;
  text-align: center;
}

.mg-price-normal {
  font-size: 18px;
  font-weight: 700;
  color: var(--mg-dark);
}

/* Sidebar filter (solde page) */
.mg-layout-with-sidebar {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
  gap: 24px;
}

.mg-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 140px;
  align-self: flex-start;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.mg-sidebar-card {
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  padding: 20px;
  box-shadow: var(--mg-shadow);
}

.mg-sidebar-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--mg-text);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.mg-sidebar-section {
  margin-bottom: 20px;
}

.mg-sidebar-section:last-child {
  margin-bottom: 0;
}

.mg-sidebar-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mg-text-light);
  margin-bottom: 8px;
  display: block;
}

.mg-checkbox-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mg-checkbox-list li {
  margin-bottom: 6px;
}

.mg-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
  transition: var(--mg-transition);
}

.mg-checkbox-list label:hover {
  color: var(--mg-accent);
}

.mg-checkbox-list input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--mg-accent);
  cursor: pointer;
}

.mg-sidebar-select {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e8e8e8;
  border-radius: var(--mg-radius-sm);
  font-size: 14px;
  transition: var(--mg-transition);
}

.mg-sidebar-select:focus {
  outline: none;
  border-color: var(--mg-accent);
}

.mg-size-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mg-size-link {
  display: block;
  padding: 6px;
  text-align: center;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mg-text);
  text-decoration: none;
  transition: var(--mg-transition);
}

.mg-size-link:hover {
  background: var(--mg-accent);
  color: white;
  text-decoration: none;
}

.mg-btn-filter {
  width: 100%;
  padding: 12px;
  background: var(--mg-accent);
  color: white;
  border: none;
  border-radius: var(--mg-radius-sm);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--mg-transition);
  margin-top: 16px;
}

.mg-btn-filter:hover {
  background: #d63851;
}

/* Main content area */
.mg-main-content {
  flex: 1;
  min-width: 0;
}

/* Order form */
.mg-order-wrap {
  max-width: 1180px;
  margin: 28px auto 48px;
  padding: 0 20px;
}

.mg-order-wrap--modal {
  margin: 0;
  padding: 0;
}

.mg-order-wrap--modal .mg-order-layout {
  border-radius: 0;
  box-shadow: none;
}

.mg-order-wrap--modal .mg-order-showcase {
  display: none;
}

.mg-order-wrap--modal .mg-order-form-head {
  display: block;
}

.mg-order-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) 1.08fr;
  background: var(--mg-white);
  border-radius: 20px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

/* ── Product showcase column ── */
.mg-order-showcase {
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, #f7f8fc 0%, #eef1f7 45%, #e8ecf4 100%);
  border-right: 1px solid rgba(0,0,0,0.05);
  position: sticky;
  top: 80px;
  align-self: start;
  min-height: 100%;
}

.mg-order-image-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 28px 20px;
  min-height: 340px;
}

.mg-order-image-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.07), inset 0 0 0 1px rgba(0,0,0,0.04);
  padding: 28px;
  min-height: 220px;
  transition: min-height 0.3s ease, padding 0.3s ease;
}

/* Checkerboard hint for transparency */
.mg-order-image-frame::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 12px;
  background-image:
    linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
    linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  opacity: 0.35;
  z-index: 0;
}

.mg-order-product-img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 340px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 6px 20px rgba(0,0,0,0.08));
  transition: transform 0.35s ease;
}

/* Small images — enlarge frame, center prominently */
.mg-order-image-frame.is-compact {
  min-height: 300px;
  max-width: 100%;
  padding: 40px 48px;
}

.mg-order-image-frame.is-compact .mg-order-product-img {
  min-width: 140px;
  min-height: 140px;
  max-height: 260px;
}

.mg-order-image-frame.is-medium {
  min-height: 260px;
  padding: 32px 36px;
}

.mg-order-image-frame.is-medium .mg-order-product-img {
  max-height: 300px;
}

.mg-order-image-frame.is-large .mg-order-product-img {
  max-height: 380px;
}

.mg-order-image-frame.is-portrait.is-compact .mg-order-product-img,
.mg-order-image-frame.is-portrait.is-medium .mg-order-product-img {
  max-height: 320px;
}

.mg-order-image-frame.is-landscape.is-compact .mg-order-product-img {
  max-width: 90%;
}

.mg-order-promo-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: var(--mg-accent);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mg-order-product-meta {
  padding: 0 28px 32px;
  text-align: center;
}

.mg-order-product-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--mg-primary);
  margin: 0 0 4px;
  line-height: 1.3;
}

.mg-order-product-ref {
  font-size: 12px;
  color: var(--mg-text-light);
  margin: 0 0 8px;
  letter-spacing: 0.3px;
}

.mg-order-product-price {
  font-size: 28px;
  font-weight: 900;
  color: var(--mg-accent);
  margin: 0;
  line-height: 1;
}

.mg-order-product-price span {
  font-size: 14px;
  font-weight: 700;
  color: var(--mg-text-light);
}

/* Legacy selectors — keep for modal/compat */
.mg-order-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 420px;
  background: #f5f5f5;
}

.mg-order-image img {
  max-width: 85%;
  max-height: 85%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.1));
}

.mg-order-image-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 32px 28px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55) 45%, rgba(0,0,0,0.7));
  color: white;
}

.mg-order-image-info h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.2;
}

.mg-order-image-info .mg-oii-ref {
  font-size: 12px;
  opacity: 0.75;
  margin: 0 0 6px;
}

.mg-order-image-info .mg-oii-price {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
}

/* ── Form column ── */
.mg-order-form {
  padding: 32px 36px 36px;
  display: flex;
  flex-direction: column;
}

.mg-order-form-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--mg-accent);
  margin: 0 0 6px;
}

.mg-order-form-head {
  margin-bottom: 8px;
}

.mg-order-form-head h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--mg-primary);
  margin: 0 0 2px;
  line-height: 1.2;
}

.mg-order-form-head .mg-ofh-ref {
  font-size: 13px;
  color: var(--mg-text-light);
  margin: 0;
}

.mg-order-form-head .mg-ofh-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--mg-accent);
  margin: 4px 0 0;
}

/* ── Form groups ── */
.mg-form-group {
  margin-bottom: 18px;
}

.mg-form-group:last-child {
  margin-bottom: 0;
}

.mg-form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--mg-text-light);
  margin-bottom: 5px;
}

.mg-form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
  color: var(--mg-text);
}

.mg-form-control:hover {
  border-color: #ccc;
  background: #fff;
}

.mg-form-control:focus {
  outline: none;
  border-color: var(--mg-accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.08);
}

.mg-form-control::placeholder {
  color: #bbb;
}

.mg-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mg-form-row--phones {
  grid-template-columns: 1fr 1fr;
}

.mg-form-row--phones .mg-form-group {
  min-width: 0;
}

.mg-label-optional {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #bbb;
  font-size: 10px;
}

.mg-order-form .mg-form-section--first {
  border-top: none;
  padding-top: 0;
  margin-top: 16px;
}

.mg-order-form .mg-form-section {
  border-top: 1px solid #eee;
  padding-top: 24px;
  margin-top: 24px;
}

.mg-form-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--mg-accent);
  color: white;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.mg-order-form .mg-form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--mg-text);
  margin: 0 0 20px;
}

.mg-order-form .mg-form-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #eee, transparent);
}

/* Flatten CakePHP form wrappers if any */
.mg-order-form .input,
.mg-order-form .input.text,
.mg-order-form .input.number,
.mg-order-form .input.email {
  margin: 0;
  padding: 0;
}

.mg-order-form .input input,
.mg-order-form .input select,
.mg-order-form .input textarea {
  width: 100%;
}

/* Quantity stepper */
.mg-form-group--qty {
  margin-bottom: 0;
}

.mg-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}

.mg-qty-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  font-size: 20px;
  font-weight: 600;
  color: var(--mg-text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  padding: 0;
}

.mg-qty-btn:hover {
  background: #eee;
  color: var(--mg-accent);
}

.mg-qty-stepper .mg-qty-input {
  width: 56px;
  max-width: none;
  text-align: center;
  border: none;
  border-left: 1.5px solid #e0e0e0;
  border-right: 1.5px solid #e0e0e0;
  border-radius: 0;
  background: #fff;
  font-weight: 800;
  padding: 10px 4px;
  -moz-appearance: textfield;
}

.mg-qty-stepper .mg-qty-input::-webkit-outer-spin-button,
.mg-qty-stepper .mg-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mg-order-trust {
  text-align: center;
  font-size: 12px;
  color: var(--mg-text-light);
  margin: 14px 0 0;
  line-height: 1.5;
}

/* ── Size selector ── */
.mg-size-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mg-size-option {
  position: relative;
}

.mg-size-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mg-size-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--mg-text);
  cursor: pointer;
  transition: all 0.2s;
  margin: 0;
  background: #fafafa;
}

.mg-size-option input:checked + label {
  border-color: var(--mg-accent);
  background: var(--mg-accent);
  color: white;
  box-shadow: 0 2px 8px rgba(233, 69, 96, 0.25);
}

.mg-size-option input:disabled + label {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f5f5f5;
  border-color: #e8e8e8;
  color: #ccc;
  text-decoration: line-through;
}

.mg-size-option label:hover:not(:has(+ input:disabled)) {
  border-color: var(--mg-accent);
  background: #fff;
}

/* ── Mobile order summary ── */
.mg-order-summary {
  display: none;
  align-items: center;
  gap: 14px;
  background: #f8f8f8;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 20px;
}

.mg-order-summary-img {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.mg-order-summary-info {
  flex: 1;
  min-width: 0;
}

.mg-order-summary-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--mg-primary);
  margin: 0 0 1px;
}

.mg-order-summary-ref {
  font-size: 11px;
  color: var(--mg-text-light);
  margin: 0 0 4px;
}

.mg-order-summary-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--mg-accent);
  margin: 0;
}

/* ── Quantity ── */
.mg-qty-input {
  max-width: 110px;
}

.mg-textarea {
  min-height: 72px;
  resize: vertical;
}

/* ── Submit ── */
.mg-btn-submit {
  width: 100%;
  padding: 16px;
  background: var(--mg-accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  margin-top: 24px;
}

.mg-btn-submit:hover {
  background: #d63851;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(233, 69, 96, 0.3);
}

.mg-btn-submit:active {
  transform: translateY(0);
}

.mg-btn-submit:disabled,
.mg-btn-submit[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.mg-btn-submit:disabled:hover,
.mg-btn-submit[aria-disabled="true"]:hover {
  background: var(--mg-accent);
  transform: none;
}

.mg-pdp-size-hint {
  margin: 0;
  font-size: 12px;
  color: var(--mg-text-light);
  text-align: center;
  line-height: 1.4;
}

/* Confirmation page */
.mg-confirm-wrap {
  max-width: 680px;
  margin: 48px auto;
  padding: 0 16px;
}

.mg-confirm-hero {
  text-align: center;
  padding: 48px 32px 32px;
  background: var(--mg-white);
  border-radius: 20px 20px 0 0;
  animation: fadeInUp 0.5s ease-out;
}

.mg-confirm-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
}

.mg-confirm-check-svg {
  width: 72px;
  height: 72px;
}

.mg-confirm-check-path {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkDraw 0.6s 0.3s ease-out forwards;
}

@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}

.mg-confirm-empty-icon {
  font-size: 56px;
  display: block;
  line-height: 1;
}

.mg-confirm-title {
  font-size: 28px;
  font-weight: 800;
  color: #10b981;
  margin: 0 0 8px;
}

.mg-confirm-subtitle {
  font-size: 15px;
  color: var(--mg-text-light);
  margin: 0;
  line-height: 1.5;
}

.mg-confirm-amount-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--mg-white);
  animation: fadeInUp 0.5s 0.15s ease-out both;
}

.mg-confirm-amount-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mg-text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.mg-confirm-amount-big {
  font-size: 42px;
  font-weight: 900;
  color: var(--mg-accent);
  line-height: 1.1;
}

.mg-confirm-amount-detail {
  font-size: 14px;
  color: var(--mg-text-light);
  margin-top: 6px;
}

.mg-confirm-savings-card {
  margin: 16px 0;
  padding: 24px;
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-radius: 16px;
  border: 1px solid #a7f3d0;
  animation: fadeInUp 0.5s 0.3s ease-out both;
}

.mg-confirm-savings-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #065f46;
  margin-bottom: 8px;
}

.mg-confirm-savings-icon {
  font-size: 22px;
}

.mg-confirm-savings-amount {
  text-align: center;
  font-size: 36px;
  font-weight: 900;
  color: #059669;
  margin-bottom: 16px;
}

.mg-confirm-savings-compare {
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.mg-confirm-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
  color: var(--mg-text);
}

.mg-confirm-compare-val {
  font-weight: 600;
}

.mg-confirm-compare-row--pay .mg-confirm-compare-val--pay {
  font-weight: 700;
  color: var(--mg-accent);
}

.mg-confirm-compare-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
}

.mg-confirm-compare-row--saved {
  font-weight: 700;
  color: #065f46;
}

.mg-confirm-compare-val--saved {
  font-weight: 800;
  color: #059669;
}

.mg-confirm-products {
  background: var(--mg-white);
  padding: 28px 24px;
  animation: fadeInUp 0.5s 0.2s ease-out both;
}

.mg-confirm-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--mg-text);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f3f5;
}

.mg-confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
}

.mg-confirm-row + .mg-confirm-row {
  border-top: 1px solid #f5f5f5;
}

.mg-confirm-row-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

.mg-confirm-row-info {
  flex: 1;
  min-width: 0;
}

.mg-confirm-row-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--mg-text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.mg-confirm-row-meta {
  font-size: 13px;
  color: var(--mg-text-light);
  margin-bottom: 6px;
}

.mg-confirm-row-promos {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mg-confirm-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.mg-confirm-chip--promo {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.mg-confirm-chip--save {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.mg-confirm-row-price {
  text-align: right;
  flex-shrink: 0;
  padding-top: 2px;
}

.mg-confirm-row-price-old {
  font-size: 13px;
  color: var(--mg-text-light);
  text-decoration: line-through;
  margin-bottom: 2px;
}

.mg-confirm-row-price-new {
  font-size: 16px;
  font-weight: 800;
  color: var(--mg-accent);
}

.mg-confirm-summary {
  background: var(--mg-white);
  padding: 20px 24px 28px;
  animation: fadeInUp 0.5s 0.35s ease-out both;
}

.mg-confirm-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--mg-text);
}

.mg-confirm-summary-row--savings {
  color: #059669;
  font-weight: 600;
}

.mg-confirm-summary-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
}

.mg-confirm-summary-row--total {
  font-size: 18px;
  font-weight: 800;
  color: var(--mg-accent);
  padding-top: 12px;
}

.mg-confirm-strikethrough {
  text-decoration: line-through;
  color: var(--mg-text-light);
  font-size: 13px;
  font-weight: 500;
  margin-right: 8px;
}

.mg-confirm-cta {
  text-align: center;
  padding: 24px 24px 48px;
  background: var(--mg-white);
  border-radius: 0 0 20px 20px;
  animation: fadeInUp 0.5s 0.4s ease-out both;
}

.mg-confirm-cta-note {
  font-size: 14px;
  color: var(--mg-text-light);
  margin: 0 0 20px;
  line-height: 1.5;
}

.mg-confirm-cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.mg-confirm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-width: 180px;
}

.mg-confirm-btn--primary {
  background: linear-gradient(135deg, var(--mg-primary), var(--mg-secondary));
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.mg-confirm-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.4);
  color: white;
  text-decoration: none;
}

.mg-confirm-btn--secondary {
  background: var(--mg-white);
  color: var(--mg-text);
  border: 2px solid #e5e7eb;
}

.mg-confirm-btn--secondary:hover {
  border-color: var(--mg-primary);
  color: var(--mg-primary);
  transform: translateY(-2px);
  text-decoration: none;
}

.mg-confirm-empty {
  max-width: 480px;
}

/* Flash messages */
.mg-flash {
  max-width: 1400px;
  margin: 12px auto 0;
  padding: 0 20px;
}

.mg-alert {
  padding: 14px 20px;
  border-radius: var(--mg-radius-sm);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
}

.mg-alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.mg-alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Responsive */
@media (max-width: 992px) {
  .mg-order-layout {
    grid-template-columns: 1fr;
  }
  .mg-order-showcase {
    position: static;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  .mg-order-image-stage {
    min-height: auto;
    padding: 28px 24px 16px;
  }
  .mg-order-image-frame {
    margin: 0 auto;
    max-width: 300px;
    min-height: 180px;
    padding: 24px;
  }
  .mg-order-image-frame.is-compact {
    min-height: 220px;
    max-width: 340px;
    padding: 32px 40px;
  }
  .mg-order-product-img {
    max-height: 240px;
  }
  .mg-order-product-meta {
    display: none;
  }
  .mg-order-image {
    min-height: 300px;
  }
  .mg-order-image img {
    max-width: 75%;
    max-height: 75%;
  }
  .mg-order-image-info {
    padding: 24px 20px 18px;
  }
  .mg-order-image-info h1 {
    font-size: 17px;
  }
  .mg-order-image-info .mg-oii-price {
    font-size: 22px;
  }
  .mg-order-form {
    padding: 24px 20px 28px;
  }
  .mg-order-form-head {
    display: none;
  }
  .mg-order-summary {
    display: flex;
  }
  .mg-layout-with-sidebar {
    flex-direction: column;
  }
  .mg-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .mg-nav-toggle {
    display: block;
  }
  .mg-nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--mg-primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  }
  .mg-nav-links.open {
    display: flex;
  }
  .mg-nav-links a {
    padding: 14px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .mg-nav-inner {
    position: relative;
  }
  .mg-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 10px;
    padding: 0 12px;
    margin: 16px auto;
  }

  .mg-product-overlay {
    transform: translateY(0);
    padding: 24px 8px 8px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.62) 100%);
  }

  .mg-product-card .mg-btn-order,
  .mg-product-card .mg-btn-colors,
  .mg-product-action {
    min-height: 34px;
    padding: 8px 10px;
    font-size: 10px;
    letter-spacing: 0.03em;
    border-radius: 8px;
  }

  .mg-product-info {
    padding: 10px 8px 12px;
  }

  .mg-product-name {
    font-size: 12px;
  }

  .mg-product-sizes {
    font-size: 11px;
  }

  .mg-price-current {
    font-size: 15px;
  }

  .mg-price-normal {
    font-size: 15px;
  }

  .mg-product-badge {
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    font-size: 10px;
  }
  .mg-filter-inner {
    flex-direction: column;
    gap: 8px;
  }
  .mg-filter-group {
    width: 100%;
  }
  .mg-filter-group select {
    width: 100%;
  }
  .mg-order-form {
    padding: 24px 16px 28px;
  }
  .mg-form-row {
    grid-template-columns: 1fr;
  }
  .mg-form-row--phones {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .mg-form-row--phones .mg-form-group label {
    font-size: 10px;
  }
  .mg-form-row--phones .mg-form-control {
    padding: 10px 10px;
    font-size: 13px;
  }
  .mg-confirm-wrap {
    margin: 24px auto;
    padding: 0 8px;
  }
  .mg-confirm-hero {
    padding: 32px 16px 24px;
  }
  .mg-confirm-amount-big {
    font-size: 34px;
  }
  .mg-confirm-savings-amount {
    font-size: 28px;
  }
  .mg-confirm-products {
    padding: 20px 16px;
  }
  .mg-confirm-row-img {
    width: 52px;
    height: 52px;
  }
  .mg-confirm-row-price-new {
    font-size: 14px;
  }
  .mg-confirm-cta {
    padding: 20px 16px 40px;
  }
  .mg-confirm-cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .mg-confirm-btn {
    width: 100%;
    min-width: 0;
  }
  .mg-confirm-savings-compare {
    padding: 12px 14px;
  }
  .mg-confirm-compare-row {
    font-size: 13px;
  }
}

/* === MODERN FILTER BAR === */
.mg-filter-bar {
  background: var(--mg-white);
  border-bottom: 1px solid #eee;
  padding: 0;
  position: sticky;
  top: 70px;
  z-index: 999;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.mg-filter-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.mg-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.mg-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mg-text);
  background: #f0f2f5;
  text-decoration: none;
  transition: var(--mg-transition);
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.mg-filter-pill:hover {
  background: #e4e6ea;
  color: var(--mg-text);
  text-decoration: none;
}

.mg-filter-pill.active {
  background: var(--mg-accent);
  color: white;
  border-color: var(--mg-accent);
}

.mg-filter-pill.active:hover {
  background: #d63851;
}

.mg-filter-pill .pill-icon {
  font-size: 16px;
}

/* Pill dropdown wrapper */
.mg-filter-dropdown {
  position: relative;
}

.mg-filter-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mg-text);
  background: #f0f2f5;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--mg-transition);
  white-space: nowrap;
  appearance: none;
  font-family: inherit;
}

.mg-filter-dropdown-toggle:hover,
.mg-filter-dropdown-toggle:focus {
  background: #e4e6ea;
  outline: none;
}

.mg-filter-dropdown-toggle .arrow {
  font-size: 10px;
  transition: transform 0.2s;
}

.mg-filter-dropdown.open .mg-filter-dropdown-toggle {
  border-color: var(--mg-accent);
  background: var(--mg-white);
}

.mg-filter-dropdown.open .arrow {
  transform: rotate(180deg);
}

.mg-filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--mg-white);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 100;
}

.mg-filter-dropdown.open .mg-filter-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mg-filter-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--mg-text);
  text-decoration: none;
  transition: var(--mg-transition);
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.mg-filter-dropdown-item:hover,
.mg-filter-dropdown-item.active {
  background: #f0f2f5;
  color: var(--mg-accent);
  text-decoration: none;
}

/* Size grid in dropdown */
.mg-size-grid-dropdown {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 4px;
}

.mg-size-grid-dropdown a {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--mg-text);
  background: #f8f9fa;
  text-decoration: none;
  transition: var(--mg-transition);
}

.mg-size-grid-dropdown a:hover,
.mg-size-grid-dropdown a.active {
  background: var(--mg-accent);
  color: white;
}

/* Active filter badges */
.mg-active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 0;
}

.mg-active-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(233, 69, 96, 0.1);
  color: var(--mg-accent);
}

.mg-active-badge .badge-remove {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.mg-active-badge .badge-remove:hover {
  opacity: 1;
}

.mg-filter-clear {
  font-size: 12px;
  font-weight: 600;
  color: var(--mg-text-light);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 8px;
  transition: var(--mg-transition);
}

.mg-filter-clear:hover {
  color: var(--mg-accent);
  background: #fee2e2;
  text-decoration: none;
}

/* Mobile filter toggle */
.mg-filter-toggle-mobile {
  display: none;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  background: var(--mg-accent);
  color: white;
  border: none;
  cursor: pointer;
  gap: 6px;
  align-items: center;
}

@media (max-width: 768px) {
  .mg-filter-toggle-mobile {
    display: inline-flex;
  }
  .mg-filter-pills {
    display: none;
    flex-direction: column;
    width: 100%;
  }
  .mg-filter-pills.open {
    display: flex;
  }
  .mg-filter-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .mg-filter-dropdown-menu {
    position: static;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 4px 0;
    display: none;
  }
  .mg-filter-dropdown.open .mg-filter-dropdown-menu {
    display: block;
  }
  .mg-size-grid-dropdown {
    grid-template-columns: repeat(7, 1fr);
  }
}

/* === ADMIN STYLES === */
.mg-admin-body {
  background: #f5f6fa;
}

.mg-admin-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding: 20px;
}

.mg-admin-login-card {
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  box-shadow: var(--mg-shadow);
  padding: 40px;
  width: 100%;
  max-width: 400px;
}

.mg-admin-login-card h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 4px;
}

.mg-admin-login-card p {
  color: var(--mg-text-light);
  margin: 0 0 24px;
  font-size: 14px;
}

.mg-admin-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 20px;
}

.mg-admin-header {
  margin-bottom: 24px;
}

.mg-admin-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 4px;
}

.mg-admin-header p {
  color: var(--mg-text-light);
  font-size: 14px;
  margin: 0;
}

.mg-admin-table-wrap {
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  box-shadow: var(--mg-shadow);
  overflow-x: auto;
}

.mg-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.mg-admin-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mg-text-light);
  background: #f8f9fa;
  border-bottom: 2px solid #eee;
}

.mg-admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.mg-admin-table tr:hover td {
  background: #fafbfc;
}

.mg-admin-table tr:last-child td {
  border-bottom: none;
}

.mg-admin-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.mg-admin-trie-input {
  width: 80px;
  padding: 8px 10px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  transition: var(--mg-transition);
}

.mg-admin-trie-input:focus {
  outline: none;
  border-color: var(--mg-accent);
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

/* Admin drag-and-drop priorities */
.mg-admin-sort-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  box-shadow: var(--mg-shadow);
  font-size: 14px;
}

.mg-admin-sort-count {
  color: var(--mg-text-light);
}

.mg-admin-sort-count strong {
  color: var(--mg-primary);
  font-size: 18px;
}

.mg-admin-sort-hint {
  color: var(--mg-text-light);
  font-size: 13px;
  font-weight: 600;
}

.mg-admin-sort-hint.is-saved {
  color: #0d7a4a;
}

.mg-admin-state-section {
  margin-bottom: 28px;
}

.mg-admin-state-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  padding: 0 4px;
}

.mg-admin-state-title {
  margin: 0;
  font-size: 18px;
  color: var(--mg-primary);
}

.mg-admin-state-meta {
  font-size: 13px;
  color: var(--mg-text-light);
}

.mg-admin-state-meta strong {
  color: var(--mg-primary);
}

.mg-admin-state-save {
  margin-left: 10px;
  font-weight: 600;
}

.mg-admin-state-save.is-saving {
  color: #b8860b;
}

.mg-admin-state-save.is-saved {
  color: #0d7a4a;
}

.mg-admin-state-save.is-error {
  color: #c0392b;
}

.mg-admin-sort-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mg-admin-auto-form {
  margin: 0;
}

.mg-admin-auto-btn {
  white-space: nowrap;
  padding: 10px 18px !important;
  font-size: 13px !important;
}

.mg-admin-sort-table .mg-col-drag {
  width: 44px;
  text-align: center;
}

.mg-admin-sort-table .mg-col-rank {
  width: 52px;
  text-align: center;
}

.mg-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--mg-text-light);
  font-size: 18px;
  cursor: grab;
  transition: background 0.2s, color 0.2s;
  user-select: none;
}

.mg-sortable-row:hover .mg-drag-handle {
  background: #f0f2f5;
  color: var(--mg-primary);
}

.mg-sortable-row.is-dragging {
  opacity: 0.45;
}

.mg-sortable-row.is-drag-over td {
  background: rgba(233, 69, 96, 0.06) !important;
}

.mg-sortable-row {
  cursor: grab;
  transition: background 0.15s;
}

.mg-sortable-row:active {
  cursor: grabbing;
}

.mg-sort-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: linear-gradient(135deg, var(--mg-primary), var(--mg-dark));
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.mg-admin-filename {
  font-size: 11px;
  word-break: break-all;
}

.mg-admin-sort-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  text-align: right;
  padding: 20px 0 8px;
}

.mg-admin-save-btn {
  width: auto !important;
  padding: 12px 40px !important;
  margin-top: 0 !important;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* Loading skeleton */
.mg-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.mg-image-loading {
  position: relative;
}

.mg-image-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* Search bar in nav */
.mg-search-wrap {
  flex: 1;
  max-width: 400px;
  margin: 0 20px;
}

.mg-search-form {
  display: flex;
  background: rgba(255,255,255,0.12);
  border-radius: 24px;
  overflow: hidden;
  transition: var(--mg-transition);
  border: 2px solid transparent;
}

.mg-search-form:focus-within {
  background: var(--mg-white);
  border-color: var(--mg-accent);
}

.mg-search-input {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 16px;
  color: var(--mg-white);
  font-size: 14px;
  outline: none;
}

.mg-search-form:focus-within .mg-search-input {
  color: var(--mg-text);
}

.mg-search-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.mg-search-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 16px;
  color: rgba(255,255,255,0.6);
  transition: var(--mg-transition);
}

.mg-search-form:focus-within .mg-search-btn {
  color: var(--mg-accent);
}

/* Cart badge */
.mg-cart-li {
  position: relative;
}

.mg-cart-link {
  display: flex !important;
  align-items: center;
  gap: 6px;
}

.mg-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: var(--mg-accent);
  color: white;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

/* Footer */
.mg-footer {
  background: var(--mg-primary);
  color: rgba(255,255,255,0.7);
  margin-top: 60px;
  padding: 32px 0;
}

.mg-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  text-align: center;
  font-size: 14px;
}

.mg-footer-inner p {
  margin: 0;
}

/* Hero Banner */
.mg-hero {
  background: linear-gradient(135deg, var(--mg-primary) 0%, var(--mg-dark) 100%);
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.mg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.mg-hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}

.mg-hero-title {
  font-size: 48px;
  font-weight: 900;
  color: var(--mg-white);
  margin: 0 0 16px;
  letter-spacing: -1px;
}

.mg-hero-text {
  font-size: 18px;
  color: rgba(255,255,255,0.7);
  margin: 0 0 32px;
  line-height: 1.6;
}

.mg-hero-btn {
  display: inline-block;
  padding: 16px 40px;
  background: var(--mg-accent);
  color: white;
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--mg-transition);
  text-decoration: none;
}

.mg-hero-btn:hover {
  background: #d63851;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(233, 69, 96, 0.35);
  color: white;
  text-decoration: none;
}

/* Category cards */
.mg-categories {
  max-width: 1400px;
  margin: -40px auto 40px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.mg-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.mg-cat-card {
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  padding: 40px 24px;
  text-align: center;
  box-shadow: var(--mg-shadow);
  transition: var(--mg-transition);
  text-decoration: none;
  display: block;
  position: relative;
  overflow: hidden;
}

.mg-cat-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--mg-shadow-hover);
  text-decoration: none;
}

.mg-cat-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
}

.mg-cat-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--mg-text);
  margin: 0 0 4px;
}

.mg-cat-sub {
  font-size: 14px;
  color: var(--mg-text-light);
  margin: 0;
}

/* Section titles */
.mg-section-title {
  max-width: 1400px;
  margin: 48px auto 24px;
  padding: 0 20px;
  font-size: 28px;
  font-weight: 800;
  color: var(--mg-text);
}

.mg-section-title span {
  color: var(--mg-accent);
}

/* Cart page */
.mg-cart-page {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 20px;
}

.mg-cart-empty {
  text-align: center;
  padding: 80px 20px;
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  box-shadow: var(--mg-shadow);
}

.mg-cart-empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  display: block;
}

.mg-cart-empty h2 {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 8px;
}

.mg-cart-empty p {
  color: var(--mg-text-light);
  margin: 0 0 24px;
}

.mg-cart-table {
  width: 100%;
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  box-shadow: var(--mg-shadow);
  overflow: hidden;
}

.mg-cart-header {
  display: grid;
  grid-template-columns: 80px 1fr 80px 120px 100px 80px;
  gap: 12px;
  padding: 16px 20px;
  background: #f8f9fa;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--mg-text-light);
  border-bottom: 1px solid #eee;
}

.mg-cart-row {
  display: grid;
  grid-template-columns: 80px 1fr 80px 120px 100px 80px;
  gap: 12px;
  padding: 16px 20px;
  align-items: center;
  border-bottom: 1px solid #f0f0f0;
  transition: var(--mg-transition);
}

.mg-cart-row:last-child {
  border-bottom: none;
}

.mg-cart-row:hover {
  background: #fafafa;
}

.mg-cart-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
}

.mg-cart-product-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--mg-text);
  margin: 0;
}

.mg-cart-product-size {
  font-size: 13px;
  color: var(--mg-text-light);
  margin: 2px 0 0;
}

.mg-cart-qty {
  width: 60px;
  padding: 6px 8px;
  border: 2px solid #e8e8e8;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.mg-cart-qty:focus {
  outline: none;
  border-color: var(--mg-accent);
}

.mg-cart-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--mg-text);
}

.mg-cart-subtotal {
  font-size: 16px;
  font-weight: 800;
  color: var(--mg-accent);
}

.mg-cart-remove {
  background: none;
  border: none;
  color: var(--mg-text-light);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: var(--mg-transition);
}

.mg-cart-remove:hover {
  color: var(--mg-accent);
  background: #fee2e2;
}

.mg-cart-footer {
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  box-shadow: var(--mg-shadow);
  margin-top: 16px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.mg-cart-total-label {
  font-size: 16px;
  color: var(--mg-text-light);
}

.mg-cart-total-amount {
  font-size: 28px;
  font-weight: 900;
  color: var(--mg-accent);
}

.mg-cart-actions {
  display: flex;
  gap: 12px;
}

/* Search results */
.mg-search-header {
  max-width: 1400px;
  margin: 24px auto 8px;
  padding: 0 20px;
}

.mg-search-header h1 {
  font-size: 24px;
  font-weight: 800;
  margin: 0;
}

.mg-search-header p {
  color: var(--mg-text-light);
  margin: 4px 0 0;
  font-size: 15px;
}

/* Responsive additions */
@media (max-width: 768px) {
  .mg-hero-title {
    font-size: 32px;
  }
  .mg-hero-text {
    font-size: 16px;
  }
  .mg-cat-grid {
    grid-template-columns: 1fr;
  }
  .mg-search-wrap {
    display: none;
  }
  .mg-cart-header {
    display: none;
  }
  .mg-cart-row {
    grid-template-columns: 60px 1fr 40px;
    gap: 8px;
    position: relative;
  }
  .mg-cart-row .mg-cart-price,
  .mg-cart-row .mg-cart-subtotal {
    display: none;
  }
  .mg-cart-footer {
    flex-direction: column;
    text-align: center;
  }
  .mg-cart-actions {
    width: 100%;
    flex-direction: column;
  }
  .mg-cart-actions .mg-btn-nav,
  .mg-cart-actions .mg-btn-nav-outline {
    width: 100%;
    text-align: center;
  }
}

/* ── Modal ── */
.mg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(6px);
  animation: mgOverlayIn 0.2s ease-out;
}

@keyframes mgOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mg-modal {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.28), 0 0 1px rgba(0,0,0,0.1);
  animation: mgModalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.mg-modal.mg-modal--account {
  max-width: 780px;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 24px;
}

.mg-modal.mg-modal--account .mg-modal-body {
  overflow-y: auto;
  flex: 1 1 auto;
}

@media (max-width: 900px) {
  .mg-modal.mg-modal--account {
    max-width: 90vw;
  }
}

@media (max-height: 720px) {
  .mg-modal.mg-modal--account {
    max-height: 88vh;
  }
}

@media (max-width: 640px) {
  .mg-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .mg-modal {
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    max-height: 96vh;
    animation: mgModalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mg-modal.mg-modal--account {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
  }
}

@keyframes mgModalIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes mgModalSlideUp {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

.mg-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(255,255,255,0.15);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: rgba(255,255,255,0.85);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  backdrop-filter: blur(4px);
}

.mg-modal-close:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
  transform: scale(1.08);
}

.mg-modal-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.mg-modal-body .mg-order-wrap {
  margin: 0;
  padding: 20px 24px 24px;
}

.mg-modal-body .mg-order-form {
  padding: 0;
}

/* ── Two-column form grid ── */
.mg-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

.mg-form-grid .mg-form-group {
  margin-bottom: 0;
}

.mg-form-grid .mg-form-group--full {
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  .mg-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.mg-modal-loading {
  padding: 60px 20px;
  text-align: center;
  color: #999;
}

.mg-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #eee;
  border-top-color: var(--mg-accent);
  border-radius: 50%;
  animation: mgSpin 0.7s linear infinite;
  margin: 0 auto 12px;
}

@keyframes mgSpin {
  to { transform: rotate(360deg); }
}

body.mg-no-scroll {
  overflow: hidden;
}

/* ── Toast ── */
.mg-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a1a;
  color: #fff;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 10000;
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  pointer-events: none;
}

.mg-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.mg-toast-success {
  background: #059669;
}

.mg-toast-error {
  background: #dc2626;
}

/* ── Enhanced UX (2026) ── */

.mg-results-bar {
  max-width: 1400px;
  margin: 16px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mg-results-count {
  font-size: 14px;
  color: var(--mg-text-light);
  font-weight: 500;
  margin: 0;
}

.mg-results-count strong {
  color: var(--mg-text);
  font-weight: 700;
}

.mg-page-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 24px;
  color: var(--mg-text);
}

.mg-empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  box-shadow: var(--mg-shadow);
  max-width: 560px;
  margin: 40px auto;
}

.mg-empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.7;
}

.mg-empty-state h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
}

.mg-empty-state p {
  color: var(--mg-text-light);
  margin: 0 0 24px;
  line-height: 1.6;
}

.mg-cta-center {
  text-align: center;
  margin: 40px 0 48px;
}

.mg-cta-center .mg-btn-nav {
  padding: 16px 48px;
}

.mg-product-card[data-href] {
  cursor: pointer;
}

.mg-product-card[data-href]:focus-within {
  outline: 2px solid var(--mg-accent);
  outline-offset: 3px;
}

.mg-product-card .mg-product-info {
  transition: var(--mg-transition);
}

.mg-product-card:hover .mg-product-info {
  background: #fafbfc;
}

.mg-stock-low {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 4px;
}

/* Staggered card entrance */
.mg-product-grid .mg-product-card {
  animation: fadeInUp 0.45s ease-out both;
}

.mg-product-grid .mg-product-card:nth-child(1) { animation-delay: 0.02s; }
.mg-product-grid .mg-product-card:nth-child(2) { animation-delay: 0.05s; }
.mg-product-grid .mg-product-card:nth-child(3) { animation-delay: 0.08s; }
.mg-product-grid .mg-product-card:nth-child(4) { animation-delay: 0.11s; }
.mg-product-grid .mg-product-card:nth-child(5) { animation-delay: 0.14s; }
.mg-product-grid .mg-product-card:nth-child(6) { animation-delay: 0.17s; }
.mg-product-grid .mg-product-card:nth-child(7) { animation-delay: 0.20s; }
.mg-product-grid .mg-product-card:nth-child(8) { animation-delay: 0.23s; }

/* Footer grid */
.mg-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  text-align: left;
  margin-bottom: 32px;
}

.mg-footer-brand p {
  font-size: 14px;
  line-height: 1.6;
  margin: 12px 0 0;
  color: rgba(255,255,255,0.6);
}

.mg-footer-logo {
  height: 44px;
  border-radius: 8px;
}

.mg-footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.9);
  margin: 0 0 16px;
}

.mg-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mg-footer-col li {
  margin-bottom: 10px;
}

.mg-footer-col a,
.mg-footer-col span {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  transition: var(--mg-transition);
}

.mg-footer-col a:hover {
  color: var(--mg-white);
}

.mg-footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
}

.mg-footer-bottom p {
  margin: 0;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

/* Back to top */
.mg-back-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--mg-primary);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  transition: var(--mg-transition);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.mg-back-top.mg-back-top--visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mg-back-top:hover {
  background: var(--mg-accent);
  transform: translateY(-3px);
}

/* Cart enhancements */
.mg-cart-summary-card {
  background: var(--mg-white);
  border-radius: var(--mg-radius);
  box-shadow: var(--mg-shadow);
  padding: 24px;
  margin-top: 16px;
}

.mg-cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--mg-text-light);
}

.mg-cart-summary-row.mg-cart-summary-total {
  border-top: 2px solid #eee;
  margin-top: 8px;
  padding-top: 16px;
  font-size: 18px;
  font-weight: 800;
  color: var(--mg-text);
}

.mg-cart-summary-total .mg-cart-total-amount {
  font-size: 24px;
}

.mg-cart-delivery-note {
  font-size: 13px;
  color: var(--mg-text-light);
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mg-cart-checkout-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  text-align: center;
  padding: 16px;
  font-size: 15px;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.mg-cart-row .mg-cart-meta {
  display: none;
}

/* Flash dismiss */
.mg-flash .mg-alert {
  animation: mgFlashIn 0.35s ease-out;
}

@keyframes mgFlashIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mg-flash .mg-alert.mg-alert--dismiss {
  animation: mgFlashOut 0.3s ease-in forwards;
}

@keyframes mgFlashOut {
  to { opacity: 0; transform: translateY(-8px); height: 0; padding: 0; margin: 0; overflow: hidden; }
}

/* Search empty */
.mg-search-empty {
  max-width: 500px;
  margin: 40px auto;
}

/* Category card accent */
.mg-cat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--mg-accent), var(--mg-gold));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.mg-cat-card:hover::before {
  transform: scaleX(1);
}

@media (max-width: 768px) {
  .mg-nav-actions {
    display: flex;
  }
  .mg-search-wrap {
    display: none;
  }
  .mg-cart-li {
    display: none;
  }
  .mg-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .mg-footer-logo {
    margin: 0 auto;
  }
  .mg-cart-row .mg-cart-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--mg-text-light);
    margin-top: 4px;
  }
  .mg-cart-row .mg-cart-meta .mg-cart-subtotal {
    display: inline;
    font-weight: 800;
    color: var(--mg-accent);
  }
  .mg-back-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
}

/* ══════════════════════════════════════════
   PRODUCT DETAIL PAGE (commander / PDP)
   ══════════════════════════════════════════ */
.mg-pdp {
  max-width: 1280px;
  margin: 0 auto 16px;
  padding: 0 20px;
}

.mg-pdp-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--mg-text-light);
  margin: 8px 0 8px;
}

.mg-pdp-top {
  margin-bottom: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff 0%, #f8f9fc 100%);
  border: 1px solid #eceff3;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(26, 26, 46, 0.05);
}

.mg-pdp-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.mg-pdp-top-badge {
  margin-bottom: 6px;
  padding: 3px 8px;
}

.mg-pdp-top-eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
}

.mg-pdp-top-title {
  font-size: clamp(18px, 2.5vw, 26px);
}

.mg-pdp-top-ref {
  margin: 4px 0 0;
  font-size: 12px;
}

.mg-pdp-top-price .mg-pdp-price {
  font-size: clamp(22px, 3vw, 30px);
}

.mg-pdp-top-price .mg-pdp-price-old {
  font-size: 15px;
}

.mg-pdp-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 1fr);
  gap: 20px;
  align-items: stretch;
}

.mg-pdp-visual {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mg-pdp-hero-image {
  position: relative;
  padding-top: 100%;
  height: 0;
  overflow: hidden;
  background: linear-gradient(145deg, #f3f4f6 0%, #e8eaef 100%);
}

.mg-pdp-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}

.mg-pdp-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.mg-pdp-perks {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mg-pdp-perks li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--mg-text-light);
  background: var(--mg-white);
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  flex: 1 1 auto;
  min-width: 0;
}

.mg-pdp-perk-icon {
  font-size: 13px;
}

.mg-pdp .mg-form-group {
  margin-bottom: 0;
}

.mg-pdp-section--stack {
  margin-top: 0;
  padding: 12px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.mg-pdp-block--checkout {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mg-pdp-block-divider {
  height: 1px;
  background: #eceff3;
  margin: 10px 0;
}

.mg-pdp-size-qty {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.mg-pdp-size-qty .mg-form-group--sizes {
  flex: 1;
  min-width: 0;
}

.mg-pdp-size-qty .mg-form-group--qty {
  flex-shrink: 0;
  width: 118px;
}

.mg-pdp-size-qty .mg-form-group--qty label {
  margin-bottom: 4px;
}

.mg-pdp-section-head {
  margin-bottom: 10px;
  gap: 10px;
}

.mg-pdp-section-head h2 {
  font-size: 15px;
}

.mg-pdp-step {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  font-size: 12px;
  background: linear-gradient(135deg, var(--mg-primary), var(--mg-dark));
  color: white;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.mg-pdp .mg-size-option label {
  min-width: 44px;
  height: 38px;
  padding: 0 10px;
  font-size: 13px;
}

.mg-pdp .mg-qty-stepper {
  max-width: 118px;
}

.mg-cart-recap {
  margin: 0 12px 12px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #f0f7ff 0%, #f8faff 100%);
  border: 1px solid #d6e4f5;
  border-radius: 10px;
}

.mg-cart-recap-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #3b5998;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.mg-cart-recap-title svg {
  flex-shrink: 0;
}

.mg-cart-recap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--mg-text);
  border-top: 1px solid rgba(59, 89, 152, 0.1);
}

.mg-cart-recap-row:first-of-type {
  border-top: none;
}

.mg-cart-recap-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.mg-tag-promo {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: var(--mg-accent);
  border-radius: 4px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

.mg-cart-recap-meta {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--mg-text-light);
}

.mg-cart-recap-price {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--mg-accent);
}

.mg-pdp-checkout-summary {
  padding: 2px 12px;
  margin-bottom: 12px;
}

.mg-pdp-checkout-summary .mg-pdp-summary-line {
  padding: 6px 0;
  font-size: 13px;
}

.mg-pdp-checkout-summary .mg-pdp-summary-total {
  padding-top: 8px;
  font-size: 14px;
}

.mg-pdp-checkout-summary .mg-pdp-summary-total strong {
  font-size: 18px;
}

.mg-pdp-actions {
  margin-top: auto;
}

.mg-pdp-size-hint {
  margin: 0;
  font-size: 11px;
}

.mg-pdp--modal {
  margin: 0;
  padding: 0;
  max-width: none;
}

.mg-pdp-breadcrumb a {
  color: var(--mg-text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.mg-pdp-breadcrumb a:hover {
  color: var(--mg-accent);
}

.mg-pdp-top-copy {
  flex: 1;
  min-width: 0;
}

.mg-pdp-top-badge {
  display: inline-block;
  background: var(--mg-accent);
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 20px;
}

.mg-pdp-top-eyebrow {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mg-accent);
}

.mg-pdp-top-title {
  margin: 0;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--mg-primary);
  text-transform: uppercase;
}

.mg-pdp-top-ref {
  color: var(--mg-text-light);
  font-weight: 500;
}

.mg-pdp-top-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.mg-pdp-top--modal {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
}

.mg-pdp-top--modal .mg-pdp-top-title {
  font-size: 18px;
}

/* Hero image */
.mg-pdp-hero {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--mg-shadow);
  background: var(--mg-white);
}

.mg-pdp-hero-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-pdp-hero-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.mg-pdp-hero.is-compact .mg-pdp-hero-img,
.mg-pdp-hero.is-medium .mg-pdp-hero-img {
  object-fit: contain;
  padding: 10%;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.mg-pdp-hero.is-compact .mg-pdp-hero-image {
  background: #fff;
}

.mg-pdp-section {
  background: var(--mg-white);
  border: 1px solid #eceff3;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(26, 26, 46, 0.04);
}

.mg-pdp-section-head {
  display: flex;
  align-items: flex-start;
}

.mg-pdp-section-head p {
  display: none;
}

.mg-pdp-block--checkout .mg-pdp-checkout-summary {
  background: #f8f9fb;
  border: 1px solid #eceff2;
  border-radius: 12px;
}

.mg-pdp-checkout-section {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.mg-pdp-header {
  margin-bottom: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.mg-pdp-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--mg-accent);
  margin: 0 0 8px;
}

.mg-pdp-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--mg-primary);
  margin: 0 0 6px;
  line-height: 1.2;
  letter-spacing: -0.3px;
}

.mg-pdp-ref {
  font-size: 13px;
  color: var(--mg-text-light);
  margin: 0 0 12px;
}

.mg-pdp-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.mg-pdp-price {
  font-size: 32px;
  font-weight: 900;
  color: var(--mg-accent);
  line-height: 1;
}

.mg-pdp-price small {
  font-size: 16px;
  font-weight: 700;
  color: var(--mg-text-light);
}

.mg-pdp-price-old {
  font-size: 18px;
  color: var(--mg-text-light);
  text-decoration: line-through;
  font-weight: 600;
}

.mg-pdp-section:focus-within {
  box-shadow: 0 3px 14px rgba(26, 26, 46, 0.06);
}

.mg-pdp-section-head h2 {
  font-weight: 800;
  margin: 0;
  color: var(--mg-text);
}

/* Mode selector cards */
.mg-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mg-mode-card {
  cursor: pointer;
  margin: 0;
}

.mg-mode-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mg-mode-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  background: #fafbfc;
  transition: all 0.25s ease;
  height: 100%;
}

.mg-mode-card:hover .mg-mode-card-inner {
  border-color: #ccc;
  background: #fff;
}

.mg-mode-card.is-active .mg-mode-card-inner,
.mg-mode-card input:checked + .mg-mode-card-inner {
  border-color: var(--mg-accent);
  background: linear-gradient(135deg, rgba(233,69,96,0.06), rgba(233,69,96,0.02));
  box-shadow: 0 4px 16px rgba(233,69,96,0.12);
}

.mg-mode-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-mode-icon--order {
  background: rgba(26,26,46,0.08);
  color: var(--mg-primary);
}

.mg-mode-icon--cart {
  background: rgba(233,69,96,0.1);
  color: var(--mg-accent);
}

.mg-mode-card.is-active .mg-mode-icon--order,
.mg-mode-card input:checked + .mg-mode-card-inner .mg-mode-icon--order {
  background: var(--mg-primary);
  color: white;
}

.mg-mode-card.is-active .mg-mode-icon--cart,
.mg-mode-card input:checked + .mg-mode-card-inner .mg-mode-icon--cart {
  background: var(--mg-accent);
  color: white;
}

.mg-mode-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mg-mode-text strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--mg-text);
  line-height: 1.2;
}

.mg-mode-text small {
  font-size: 12px;
  color: var(--mg-text-light);
  line-height: 1.35;
}

/* Summary & actions */
.mg-pdp-checkout-section {
  background: linear-gradient(165deg, #fafbfc 0%, #f3f5f8 100%);
  border-color: #e4e8ee;
}

.mg-pdp-checkout-summary {
  background: #fff;
  border: 1px solid #eceff2;
  border-radius: 14px;
  padding: 4px 16px;
  margin-bottom: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mg-pdp-checkout-summary .mg-pdp-summary-line {
  padding: 10px 0;
}

.mg-pdp-checkout-summary .mg-pdp-summary-total {
  margin-top: 0;
  padding-top: 12px;
}

.mg-mode-grid--checkout {
  margin-bottom: 18px;
}

.mg-pdp-summary-section {
  background: linear-gradient(160deg, #fafbfc, #f5f6f8);
  border-color: #e8e8e8;
}

.mg-pdp-summary {
  margin-bottom: 16px;
}

.mg-pdp-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--mg-text);
}

.mg-pdp-summary-line--muted {
  color: var(--mg-text-light);
  font-size: 13px;
}

.mg-pdp-summary-total {
  border-top: 2px solid #e0e0e0;
  margin-top: 4px;
  padding-top: 14px;
  font-size: 16px;
  font-weight: 800;
}

.mg-pdp-summary-total strong {
  font-size: 22px;
  color: var(--mg-accent);
}

.mg-pdp-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mg-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 2px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  text-align: left;
  color: #fff;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.mg-action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0));
  transition: opacity 0.3s ease;
  border-radius: inherit;
  pointer-events: none;
}

.mg-action-card:hover::before {
  opacity: 1;
}

.mg-action-card--primary {
  background: linear-gradient(135deg, #e4580d 0%, #c2410c 100%);
  box-shadow: 0 4px 16px rgba(228, 88, 13, 0.35);
}

.mg-action-card--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(228, 88, 13, 0.45);
}

.mg-action-card--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(228, 88, 13, 0.3);
}

.mg-action-card--secondary {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 4px 14px rgba(26, 26, 46, 0.3);
}

.mg-action-card--secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 26, 46, 0.4);
}

.mg-action-card--secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26, 26, 46, 0.25);
}

.mg-action-card:disabled,
.mg-action-card[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.mg-action-card:disabled::before,
.mg-action-card[aria-disabled="true"]::before {
  display: none;
}

.mg-action-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.mg-action-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mg-action-card-text strong {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.mg-action-card-text small {
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.3;
}

/* Modal PDP */
.mg-pdp--modal .mg-pdp-breadcrumb,
.mg-pdp--modal .mg-pdp-visual {
  display: none;
}

.mg-pdp--modal .mg-pdp-visual-price--modal {
  display: flex;
}

.mg-pdp--modal .mg-pdp-shell {
  grid-template-columns: 1fr;
  gap: 0;
}

.mg-pdp--modal .mg-pdp-header {
  padding-top: 8px;
}

.mg-pdp--modal .mg-pdp-title {
  font-size: 20px;
}

.mg-modal-body .mg-pdp {
  padding: 16px 20px 20px;
}

@media (max-width: 992px) {
  .mg-pdp-top {
    margin-bottom: 12px;
    padding: 12px 16px;
  }

  .mg-pdp-top-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .mg-pdp-shell {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .mg-pdp-visual {
    height: auto;
  }

  .mg-pdp-hero-image {
    padding-top: 100%;
    height: 0;
  }

  .mg-pdp-panel,
  .mg-pdp-form,
  .mg-pdp-section--stack,
  .mg-pdp-block--checkout {
    height: auto;
    min-height: 0;
    flex: none;
  }

  .mg-pdp-actions {
    margin-top: 0;
  }

  .mg-pdp-size-qty {
    flex-direction: column;
    align-items: stretch;
  }

  .mg-pdp-size-qty .mg-form-group--qty {
    width: 100%;
  }

  .mg-pdp-size-qty .mg-qty-stepper {
    max-width: 140px;
  }
}

@media (max-width: 600px) {
  .mg-mode-grid {
    grid-template-columns: 1fr;
  }

  .mg-pdp-top {
    padding: 12px 14px;
    margin-bottom: 10px;
  }

  .mg-pdp-top-title {
    font-size: 17px;
  }

  .mg-pdp-section--stack {
    padding: 12px 14px;
  }

  .mg-pdp-perks li {
    font-size: 10px;
    padding: 5px 8px;
  }
}

/* ══ Customer account / popup ══ */

/* Header with icon */
.mg-account-popup-head {
  background: linear-gradient(135deg, var(--mg-primary) 0%, var(--mg-dark) 100%);
  margin: -24px -32px 0;
  padding: 32px 32px 26px;
  border-radius: 24px 24px 0 0;
}

.mg-account-popup-head-inner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.mg-account-popup-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.12);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.9);
}

.mg-account-popup-head h2 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.mg-account-popup-head p {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin: 0;
  line-height: 1.5;
}

/* Panel body — generous breathing room */
.mg-modal-body .mg-account-panel--popup {
  padding: 28px 32px 32px;
}

/* Form sections */
.mg-form-section {
  margin-bottom: 32px;
}

.mg-form-section:last-child {
  margin-bottom: 0;
}

.mg-form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--mg-text);
  margin: 0 0 22px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f2f5;
}

.mg-form-section-title svg {
  color: var(--mg-accent);
  flex-shrink: 0;
}

.mg-form-section--personal + .mg-form-section--address {
  margin-top: 8px;
}

/* Labels with icons */
.mg-form-group label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
}

.mg-label-icon {
  color: #94a3b8;
  flex-shrink: 0;
  transition: color 0.2s;
}

.mg-form-group:focus-within .mg-label-icon {
  color: var(--mg-accent);
}

/* Tabs */
.mg-account-panel--popup .mg-account-tabs {
  margin: 20px -32px 22px;
  border-bottom: none;
  padding: 6px;
  background: #f1f5f9;
  border-radius: 12px;
  gap: 4px;
}

.mg-account-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: none;
  padding: 6px;
  background: #f1f5f9;
  border-radius: 12px;
}

.mg-account-tabs[hidden] {
  display: none !important;
}

.mg-account-tab {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--mg-text-light);
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.25s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 7px;
}

.mg-account-tab svg {
  opacity: 0.5;
  transition: opacity 0.2s;
}

.mg-account-tab:hover {
  color: var(--mg-text);
}

.mg-account-tab:hover svg {
  opacity: 0.75;
}

.mg-account-tab.is-active {
  color: var(--mg-text);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  font-weight: 700;
}

.mg-account-tab.is-active svg {
  color: var(--mg-accent);
  opacity: 1;
}

.mg-account-tab[hidden] {
  display: none !important;
}

/* Form groups */
.mg-account-panel--popup .mg-form-group {
  margin-bottom: 0;
}

.mg-account-panel--popup label {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0;
  text-transform: none;
}

.mg-account-panel--popup .mg-form-control {
  height: 52px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  font-size: 15px;
  transition: all 0.2s ease;
}

.mg-account-panel--popup .mg-form-control:hover {
  border-color: #d1d5db;
  background: #fff;
}

.mg-account-panel--popup .mg-form-control:focus {
  border-color: var(--mg-accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08);
  outline: none;
}

.mg-account-panel--popup .mg-textarea {
  height: auto;
  min-height: 100px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.5;
}

/* Select wrapper with chevron */
.mg-select-wrap {
  position: relative;
}

.mg-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
}

.mg-select-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #9ca3af;
}

.mg-account-panel--popup .mg-form-row {
  gap: 20px;
  margin-bottom: 0;
}

.mg-account-panel--popup .mg-form-row--popup {
  grid-template-columns: 1fr;
  gap: 0;
}

.mg-account-panel--popup .mg-form-row--popup .mg-form-group {
  margin-bottom: 0;
}

/* Phone lookup input group */
.mg-phone-lookup-row {
  display: flex;
  gap: 0;
}

.mg-phone-lookup-group {
  min-width: 0;
}

.mg-phone-lookup-row .mg-form-control {
  flex: 1;
  min-width: 0;
  border-radius: 12px 0 0 12px;
  border-right: none;
}

.mg-phone-lookup-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 0 22px !important;
  height: 52px;
  font-size: 14px !important;
  background: var(--mg-accent) !important;
  color: #fff !important;
  border: 1.5px solid var(--mg-accent) !important;
  border-radius: 0 12px 12px 0 !important;
  font-weight: 700 !important;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
}

.mg-phone-lookup-btn:hover {
  background: #d63851 !important;
  border-color: #d63851 !important;
}

.mg-phone-lookup-btn svg {
  flex-shrink: 0;
}

/* Account found alert */
.mg-account-found-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
  color: #065f46;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  animation: mgFadeSlideIn 0.3s ease-out;
}

.mg-account-found-alert[hidden] {
  display: none !important;
}

.mg-account-found-icon {
  width: 24px;
  height: 24px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Account actions */
.mg-account-panel--popup .mg-account-actions {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px solid #f0f2f5;
}

.mg-account-actions .mg-btn-submit {
  margin-top: 0;
}

.mg-btn-submit--checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 24px;
  background: linear-gradient(135deg, var(--mg-accent) 0%, #d63851 100%);
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.mg-btn-submit--checkout::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transition: left 0.5s ease;
}

.mg-btn-submit--checkout:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(233, 69, 96, 0.3);
}

.mg-btn-submit--checkout:hover::before {
  left: 100%;
}

.mg-account-panel-desc {
  font-size: 13px;
  color: var(--mg-text-light);
  margin: 0 0 20px;
}

/* Account page */
.mg-account-page {
  max-width: 720px;
  margin: 32px auto 56px;
  padding: 0 20px;
}

.mg-account-page-header {
  text-align: center;
  margin-bottom: 28px;
}

.mg-account-page-header h1 {
  font-size: 28px;
  font-weight: 900;
  color: var(--mg-primary);
  margin: 0 0 8px;
}

.mg-account-page-header p {
  color: var(--mg-text-light);
  margin: 0;
  font-size: 15px;
}

.mg-account-page-card {
  background: var(--mg-white);
  border-radius: 20px;
  box-shadow: var(--mg-shadow);
  border: 1px solid #eee;
  padding: 28px 24px;
}

.mg-account-phone-gate {
  text-align: center;
  padding: 20px 0 28px;
  border-bottom: 1px solid #eee;
  margin-bottom: 24px;
}

.mg-account-gate-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.8;
}

.mg-account-phone-gate h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 8px;
}

.mg-account-phone-gate p {
  color: var(--mg-text-light);
  font-size: 14px;
  margin: 0 0 20px;
  line-height: 1.5;
}

.mg-account-phone-row {
  display: flex;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto 12px;
}

.mg-account-phone-row .mg-form-control {
  flex: 1;
}

.mg-account-phone-row .mg-btn-submit {
  margin: 0;
  white-space: nowrap;
  padding: 12px 20px;
  width: auto;
}

.mg-account-gate-hint {
  font-size: 12px;
  color: var(--mg-text-light);
  margin: 0;
}

/* History */
.mg-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow-y: auto;
}

.mg-history-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--mg-text-light);
  font-size: 14px;
}

.mg-history-item {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 14px;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  transition: all 0.25s ease;
}

.mg-history-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.mg-history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.mg-history-id {
  font-size: 13px;
  font-weight: 800;
  color: var(--mg-primary);
}

.mg-history-date {
  font-size: 12px;
  color: var(--mg-text-light);
}

.mg-history-item-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mg-history-state {
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  padding: 4px 12px;
  border-radius: 20px;
  color: var(--mg-text);
}

.mg-history-total {
  font-size: 16px;
  font-weight: 800;
  color: var(--mg-accent);
}

.mg-history-detail {
  font-size: 12px;
  color: var(--mg-text-light);
  margin: 8px 0 0;
  line-height: 1.4;
}

.mg-modal-body .mg-account-panel:not(.mg-account-panel--popup) {
  padding: 4px 0;
}

@keyframes mgFadeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══ Responsive: Tablet ══ */
@media (max-width: 900px) {
  .mg-account-popup-head {
    margin: -24px -24px 0;
    padding: 28px 24px 22px;
  }

  .mg-modal-body .mg-account-panel--popup {
    padding: 24px 24px 24px;
  }

  .mg-account-panel--popup .mg-account-tabs {
    margin-left: -24px;
    margin-right: -24px;
  }
}

/* ══ Responsive: Mobile ══ */
@media (max-width: 640px) {
  .mg-account-popup-head {
    margin: -20px -20px 0;
    padding: 24px 20px 20px;
    border-radius: 20px 20px 0 0;
  }

  .mg-account-popup-head h2 {
    font-size: 18px;
  }

  .mg-account-popup-head p {
    font-size: 12px;
  }

  .mg-modal-body .mg-account-panel--popup {
    padding: 20px 20px 24px;
  }

  .mg-account-panel--popup .mg-account-tabs {
    margin-left: -20px;
    margin-right: -20px;
  }

  .mg-account-panel--popup .mg-form-control {
    height: 48px;
    font-size: 14px;
  }

  .mg-phone-lookup-btn {
    height: 48px !important;
    padding: 0 16px !important;
    font-size: 13px !important;
  }

  .mg-phone-lookup-row .mg-form-control {
    border-radius: 10px 0 0 10px;
  }

  .mg-phone-lookup-btn {
    border-radius: 0 10px 10px 0 !important;
  }

  .mg-account-tab {
    padding: 8px 14px;
    font-size: 12px;
  }

  .mg-form-section-title {
    font-size: 14px;
  }

  .mg-btn-submit--checkout {
    padding: 14px 20px;
    font-size: 15px;
  }

  .mg-account-phone-row {
    flex-direction: column;
  }

  .mg-phone-lookup-row {
    flex-direction: column;
  }

  .mg-phone-lookup-row .mg-form-control {
    border-radius: 12px;
    border-right: 1px solid #e5e7eb;
  }

  .mg-phone-lookup-btn {
    border-radius: 12px !important;
    height: 48px !important;
  }
}
