/* ============================================================
   MIDORI (緑) — extras.css
   Sticky Bar · Size Selector · Volume Discount · Stock Meter · Price Savings
   ============================================================ */

/* ===== Price Savings Badge ===== */
/* Shown when user selects a larger/better-value size */
.price-savings {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #2A7A52;
  background: #D6F0E3;
  border: 1px solid rgba(42,122,82,0.25);
  border-radius: var(--radius-full);
  padding: 3px var(--sp-3);
  margin-top: var(--sp-2);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  align-self: flex-start;
  min-height: 1.25rem; /* Reserve space to keep footer height consistent */
}
.price-savings.show {
  opacity: 1;
  transform: translateY(0);
}
/* Featured card (dark bg) variant */
.product-card--featured .price-savings {
  color: var(--color-gold-light);
  background: rgba(201,168,76,0.15);
  border-color: rgba(201,168,76,0.35);
}



/* ===== Sticky Purchase Bar ===== */
.sticky-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(26, 58, 42, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(201,168,76,0.25);
  padding: var(--sp-4) 0;
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.25,0.46,0.45,0.94);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.20);
}
.sticky-bar.visible { transform: translateY(0); }

.sticky-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}
.sticky-bar__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sticky-bar__name {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--color-cream);
}
.sticky-bar__sub {
  font-size: var(--text-xs);
  color: rgba(245,240,232,0.55);
  letter-spacing: 0.06em;
}
.sticky-bar__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.sticky-bar__offer {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.35);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ===== Size Selector ===== */
.size-selector {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-1);
}
.size-selector__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.size-options { display: flex; gap: var(--sp-2); }

.size-opt {
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.06em;
  border-radius: var(--radius-full);
  border: 1.5px solid rgba(74,124,89,0.30);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--ease-fast);
}
.size-opt:hover {
  border-color: var(--color-jade);
  color: var(--color-jade);
}
.size-opt.active {
  background: var(--color-jade);
  border-color: var(--color-jade);
  color: var(--color-white);
}
/* Featured card size opt overrides */
.product-card--featured .size-selector__label { color: rgba(245,240,232,0.55); }
.product-card--featured .size-opt {
  border-color: rgba(245,240,232,0.25);
  color: rgba(245,240,232,0.70);
}
.product-card--featured .size-opt:hover {
  border-color: var(--color-gold-light);
  color: var(--color-gold-light);
}
.product-card--featured .size-opt.active {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: var(--color-white);
}

/* ===== Stock Meter (Miyabi) ===== */
.stock-meter {
  padding: var(--sp-3) var(--sp-4);
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.22);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-2);
}
.stock-meter__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}
.stock-meter__text {
  font-size: var(--text-xs);
  color: rgba(245,240,232,0.70);
  letter-spacing: 0.05em;
}
.stock-meter__count {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-gold-light);
  letter-spacing: 0.04em;
}
.stock-meter__bar {
  height: 4px;
  background: rgba(245,240,232,0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.stock-meter__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold), var(--color-gold-light));
  border-radius: var(--radius-full);
  width: 73%;
  transition: width 1.5s cubic-bezier(0.25,0.46,0.45,0.94);
}
/* Countdown timer on Miyabi */
.miyabi-countdown {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: rgba(245,240,232,0.55);
  margin-top: var(--sp-2);
}
.miyabi-countdown__icon { color: var(--color-gold-light); }
.miyabi-countdown__time { font-weight: 600; color: var(--color-gold-light); }

/* ===== Volume Discount Section ===== */
.volume-discount {
  padding: var(--sp-24) 0;
  background: var(--color-forest);
  position: relative;
  overflow: hidden;
}
.volume-discount::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(201,168,76,0.12), transparent 65%);
  pointer-events: none;
}
.vd-inner {
  text-align: center;
  position: relative;
  z-index: 1;
}
.vd-inner .eyebrow { color: var(--color-gold-light); }
.vd-inner .section-title { color: var(--color-white); margin-bottom: var(--sp-4); }
.vd-inner .section-title em { color: var(--color-gold-light); }
.vd-sub {
  font-size: var(--text-lg);
  color: rgba(245,240,232,0.65);
  margin-bottom: var(--sp-12);
  line-height: 1.7;
}

