/*
Theme Name:    名品汇国际酒业 (Storefront Child)
Theme URI:      https://localhost:45369
Description:   Premium Chinese liquor store theme with Chinese Red color scheme
Author:        Hermes Agent
Author URI:    https://localhost:45369
Template:      storefront
Version:       2.0.0
License:       GPL v2 or later
*/

/* ===== Chinese Red Premium Theme ===== */

/* === Color Variables === */
:root {
  --red-primary: #C41E24;
  --red-dark: #A0161B;
  --red-light: #E83A40;
  --red-bg: #FEF2F2;
  --gold: #D4A549;
  --gold-light: #E8C97A;
  --gold-dark: #B8862E;
  --dark: #1A1A1A;
  --dark-2: #2D2D2D;
  --dark-3: #404040;
  --cream: #F5F0E8;
  --white: #FFFFFF;
  --gray-bg: #F8F6F3;
  --gray-border: #E5E0D8;
  --text: #1A1A1A;
  --text-light: #6B6B6B;
  --text-on-dark: #CCCCCC;
}

/* === Global === */
body {
  font-family: 'Noto Sans SC', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
}

/* === Remove Storefront default page header on front page === */
.home .page-header,
.home .entry-header,
.home .woocommerce-products-header {
  display: none !important;
}

.home .entry-title {
  display: none !important;
}

