:root {
  --orange: #f39c12;
  --red: #e53935;
  --text: #1a1a1a;
  --bg: #f5f6f8;
  --navy: #0b1f5e;
  --navy-2: #142b8c;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.97);
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, #fafbfc 0%, var(--bg) 100%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; }
button, input { font: inherit; }

.site-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  position: sticky;
  top: 0;
  z-index: 30;
  background:
    linear-gradient(120deg, rgba(120, 70, 255, 0.08), transparent 40%, rgba(255, 215, 90, 0.08)),
    rgba(255,255,255,0.8);
  backdrop-filter: blur(12px);
  border-top: 3px solid;
  border-bottom: 3px solid;
  border-image: linear-gradient(90deg, var(--navy), var(--navy-2), #ff2e2e, #f5c542, var(--navy)) 1;
  animation: borderWave 8s linear infinite;
}

@keyframes borderWave {
  0%, 100% { border-image: linear-gradient(90deg, var(--navy), var(--navy-2), #ff2e2e, #f5c542) 1; }
  50% { border-image: linear-gradient(90deg, #f5c542, #ff2e2e, var(--navy-2), var(--navy)) 1; }
}

header::before,
header::after,
.site-footer::before,
.site-footer::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 20px;
  filter: blur(16px);
  pointer-events: none;
}

header::before,
.site-footer::before {
  top: -10px;
  background: radial-gradient(80% 100% at 50% 100%, rgba(243,156,18,0.55), transparent 70%);
}
header::after,
.site-footer::after {
  bottom: -10px;
  background: radial-gradient(80% 100% at 50% 0%, rgba(229,57,53,0.25), transparent 70%);
}

.nav-container,
.footer-wrapper,
.page-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
}

.nav-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
}

.nav-brand {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  animation: dropIn 0.9s cubic-bezier(.2,1.2,.3,1) both;
}
.nav-brand .brand-accent { color: var(--red); }

@keyframes dropIn {
  0% { transform: translateY(-40px); opacity: 0; }
  70% { transform: translateY(6px); opacity: 1; }
  100% { transform: translateY(0); }
}

.nav-links,
.nav-ui {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-links { justify-content: center; }
.nav-ui { justify-content: flex-end; }

.nav-link {
  position: relative;
  text-decoration: none;
  font-weight: 600;
  padding: 8px 10px;
}
.nav-link:hover { color: var(--red); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--navy), #ff2e2e, #f5c542, var(--navy));
  background-size: 200% 100%;
  transition: width 0.35s ease;
}
.nav-link.active::after { width: 100%; animation: activeSweep 5s linear infinite; }
@keyframes activeSweep { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }

.icon-btn,
.primary-btn,
.ghost-btn {
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-btn {
  padding: 10px 14px;
  background: rgba(255,255,255,0.9);
  text-decoration: none;
  white-space: nowrap;
}
.icon-btn:hover,
.primary-btn:hover,
.ghost-btn:hover { transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(243,156,18,0.12); }

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  text-decoration: none;
}
.primary-btn { background: var(--panel-strong); }
.ghost-btn { background: rgba(255,255,255,0.6); }

.page-shell {
  flex: 1;
  padding: 56px 0 80px;
}

.page-content {
  min-height: 420px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.fade-out { opacity: 0; transform: translateY(10px); }
.fade-in { opacity: 1; transform: translateY(0); }

.content-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.glow-card,
.hero-block,
.metric-card,
.config-card,
.modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.hero-block {
  padding: 28px;
  overflow: hidden;
  position: relative;
}
.hero-block::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(243,156,18,0.18), transparent 35%), radial-gradient(circle at bottom left, rgba(11,31,94,0.1), transparent 32%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(11,31,94,0.12);
  background: rgba(255,255,255,0.8);
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  position: relative;
}
.hero-title { margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; }
.hero-sub { margin: 0 0 18px; color: rgba(0,0,0,0.72); font-size: 1.05rem; max-width: 64ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-panel {
  padding: 18px;
  background: rgba(255,255,255,0.9);
  border-radius: 18px;
  border: 1px solid rgba(0,0,0,0.06);
}
.hero-panel h3 { margin-top: 0; margin-bottom: 12px; }
.hero-panel ul { margin: 0; padding-left: 18px; display: grid; gap: 10px; color: rgba(0,0,0,0.76); }

.grid-two,
.grid-three,
.footer-grid,
.config-grid {
  display: grid;
  gap: 16px;
}
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.config-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.metric-card,
.config-card,
.glow-card {
  padding: 20px;
}
.metric-card h3,
.config-card h3,
.glow-card h2,
.glow-card h3 { margin-top: 0; }
.muted { color: rgba(0,0,0,0.65); }
.mini-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-2);
  margin-bottom: 8px;
}

.config-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.config-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(245,246,248,0.85);
  border: 1px solid rgba(0,0,0,0.06);
}
.config-key { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(0,0,0,0.56); }
.config-value { font-weight: 600; word-break: break-word; }

