/*
Theme Name: Storefront Child - KZYAO
Template: storefront
Version: 1.0.0
Description: Custom child theme for KZYAO 3C accessories store.
Author: KZYAO
Text Domain: storefront-child
*/

/* ===== Brand & Layout ===== */
:root {
  --tw-dark: #0f172a;
  --tw-dark-2: #1e293b;
  --tw-accent: #2563eb;
  --tw-accent-2: #0ea5e9;
  --tw-light: #f8fafc;
}

body, button, input, select, textarea {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* Header */
.site-header {
  background: var(--tw-dark);
  border-bottom: 3px solid var(--tw-accent);
}
.site-header .site-branding .site-title a {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.site-header .site-branding .site-description {
  color: #94a3b8;
}
.main-navigation ul.menu > li > a {
  color: #cbd5e1;
  font-weight: 600;
}
.main-navigation ul.menu > li > a:hover {
  color: var(--tw-accent-2);
}
.main-navigation ul.menu > li.current-menu-item > a {
  color: #fff;
  border-bottom: 2px solid var(--tw-accent-2);
}

/* Buttons */
.button, button, input[type="button"], input[type="reset"], input[type="submit"] {
  background: var(--tw-accent);
  border-color: var(--tw-accent);
  border-radius: 6px;
  font-weight: 600;
}
.button:hover, button:hover, input[type="submit"]:hover {
  background: var(--tw-accent-2);
  border-color: var(--tw-accent-2);
}
a.button.alt, button.alt {
  background: #10b981;
  border-color: #10b981;
}

/* WooCommerce products */
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 1rem;
  color: var(--tw-dark);
}
.woocommerce ul.products li.product .price {
  color: var(--tw-accent);
  font-weight: 700;
}
.woocommerce ul.products li.product .button {
  border-radius: 6px;
}
.woocommerce ul.products li.product:hover {
  box-shadow: 0 6px 18px rgba(15,23,42,0.12);
}

/* Hero section on homepage */
.tw-hero {
  background: linear-gradient(135deg, var(--tw-dark) 0%, #1d4ed8 100%);
  color: #fff;
  padding: 64px 24px;
  text-align: center;
  border-radius: 12px;
  margin-bottom: 32px;
}
.tw-hero h1, .tw-hero h2 {
  color: #fff;
  font-size: 2.2rem;
  margin-bottom: 16px;
}
.tw-hero p {
  color: #dbeafe;
  font-size: 1.1rem;
  max-width: 640px;
  margin: 0 auto 24px;
}
.tw-hero .tw-hero-btn {
  display: inline-block;
  background: #fff;
  color: var(--tw-dark);
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
}

/* Feature cards */
.tw-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 32px 0;
}
.tw-feature {
  background: var(--tw-light);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}
.tw-feature h3 {
  margin-top: 0;
  color: var(--tw-dark);
}
.tw-feature p {
  color: #475569;
  margin-bottom: 0;
}

/* Trust badges */
.tw-trust {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0 40px;
}
.tw-trust div {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  font-weight: 600;
  color: var(--tw-dark);
}

/* Footer */
.site-footer {
  background: var(--tw-dark);
  color: #94a3b8;
  border-top: 3px solid var(--tw-accent);
}
.site-footer a {
  color: #cbd5e1;
}
.site-footer a:hover {
  color: #fff;
}

/* Checkout & account accent */
.woocommerce-checkout h3 {
  border-bottom: 2px solid var(--tw-accent);
  padding-bottom: 8px;
}
.woocommerce-MyAccount-navigation ul li.is-active a {
  color: var(--tw-accent);
}

/* Responsive tweaks */
@media (max-width: 768px) {
  .tw-hero h1, .tw-hero h2 { font-size: 1.6rem; }
  .tw-hero { padding: 40px 16px; }
}

/* MOQ hint */.moq-hint { color: #e35b5b; font-weight: 600; margin: 0 0 10px; }


/* ===== Customer Service / WhatsApp ===== */

/* Floating WhatsApp button */
.tw-wa-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 99999;
  display: flex;
  align-items: center;
  background: #25d366;
  border-radius: 40px;
  padding: 12px 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  animation: tw-wa-pulse 2.6s infinite;
}
.tw-wa-float:hover, .tw-wa-float:focus {
  background: #1ebe5d;
  text-decoration: none;
}
.tw-wa-float svg {
  display: block;
  flex: 0 0 auto;
}
.tw-wa-tip {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  opacity: 0;
  transition: max-width 0.25s ease, opacity 0.2s ease, margin-left 0.25s ease;
}
.tw-wa-float:hover .tw-wa-tip, .tw-wa-float:focus .tw-wa-tip {
  max-width: 160px;
  margin-left: 10px;
  opacity: 1;
}
@keyframes tw-wa-pulse {
  0%   { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), 0 0 0 0 rgba(37, 211, 102, 0.55); }
  70%  { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28), 0 0 0 0 rgba(37, 211, 102, 0); }
}
@media (max-width: 767px) {
  .tw-wa-float { right: 12px; bottom: 12px; padding: 11px; }
  .tw-wa-float:hover .tw-wa-tip, .tw-wa-float:focus .tw-wa-tip {
    max-width: 0;
    margin-left: 0;
    opacity: 0;
  }
}