/* === Top Bar / Header - Compact Flex Row === */
.site-header {
  background: var(--dark) !important;
  border-bottom: 3px solid var(--red-primary);
  padding: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

/* Make both sections inline flex items */
.col-full {
  max-width: none !important;
  display: flex;
  align-items: center;
  padding: 8px 20px !important;
  margin: 0 !important;
}

/* First col-full (logo area): don't grow */
.site-header > .col-full {
  flex: 0 0 auto;
}

/* Nested col-full (nav area): fill available space */
.site-header .col-full .col-full {
  flex: 1 1 auto;
}

.storefront-primary-navigation {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 20px 8px 0;
  background: transparent;
}

/* Inner col-full inside primary nav: fill space, proper gap, group items */
.storefront-primary-navigation .col-full {
  gap: 12px;
  width: 100%;
}

/* Logo only branding - compact */
.mh-logo-only {
  padding: 0 !important;
  margin: 0 !important;
}
.mh-logo-only .custom-logo-link img {
  max-height: 40px;
  width: auto;
  display: block;
}
.site-branding .site-title,
.site-branding .site-description {
  display: none !important;
}

/* Search bar inline compact */
.site-search {
  display: flex;
  align-items: center;
  margin: 0 !important;
  padding: 0 !important;
}
.site-search .widget.widget_product_search {
  margin: 0;
}
.site-search input[type="search"] {
  border: 2px solid var(--dark-3) !important;
  border-radius: 25px !important;
  background: var(--dark-2);
  color: white;
  padding: 5px 15px !important;
  font-size: 0.82em;
  width: 180px;
  min-width: 120px;
  transition: border-color 0.3s, width 0.3s;
}
.site-search input[type="search"]:focus {
  border-color: var(--red-primary) !important;
  outline: none;
  width: 220px;
}
.site-search input[type="search"]::placeholder {
  color: rgba(255,255,255,0.55);
}
/* Hide Storefront default search icon and button, fix padding */
.site-search .widget_product_search form::before {
  display: none !important;
}
.site-search .widget_product_search .search-submit {
  display: none !important;
}
.site-search .widget_product_search input[type="search"] {
  padding-left: 15px !important;
}

/* Primary nav inline with search and cart */
.storefront-primary-navigation .main-navigation {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
}
.storefront-primary-navigation .main-navigation ul.menu > li > a {
  padding: 8px 14px !important;
  font-size: 0.82em !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.storefront-primary-navigation .main-navigation ul.menu > li:first-child > a {
  padding-left: 0 !important;
}

/* Cart inline compact */
.storefront-primary-navigation .site-header-cart {
  margin: 0;
}
.site-header-cart .cart-contents {
  color: #ffffff !important;
  font-size: 0.82em;
  padding: 6px 10px;
  white-space: nowrap;
}
.site-header-cart .cart-contents .cart-icon-wrap {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
}
.cart-svg-icon {
  color: #ffffff;
  transition: color 0.2s ease;
}
.site-header-cart .cart-contents:hover .cart-svg-icon {
  color: var(--gold);
}
/* Hide old FontAwesome cart icon (both before and after) */
.site-header-cart .cart-contents::before,
.site-header-cart .cart-contents::after {
  display: none !important;
}
.site-header-cart .cart-contents .amount,
.site-header-cart .cart-contents .count {
  color: #ffffff !important;
}
.site-header-cart .cart-contents:hover {
  color: var(--gold) !important;
}
.site-header-cart .cart-contents:hover .amount,
.site-header-cart .cart-contents:hover .count {
  color: var(--gold) !important;
}
/* Hide dropdown cart widget */
#site-header-cart .widget_shopping_cart {
  display: none !important;
}

/* === 导航链接白色 === */
.main-navigation ul.menu > li > a,
.main-navigation ul.nav-menu > li > a,
.main-navigation a {
  color: #ffffff !important;
  font-size: 15px;
  letter-spacing: 1px;
}

.main-navigation ul.menu > li > a:hover,
.main-navigation ul.nav-menu > li > a:hover,
.main-navigation a:hover {
  color: var(--gold) !important;
}

/* === 隐藏导航栏中的购物车链接（右侧已有） === */
.main-navigation li a[href*="/cart/"] {
  display: none !important;
}

/* === Navigation === */
.main-navigation {
  background: var(--dark);
  border-top: 1px solid var(--dark-2);
}

.main-navigation ul.menu > li > a {
  color: var(--cream) !important;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  text-transform: uppercase;
  font-size: 0.85em;
  transition: color 0.3s;
}

.main-navigation ul.menu > li > a:hover,
.main-navigation ul.menu > li.current-menu-item > a {
  color: var(--gold) !important;
}

.main-navigation ul.menu > li:hover {
  background: var(--dark-2);
}

/* === Search Bar === */
.site-search input[type="search"] {
  border: 2px solid var(--dark-2) !important;
  border-radius: 25px !important;
  background: var(--dark-2);
  color: white;
  padding: 10px 20px;
  transition: border-color 0.3s;
}

.site-search input[type="search"]:focus {
  border-color: var(--red-primary) !important;
  outline: none;
}

.site-search input[type="search"]::placeholder {
  color: rgba(255,255,255,0.55);
}

/* === Hero Section (Homepage) === */
.homepage-hero {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(196,30,36,0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(196,30,36,0.20) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(212,165,73,0.10) 0%, transparent 40%),
    linear-gradient(135deg, #0D0D0D 0%, #1A0A0A 30%, #2D0000 60%, #1A0000 100%);
}

.homepage-hero .hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
}

.homepage-hero .hero-overlay h1 {
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  font-size: 3.5em;
  color: var(--white);
  margin-bottom: 12px;
  text-shadow: 0 2px 15px rgba(0,0,0,0.6);
  letter-spacing: 3px;
}

.homepage-hero .hero-overlay p {
  font-size: 1.4em;
  color: var(--cream);
  max-width: 600px;
  margin-bottom: 30px;
  letter-spacing: 2px;
  opacity: 0.9;
}

.homepage-hero .hero-overlay .hero-btn {
  display: inline-block;
  padding: 16px 50px;
  background: var(--red-primary);
  color: var(--white);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.95em;
  transition: all 0.3s ease;
  border: 2px solid var(--red-primary);
}

.homepage-hero .hero-overlay .hero-btn:hover {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
  transform: scale(1.05);
}

/* === Featured Section === */
.we-featured-section {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
}

.section-title {
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  font-size: 2em;
  text-align: center;
  color: var(--dark);
  margin-bottom: 40px;
  position: relative;
  letter-spacing: 1px;
}

.section-title:after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--red-primary);
  margin: 15px auto 0;
}

