/*
Theme Name:  BellePro
Theme URI:   https://example.com/beaute-pro
Author:      RiCaisse Dev
Author URI:  https://richesse.top
Description: 法国/欧洲美业(美甲·美睫)跨境独立站主题 —— 移动端优先、零售+批发双入口、面向 Google SEO 优化。二次开发自 WooCommerce 官方 Storefront 主题(子主题)。
Template:    storefront
Version:     1.0.0
Text Domain: beaute-pro
*/

/* ============================================================
   0. 设计规范 (调研自 Manucurist 等法式美业标杆站)
   ------------------------------------------------------------
   配色: 暖白底 + 炭黑字 + 裸粉主色 + 鼠尾草绿点缀 (法式自然系)
   字体: 标题用法式衬线(Playfair Display), 正文用无衬线(Jost)
   原则: 移动端优先 (mobile-first) —— 先写手机样式, 再用
         min-width 媒体查询逐步增强到平板/桌面
   ============================================================ */

:root {
  /* 色板 */
  --bp-bg:        #FBF9F7;  /* 暖白 —— 页面底色 */
  --bp-surface:   #FFFFFF;  /* 卡片白 */
  --bp-ink:       #2B2622;  /* 炭黑 —— 正文 */
  --bp-ink-soft:  #6E655E;  /* 次级文字 */
  --bp-rose:      #C69B8F;  /* 裸粉 —— 品牌主色/按钮 */
  --bp-rose-deep: #A97E72;  /* 深裸粉 —— 按钮悬停 */
  --bp-sage:      #8FA390;  /* 鼠尾草绿 —— 点缀/批发入口 */
  --bp-line:      #E8E1DB;  /* 分隔线 */
  --bp-gold:      #B99659;  /* 金 —— 价格/高级感点缀 */

  /* 字体 */
  --bp-font-serif: "Playfair Display", "Noto Serif SC", Georgia, serif;
  --bp-font-sans:  "Jost", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;

  /* 尺寸 */
  --bp-radius:    14px;
  --bp-shadow:    0 4px 24px rgba(43, 38, 34, .07);
  --bp-header-h:  60px;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bp-bg);
  color: var(--bp-ink);
  font-family: var(--bp-font-sans);
  font-size: 16px;
  line-height: 1.7;
  /* 移动端字体渲染优化 */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--bp-font-serif);
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.25;
  color: var(--bp-ink);
}

img { max-width: 100%; height: auto; }

a { color: var(--bp-ink); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--bp-rose-deep); }

