/* ============================================================
   Reformation Theme - Common Public Styles
   全局公共样式（加载到所有页面）
   - Fonts / Reset / Body / Utility
   - Top Announcement Bar (.ref-topbar)
   - Header / Navigation (.ref-header, .ref-nav)
   - Mobile Menu (.ref-mobile)
   - Search Modal (.ref-search-modal)
   - Footer (.ref-footer)
   - Shared: Buttons / Badges / Stars / Responsive
   ============================================================ */

/* ========== CSS Variables ========== */
:root {
  --ref-black: #111111;
  --ref-dark: #1a1a1a;
  --ref-white: #ffffff;
  --ref-bg: #ffffff;
  --ref-bg-soft: #f8f8f8;
  --ref-bg-dark: #111111;
  --ref-text: #111111;
  --ref-text-light: #666666;
  --ref-text-muted: #999999;
  --ref-border: #e5e5e5;
  --ref-border-light: #f0f0f0;
  --ref-accent: #ffffff;
  --ref-red: #C30101;
  --ref-orange: #ff5a2b;
  --ref-blue: #2154c9;
  --ref-star: #f5a623;
  --ref-radius: 0;
  --ref-radius-sm: 2px;
  --ref-radius-lg: 4px;
  --ref-transition: all 0.25s ease;
}

/* ========== Fonts ========== */
/* 全站统一字体：Montserrat-Regular */
@font-face {
  font-family: refFont;
  src: url('../fonts/Montserrat-Regular.ttf');
}

/* body 设置全局字体，所有子元素自动继承 */
body {
  margin: 0;
  font-family: refFont, 'Montserrat', sans-serif;
  background: var(--ref-white);
  color: var(--ref-text);
  -webkit-font-smoothing: antialiased;
}

/* 覆盖 UIKit 对 h1~h6 的默认 font-family，保持全站统一 */
h1, h2, h3, h4, h5, h6 {
  font-family: refFont, 'Montserrat', sans-serif;
}

/* ========== 全站字体统一：覆盖所有常见元素的默认 font-family ==========
   确保 button / a / span / label / input / select / textarea 等
   不被浏览器或 UIKit 覆盖成其他字体
*/
a, span, p, li, label, small, strong, b, em, i,
button, input, select, textarea, option, optgroup,
table, caption, tbody, tfoot, thead, tr, th, td,
blockquote, cite, code, pre, kbd, samp, var {
  font-family: refFont, 'Montserrat', sans-serif;
}

/* UIKit 组件字体统一（防止 UIKit 内建样式覆盖） */
.uk-button,
.uk-input,
.uk-select,
.uk-textarea,
.uk-checkbox,
.uk-radio,
.uk-form-label,
.uk-navbar,
.uk-navbar-item,
.uk-navbar-nav > li > a,
.uk-subnav > * > a,
.uk-tab > * > a,
.uk-accordion-title,
.uk-breadcrumb > * > a,
.uk-breadcrumb > *:last-child,
.uk-alert,
.uk-badge,
.uk-card-title,
.uk-card-body,
.uk-modal-title,
.uk-offcanvas-bar,
.uk-offcanvas-bar .uk-nav > li > a,
.uk-drop,
.uk-dropdown,
.uk-nav > li > a,
.uk-nav-header,
.uk-nav-divider,
.uk-table,
.uk-pagination > * > a,
.uk-pagination > * > span,
.uk-tile,
.uk-heading-bullet::before,
.uk-link,
.uk-link-text,
.uk-text-lead,
.uk-text-meta,
.uk-meta,
.uk-icon {
  font-family: refFont, 'Montserrat', sans-serif;
}

/* UIKit 所有带 button / input 的元素额外加一层保险 */
[class*="uk-button"],
[class*="uk-input"],
[class*="uk-select"],
[class*="uk-textarea"] {
  font-family: refFont, 'Montserrat', sans-serif !important;
}