/* === Category Grid === */
.we-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.we-category-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 12px;
  padding: 40px 30px;
  text-align: center;
  text-decoration: none;
  transition: all 0.4s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.we-category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 30px rgba(196,30,36,0.12);
  border-color: var(--red-primary);
  text-decoration: none;
}

.we-category-icon {
  font-size: 3em;
  margin-bottom: 15px;
  line-height: 1;
}

.we-category-card h3 {
  font-family: 'Noto Serif SC', 'Playfair Display', serif;
  font-size: 1.4em;
  color: var(--dark);
  margin: 0 0 10px;
  font-weight: 600;
}

.we-category-card p {
  color: var(--text-light);
  font-size: 0.9em;
  line-height: 1.6;
  margin: 0;
}

.we-category-card:hover h3 {
  color: var(--red-primary);
}

/* === About Section === */
.we-about-section {
  background: var(--gray-bg);
  padding: 60px 20px;
  margin: 0;
  border-top: 1px solid var(--gray-border);
}

.we-about-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.we-about-content h2 {
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
  font-size: 2em;
  color: var(--dark);
  margin-bottom: 20px;
}

.we-about-content h2:after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--red-primary);
  margin: 15px auto 0;
}

.we-about-content p {
  color: var(--text-light);
  font-size: 1.05em;
  line-height: 1.8;
  margin-bottom: 15px;
}

/* === Product Grid (The Whisky Exchange inspired) === */
/* ===================== */
/* Product Grid - TWX Style */
/* ===================== */
ul.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0;
  padding: 0;
  margin: 20px 0;
  list-style: none;
}

ul.products li.product {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  padding: 0;
  margin: 0;
  position: relative;
}

ul.products li.product:hover {
  border-color: transparent;
  box-shadow: none;
}

ul.products li.product .woocommerce-loop-product__link {
  display: block;
  text-decoration: none;
  padding: 8px;
  transition: background-color 0.15s ease;
}

ul.products li.product:hover .woocommerce-loop-product__link {
  background: #F9F9F9;
}

/* Image area - clean product shot, square aspect */
ul.products li.product img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 16px;
  margin: 0;
  background: #FFFFFF;
  transition: transform 0.25s ease;
  display: block;
}

ul.products li.product:hover img {
  transform: scale(1.04);
}

