/* ============================================================
   Miner Batch Shipping Timer — Frontend CSS
   Uses CSS custom properties set by PHP (--mbt-primary, etc.)
   ============================================================ */

/* ---- CSS Variable fallbacks (overridden by PHP inject) ---- */
:root {
  --mbt-primary:  #00bcd4;
  --mbt-accent:   #f5a623;
  --mbt-bg:       #0d1117;
  --mbt-text:     #e6edf3;
  --mbt-muted:    rgba(230, 237, 243, 0.65);
  --mbt-border:   rgba(0, 188, 212, 0.25);
  --mbt-radius:   12px;
  --mbt-font:     'Inter', system-ui, -apple-system, sans-serif;
}

/* ============================================================
   BASE BANNER WRAPPER
   ============================================================ */
.mbt-banner,
#mbt-sticky {
  font-family: var(--mbt-font);
  box-sizing: border-box;
  line-height: 1.4;
}

/* ============================================================
   STICKY BAR (thin top strip)
   ============================================================ */
#mbt-sticky {
  position: sticky;
  top: 0;
  z-index: 9999;
  width: 100%;
}

#mbt-sticky .mbt--compact {
  border-radius: 0;
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid var(--mbt-border);
}

/* ============================================================
   COMPACT / STICKY STYLE  (.mbt--compact)
   ============================================================ */
.mbt--compact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  background: var(--mbt-bg);
  color: var(--mbt-text);
  padding: 10px 20px;
  border-radius: var(--mbt-radius);
  border: 1px solid var(--mbt-border);
  font-size: 0.875rem;
}

.mbt-compact-icon { font-size: 1.1rem; }

.mbt-compact-label {
  color: var(--mbt-muted);
  font-weight: 500;
  white-space: nowrap;
}

.mbt-compact-timer {
  display: flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.mbt-compact-timer .mbt-unit {
  background: rgba(0, 188, 212, 0.12);
  color: var(--mbt-accent);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.mbt-compact-timer .mbt-unit small {
  font-size: 0.6rem;
  font-weight: 400;
  color: var(--mbt-muted);
  margin-left: 2px;
  vertical-align: super;
}

.mbt-compact-timer .mbt-colon {
  color: var(--mbt-muted);
  font-weight: 700;
  font-size: 1rem;
  padding-bottom: 4px;
}

.mbt-compact-timer .mbt-seconds {
  opacity: 0.85;
}

.mbt-ship-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--mbt-muted);
}

.mbt-ship-inline strong {
  color: var(--mbt-text);
}

.mbt-opens-label {
  color: var(--mbt-muted);
  font-size: 0.82rem;
}

/* ============================================================
   FULL BANNER  (.mbt--full)
   ============================================================ */
.mbt--full {
  background: var(--mbt-bg);
  color: var(--mbt-text);
  border: 1px solid var(--mbt-border);
  border-radius: var(--mbt-radius);
  overflow: hidden;
  margin: 0 0 24px 0;
  box-shadow: 0 4px 30px rgba(0, 188, 212, 0.08);
}

/* ---- Header ---- */
.mbt-full-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: rgba(0, 188, 212, 0.07);
  border-bottom: 1px solid var(--mbt-border);
}

.mbt-full-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--mbt-text);
  letter-spacing: 0.01em;
}

.mbt-full-badge {
  background: var(--mbt-primary);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.mbt-full-badge--processing {
  background: var(--mbt-accent);
}

/* Animated pulse dot */
.mbt-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mbt-primary);
  position: relative;
  flex-shrink: 0;
}

.mbt-pulse-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--mbt-primary);
  opacity: 0.3;
  animation: mbt-pulse 2s ease-in-out infinite;
}

.mbt-pulse-dot--orange        { background: var(--mbt-accent); }
.mbt-pulse-dot--orange::after { background: var(--mbt-accent); }

@keyframes mbt-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.3; }
  50%       { transform: scale(1.7); opacity: 0;   }
}

/* ---- Body ---- */
.mbt-full-body {
  padding: 22px 22px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

/* Digit blocks row */
.mbt-digits-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mbt-digits-row--sm .mbt-digit-value { font-size: 1.8rem; }
.mbt-digits-row--sm .mbt-digit-block { min-width: 54px; }

.mbt-digit-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--mbt-border);
  border-radius: 10px;
  padding: 10px 8px 6px;
}