/* ========== Utility Classes ========== */
.ref-uppercase {
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========== Top Announcement Bar ========== */
.ref-topbar {
  background: var(--ref-black);
  color: var(--ref-white);
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
  position: relative;
  white-space: nowrap;
}

.ref-topbar__track {
  display: flex;
  align-items: center;
  animation: refTopbarScroll 30s linear infinite;
  will-change: transform;
}

.ref-topbar__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 40px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* 公告条内链接样式 */
.ref-topbar__item a {
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s;
}

.ref-topbar__item a:hover {
  opacity: 0.75;
}

.ref-topbar__item span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ref-topbar__item i {
  color: #fff;
  font-size: 13px;
}

@keyframes refTopbarScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== Main Header / Navigation ========== */
.ref-header {
  background: var(--ref-white);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--ref-border-light);
}

.ref-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 64px;
  gap: 24px;
}

/* ---- Left Nav ---- */
.ref-nav__left {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}

.ref-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ref-nav__list--left {
  justify-content: flex-start;
}

.ref-nav__list > li {
  position: relative;
}

.ref-nav__list > li > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ref-text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 10px 14px;
  transition: var(--ref-transition);
  position: relative;
}

.ref-nav__list > li.uk-active > a,
.ref-nav__list > li:hover > a {
  color: var(--ref-text);
  opacity: 0.7;
}

/* ---- Dropdown Submenu ---- */
.ref-nav__dropdown:hover .ref-nav__submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.ref-nav__submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 220px;
  background: var(--ref-white);
  border: 1px solid var(--ref-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  z-index: 100;
}

.ref-nav__submenu ul {
  list-style: none;
  padding: 10px 0;
  margin: 0;
}

.ref-nav__submenu li a {
  display: block;
  padding: 10px 22px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ref-text);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: var(--ref-transition);
}

.ref-nav__submenu li a:hover {
  background: var(--ref-bg-soft);
  color: var(--ref-text);
  padding-left: 26px;
}

/* ---- Badge ---- */
.ref-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-left: 4px;
  vertical-align: middle;
}

.ref-badge--red {
  background: var(--ref-red);
  color: var(--ref-white);
}

/* ---- Logo ---- */
.ref-logo {
  display: block;
  text-align: left;
  text-decoration: none;
  font-family: refFont, 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 1.5px;
  color: var(--ref-text);
  padding: 0 16px;
  line-height: 1;
}

.ref-logo:hover {
  text-decoration: none;
  color: var(--ref-text);
  opacity: 0.85;
}

/* ---- Right Actions ---- */
.ref-nav__right {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-self: end;
}

.ref-nav__currency {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--ref-text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
  transition: var(--ref-transition);
}

.ref-nav__currency:hover {
  opacity: 0.7;
  text-decoration: none;
  color: var(--ref-text);
}

.ref-nav__currency i {
  font-size: 13px;
}

.ref-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ref-text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 0;
  transition: var(--ref-transition);
}

.ref-nav__link:hover {
  opacity: 0.7;
  text-decoration: none;
  color: var(--ref-text);
}

.ref-nav__link i {
  font-size: 15px;
}

/* ---- Icon Buttons ---- */
.ref-icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--ref-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--ref-transition);
  font-size: 19px;
  text-decoration: none;
  position: relative;
  border-radius: 50%;
}

.ref-icon-btn:hover {
  background: var(--ref-bg-soft);
  color: var(--ref-text);
  text-decoration: none;
}

/* ---- Cart Count Badge ---- */
.ref-cart-count {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--ref-red);
  color: var(--ref-white);
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  pointer-events: none;
  letter-spacing: 0;
}

/* ---- User Dropdown ---- */
.ref-user-dropdown {
  min-width: 220px;
  padding: 8px 0;
  background: var(--ref-white);
  border: 1px solid var(--ref-border);
  border-radius: 0;
}

.ref-user-dropdown .uk-dropdown-nav li a {
  padding: 11px 20px;
  color: var(--ref-text);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: var(--ref-transition);
}

.ref-user-dropdown .uk-dropdown-nav li a:hover {
  background: var(--ref-bg-soft);
  color: var(--ref-text);
}