/* Product title - compact, left-aligned */
ul.products li.product .woocommerce-loop-product__title {
  font-family: 'Noto Sans SC', 'Helvetica', Arial, sans-serif;
  font-size: 0.78em;
  font-weight: 500;
  color: #222;
  padding: 6px 4px 2px;
  text-align: left;
  line-height: 1.35;
  min-height: 0;
  letter-spacing: 0;
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product SKU/attributes - like TWX "70cl / 43%" */
.woocommerce-loop-product__attrs {
  font-size: 0.72em;
  color: #888;
  padding: 0 4px;
  margin: 0;
  line-height: 1.4;
}

/* Price - smaller, left-aligned, red */
ul.products li.product .price {
  color: var(--red-primary) !important;
  font-weight: 600;
  font-size: 0.9em !important;
  text-align: left;
  padding: 2px 4px 8px;
  display: block;
}

ul.products li.product .price del {
  color: #999;
  font-size: 0.8em;
  font-weight: 400;
  margin-right: 4px;
}

ul.products li.product .price ins {
  font-weight: 700;
  text-decoration: none;
}

/* Hide add-to-cart button and star rating on listing page */
ul.products li.product .button,
ul.products li.product .star-rating,
ul.products li.product .added_to_cart {
  display: none !important;
}

/* === Widen content area - reduce page whitespace === */
.col-full {
  max-width: 95% !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

@media (min-width: 1600px) {
  .col-full {
    max-width: 1520px !important;
  }
}

/* === Override Storefront Default Grid Styles === */
/* Storefront uses flexbox + column classes — override with our grid */
.woocommerce-page ul.products,
.woocommerce ul.products,
.woocommerce-page ul.products.columns-1,
.woocommerce ul.products.columns-2,
.woocommerce-page ul.products.columns-3,
.woocommerce ul.products.columns-4,
.woocommerce-page ul.products.columns-5,
.woocommerce ul.products.columns-6 {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
  gap: 0 !important;
}

/* Remove Storefront's default margin/padding on list items */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.woocommerce ul.products li.product.col-1,
.woocommerce-page ul.products li.product.col-2,
.woocommerce ul.products li.product.col-3,
.woocommerce-page ul.products li.product.col-4,
.woocommerce ul.products li.product.col-5,
.woocommerce-page ul.products li.product.col-6 {
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  clear: none !important;
}

/* Remove Storefront's ::after clearfix on grid items */
.woocommerce ul.products li.product.last,
.woocommerce-page ul.products li.product.last {
  margin-right: 0 !important;
}

/* === Shop Page Header === */
.woocommerce-products-header .page-title {
  font-family: 'Noto Serif SC', 'Playfair Display', serif;
  color: var(--dark);
  text-align: center;
  font-size: 2em;
  margin: 30px 0;
  position: relative;
}

.woocommerce-products-header .page-title:after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--red-primary);
  margin: 15px auto 0;
}

/* === Single Product Page === */
.single-product div.product .images img {
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  padding: 20px;
  background: var(--white);
}

.single-product div.product .summary .product_title {
  font-family: 'Noto Serif SC', 'Playfair Display', serif;
  font-size: 2em !important;
  color: var(--dark);
  margin-bottom: 15px;
}

.single-product div.product .summary .price {
  font-size: 1.8em !important;
  color: var(--red-primary) !important;
  font-weight: 700;
}

.single-product div.product .summary .button {
  background: var(--red-primary) !important;
  color: var(--white) !important;
  font-weight: 600;
  border: none;
  padding: 15px 40px;
  font-size: 1em;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 4px;
  transition: all 0.3s;
}

.single-product div.product .summary .button:hover {
  background: var(--red-dark) !important;
}

/* === Sidebar === */
.widget-area {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  padding: 20px;
}

.widget-title {
  font-family: 'Noto Serif SC', 'Playfair Display', serif;
  color: var(--dark);
  border-bottom: 2px solid var(--red-primary);
  padding-bottom: 10px;
  font-size: 1.1em;
}

/* === Footer === */
.site-footer {
  background: var(--dark) !important;
  color: var(--text-on-dark);
  border-top: 3px solid var(--red-primary);
  padding: 50px 0 30px;
}

.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer .widget-title {
  color: var(--white) !important;
  font-family: 'Playfair Display', 'Noto Serif SC', serif;
}

.site-footer a {
  color: var(--text-on-dark) !important;
  transition: color 0.3s;
}

.site-footer a:hover {
  color: var(--gold) !important;
}

/* === Breadcrumbs === */
.woocommerce-breadcrumb {
  color: var(--text-light) !important;
  font-size: 0.85em;
  padding: 15px 0;
}

.woocommerce-breadcrumb a {
  color: var(--red-primary) !important;
}

/* === Category Widget === */
.widget_product_categories ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-border);
  display: flex;
  align-items: center;
}

.widget_product_categories ul li .count {
  float: none !important;
  margin-left: auto;
  padding-right: 8px;
  font-size: 12px;
  color: #999;
}

.widget_product_categories ul li a {
  flex: 1;
  color: var(--text);
  font-weight: 500;
}

.widget_product_categories ul li a:hover {
  color: var(--red-primary);
}

/* === Cart === */
.woocommerce-cart .cart-collaterals .cart_totals {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  padding: 20px;
}