.site-footer {
  position: relative;
  background: rgba(255,255,255,0.88);
  border-top: 3px solid;
  border-image: linear-gradient(90deg, var(--navy), var(--navy-2), #ff2e2e, #f5c542, var(--navy)) 1;
  padding: 64px 0 40px;
}

.footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; }
.footer-brand-block h3,
.footer-column h4 {
  position: relative;
  display: inline-block;
  margin-top: 0;
}
.footer-column h4::after,
.footer-brand-block h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(11,31,94,0.5), rgba(255,46,46,0.5), rgba(245,197,66,0.5));
}
.footer-column ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: rgba(0,0,0,0.7); }
.footer-meta {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,0,0,0.08);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: rgba(0,0,0,0.64);
}

.qp-loader,
.modal {
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Page transition loader (fades in/out instead of popping in). */
.qp-loader {
  display: flex;
  background: rgba(245,246,248,0.78);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.qp-loader.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.loader-card,
.modal-card {
  width: min(560px, calc(100% - 24px));
  padding: 24px;
}
.loader-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 4px solid rgba(11,31,94,0.14);
  border-top-color: var(--red);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal {
  display: none;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  padding: 16px;
}
.modal.active { display: flex; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.close-btn {
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
}
.form-grid { display: grid; gap: 14px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.text-input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.96);
  outline: none;
}
.text-input:focus { border-color: rgba(243,156,18,0.65); box-shadow: 0 0 0 4px rgba(243,156,18,0.12); }
#trackingResult {
  min-height: 24px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(245,246,248,0.9);
  color: rgba(0,0,0,0.72);
}

@media (max-width: 1100px) {
  .nav-container { grid-template-columns: 1fr; justify-items: center; }
  .nav-brand, .nav-ui { justify-self: center; }
  .hero-grid, .footer-grid, .config-grid, .grid-three { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  .grid-two, .grid-three, .footer-grid, .config-grid, .hero-grid { grid-template-columns: 1fr; }
  .nav-links, .nav-ui { flex-wrap: wrap; justify-content: center; }
  .page-shell { padding-top: 36px; }
}
/* --- Product storefront area --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(.2,1.2,.3,1);
}
.product-card:hover { transform: translateY(-8px); }

.product-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgba(0,0,0,0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-info {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.product-title {
  margin: 0;
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
}
.centered { text-align: center; justify-content: center; }

.product-price {
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.unit-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  max-width: 130px;
  margin: 8px auto;
  background: rgba(255,255,255,0.6);
}
.unit-btn {
  background: transparent;
  border: 0;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--navy);
}
.unit-input {
  width: 40px;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 700;
  appearance: textfield;
}
.unit-input::-webkit-outer-spin-button,
.unit-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.add-to-cart-btn {
  background: linear-gradient(135deg, var(--navy), var(--navy-2)) !important;
  color: #fff !important;
  font-weight: 700;
  border: 0 !important;
  box-shadow: 0 4px 14px rgba(20, 43, 140, 0.3);
}
.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 43, 140, 0.5);
}

.buy-now-btn {
  margin-top: auto;
  background: linear-gradient(135deg, #42b883, #34d399) !important;
  color: #fff !important;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: 0 !important;
  box-shadow: 0 4px 14px rgba(52, 211, 153, 0.4);
}
.buy-now-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.6);
}

.product-listing-glow {
  border: 4px solid transparent;
  border-radius: 22px;
  background-clip: padding-box;
  position: relative;
}
.product-listing-glow::before {
  content: "";
  position: absolute;
  top: -4px; bottom: -4px;
  left: -4px; right: -4px;
  background: linear-gradient(90deg, var(--navy), var(--navy-2), #ff2e2e, #f5c542, var(--navy));
  background-size: 200% auto;
  z-index: -1;
  border-radius: 26px;
  animation: borderWave 8s linear infinite;
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  margin-left: 6px;
  font-weight: 800;
  transition: transform 0.2s cubic-bezier(.2,1.2,.3,1);
}
.cart-count:empty { display: none; }
.cart-pop { transform: scale(1.4); }

@media (max-width: 780px) {
  .product-grid { grid-template-columns: 1fr; }
}