/* Homepage customer service section */
.tw-support {
  text-align: center;
  padding: 52px 24px;
  margin-top: 32px;
  background: var(--tw-light);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}
.tw-support-title {
  font-size: 30px;
  color: var(--tw-dark);
  margin: 0 0 12px;
}
.tw-support-sub {
  color: #475569;
  font-size: 16px;
  line-height: 1.7;
  max-width: 660px;
  margin: 0 auto 26px;
}
.tw-support-note {
  color: #64748b;
  font-size: 14px;
  margin: 16px 0 0;
}
.tw-support-wa {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25d366;
  color: #fff;
  padding: 13px 26px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}
.tw-support-wa svg { display: block; }
.tw-support-wa:hover {
  background: #1ebe5d;
  color: #fff;
  text-decoration: none;
}
/* === WhatsApp "Get Quote" nav CTA === */
.main-navigation .menu { position: relative; }
li.tw-nav-cta { position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); list-style: none; margin: 0; }
li.tw-nav-cta a.tw-nav-cta-a { display: inline-block; background: #25D366; color: #fff; font-size: 0.9rem; font-weight: 600; line-height: 1; padding: 0.7rem 1.1rem; border-radius: 0.4rem; text-decoration: none; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
li.tw-nav-cta a.tw-nav-cta-a:hover, li.tw-nav-cta a.tw-nav-cta-a:focus { background: #1eb95a; color: #fff; }
@media (max-width: 66.4989378333em) {
  li.tw-nav-cta { position: absolute; right: 4.6rem; top: 0.55rem; transform: none; z-index: 30; }
  li.tw-nav-cta a.tw-nav-cta-a { padding: 0.6rem 0.9rem; font-size: 0.82rem; }
}
@media (max-width: 567px) {
  li.tw-nav-cta { right: 3.4rem; top: 0.45rem; }
  li.tw-nav-cta a.tw-nav-cta-a { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
}

/* ================================================================
   Mobile (handheld) navigation - KZYAO
   The 'handheld' location now renders the dedicated Handheld Menu
   (Shop > Audio / Tablet Accessories, About Us, Customer Reviews,
   FAQ, Contact) plus the WhatsApp "Get Quote" CTA appended in PHP.
   ================================================================ */
@media (max-width: 66.4989378333em) {
  /* Toggle / "Menu" hamburger that turns into an X when open. */
  #site-navigation button.menu-toggle,
  #site-navigation button.menu-toggle:hover,
  #site-navigation button.menu-toggle:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: none;
    padding: 0.5rem 0.9rem 0.5rem 2.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    max-width: none;
  }
  #site-navigation button.menu-toggle::before,
  #site-navigation button.menu-toggle::after,
  #site-navigation button.menu-toggle span::before {
    background-color: #ffffff;
    left: 0.9rem;
    width: 15px;
  }
  #site-navigation button.menu-toggle:hover,
  #site-navigation button.menu-toggle:focus {
    background: rgba(255, 255, 255, 0.16);
  }

  /* Expanded menu panel */
  #site-navigation .handheld-navigation {
    background: var(--tw-dark-2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  #site-navigation .handheld-navigation ul.menu {
    margin: 0;
    padding: 0.15rem 1rem 0.8rem;
    list-style: none;
  }
  #site-navigation .handheld-navigation ul.menu > li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  #site-navigation .handheld-navigation ul.menu > li:last-child {
    border-bottom: 0;
  }
  #site-navigation .handheld-navigation ul.menu > li > a {
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.45;
    padding: 0.7rem 0.3rem;
    display: block;
    text-decoration: none;
  }
  #site-navigation .handheld-navigation ul.menu > li > a:hover,
  #site-navigation .handheld-navigation ul.menu > li > a:focus {
    color: var(--tw-accent-2);
    background: transparent;
    text-decoration: none;
  }
  #site-navigation .handheld-navigation ul.menu .sub-menu {
    margin: 0;
    padding: 0 0 0.3rem 0.9rem;
    list-style: none;
  }
  #site-navigation .handheld-navigation ul.menu .sub-menu a {
    color: #e2e8f0;
    font-size: 0.95rem;
    padding: 0.45rem 0.3rem;
    display: block;
    text-decoration: none;
  }
  #site-navigation .handheld-navigation ul.menu .sub-menu a:hover,
  #site-navigation .handheld-navigation ul.menu .sub-menu a:focus {
    color: var(--tw-accent-2);
    text-decoration: none;
  }

  /* Parent item arrow / toggle hit area */
  #site-navigation .handheld-navigation li.menu-item-has-children {
    position: relative;
  }
  #site-navigation .handheld-navigation li.menu-item-has-children > a {
    padding-right: 2.8rem;
  }
  #site-navigation .handheld-navigation .dropdown-toggle {
    top: 0;
    bottom: 0;
    height: auto;
    width: 2.8rem;
    color: #ffffff;
    font-size: 0.9rem;
    text-align: center;
    border: 0;
    background: transparent;
    border-radius: 0;
  }
  #site-navigation .handheld-navigation .dropdown-toggle:hover,
  #site-navigation .handheld-navigation .dropdown-toggle:focus {
    color: var(--tw-accent-2);
    background: transparent;
  }

  /* WhatsApp "Get Quote" CTA rendered as a normal list item inside
     the handheld menu (not absolutely positioned like in the header). */
  .handheld-navigation li.tw-nav-cta {
    position: static;
    transform: none;
    right: auto;
    top: auto;
    margin: 0.45rem 0 0.15rem;
    border-bottom: 0;
  }
  .handheld-navigation li.tw-nav-cta a.tw-nav-cta-a {
    display: block;
    text-align: center;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    line-height: 1.3;
    border-radius: 0.5rem;
  }
  .handheld-navigation li.tw-nav-cta a.tw-nav-cta-a:hover,
  .handheld-navigation li.tw-nav-cta a.tw-nav-cta-a:focus {
    color: #ffffff;
  }

  /* Floating WhatsApp bubble: raise it above the fixed handheld bar so
     it no longer overlaps the Cart icon. */
  .tw-wa-float {
    right: 12px;
    bottom: calc(5.9em + env(safe-area-inset-bottom, 0px));
    padding: 11px;
  }

  /* Handheld bottom bar: drop the redundant Search column and give the
     remaining My Account / Cart actions a wider two-column layout. */
  .storefront-handheld-footer-bar ul li.search {
    display: none;
  }
  .storefront-handheld-footer-bar ul.columns-3 li {
    width: 50%;
  }
  .site-footer .col-full {
    padding-bottom: calc(5em + env(safe-area-inset-bottom, 0px));
  }
}