/* === Checkout === */
.woocommerce-checkout #customer_details {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  padding: 20px;
}

.woocommerce-checkout #order_review {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 8px;
  padding: 20px;
}

/* === Language Switcher === */
.polylang_langswitcher {
  display: flex;
  gap: 0;
  border: 1px solid var(--dark-3);
  border-radius: 3px;
  overflow: hidden;
  margin-left: auto;
}

.polylang_langswitcher a.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  font-size: 0.8em;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s;
  letter-spacing: 0;
}

/* 中 - active language always red */
.polylang_langswitcher a.lang-switch.active {
  background: var(--red-primary);
  color: var(--white);
}

/* 中 - inactive (on English page, 中 is the other option) */
.polylang_langswitcher a.lang-switch:not(.active) {
  background: transparent;
  color: var(--cream);
}

.polylang_langswitcher a.lang-switch:hover {
  background: var(--red-primary) !important;
  color: var(--white) !important;
}

/* === Remove breadcrumbs on front page === */
.home .woocommerce-breadcrumb,
.page-id-620 .woocommerce-breadcrumb,
.page-id-622 .woocommerce-breadcrumb {
  display: none !important;
}

/* === Responsive === */
@media (max-width: 768px) {
  .homepage-hero {
    height: 350px;
  }

  .homepage-hero .hero-overlay h1 {
    font-size: 2em;
  }

  .homepage-hero .hero-overlay p {
    font-size: 1em;
  }

  .homepage-hero .hero-overlay .hero-btn {
    padding: 12px 30px;
    font-size: 0.85em;
  }

  .we-category-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .we-category-card {
    padding: 25px 20px;
  }

  /* Product grid: 2 columns on mobile, tighter */
  ul.products {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2px !important;
  }

  ul.products li.product img {
    aspect-ratio: 1 / 1;
    padding: 10px;
  }

  ul.products li.product .woocommerce-loop-product__link {
    padding: 4px;
  }

  .site-branding .site-title a {
    font-size: 1.3em;
  }

  .section-title {
    font-size: 1.5em;
  }

  .we-about-section {
    padding: 40px 15px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .we-category-grid {
    gap: 20px;
  }

  .we-category-card {
    padding: 30px 20px;
  }
}

/* ===== Mobile Responsive Optimizations ===== */

/* Hide mobile toggle and dropdown on desktop */
.mobile-categories-toggle,
.mobile-categories-dropdown,
.mobile-categories-wrap {
  display: none;
}

/* Tablet: Stack sidebar below content */
@media (max-width: 1024px) {
  #primary {
    width: 100% !important;
    float: none !important;
  }
  #secondary {
    width: 100% !important;
    float: none !important;
    clear: both;
    margin-top: 20px;
  }

  /* Header - prevent horizontal overflow */
  .site-header {
    flex-wrap: wrap;
  }
  .site-header > .col-full {
    flex: 0 0 auto;
    width: auto;
  }
  .storefront-primary-navigation .col-full {
    gap: 8px;
  }
  .site-search input[type="search"] {
    width: 140px;
    min-width: 80px;
  }
}

/* Phone: Full mobile layout */
@media (max-width: 768px) {
  /* Sidebar hidden behind toggle button */
  #secondary {
    display: none;
  }
  /* Mobile category strip appears at top of content */
  .mobile-categories-wrap {
    display: block;
    margin-bottom: 16px;
  }
  .mobile-categories-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--red-primary);
    color: white;
    border: none;
    border-radius: 8px 8px 0 0;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: opacity 0.2s;
  }
  .mobile-categories-toggle:active {
    opacity: 0.85;
  }
  .mobile-categories-toggle .toggle-icon {
    transition: transform 0.3s ease;
  }
  .mobile-categories-toggle.open .toggle-icon {
    transform: rotate(180deg);
  }
  # SECONDARY IS NOW A DROPDOWN ON MOBILE (see .mobile-categories-dropdown)
  .site-header {
    padding: 0;
  }
  .storefront-primary-navigation {
    padding: 4px 10px !important;
    flex-wrap: wrap;
  }
  .storefront-primary-navigation .col-full {
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 10px !important;
    justify-content: center;
  }
  .main-navigation {
    order: 0;
  }
  .site-header-cart {
    order: 2;
  }
  .site-search {
    order: 1;
    width: auto;
    flex: 1;
  }
  .site-search input[type="search"] {
    width: 100%;
    min-width: 80px;
    padding: 4px 10px !important;
    font-size: 0.78em;
  }
  .polylang_langswitcher {
    order: 3;
    margin-left: 0;
  }
}

