/* ══════════════════════════════════════
   FLORAVERA — EXTENDED STYLES
   B2B批发、商品筛选、移动端深度优化
   ══════════════════════════════════════ */

/* ── B2B WHOLESALE PAGE ── */
.fv-wholesale-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 80px;
  align-items: start;
}
.fv-wholesale-info h2 { margin-bottom: 40px; }
.fv-wholesale-benefits {
  display: flex; flex-direction: column; gap: 28px;
  margin-bottom: 48px;
}
.fv-benefit {
  display: flex; gap: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.fv-benefit:last-child { border-bottom: none; }
.fv-benefit__icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 56px; height: 56px;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
}
.fv-benefit h4 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--charcoal);
}
.fv-benefit p {
  font-size: 0.8rem;
  line-height: 1.7;
}
.fv-wholesale-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 40px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

/* B2B Form Card */
.fv-form-card {
  background: #fff;
  padding: 48px;
  box-shadow: var(--shadow-md);
  position: sticky; top: 100px;
}
.fv-form-card h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 8px;
}
.fv-form-sub {
  font-size: 0.78rem;
  color: var(--gray-text);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.fv-form-row { margin-bottom: 18px; }
.fv-form-row--2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.fv-inquiry-form input,
.fv-inquiry-form select,
.fv-inquiry-form textarea {
  font-size: 0.82rem;
  padding: 12px 16px;
}
.fv-form-note {
  font-size: 0.68rem;
  color: var(--gray-mid);
  text-align: center;
  margin-top: 14px;
  line-height: 1.6;
}

/* Process Steps */
.fv-process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 60px;
}
.fv-process-step {
  text-align: center;
  position: relative;
  padding: 0 16px;
}
.fv-process-step::after {
  content: '';
  position: absolute;
  top: 24px; right: -16px;
  width: 32px; height: 1px;
  background: var(--blush);
}
.fv-process-step:last-child::after { display: none; }
.fv-step-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--rose);
  font-weight: 300;
  margin-bottom: 14px;
}
.fv-process-step h4 {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--charcoal);
}
.fv-process-step p {
  font-size: 0.78rem;
  line-height: 1.7;
}

/* ══════════════════════════════════════
   ENHANCED PRODUCT FILTERS
   ══════════════════════════════════════ */
.fv-filter-bar {
  background: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.fv-filter-tabs {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}
.fv-filter-tab {
  padding: 8px 18px;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-mid);
  transition: color 0.3s;
  position: relative;
}
.fv-filter-tab::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--rose);
  transform: translateX(-50%);
  transition: width 0.3s;
}
.fv-filter-tab.active,
.fv-filter-tab:hover { color: var(--charcoal); }
.fv-filter-tab.active::after { width: 24px; }

.fv-filter-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.fv-view-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--cream);
}
.fv-view-btn {
  width: 32px; height: 28px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-mid);
  font-size: 0.78rem;
  transition: background 0.3s, color 0.3s;
}
.fv-view-btn.active {
  background: var(--charcoal);
  color: var(--cream);
}

/* ══════════════════════════════════════
   PRELOADER
   ══════════════════════════════════════ */
.fv-preloader {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.fv-preloader.fv-loaded {
  opacity: 0;
  visibility: hidden;
}
.fv-preloader__logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  color: var(--charcoal);
}
.fv-preloader__logo em {
  color: var(--rose);
  font-style: italic;
}
.fv-preloader__bar {
  width: 100px; height: 1px;
  background: rgba(0,0,0,0.1);
  overflow: hidden;
  position: relative;
}
.fv-preloader__bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: var(--rose);
  animation: fvLoaderPulse 1.4s ease-in-out infinite;
}
@keyframes fvLoaderPulse {
  0%   { width: 0%;   left: 0%; }
  50%  { width: 100%; left: 0%; }
  100% { width: 0%;   left: 100%; }
}

/* ══════════════════════════════════════
   IMAGE LAZY LOAD FADE-IN
   ══════════════════════════════════════ */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}
img[loading="lazy"].fv-loaded { opacity: 1; }