/* Phone-only hardening (<=767px): "Get Quote" CTA fills its row and is never
   clipped; tighter rows so the full menu fits one screen. */
@media (max-width: 767px) {
  #site-navigation .handheld-navigation ul.menu {
    padding: 0.1rem 0.9rem 0.7rem;
  }
  #site-navigation .handheld-navigation ul.menu > li > a {
    padding: 0.7rem 0.3rem;
    line-height: 1.45;
  }
  #site-navigation .handheld-navigation ul.menu .sub-menu a {
    padding: 0.4rem 0.3rem;
  }
  #site-navigation .handheld-navigation li.tw-nav-cta {
    margin: 0.35rem 0 0.1rem;
  }
  #site-navigation .handheld-navigation li.tw-nav-cta a.tw-nav-cta-a {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.3;
  }
}

/* ===== Mobile site-wide product search (restored on phones; inert on desktop) ===== */
#site-navigation .kzy-search-toggle,
.kzy-mobile-search {
  display: none;
}

@media (max-width: 767px) {
  /* Shrink the brand block just enough to fit the search icon next to Menu. */
  .site-header .site-branding {
    width: calc(100% - 172px);
  }

  #site-navigation .kzy-search-toggle {
    display: inline-flex;
    float: right;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 8px 0 0;
    padding: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    box-shadow: none;
    cursor: pointer;
  }
  #site-navigation .kzy-search-toggle svg {
    display: block;
    width: 18px;
    height: 18px;
  }
  #site-navigation .kzy-search-toggle:hover,
  #site-navigation .kzy-search-toggle:focus {
    background: rgba(255, 255, 255, 0.16);
  }
  #site-navigation .kzy-search-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.22);
    border-color: #ffffff;
  }

  #site-navigation .kzy-mobile-search {
    display: none;
    clear: both;
    background: var(--tw-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  #site-navigation .kzy-mobile-search.is-open {
    display: block;
  }
  #site-navigation .kzy-mobile-search form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.6rem 0;
  }
  #site-navigation .kzy-mobile-search .search-field {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 0.55rem 0.75rem;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.3;
  }
  #site-navigation .kzy-mobile-search .search-field::placeholder {
    color: #94a3b8;
    opacity: 1;
  }
  #site-navigation .kzy-mobile-search-submit {
    flex: 0 0 auto;
    padding: 0.55rem 0.9rem;
    color: #ffffff;
    background: var(--tw-accent);
    border: 1px solid var(--tw-accent);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
  }
  #site-navigation .kzy-mobile-search-submit:hover,
  #site-navigation .kzy-mobile-search-submit:focus {
    background: var(--tw-accent-2);
    border-color: var(--tw-accent-2);
  }
  #site-navigation .kzy-search-close {
    flex: 0 0 auto;
    padding: 0.4rem 0.6rem;
    color: #ffffff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
    box-shadow: none;
  }
  #site-navigation .kzy-search-close:hover,
  #site-navigation .kzy-search-close:focus {
    background: rgba(255, 255, 255, 0.16);
  }
}