.mbt-digit-value {
  font-size: 2.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--mbt-accent);
  line-height: 1;
  letter-spacing: -0.02em;
  transition: color 0.15s;
}

.mbt-digit-label {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mbt-muted);
  margin-top: 4px;
}

.mbt-digits-sec .mbt-digit-value { color: var(--mbt-muted); }

.mbt-sep {
  font-size: 2rem;
  font-weight: 700;
  color: var(--mbt-border);
  margin: 0 2px;
  padding-bottom: 14px;
}

.mbt-sep--sm { display: none; }

/* Ship-date block */
.mbt-ship-block {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 188, 212, 0.07);
  border: 1px solid var(--mbt-border);
  border-radius: 10px;
  padding: 12px 18px;
  min-width: 200px;
}

.mbt-ship-icon { font-size: 1.5rem; }

.mbt-ship-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mbt-muted);
  margin-bottom: 4px;
}

.mbt-ship-date {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--mbt-primary);
}

/* ---- Footer ---- */
.mbt-full-footer {
  padding: 12px 22px 16px;
  border-top: 1px solid var(--mbt-border);
  background: rgba(255, 255, 255, 0.02);
}

.mbt-sub {
  font-size: 0.82rem;
  color: var(--mbt-muted);
  margin: 0 0 10px;
}

.mbt-trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.75rem;
  color: var(--mbt-muted);
}

.mbt-trust-badges span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   PROCESSING PHASE
   ============================================================ */
.mbt--processing .mbt-full-header {
  background: rgba(245, 166, 35, 0.07);
  border-bottom-color: rgba(245, 166, 35, 0.2);
}

.mbt--processing { border-color: rgba(245, 166, 35, 0.25); }

.mbt-processing-msg {
  font-size: 0.9rem;
  color: var(--mbt-muted);
  max-width: 500px;
  margin: 0 0 16px;
  line-height: 1.6;
}

.mbt-reopens-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   RESPONSIVE — Tablet
   ============================================================ */
@media (max-width: 768px) {
  .mbt-full-body {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .mbt-digit-block  { min-width: 58px; }
  .mbt-digit-value  { font-size: 2rem; }
  .mbt-ship-block   { min-width: 0; width: 100%; }

  .mbt--compact {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px 12px;
    font-size: 0.8rem;
  }
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 480px) {
  .mbt--full { border-radius: 8px; }

  .mbt-full-header { padding: 12px 16px; }
  .mbt-full-body   { padding: 16px; }
  .mbt-full-footer { padding: 10px 16px 14px; }

  .mbt-digit-block { min-width: 50px; padding: 8px 5px 5px; }
  .mbt-digit-value { font-size: 1.6rem; }
  .mbt-digit-label { font-size: 0.55rem; }

  .mbt-sep { font-size: 1.5rem; padding-bottom: 12px; }
  .mbt-sep--sm { display: block; }

  /* Hide the main separator on very small screens, keep only small */
  .mbt-digits-row > .mbt-sep:not(.mbt-sep--sm) {
    display: none;
  }

  .mbt-digits-row { gap: 4px; }

  .mbt-trust-badges { display: none; } /* save space on mobile */
}

/* ============================================================
   ANIMATION — digit flip on change
   ============================================================ */
@keyframes mbt-second-tick {
  0%   { transform: translateY(-3px); opacity: 0.55; }
  100% { transform: translateY(0); opacity: 1; }
}

.mbt-digit-value,
.mbt-unit {
  font-variant-numeric: tabular-nums;
}

.mbt-digits-sec .mbt-digit-value.is-ticking,
.mbt-unit.mbt-seconds.is-ticking {
  animation: mbt-second-tick 0.2s ease-out;
}

/* ============================================================
   HOMEPAGE HERO BATCH TIMER
   ============================================================ */
.mbt-banner--hero {
  width: 100%;
  max-width: 520px;
  margin: 0 0 28px;
}

.mbt--hero {
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.09);
  backdrop-filter: blur(12px);
}

.mbt-hero-topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.035));
}

.mbt-hero-status,
.mbt-hero-ship {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.025em;
}