.ref-user-dropdown .uk-dropdown-nav li a i {
  font-size: 16px;
  color: var(--ref-text-light);
}

/* ---- Mobile Toggle ---- */
.ref-nav__toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--ref-border);
  background: var(--ref-white);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.ref-nav__toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--ref-text);
  transition: all 0.3s ease;
}

/* ========== Mobile Menu Off-canvas ========== */
.ref-mobile-wrap .uk-offcanvas-bar {
  background: var(--ref-white);
  color: var(--ref-text);
  width: 320px;
}

.ref-mobile-menu {
  background: var(--ref-white);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
}

.ref-mobile-logo {
  font-family: refFont, 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--ref-text);
  margin-bottom: 20px;
  text-decoration: none;
  display: inline-block;
}

.ref-mobile-menu .uk-nav {
  border-top: 1px solid var(--ref-border-light);
}

.ref-mobile-menu .uk-nav > li > a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ref-text);
  padding: 14px 0;
  border-bottom: 1px solid var(--ref-border-light);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.ref-mobile-menu .uk-nav > li.uk-active > a {
  color: var(--ref-text);
  opacity: 0.7;
}

.ref-mobile-menu .uk-nav-sub li a {
  font-size: 13px;
  padding: 10px 16px;
  color: var(--ref-text-light);
}

.ref-mobile-actions {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-mobile-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ref-bg-soft);
  color: var(--ref-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: var(--ref-transition);
}

.ref-mobile-action:hover {
  background: var(--ref-black);
  color: var(--ref-white);
  text-decoration: none;
}

.ref-mobile-action i {
  font-size: 18px;
}

/* ========== Search Modal ========== */
.ref-search-modal .uk-modal-dialog {
  background: var(--ref-white);
  border-radius: 0;
  padding: 48px 40px;
  border: 1px solid var(--ref-border);
}

.ref-search-title {
  font-family: refFont, 'Montserrat', sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--ref-text);
  text-transform: uppercase;
}

.ref-search-btn {
  background: var(--ref-black);
  color: var(--ref-white);
  border-radius: 0;
  font-weight: 700;
  letter-spacing: 2px;
  border: none;
  padding: 14px 20px;
  text-transform: uppercase;
  font-size: 12px;
  transition: var(--ref-transition);
}

.ref-search-btn:hover {
  background: var(--ref-dark);
  color: var(--ref-white);
}

.ref-search-modal .uk-input {
  border: 1px solid var(--ref-border);
  border-radius: 0;
  padding: 14px 20px 14px 50px;
  font-size: 14px;
  background: var(--ref-white);
}

.ref-search-modal .uk-input:focus {
  border-color: var(--ref-text);
  box-shadow: none;
}

/* ========== Footer ========== */
.ref-footer {
  background: var(--ref-bg-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 80px 0 0;
}

.ref-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  padding-bottom: 60px;
}

/* ---- Brand ---- */
.ref-footer__logo {
  display: inline-block;
  font-family: refFont, 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--ref-white);
  text-decoration: none;
  margin: 0 0 18px;
  text-transform: uppercase;
}

.ref-footer__logo:hover {
  color: var(--ref-white);
  opacity: 0.85;
  text-decoration: none;
}

.ref-footer__desc {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 24px;
  max-width: 360px;
}

/* ---- Socials ---- */
.ref-footer__socials {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
}

.ref-footer__socials a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  transition: var(--ref-transition);
  font-size: 16px;
}

.ref-footer__socials a:hover {
  background: var(--ref-white);
  color: var(--ref-black);
  transform: translateY(-2px);
}

/* ---- Payments ---- */
.ref-footer__payments {
  margin-top: 8px;
}

.ref-footer__pay-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 10px;
}

.ref-footer__pay-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ref-footer__pay-list img {
  height: 34px;
  width: auto;
  border-radius: 2px;
  transition: var(--ref-transition);
}

.ref-footer__pay-list img:hover {
  transform: translateY(-2px);
  opacity: 1;
}

/* ---- Link Columns ---- */
.ref-footer__links h5 {
  font-size: 11px;
  font-weight: 700;
  color: var(--ref-white);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 22px;
}

