/* ============================================================
   LINENWEAR — COMMON Stylesheet
   公共全局样式：跨页面复用（Header / Footer / Brand Story）
   包含：Design Tokens、Reset、Announcement Bar、Nav、Brand Story、Footer
   ============================================================ */

/* ---------- CSS Custom Properties (Design Tokens) ---------- */
:root {
  /* Color Palette */
  --color-cream: #F7F4EF;
  --color-terracotta: #B5765B;
  --color-dark-red: #9A4935;
  --color-dark-text: #3F3A35;
  --color-light-beige: #E8E0D3;
  --color-card-bg: #F4F0EA;
  --color-white: #FFFFFF;
  --color-black: #000000;

  /* Typography */
  --font-heading: 'Cormorant Garamond', 'Georgia', serif;
  --font-body: 'Inter', 'Helvetica Neue', 'Arial', sans-serif;

  /* Spacing */
  --section-padding-x: clamp(20px, 5.56vw, 40px);
  --section-max-width: 1440px;

  /* Border Radius */
  --radius-sm: 7px;

  /* Shadows */
  --shadow-card: 5px 5px 5px rgba(0, 0, 0, 0.05);

  /* Transitions */
  --transition-default: 0.3s ease;
}

/* ---------- Reset & Base Styles ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--color-dark-text);
  background-color: var(--color-cream);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

ul,
ol {
  list-style: none;
}

/* ---------- Google Fonts Import ---------- */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400&family=Inter:wght@100;200;300;400;500;600;700&display=swap');

/* ============================================================
   SECTION 1: Announcement Bar (Marquee / 走马灯)
   ============================================================ */
.announcement-bar {
  background-color: var(--color-cream);
  color: var(--color-dark-text);
  font-size: clamp(11px, 0.97vw, 14px);
  font-weight: 200;
  letter-spacing: 0.025em;
  padding: clamp(6px, 0.69vw, 10px) 0;
  position: relative;
  z-index: 10;
  overflow: hidden;
  white-space: nowrap;
}

/* 走马灯轨道 — 包含所有公告文案，水平连续滚动 */
.announcement-bar__track {
  display: inline-flex;
  animation: marquee-scroll 24s linear infinite;
  will-change: transform;
}

/* 每一条公告 */
.announcement-bar__item {
  display: inline-block;
  flex-shrink: 0;
  padding: 0 1.2em;
}

.announcement-bar__separator {
  margin-left: 1.2em;
  opacity: 0.35;
  font-size: 0.7em;
}

/* 鼠标悬停暂停，提高可读性 */
.announcement-bar:hover .announcement-bar__track {
  animation-play-state: paused;
}

/* 关键帧：无缝向左滚动整组公告的宽度 */
@keyframes marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ============================================================
   SECTION 2: Navigation Bar (Sticky)
   ============================================================ */
.navbar {
  background-color: var(--color-dark-red);
  color: var(--color-cream);
  position: sticky;
  top: 0;
  z-index: 100;
  height: auto;
  min-height: 50px;
}

.navbar__container {
  max-width: var(--section-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px var(--section-padding-x);
  position: relative;
}

/* Logo */
.navbar__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.navbar__logo-icon {
  width: 25px;
  height: 30px;
}

.navbar__logo-text {
  font-family: var(--font-heading);
  font-size: clamp(16px, 1.39vw, 20px);
  font-weight: 600;
  color: var(--color-white);
  white-space: nowrap;
}

/* Navigation Links */
.navbar__nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 8.68vw, 100px);
}

/* wp_nav_menu() 生成的 <ul> — 复用导航栏 flex 布局 */
.navbar__nav-list {
  display: flex;
  align-items: center;
  gap: clamp(20px, 8.68vw, 100px);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 子菜单（下拉） */
.navbar__nav-list .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--color-dark-red);
  padding: 8px 0;
  border-radius: var(--radius-sm);
  min-width: 160px;
  z-index: 200;
  list-style: none;
  margin: 0;
}

.navbar__nav-list .menu-item-has-children {
  position: relative;
}

.navbar__nav-list .menu-item-has-children:hover > .sub-menu,
.navbar__nav-list .menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

.navbar__nav-list .sub-menu .navbar__link {
  display: block;
  padding: 6px 16px;
}

.navbar__link {
  font-size: clamp(12px, 0.97vw, 14px);
  font-weight: 200;
  letter-spacing: 0.025em;
  color: var(--color-cream);
  transition: opacity var(--transition-default);
  white-space: nowrap;
}

.navbar__link:hover,
.navbar__link:focus-visible {
  opacity: 0.8;
}

/* Cart Section */
.navbar__cart {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.navbar__cart-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.navbar__cart-icon {
  width: clamp(20px, 1.74vw, 25px);
  height: auto;
}

.navbar__cart-count {
  position: absolute;
  top: -2px;
  right: -8px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-terracotta);
}

.navbar__cart-icons {
  display: flex;
  gap: 15px;
}

.navbar__cart-icons img {
  width: 20px;
  height: auto;
}

/* Mobile Menu Toggle */
.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
}