/* Tier cards */
.vd-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
  margin-bottom: var(--sp-10);
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}
.vd-tier {
  position: relative;
  background: rgba(245,240,232,0.06);
  border: 1px solid rgba(245,240,232,0.12);
  border-radius: var(--radius-lg);
  padding: var(--sp-8) var(--sp-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  transition: background var(--ease-med), border-color var(--ease-med), transform var(--ease-med);
}
.vd-tier:hover { background: rgba(245,240,232,0.10); transform: translateY(-4px); }

/* Best value card */
.vd-tier--best {
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.40);
  transform: scale(1.05);
}
.vd-tier--best:hover { transform: scale(1.05) translateY(-4px); }

.vd-tier__badge {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--color-gold);
  color: var(--color-white);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px var(--sp-3);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.vd-tier__qty {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.60);
}
.vd-tier__save-pct {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  color: var(--color-white);
  line-height: 1;
}
.vd-tier--best .vd-tier__save-pct { color: var(--color-gold-light); }
.vd-tier__label {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(245,240,232,0.45);
}
.vd-tier__example {
  font-size: var(--text-xs);
  color: rgba(245,240,232,0.40);
  margin-top: var(--sp-1);
  font-style: italic;
}

.vd-note {
  font-size: var(--text-sm);
  color: rgba(245,240,232,0.45);
  margin-bottom: var(--sp-8);
  font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 1023px) {
  .vd-tiers { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 819px) {
  .sticky-bar__sub { display: none; }
  .sticky-bar__offer { display: none; }
  .sticky-bar__inner { justify-content: space-between; }

  .vd-tiers {
    grid-template-columns: 1fr;
    max-width: 360px;
  }
  .vd-tier--best { transform: scale(1); }
  .vd-tier--best:hover { transform: translateY(-4px); }
  .vd-tier { padding: var(--sp-6); flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
  .vd-tier__save-pct { font-size: 2rem; }
  .vd-tier__badge { top: auto; left: auto; position: relative; transform: none; margin-bottom: 0; }

  .stock-meter { padding: var(--sp-3); }
}

@media (max-width: 389px) {
  .sticky-bar__actions .btn { padding: var(--sp-2) var(--sp-4); }
}

/* ===== Zalo Floating Button ===== */
.zalo-float {
  position: fixed;
  bottom: var(--sp-24); /* Stay above sticky bar if both visible */
  right: var(--sp-6);
  z-index: 1100; /* Higher than sticky bar (900) */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px; height: 60px;
  background: #0068ff; /* Zalo Blue */
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(0, 104, 255, 0.35);
  color: white;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: scale(0);
  opacity: 0;
}

.zalo-float.visible {
  transform: scale(1);
  opacity: 1;
}

.zalo-float:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(0, 104, 255, 0.5);
}

.zalo-float__text {
  font-family: Arial, sans-serif; /* Zalo-like font */
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Pulsing effect */
.zalo-float::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  z-index: -1;
  animation: pulse-zalo 2.5s infinite;
}

@keyframes pulse-zalo {
  0%   { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0;   }
}

/* Tooltip */
.zalo-float__tooltip {
  position: absolute;
  right: 75px;
  background: white;
  color: var(--color-forest);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s ease;
}

.zalo-float:hover .zalo-float__tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile adjustments */
@media (max-width: 819px) {
  .zalo-float {
    bottom: 145px; /* Pushed above the sticky shopping bar height (~100px) + margin */
    right: var(--sp-4);
    width: 56px; height: 56px;
  }
  .zalo-float__text { font-size: 13px; }
  .zalo-float__tooltip { display: none; } /* Hide tooltip on mobile */
}