.mbt-hero-status { color: #1d4ed8; text-transform: none; }
.mbt-hero-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.mbt-hero-ship {
  color: #64748b;
  white-space: nowrap;
}
.mbt-hero-ship::before {
  content: "•";
  margin-right: 8px;
  color: #94a3b8;
}
.mbt-hero-ship strong { color: #0f172a; }

.mbt-hero-content {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px 16px;
}

.mbt--hero .mbt-digits-row { flex: 0 0 auto; gap: 7px; }
.mbt--hero .mbt-digit-block {
  min-width: 56px;
  padding: 8px 7px 6px;
  border-color: rgba(148, 163, 184, 0.23);
  border-radius: 9px;
  background: #f8fafc;
}
.mbt--hero .mbt-digit-value { color: #2563eb; font-size: 1.65rem; }
.mbt--hero .mbt-digit-label { color: #64748b; }
.mbt--hero .mbt-digits-sec .mbt-digit-value { color: #475569; }
.mbt-hero-content p {
  margin: 0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.55;
}
.mbt-hero-content .mbt-hero-note {
  position: relative;
  padding: 9px 0 0 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.45;
}
.mbt-hero-content .mbt-hero-note:before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(9px + .38em);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.mbt--hero .mbt-digits-row { width: 100%; justify-content: flex-start; }

.mbt--hero.mbt--closing-soon { border-color: rgba(245, 158, 11, 0.34); }
.mbt--hero.mbt--closing-soon .mbt-hero-topline,
.mbt--hero.mbt--processing .mbt-hero-topline { background: rgba(245, 158, 11, 0.08); }
.mbt--hero.mbt--closing-soon .mbt-hero-status,
.mbt--hero.mbt--processing .mbt-hero-status { color: #b45309; }
.mbt--hero.mbt--closing-soon .mbt-hero-status i,
.mbt--hero.mbt--processing .mbt-hero-status i {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.13);
}

/* Small status beneath product-card prices. */
.mbt-card-batch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin: 8px 0 11px;
  color: #64748b;
  line-height: 1.25;
}

.woocommerce ul.products li.product .mbt-card-batch { margin: 3px 20px 14px; }
.mbt-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mbt-card-badge.is-closing,
.mbt-card-badge.is-processing { background: #fff7ed; color: #b45309; }
.mbt-card-batch small { color: #64748b; font-size: 0.62rem; font-weight: 650; }

@media (max-width: 600px) {
  .mbt-banner--hero { max-width: none; }
  .mbt-hero-topline { align-items: center; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .mbt-hero-content { align-items: stretch; flex-direction: column; gap: 10px; }
  .mbt--hero .mbt-digits-row { width: 100%; justify-content: space-between; }
  .mbt--hero .mbt-digit-block { min-width: 0; flex: 1 1 0; }
  .mbt--hero .mbt-digit-value { font-size: 1.5rem; }
}

/* Single-product shipping note and specifications value. */
.mbt-product-shipping-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 10px;
  background: #f8fbff;
  color: #0f172a;
}

.mbt-product-shipping-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.9rem;
  font-weight: 900;
}

.mbt-product-shipping-note > span:last-child { min-width: 0; }
.mbt-product-shipping-note strong,
.mbt-product-shipping-note small { display: block; }
.mbt-product-shipping-note small {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 650;
}
.mbt-product-shipping-note small strong {
  display: inline;
  color: #0f172a;
  font-size: inherit;
  font-weight: 800;
}

.mbt-spec-shipping-date {
  color: inherit;
  font-weight: inherit;
}

/* ============================================================
   UNIVERSAL UNBOXED GLASS TIMER
   Sits directly on its parent background; only time cells use glass.
   Text inherits the surrounding section color so the timer works in
   both light and dark placements.
   ============================================================ */
.mbt-banner {
  --mbt-glass: linear-gradient(145deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  --mbt-glass-border: rgba(255,255,255,.38);
  --mbt-glass-shadow: 0 10px 28px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.35);
  width: 100%;
  color: inherit;
}

.mbt-banner .mbt--full,
.mbt-banner .mbt--hero,
.mbt-banner .mbt--compact {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  backdrop-filter: none;
}

.mbt-banner .mbt-full-header,
.mbt-banner .mbt-hero-topline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 7px 12px;
  padding: 0 0 12px;
  border: 0;
  background: transparent !important;
  color: inherit;
}

.mbt-banner .mbt-full-title,
.mbt-banner .mbt-hero-status,
.mbt-banner .mbt-compact-label {
  color: inherit;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .025em;
  text-shadow: 0 1px 2px rgba(255,255,255,.2), 0 1px 3px rgba(15,23,42,.18);
}

.mbt-banner .mbt-hero-ship,
.mbt-banner .mbt-ship-inline,
.mbt-banner .mbt-opens-label {
  color: inherit;
  opacity: .78;
  font-size: .72rem;
}
.mbt-banner .mbt-hero-ship strong,
.mbt-banner .mbt-ship-inline strong { color: inherit; opacity: 1; }

.mbt-banner .mbt-full-badge,
.mbt-banner .mbt-card-badge {
  border: 1px solid color-mix(in srgb, var(--mbt-primary) 35%, transparent);
  background: color-mix(in srgb, var(--mbt-primary) 14%, transparent);
  color: color-mix(in srgb, var(--mbt-primary) 82%, currentColor);
  box-shadow: none;
}

.mbt-banner .mbt-full-body,
.mbt-banner .mbt-hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 0;
}

.mbt-banner .mbt-digits-row {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: repeat(4, minmax(52px, 1fr));
  gap: clamp(6px, 1.2vw, 10px);
  align-items: stretch;
}
.mbt-banner .mbt-reopens-block .mbt-digits-row,
.mbt-banner .mbt-digits-row--sm { grid-template-columns: repeat(3, minmax(52px, 1fr)); }

.mbt-banner .mbt-digit-block {
  min-width: 0;
  min-height: 76px;
  display: flex;
  justify-content: center;
  padding: 11px 7px 8px;
  border: 1px solid var(--mbt-glass-border);
  border-radius: 13px;
  background: var(--mbt-glass);
  box-shadow: var(--mbt-glass-shadow);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  backdrop-filter: blur(14px) saturate(145%);
}

.mbt-banner .mbt-digit-value {
  color: var(--mbt-primary);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(255,255,255,.45), 0 2px 8px rgba(15,23,42,.12);
}
.mbt-banner .mbt-digits-sec .mbt-digit-value { color: var(--mbt-accent); }
.mbt-banner .mbt-digit-label {
  margin-top: 7px;
  color: inherit;
  opacity: .72;
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.mbt-banner .mbt-sep { display: none !important; }

.mbt-banner .mbt-ship-block {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.mbt-banner .mbt-ship-label,
.mbt-banner .mbt-ship-date { color: inherit; }
.mbt-banner .mbt-ship-label { opacity: .7; }

.mbt-banner .mbt-full-footer {
  padding: 12px 0 0;
  border: 0;
  background: transparent;
  color: inherit;
}
.mbt-banner .mbt-sub,
.mbt-banner .mbt-trust-badges,
.mbt-banner .mbt-processing-msg,
.mbt-banner .mbt-hero-content p,
.mbt-banner .mbt-hero-content .mbt-hero-note {
  color: inherit;
  opacity: .76;
  text-shadow: 0 1px 2px rgba(255,255,255,.15), 0 1px 3px rgba(15,23,42,.14);
}
.mbt-banner .mbt-hero-content .mbt-hero-note {
  margin: 0;
  padding: 0 0 0 12px;
  border: 0;
}
.mbt-banner .mbt-hero-content .mbt-hero-note:before { top: .42em; }

/* Compact placements remain unboxed and wrap safely. */
.mbt-banner .mbt--compact { gap: 8px 14px; }
.mbt-banner .mbt-compact-timer { gap: 5px; }
.mbt-banner .mbt-compact-timer .mbt-unit {
  padding: 6px 9px;
  border: 1px solid var(--mbt-glass-border);
  border-radius: 9px;
  background: var(--mbt-glass);
  box-shadow: var(--mbt-glass-shadow);
  color: var(--mbt-primary);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}
.mbt-banner .mbt-compact-timer .mbt-colon { display: none; }

@media (max-width: 600px) {
  .mbt-banner--hero { margin-bottom: 22px; }
  .mbt-banner .mbt-digits-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .mbt-banner .mbt-digit-block {
    min-height: 67px;
    padding: 9px 4px 7px;
    border-radius: 11px;
  }
  .mbt-banner .mbt-digit-value { font-size: clamp(1.35rem, 7vw, 1.75rem); }
  .mbt-banner .mbt-digit-label { font-size: .5rem; letter-spacing: .07em; }
  .mbt-banner .mbt-trust-badges { display: flex; gap: 6px 12px; font-size: .65rem; }
}

@media (max-width: 360px) {
  .mbt-banner .mbt-digit-block { min-height: 62px; padding-inline: 2px; }
  .mbt-banner .mbt-digit-value { font-size: 1.25rem; }
  .mbt-banner .mbt-full-badge { display: none; }
  .mbt-banner .mbt--compact { align-items: flex-start; flex-direction: column; }
}