.navbar__toggle-bar {
  width: 22px;
  height: 2px;
  background-color: var(--color-cream);
  border-radius: 1px;
  transition: transform var(--transition-default), opacity var(--transition-default);
}

/* ============================================================
   SECTION 13: Brand Story + How To Arrive
   ============================================================ */
.brand-story {
  padding: clamp(40px, 5.56vw, 80px) var(--section-padding-x) clamp(8px, 1.94vw, 28px);
  background-color: var(--color-cream);
}

.brand-story__container {
  max-width: var(--section-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 5.56vw, 80px);
}

.brand-story__section-title {
  font-family: var(--font-heading);
  font-size: clamp(22px, 2.5vw, 36px);
  font-weight: 500;
  letter-spacing: 0.015em;
  color: var(--color-dark-text);
  margin-bottom: clamp(16px, 2.22vw, 32px);
}

.brand-story__text {
  font-size: clamp(13px, 1.11vw, 16px);
  font-weight: 400;
  color: var(--color-dark-text);
  line-height: 1.8;
  margin-bottom: 16px;
}

.brand-story__text strong {
  font-weight: 700;
}

/* Payment/Shipping Icons */
.brand-story__icons {
  display: flex;
  gap: clamp(12px, 2.19vw, 31.5px);
  align-items: center;
  margin-top: clamp(16px, 2.78vw, 40px);
  flex-wrap: wrap;
}

.brand-story__icon {
  width: clamp(48px, 5vw, 60px);
  height: auto;
}

/* ============================================================
   SECTION 14: Footer Bar
   ============================================================ */
.footer {
  background-color: var(--color-terracotta);
  color: var(--color-white);
  padding: clamp(14px, 1.18vw, 17px) var(--section-padding-x);
}

.footer__container {
  max-width: var(--section-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer__copyright {
  font-size: clamp(13px, 1.11vw, 16px);
  font-weight: 400;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: clamp(11px, 0.97vw, 14px);
  font-weight: 200;
  letter-spacing: 0.025em;
  color: var(--color-card-bg);
}

/* wp_nav_menu() 生成的 footer <ul> */
.footer__links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer__links-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer__links-list li:not(:last-child)::after {
  content: '|';
  opacity: 0.5;
  font-size: clamp(11px, 0.97vw, 14px);
}

.footer__links a {
  transition: opacity var(--transition-default);
  white-space: nowrap;
}

.footer__links a:hover,
.footer__links a:focus-visible {
  opacity: 0.7;
}

.footer__links-separator {
  opacity: 0.5;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS（公共组件）
   ============================================================ */

/* Tablet (768px - 1024px) */
@media screen and (max-width: 1024px) {
  .brand-story__container {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .navbar__nav {
    gap: 30px;
  }
}

/* Mobile (320px - 767px) */
@media screen and (max-width: 767px) {
  /* Navigation - Mobile */
  .navbar__toggle {
    display: flex;
  }

  .navbar__nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-dark-red);
    flex-direction: column;
    padding: 16px var(--section-padding-x);
    gap: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  }

  .navbar__nav--open {
    display: flex;
  }

  /* wp_nav_menu() 也要支持移动展开 */
  .navbar__nav-list {
    flex-direction: column;
    gap: 12px;
  }

  .navbar__nav-list .sub-menu {
    position: static;
    padding-left: 16px;
    box-shadow: none;
    border-radius: 0;
  }

  .navbar__cart-icons {
    display: none;
  }

  /* Footer */
  .footer__container {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    justify-content: center;
  }
}

/* Small Mobile (320px - 480px) */
@media screen and (max-width: 480px) {
  .brand-story__icons {
    justify-content: center;
  }
}

/* ============================================================
   FLOATING ACTION BUTTONS: Back to Top + WhatsApp
   ============================================================ */
.floating-actions {
  position: fixed;
  right: clamp(16px, 2.22vw, 32px);
  bottom: clamp(20px, 2.78vw, 40px);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* 返回顶部按钮 — 默认隐藏，JS 控制显隐 */
.floating-actions__btn--top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease,
              background-color 0.25s ease;
}

.floating-actions__btn--top--visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.floating-actions__btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.floating-actions__btn:hover,
.floating-actions__btn:focus-visible {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  outline: none;
}

.floating-actions__btn:active {
  transform: scale(0.95);
}

/* 返回顶部按钮 — 陶土色主题 */
.floating-actions__btn--top {
  background-color: var(--color-terracotta);
  color: #fff;
}

.floating-actions__btn--top:hover,
.floating-actions__btn--top:focus-visible {
  background-color: var(--color-dark-red);
}

/* WhatsApp 按钮 — 绿色 */
.floating-actions__btn--whatsapp {
  background-color: var(--color-dark-red);
  color: #fff;
}

.floating-actions__btn--whatsapp:hover,
.floating-actions__btn--whatsapp:focus-visible {
  background-color:var(--color-terracotta);
}

/* 移动端适配：略微缩小按钮，避免遮挡内容 */
@media screen and (max-width: 767px) {
  .floating-actions {
    right: 16px;
    bottom: 24px;
    gap: 10px;
  }

  .floating-actions__btn {
    width: 42px;
    height: 42px;
  }
}