/* Very small phones */
@media (max-width: 480px) {
  .storefront-primary-navigation .col-full {
    padding: 4px 6px !important;
    gap: 4px;
  }
  .site-header-cart .cart-contents {
    font-size: 0.75em;
    padding: 4px 6px;
  }
  .site-search input[type="search"] {
    min-width: 60px;
    font-size: 0.72em;
    padding: 3px 8px !important;
  }
  .polylang_langswitcher a.lang-switch {
    width: 28px;
    height: 24px;
    font-size: 0.7em;
  }
}

/* ===== Hide mobile menu toggle button (冗余, compact header不需要) ===== */
button.menu-toggle {
  display: none !important;
}
.handheld-navigation {
  display: none !important;
}

/* Override Storefront mobile nav toggle behavior */
.main-navigation.toggled .handheld-navigation,
.main-navigation.toggled div.menu {
  max-height: none !important;
}

/* ===== Mobile category child toggles ===== */
@media (max-width: 768px) {
  #secondary .cat-parent > .children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 1em;
  }
  #secondary .cat-parent.children-visible > .children {
    max-height: 500px;
  }
  #secondary .cat-parent > a::after {
    content: " \25B8";
    font-size: 0.8em;
    opacity: 0.5;
    transition: transform 0.2s;
  }
  #secondary .cat-parent.children-visible > a::after {
    transform: rotate(90deg);
  }
  #secondary .cat-item a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    padding: 8px 0;
    display: inline-block;
  }
  .mobile-categories-wrap {
    position: relative;
  }
  .mobile-categories-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: 2px solid var(--red-primary);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    max-height: 55vh;
    overflow-y: auto;
    font-size: 14px;
    display: none;
  }
  .mobile-categories-dropdown.active {
    display: block;
  }
  .mobile-categories-dropdown .mobile-cat-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
  }
  .mobile-categories-dropdown .cat-item {
    margin: 0;
    display: flex;
    align-items: center;
  }
  .mobile-categories-dropdown .cat-item .count {
    float: none !important;
    display: inline !important;
    font-size: 12px;
    color: #999;
    margin-left: auto;
    padding-right: 16px;
    order: 2;
  }
  .mobile-categories-dropdown .cat-item a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    color: #222;
    text-decoration: none;
    border-bottom: 1px solid #f2f2f2;
    font-size: 14px;
    line-height: 1.4;
    touch-action: manipulation;
    transition: background 0.15s;
  }
  .mobile-categories-dropdown .cat-item:last-child a {
    border-bottom: none;
  }
  .mobile-categories-dropdown .cat-item a:active {
    background: #f0f0f0;
  }
  .mobile-categories-dropdown .cat-parent > a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: rotate(-45deg);
    margin-left: 8px;
    transition: transform 0.25s ease;
    flex-shrink: 0;
  }
  .mobile-categories-dropdown .cat-parent.children-visible > a::after {
    transform: rotate(45deg);
  }
  .mobile-categories-dropdown .children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f8f8f8;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .mobile-categories-dropdown .cat-parent.children-visible > .children {
    max-height: 500px;
  }
  .mobile-categories-dropdown .children .cat-item a {
    padding-left: 28px;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #eee;
  }
}