.ref-footer__links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ref-footer__links li {
  margin-bottom: 12px;
}

.ref-footer__links li a {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: var(--ref-transition);
  line-height: 1.4;
}

.ref-footer__links li a:hover {
  color: var(--ref-white);
  padding-left: 3px;
}

/* ---- Bottom Bar ---- */
.ref-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 26px 0;
  text-align: center;
}

.ref-footer__bottom p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin: 0;
  letter-spacing: 0.5px;
}

/* ========== Utility: Stars Rating ========== */
.ref-stars {
  display: inline-flex;
  gap: 1px;
  font-size: 12px;
  color: var(--ref-star);
}

.ref-stars .ref-stars--empty {
  color: #dddddd;
}

/* ========== Utility: Labels (New / Sale / Trending) ========== */
.ref-label {
  display: inline-block;
  padding: 4px 10px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #fff;
  line-height: 1;
}

.ref-label--new {
  background: var(--ref-orange);
}

.ref-label--sale {
  background: var(--ref-red);
}

.ref-label--trending {
  background: var(--ref-blue);
}

.ref-label--bestseller {
  background: #2b99d9;
}

/* ========== Pagination Component (keep compat) ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 30px 0;
  padding: 0;
  list-style: none;
}

.pagination li a,
.pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--ref-border);
  color: var(--ref-text);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 14px;
  box-sizing: border-box;
}

.pagination li a:hover {
  background-color: var(--ref-bg-soft);
  border-color: #bbb;
}

.pagination li.active span {
  background-color: var(--ref-black);
  border-color: var(--ref-black);
  color: var(--ref-white);
}

.pagination li.disabled span {
  color: var(--ref-text-muted);
  cursor: not-allowed;
  background: var(--ref-bg-soft);
}

/* ========== Shared Responsive ========== */
@media (max-width: 1199px) {
  .ref-nav__list > li > a {
    padding: 10px 10px;
    font-size: 10px;
    letter-spacing: 0.8px;
  }
  .ref-nav__currency {
    font-size: 9px;
  }
  .ref-nav__link {
    font-size: 10px;
  }
  .ref-nav__right {
    gap: 12px;
  }
  .ref-footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 959px) {
  body { min-width: auto; }

  .ref-topbar { height: 32px; }
  .ref-topbar__item { font-size: 10px; padding: 0 24px; }

  .ref-nav {
    grid-template-columns: auto 1fr auto;
    min-height: 60px;
    gap: 12px;
    padding: 8px 0;
  }

  /* Hide desktop nav / currency / login-link on mobile */
  .ref-nav__list--left { display: none; }
  .ref-nav__toggle { display: flex; }
  .ref-nav__currency { display: none; }
  .ref-nav__link { display: none; }

  .ref-logo {
    font-size: 18px;
    letter-spacing: 1.2px;
  }

  .ref-nav__right { gap: 2px; justify-self: end; }
  .ref-icon-btn { width: 36px; height: 36px; font-size: 18px; }
  .ref-nav__right .uk-inline { display: none; }

  .ref-footer { padding: 50px 0 0; }
  .ref-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
  }
}

@media (max-width: 639px) {
  .ref-topbar { display: none; }
  .ref-logo { font-size: 16px; }
  .ref-footer { padding: 40px 0 0; }
  .ref-footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 32px;
  }
  .ref-footer__logo { font-size: 20px; }
}

/* ============================================================
   公共布局类 — 供非首页（产品/购物车/用户中心等）页面使用
   .am-container  : 居中内容容器，等价于 uk-container-large
   .am-section    : 通用区块包装
   .am-section-title : 页面主标题
   ============================================================ */
.am-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.am-section {
  position: relative;
}

.am-section-title {
  font-family: refFont, 'Montserrat', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #232f3e;
  margin: 0;
  line-height: 1.2;
}

/* 响应式适配 */
@media (max-width: 767px) {
  .am-container { padding: 0 16px; }
  .am-section-title { font-size: 26px; }
}