/* Product card stagger animation */
.woocommerce ul.products li.product,
.fv-product-grid > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fvStaggerIn 0.6s cubic-bezier(0.25,0.46,0.45,0.94) forwards;
}
.woocommerce ul.products li.product:nth-child(1) { animation-delay: 0.05s; }
.woocommerce ul.products li.product:nth-child(2) { animation-delay: 0.1s; }
.woocommerce ul.products li.product:nth-child(3) { animation-delay: 0.15s; }
.woocommerce ul.products li.product:nth-child(4) { animation-delay: 0.2s; }
.woocommerce ul.products li.product:nth-child(5) { animation-delay: 0.25s; }
.woocommerce ul.products li.product:nth-child(6) { animation-delay: 0.3s; }
.woocommerce ul.products li.product:nth-child(7) { animation-delay: 0.35s; }
.woocommerce ul.products li.product:nth-child(8) { animation-delay: 0.4s; }
@keyframes fvStaggerIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   MOBILE OPTIMIZATIONS — TOUCH FIRST
   ══════════════════════════════════════ */
@media (max-width: 768px) {

  /* Increased tap targets — Apple HIG / Material 44pt min */
  .btn,
  .woocommerce a.button,
  .woocommerce button.button,
  .primary-nav a,
  .header-actions a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .primary-nav a { padding: 12px 0; }

  /* Touch-friendly form inputs */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important; /* prevents iOS zoom */
    padding: 14px 16px;
    min-height: 48px;
  }

  /* Hero adjustments */
  .fv-hero { min-height: auto; padding-top: 100px; }
  .fv-hero__content { padding: 30px 24px 60px; }
  .fv-hero__title { font-size: 2.4rem !important; line-height: 1.1; }
  .fv-hero__title .line2 { padding-left: 32px; }
  .fv-hero__stats { gap: 20px; }
  .fv-hero__stat-num { font-size: 1.4rem; }

  /* Categories stack */
  .fv-categories-grid { gap: 12px; }

  /* B2B wholesale page */
  .fv-wholesale-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .fv-form-card {
    padding: 28px 22px;
    position: static;
  }
  .fv-form-row--2col { grid-template-columns: 1fr; }
  .fv-process-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .fv-process-step::after { display: none; }
  .fv-wholesale-stats { grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

  /* Product cards — 2 column on mobile, larger touch */
  .woocommerce ul.products { gap: 12px !important; }
  .woocommerce ul.products li.product .woocommerce-loop-product__title {
    font-size: 0.9rem !important;
  }

  /* Filter bar — scrollable horizontal */
  .fv-filter-bar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .fv-filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .fv-filter-tabs::-webkit-scrollbar { display: none; }
  .fv-filter-tab { flex-shrink: 0; padding: 8px 14px; }

  /* Section padding reduced */
  .fv-section { padding: 60px 0; }
  .fv-section__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 32px;
  }

  /* Marquee speed up */
  .fv-marquee__track { animation-duration: 20s; }
  .fv-marquee__item { padding: 0 18px; font-size: 0.58rem; }

  /* Sticky add-to-cart on mobile product page */
  .fv-mobile-sticky-cart {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    padding: 12px 16px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.4s;
  }
  .fv-mobile-sticky-cart.visible { transform: translateY(0); }

  /* Newsletter form stack */
  .fv-newsletter__form { flex-direction: column; gap: 10px; }
  .fv-newsletter__input {
    border-right: 1px solid rgba(0,0,0,0.1);
    text-align: center;
  }
  .fv-newsletter__btn { padding: 16px; }

  /* Footer cleaner mobile */
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* Touch optimization (disable hover on touch) */
@media (hover: none) {
  .fv-card:hover .fv-card__img-wrap img,
  .woocommerce ul.products li.product:hover .woocommerce-loop-product__link img {
    transform: scale(1);
  }
  .fv-card__actions {
    transform: translateY(0);
    position: static;
    margin-top: 12px;
  }
}

/* ══════════════════════════════════════
   PERFORMANCE — REDUCE MOTION
   ══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .fv-marquee__track { animation: none; }
}