/* ---------- 通用按钮 (移动端大触控目标 ≥48px) ---------- */
.bp-btn,
button.button,
a.button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border: none;
  border-radius: 999px;                 /* 胶囊按钮 —— 法式柔和 */
  background: var(--bp-rose);
  color: #fff !important;
  font-family: var(--bp-font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease, transform .15s ease;
}
.bp-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover {
  background: var(--bp-rose-deep);
  transform: translateY(-1px);
}
.bp-btn--sage  { background: var(--bp-sage); }
.bp-btn--sage:hover { background: #7B8F7D; }
.bp-btn--ghost {
  background: transparent;
  color: var(--bp-ink) !important;
  border: 1.5px solid var(--bp-ink);
}
.bp-btn--ghost:hover { background: var(--bp-ink); color: #fff !important; }

/* ============================================================
   1. 顶部导航 (移动端优先: 精简单行 + 汉堡菜单)
   ============================================================ */
.bp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--bp-header-h);
  background: rgba(251, 249, 247, .92);
  backdrop-filter: blur(12px);          /* 毛玻璃 —— 现代感 */
  border-bottom: 1px solid var(--bp-line);
}
.bp-header__inner {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bp-logo {
  font-family: var(--bp-font-serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .04em;
}
.bp-logo em { color: var(--bp-rose); font-style: normal; }

/* 桌面导航 —— 移动端默认隐藏 */
.bp-nav { display: none; }

/* 汉堡按钮 (仅移动端) */
.bp-burger {
  width: 44px; height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none; border: none; cursor: pointer;
}
.bp-burger span {
  width: 22px; height: 2px;
  background: var(--bp-ink);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
}
/* 展开时变 X */
.bp-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bp-burger.is-open span:nth-child(2) { opacity: 0; }
.bp-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* 移动端抽屉菜单 */
.bp-drawer {
  position: fixed;
  inset: var(--bp-header-h) 0 0 0;
  background: var(--bp-bg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1);
  z-index: 99;
}
.bp-drawer.is-open { transform: translateX(0); }
.bp-drawer a {
  padding: 14px 8px;
  font-size: 18px;
  border-bottom: 1px solid var(--bp-line);
}
.bp-drawer .bp-drawer__pro { color: var(--bp-sage); font-weight: 600; }

/* ============================================================
   2. 首屏 Hero + 双入口 (本站核心: 零售/批发分流)
   ============================================================ */
.bp-hero {
  padding: 48px 20px 32px;
  text-align: center;
}
.bp-hero__eyebrow {
  font-size: 13px;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--bp-rose);
  margin-bottom: 12px;
}
.bp-hero__title {
  font-size: clamp(28px, 7vw, 52px);    /* 流式字号: 随屏宽缩放 */
  margin: 0 0 14px;
}
.bp-hero__sub {
  max-width: 520px;
  margin: 0 auto;
  color: var(--bp-ink-soft);
  font-size: 16px;
}

/* 双入口卡片: 移动端上下排列, 桌面左右排列 */
.bp-entry {
  max-width: 1080px;
  margin: 36px auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.bp-entry__card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 300px;
  padding: 28px;
  border-radius: var(--bp-radius);
  overflow: hidden;
  text-align: left;
  background: var(--bp-surface);
  box-shadow: var(--bp-shadow);
  transition: transform .3s ease, box-shadow .3s ease;
}
.bp-entry__card:hover { transform: translateY(-4px); box-shadow: 0 12px 36px rgba(43,38,34,.12); }
.bp-entry__card::before {
  /* 渐变罩层, 让文字在背景图上可读 */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(43,38,34,0) 30%, rgba(43,38,34,.55) 100%);
  z-index: 1;
}
.bp-entry__card > * { position: relative; z-index: 2; }
.bp-entry__bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.bp-entry__tag {
  align-self: flex-start;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .15em;
  text-transform: uppercase;
  background: rgba(255,255,255,.9);
  color: var(--bp-ink);
  margin-bottom: auto;
}
.bp-entry__card--pro .bp-entry__tag { color: var(--bp-sage); font-weight: 600; }
.bp-entry__title { color: #fff; font-size: 28px; margin: 14px 0 6px; }
.bp-entry__desc  { color: rgba(255,255,255,.85); font-size: 14px; margin-bottom: 18px; }

/* ============================================================
   3. 分区标题 / 产品网格 / 信任徽章
   ============================================================ */
.bp-section { padding: 48px 20px; max-width: 1200px; margin: 0 auto; }
.bp-section__head { text-align: center; margin-bottom: 28px; }
.bp-section__head h2 { font-size: clamp(24px, 5vw, 36px); margin: 0 0 8px; }
.bp-section__head p  { color: var(--bp-ink-soft); margin: 0; }

/* WooCommerce 产品网格: 移动端 2 列, 桌面 4 列 */
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0 !important;
  padding: 0 !important;
  clear: both;
}
/* 清除 WooCommerce 默认 clearfix 伪元素 —— 它会成为 grid 的隐式项目,
   占据第一格位置, 导致产品从第二格才开始渲染 (热销区左上角空位) */
.woocommerce ul.products::before,
.woocommerce ul.products::after { content: none !important; display: none !important; }
.woocommerce ul.products li.product {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  margin-right: 0 !important;
  clear: none !important;
  background: var(--bp-surface);
  border-radius: var(--bp-radius);
  padding: 12px 12px 16px;
  box-shadow: var(--bp-shadow);
  text-align: center;
  transition: transform .25s ease;
}
/* WooCommerce 按默认列数给产品打 first/last 类 (旧 float 布局遗留),
   会与我们的 grid 列数错位 → 出现空格. 强制清除其副作用 */