/* Task 16: 产品页已售数量 */
p.kzyao-sold{margin:6px 0 12px;font-size:13px;line-height:1.4;color:#475569;}
p.kzyao-sold strong{color:#2563eb;font-size:15px;font-weight:700;}

/* ===== Task 17: Retail / wholesale tiered pricing ===== */
.kzyao-tier-price-wrap { margin: 0 0 1.1em; }
p.kzyao-tier-price { margin: 0 0 2px; line-height: 1.45; }
p.kzyao-tier-retail { font-size: 1.35rem; }
p.kzyao-tier-retail strong { color: var(--tw-accent); font-weight: 800; }
p.kzyao-tier-wholesale { font-size: 0.92rem; color: #475569; }
p.kzyao-tier-wholesale strong { color: var(--tw-dark); font-weight: 700; }
p.kzyao-tier-note { font-size: 0.85rem; color: #64748b; margin: 0 0 14px; }
.kzyao-tier-wholesale-from { display: block; font-size: 0.78rem; font-weight: 500; color: #64748b; margin-top: 2px; line-height: 1.4; }
.kzyao-tier-wholesale-from .woocommerce-Price-amount { color: #64748b; }
.kzyao-tier-loop-retail .woocommerce-Price-amount { color: var(--tw-accent); }
.kzyao-tier-cart-applied { display: inline-block; font-size: 0.78rem; color: #059669; font-weight: 600; margin-left: 4px; }
@media (max-width: 567px) {
  p.kzyao-tier-retail { font-size: 1.15rem; }
  .kzyao-tier-wholesale-from { white-space: normal; }
}

/* ===== Task 37d: header brand logo (real logo replaces the KZYAO wordmark) ===== */
.site-header .site-branding .custom-logo-link {
  display: inline-block;
  line-height: 0;
  margin-bottom: 8px;
}
.site-header .site-branding .custom-logo-link img.custom-logo {
  display: block;
  width: auto;
  height: 44px;
  max-width: 100%;
  border-radius: 0;
}
@media (max-width: 767px) {
  /* The mark is a circle (no optical side bearing like a glyph has), so give
     it the same 16px inset the top bar text uses instead of touching x=0. */
  .site-header .site-branding .custom-logo-link {
    margin-bottom: 0;
    margin-left: 16px;
  }
  .site-header .site-branding .custom-logo-link img.custom-logo {
    height: 30px;
  }
}
/* ===== End Task 37d ===== */