.woocommerce ul.products li.product.first,
.woocommerce ul.products li.product.last {
  clear: none !important;
  float: none !important;
  margin: 0 !important;
  margin-right: 0 !important;
}
.woocommerce ul.products li.product:hover { transform: translateY(-3px); }
.woocommerce ul.products li.product img {
  border-radius: calc(var(--bp-radius) - 6px);
  margin-bottom: 10px;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--bp-font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 0 4px;
}
.woocommerce ul.products li.product .price {
  color: var(--bp-gold);
  font-weight: 600;
  font-size: 15px;
}
.woocommerce ul.products li.product .button { min-height: 42px; padding: 8px 18px; font-size: 13px; }

/* 信任徽章 (法国消费者看重: 安全支付/欧洲发货/退换) */
.bp-trust {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 8px 20px 40px;
  max-width: 900px;
  margin: 0 auto;
}
.bp-trust__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bp-surface);
  border-radius: var(--bp-radius);
  border: 1px solid var(--bp-line);
  font-size: 13px;
}
.bp-trust__item svg { flex: 0 0 26px; width: 26px; height: 26px; stroke: var(--bp-rose); }

/* ============================================================
   4. 批发专页 (Espace Pro) 元素
   ============================================================ */
.bp-pro-hero {
  background: linear-gradient(135deg, #F0EDE8 0%, #E4EBE5 100%);
  border-radius: var(--bp-radius);
  padding: 36px 24px;
  text-align: center;
}
/* 阶梯价表 */
.bp-tiers {
  width: 100%;
  border-collapse: collapse;
  background: var(--bp-surface);
  border-radius: var(--bp-radius);
  overflow: hidden;
  box-shadow: var(--bp-shadow);
}
.bp-tiers th, .bp-tiers td { padding: 14px 16px; text-align: center; font-size: 14px; }
.bp-tiers thead th { background: var(--bp-sage); color: #fff; letter-spacing: .05em; font-weight: 500; }
.bp-tiers tbody tr:nth-child(even) { background: #F6F8F6; }

/* 批发价标签 */
.bp-wholesale-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bp-sage);
  color: #fff;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.price .bp-wholesale-note { display: block; font-size: 12px; color: var(--bp-sage); }

/* ============================================================
   5. 移动端底部工具栏 (拇指可达 —— 转化关键)
   ============================================================ */
.bp-tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  display: flex;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--bp-line);
  padding-bottom: env(safe-area-inset-bottom);   /* iPhone 底部安全区 */
}
.bp-tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  font-size: 11px;
  color: var(--bp-ink-soft);
}
.bp-tabbar a.is-active { color: var(--bp-rose); }
.bp-tabbar svg { width: 22px; height: 22px; }
/* 给底部栏让位 */
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

/* ============================================================
   6. 页脚 (合规链接: CGV / Mentions légales / GDPR)
   ============================================================ */
.bp-footer {
  background: #241F1B;
  color: rgba(255,255,255,.72);
  padding: 40px 20px 32px;
  margin-top: 40px;
}
.bp-footer__grid { max-width: 1100px; margin: 0 auto; display: grid; gap: 28px; grid-template-columns: 1fr; }
.bp-footer h4 { color: #fff; font-size: 16px; margin: 0 0 12px; }
.bp-footer a  { color: rgba(255,255,255,.72); font-size: 14px; display: block; padding: 4px 0; }
.bp-footer a:hover { color: var(--bp-rose); }
.bp-footer__legal {
  max-width: 1100px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.12);
  font-size: 12px;
  text-align: center;
}

/* ============================================================
   7. 平板增强 (≥640px)
   ============================================================ */
@media (min-width: 640px) {
  .bp-entry { grid-template-columns: 1fr 1fr; }
  .bp-entry__card { min-height: 360px; }
  .woocommerce ul.products { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  /* WooCommerce shortcode 用 columns-N 类控制列数, 覆盖默认4列 */
  .woocommerce ul.products.columns-3 { grid-template-columns: repeat(3, 1fr); }
  .bp-trust { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   8. 桌面增强 (≥960px)
   ============================================================ */
@media (min-width: 960px) {
  :root { --bp-header-h: 72px; }
  .bp-burger, .bp-drawer, .bp-tabbar { display: none; }   /* 桌面隐藏移动专属元素 */
  body { padding-bottom: 0; }

  .bp-nav { display: flex; align-items: center; gap: 28px; }
  .bp-nav a { font-size: 15px; letter-spacing: .03em; }
  .bp-nav .bp-nav__cta {
    padding: 10px 22px;
    border-radius: 999px;
    background: var(--bp-rose);
    color: #fff !important;
  }
  .bp-nav .bp-nav__cta--pro { background: var(--bp-sage); }

  .bp-hero { padding: 80px 20px 40px; }
  .bp-entry__card { min-height: 420px; }
  .woocommerce ul.products { grid-template-columns: repeat(4, 1fr); }
  /* 首页热销区明确3列 (columns=3), 覆盖上面的默认4列 */
  .woocommerce ul.products.columns-3 { grid-template-columns: repeat(3, 1fr); }
  .bp-footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ============================================================
   8. 语言切换器 (Polylang 8语言, 国旗下拉模式)
   ------------------------------------------------------------
   位置: header 右侧, 购物车图标旁边
   交互: 显示当前语言国旗 → 点击展开下拉, 选择其他语言
   ============================================================ */
.bp-lang-switcher { position: relative; }

/* 触发按钮: 当前语言国旗 + 小三角 */
.bp-lang-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bp-ink);
  border-radius: 8px;
}
.bp-lang-toggle:hover { background: var(--bp-line); }
.bp-flag--current { font-size: 20px; line-height: 1; }
.bp-lang-caret { opacity: .5; }

/* 下拉面板: 默认隐藏, .is-open 时显示 */
.bp-lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--bp-surface);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(43,38,34,.15);
  padding: 6px;
  display: none;
  z-index: 300;
}
.bp-lang-switcher.is-open .bp-lang-dropdown { display: block; }

/* 下拉里的语言项: 国旗 + 语言名 */
.bp-lang-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--bp-ink);
  font-size: 14px;
  transition: background .15s;
}
.bp-lang-link:hover { background: var(--bp-bg); }
.bp-lang-link.is-active { background: rgba(198,155,143,.12); color: var(--bp-rose-deep); font-weight: 600; }
.bp-lang-link .bp-flag { font-size: 18px; line-height: 1; }
.bp-lang-name { flex: 1; }

/* ============================================================
   9. Storefront 父主题残留样式清理 (让它服从我们的规范)
   ============================================================ */
.storefront-primary-navigation,
.site-header, .site-footer, .handheld-navigation { all: revert; }
.site-header, .site-footer { display: none !important; }   /* 用我们自己的 header/footer */
.col-full { max-width: 1200px; margin: 0 auto; padding: 0; }
.content-area, .site-main { margin: 0 !important; }
.hentry { margin: 0 !important; padding: 0 !important; border: none !important; }
.entry-header, .entry-footer { display: none; }

/* 隐藏 Storefront 默认侧边栏 (批发页等无侧边栏设计) */
#secondary, .widget-area { display: none !important; }
/* 主内容区撑满宽度 (去掉 Storefront 为侧边栏预留的右间距) */
.content-area, .site-main { width: 100% !important; max-width: 100% !important; float: none !important; }
/* Storefront 用 body class 控制布局, 强制无侧边栏模式 */
body.right-sidebar .content-area,
body.left-sidebar .content-area { width: 100% !important; float: none !important; margin: 0 !important; }

/* WooCommerce 提示条统一为胶囊风 */
.woocommerce-message, .woocommerce-info, .woocommerce-error {
  border-radius: var(--bp-radius);
  border-top-color: var(--bp-rose);
}

/* 产品页价格用金色强调 */
.single-product .price { color: var(--bp-gold); font-size: 26px; font-weight: 600; }

/* 数量输入框加大 (移动端好按) */
.quantity input.qty { min-height: 48px; border-radius: 10px; border: 1px solid var(--bp-line); }
