/*
Theme Name: Nest & Paw
Theme URI: https://nestandpaw.com
Author: Nest & Paw Studio
Author URI: https://nestandpaw.com
Description: A bilingual (EN/中文) Shopify-style storefront theme for home & pet brands. Editorial layout, cart drawer, product quick-add, collection filtering, WooCommerce-ready.
Version: 1.6.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nestandpaw
Tags: e-commerce, bilingual, pets, home, editorial, woocommerce
*/

/* Base styles live in assets/css/main.css (enqueued in functions.php). */

.np-prose {
  max-width: 720px;
  font-size: 16.5px;
  color: var(--ink-2);
}
.np-prose p { margin-bottom: 1.4em; }
.np-prose h2, .np-prose h3 { margin: 1.6em 0 0.6em; }
.np-prose a { color: var(--clay); text-decoration: underline; }
.np-prose img { border-radius: 10px; margin: 1.5em 0; }
.np-prose blockquote {
  border-left: 3px solid var(--clay);
  padding-left: 18px;
  font-family: var(--serif);
  font-size: 19px;
  margin: 1.6em 0;
}

/* Post grid (blog) */
.grid-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2vw, 28px); }
.post-card__media { border-radius: 8px; overflow: hidden; background: var(--sand); }
.post-card__media img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; transition: transform 0.8s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__info { padding: 16px 4px 0; }
.post-card__info h3 { font-size: 21px; margin: 6px 0 8px; }
.post-card__info h3 a:hover { color: var(--clay); }
.post-card__info .muted { font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
@media (max-width: 900px) { .grid-posts { grid-template-columns: 1fr; } }

/* WordPress core + WooCommerce compat */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
body.woocommerce-page .page-head { display: none; }
.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2vw, 26px); margin: 0 !important; }
.woocommerce ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font-family: var(--sans); font-size: 15px; font-weight: 600; padding: 10px 4px 0; }
.woocommerce ul.products li.product .price { color: var(--ink); font-size: 15px; font-weight: 600; }
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce a.button.alt,
.woocommerce button.button.alt {
  background: var(--ink); color: var(--paper); border-radius: 999px;
  padding: 13px 26px; font-weight: 500; transition: 0.25s;
}
.woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--clay-d); color: var(--paper); }
.woocommerce span.onsale {
  background: var(--clay); color: #fff; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 6px 10px; min-width: 0; min-height: 0; line-height: 1.2; top: 12px; left: 12px;
}
.woocommerce-message, .woocommerce-info, .woocommerce-error {
  border-top-color: var(--clay); border-radius: 10px; background: var(--cream);
}
.woocommerce div.product .woocommerce-tabs ul.tabs li { background: var(--cream); border-radius: 999px 999px 0 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li.active { background: var(--paper); }
.woocommerce div.product .woocommerce-tabs ul.tabs::before { border-color: var(--line); }
@media (max-width: 900px) { .woocommerce ul.products { grid-template-columns: repeat(2, 1fr); } }

/* ==========================================================================
   v1.1 — Tactical restyle / product gallery spacing / shipping note
   ========================================================================== */

/* Oswald 没有斜体，em 用正体 + 品牌色 */
.h1 em, .h2 em, .banner__inner .h2 em { font-style: normal; color: var(--clay); }

/* 徽标更硬朗 */
.logo { letter-spacing: 0.14em; }

/* ---------- 商品详情页画廊：四周留白，不顶满 ---------- */
.woocommerce div.product div.images { margin-bottom: 36px; }
.woocommerce div.product div.images .woocommerce-product-gallery__wrapper {
  border-radius: 10px; overflow: hidden; background: var(--white);
  border: 1px solid var(--line);
}
.woocommerce div.product div.images .woocommerce-product-gallery__image { background: var(--white); }
.woocommerce div.product div.images .woocommerce-product-gallery__image img {
  width: 100% !important; height: auto !important;
  object-fit: contain !important;
  padding: clamp(18px, 2.4vw, 34px) !important;
}
.woocommerce div.product div.images .flex-control-thumbs {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px;
}
.woocommerce div.product div.images .flex-control-thumbs li { width: auto; float: none; list-style: none; }
.woocommerce div.product div.images .flex-control-thumbs img {
  border-radius: 6px; background: var(--white); object-fit: cover;
  border: 1px solid var(--line); opacity: 1; transition: border-color 0.2s;
}
.woocommerce div.product div.images .flex-control-thumbs img.flex-active,
.woocommerce div.product div.images .flex-control-thumbs img:hover { border-color: var(--ink); }

/* 商店列表 / 相关商品里的图也留白（自有 .card 的除外，那套已有留白） */
.woocommerce ul.products li.product:not(.card) img {
  object-fit: contain; background: var(--white);
  border: 1px solid var(--line); border-radius: 8px;
  padding: clamp(12px, 1.4vw, 20px);
}

/* ---------- 加购按钮下方的发货提示 ---------- */
.np-ship-note {
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 18px; padding: 14px 16px;
  background: var(--cream); border: 1px dashed var(--clay); border-radius: 8px;
  font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
}
.np-ship-note svg { flex: none; color: var(--clay); margin-top: 2px; }
.np-ship-note strong { color: var(--ink); }

/* 分类只有 2 个时排成两列，避免留空一格 */
.cats:not(:has(.cat:nth-child(3))) { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .cats:not(:has(.cat:nth-child(3))) { grid-template-columns: 1fr; } }

/* ---------- 商品页：现货提示 + 信任徽章（参考 Doggykingdom） ---------- */
.np-stock {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 0 4px; font-size: 13.5px; font-weight: 600; color: var(--clay);
}
.np-stock__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--clay);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--clay) 18%, transparent);
}
.np-trust { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.np-trust span {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
  background: var(--cream); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px;
}
.np-trust svg { color: var(--clay); flex: none; }

/* 商品页区块不与浮动图重叠 */
.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .related.products { clear: both; }

/* 支付图标行（参考 Doggykingdom） */
.np-pay-row { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.np-pay-row svg { height: 26px; width: auto; background: var(--white); border-radius: 4px; padding: 3px 5px; border: 1px solid var(--line); }

/* 底部吸底加购栏 */
.np-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 96;
  background: var(--ink); color: var(--paper);
  transform: translateY(110%); transition: transform 0.35s var(--ease);
  box-shadow: 0 -10px 34px rgba(32, 36, 27, 0.22);
}
body.np-bar-show .np-bar { transform: none; }
.np-bar__inner {
  max-width: var(--container); margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex; align-items: center; gap: 16px;
}
.np-bar__img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--white); flex: none; }
.np-bar__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.np-bar__title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-bar__price { font-size: 16px; font-weight: 700; color: #f7b500; }
.np-bar__btn {
  flex: none; background: #f7b500; color: #20241b;
  border-radius: 999px; padding: 13px 28px;
  font-size: 14px; font-weight: 700; letter-spacing: 0.03em;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.np-bar__btn:hover { background: #ffc02e; transform: translateY(-1px); }
@media (max-width: 560px) {
  .np-bar__img { display: none; }
  .np-bar__btn { padding: 12px 20px; }
}

/* 首页生日俱乐部表单 */
.news form#npBirthdayForm { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.news form#npBirthdayForm input[type="email"],
.news form#npBirthdayForm input[type="date"] {
  flex: 1; min-width: 180px; padding: 15px 22px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); font-size: 14px;
}
.news form#npBirthdayForm input:focus { outline: none; border-color: var(--ink); }
.news form#npBirthdayForm .btn { flex: none; }
.np-form-msg { margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--clay); min-height: 1em; }

/* 商品详情图区（描述下方 7 张细节图） */
.np-detail {
  max-width: 880px; margin: 70px auto 30px;
  padding: 0 var(--gutter);
  display: flex; flex-direction: column; align-items: center;
}
.np-detail .eyebrow { margin-bottom: 6px; }
.np-detail .h2 { text-align: center; margin-bottom: 30px; }
.np-detail img {
  width: 100%; max-width: 760px;
  border-radius: 14px; margin-bottom: 26px;
  background: var(--white); border: 1px solid var(--line);
  box-shadow: 0 10px 30px -18px rgba(32, 36, 27, 0.18);
}

/* 详情图可点击放大 */
.np-detail__item {
  display: block; width: 100%; max-width: 760px; padding: 0; margin: 0 0 26px;
  border: 0; background: none; cursor: zoom-in;
}
.np-detail__item img {
  width: 100%; margin: 0; border-radius: 14px;
  background: var(--white); border: 1px solid var(--line);
  box-shadow: 0 10px 30px -18px rgba(32, 36, 27, 0.18);
  transition: transform 0.25s var(--ease);
}
.np-detail__item:hover img { transform: translateY(-2px); }
.np-lightbox {
  position: fixed; inset: 0; z-index: 999; display: none;
  align-items: center; justify-content: center;
  background: rgba(20, 23, 18, 0.92); padding: 40px 20px;
}
.np-lightbox.is-open { display: flex; }
.np-lightbox img { max-width: 94vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.np-lightbox__close {
  position: absolute; top: 18px; right: 24px; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,0.14);
  color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}
.np-lightbox__close:hover { background: rgba(255,255,255,0.26); }
body.np-lb-open { overflow: hidden; }

/* ===== 商品页右侧架构（参考 Doggykingdom） ===== */
/* NEW + 奖杯行 */
.np-award { font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; margin: 10px 0 0; color: var(--ink); }
/* 价格行黄标 */
.single-product .price { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.single-product .price del { color: var(--muted); font-size: 18px; font-weight: 500; }
.single-product .price ins { text-decoration: none; font-size: 28px; font-weight: 800; color: var(--ink); }
.np-sale-tag, .np-off-tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: #f7b500; color: #20241b; font-size: 12.5px; font-weight: 800; letter-spacing: 0.04em;
}
/* Size Guide 链接 */
.np-size-guide-link {
  display: inline-block; margin-top: 10px; padding: 0; border: 0; background: none;
  color: var(--clay); font-size: 14px; font-weight: 700; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.np-size-guide-link:hover { color: var(--ink); }
/* 颜色/尺码色块 */
.np-swatches { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.np-swatches__row { display: flex; flex-direction: column; gap: 8px; }
.np-swatches__name { font-size: 14px; font-weight: 700; color: var(--ink); }
.np-swatches__group { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.np-swatch {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 2px solid var(--line); transition: transform 0.15s var(--ease), box-shadow 0.15s;
}
.np-swatch.is-active {
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); transform: scale(1.05);
}
.np-swatch--camo {
  background:
    radial-gradient(circle at 30% 30%, #6d7a45 0 22%, transparent 23%),
    radial-gradient(circle at 70% 55%, #4a5530 0 26%, transparent 27%),
    radial-gradient(circle at 45% 75%, #8a8a5a 0 20%, transparent 21%),
    #a49b6a;
}
.np-swatches__group--size .np-size-btn,
.np-swatches__group--size button {
  min-width: 52px; padding: 11px 16px; border-radius: 10px; cursor: pointer;
  border: 1.6px solid var(--line); background: var(--paper);
  font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: 0.02em;
  transition: all 0.15s var(--ease);
}
.np-swatches__group--size button.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.np-swatches__group--size button:hover:not(.is-active) { border-color: var(--ink); }
/* 黄色大加购按钮 */
.woocommerce div.product form.cart .single_add_to_cart_button {
  width: 100%; background: #f7b500; color: #20241b;
  border: 0; border-radius: 999px; padding: 16px 30px;
  font-size: 15.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  cursor: pointer; transition: background 0.2s, transform 0.15s var(--ease);
}
.woocommerce div.product form.cart .single_add_to_cart_button:hover:not(:disabled) {
  background: #ffc02e; transform: translateY(-1px);
}
.woocommerce div.product form.cart .single_add_to_cart_button:disabled { opacity: 0.45; cursor: not-allowed; }
.woocommerce div.product form.cart .quantity { margin-bottom: 12px; }
/* 隐藏变体表单多余元素 */
.woocommerce div.product form.cart .reset_variations { display: none !important; }
.woocommerce-variation-price, .woocommerce-variation-availability { display: none !important; }
.woocommerce div.product form.cart .variations { margin-bottom: 0; }
/* 2×2 信任徽章网格 */
.np-trust {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 16px;
}
.np-trust span {
  display: flex; align-items: center; gap: 9px; justify-content: center;
  padding: 11px 10px; border-radius: 10px;
  background: var(--paper); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
/* Size Guide 弹窗 */
.np-modal {
  position: fixed; inset: 0; z-index: 999; display: none;
  align-items: center; justify-content: center;
  background: rgba(20, 23, 18, 0.86); padding: 24px;
}
.np-modal.is-open { display: flex; }
.np-modal__card {
  position: relative; background: var(--white); border-radius: 16px;
  max-width: 720px; width: 100%; max-height: 84vh; overflow: auto;
  padding: 34px 34px 30px;
}
.np-modal__card h3 { font-family: var(--head); font-size: 22px; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.02em; }
.np-modal__close {
  position: absolute; top: 14px; right: 16px; width: 40px; height: 40px;
  border: 0; border-radius: 50%; background: var(--sand);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.np-modal__close:hover { background: var(--line); }
.np-modal__body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.np-modal__body th, .np-modal__body td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.np-modal__body th { background: var(--sand); font-weight: 700; }
@media (max-width: 560px) {
  .np-trust { grid-template-columns: 1fr 1fr; }
  .np-modal__card { padding: 26px 20px; }
}


/* ===== 商品页双列：纯 CSS grid 覆盖 WooCommerce float 布局 ===== */
@media (min-width: 901px) {
  .single-product div.product {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(0, 48%) minmax(0, 1fr);
    column-gap: 46px;
    align-items: start;
  }
  /* 促销角标脱离文档流，不占 grid 单元格 */
  .single-product div.product > span.onsale { position: absolute; top: 14px; left: 14px; z-index: 3; }
  /* 左图：取消 float，改为 sticky 钉住 */
  .single-product div.product > div.images {
    grid-column: 1; float: none !important; width: auto !important;
    position: sticky; top: 96px; margin-bottom: 0;
  }
  /* 右列信息：白底干净，取消 float / 旧卡片样式 */
  .single-product div.product > div.summary {
    grid-column: 2; float: none !important; width: auto !important;
    position: static; background: none; border-radius: 0; padding: 0;
  }
  /* 下方整宽区块 */
  .single-product div.product > div.woocommerce-tabs,
  .single-product div.product > .np-detail,
  .single-product div.product > section.related,
  .single-product div.product > .related.products,
  .single-product div.product > .upsells.products,
  .single-product div.product > .woocommerce-notices-wrapper { grid-column: 1 / -1; }
}
/* 详情区永远在上层，杜绝任何浮层遮挡 */
.np-detail { position: relative; z-index: 4; background: var(--paper); padding-top: 10px; }

/* ===== 商品画廊：1 张大主图 + 4 列缩略图网格（参考站布局） ===== */
.np-gallery__stage {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 14px;
}
.np-gallery__main {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 10px;
  background: var(--white);
}
.np-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.np-gallery__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.np-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.np-gallery__thumb:hover { border-color: var(--ink-2); }
.np-gallery__thumb.is-active {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
@media (max-width: 560px) {
  .np-gallery__thumbs { gap: 8px; }
  .np-gallery__stage { padding: 8px; }
}

/* 详情页保持干净：价格旁已有 SALE 徽章，图片上不再重复挂角标 */
.single-product div.product > span.onsale { display: none; }

/* ==========================================================================
   v1.6.1 — 商品页「清爽 · 干净 · 高级感」精简
   ========================================================================== */

/* 标题：大而安静 */
.single-product div.product div.summary .product_title {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.25; letter-spacing: 0.01em; margin-bottom: 10px;
}

/* 价格：划线价浅灰、现价大字、一枚安静的折扣胶囊 */
.single-product div.product .price { margin: 0 0 2px; gap: 12px; }
.single-product div.product .price del { font-size: 15px; font-weight: 500; color: var(--muted); }
.single-product div.product .price ins { font-size: 25px; font-weight: 700; color: var(--ink); }
.np-off-tag {
  background: var(--cream); color: var(--clay-d);
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em;
  padding: 5px 12px; border-radius: 999px;
}
.np-sale-tag { display: none; }

/* 发货提示：去掉虚线框，一行浅色小字 */
.np-ship-note {
  display: flex; align-items: center; gap: 9px;
  background: none; border: 0; padding: 0; margin: 14px 0 0;
  color: var(--muted); font-size: 13.5px; line-height: 1.5;
}
.np-ship-note svg { color: var(--sage); margin-top: 0; }
.np-ship-note strong { color: var(--ink-2); font-weight: 600; }

/* 信任徽章：一行细字 + 细分隔线，去掉胶囊底 */
.np-trust {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.np-trust span {
  padding: 0; background: none; border: 0; border-radius: 0;
  font-size: 13px; font-weight: 500; color: var(--muted);
}
.np-trust svg { color: var(--sage); }

/* 支付图标：小而收敛 */
.np-pay-row { margin-top: 12px; gap: 8px; }
.np-pay-row svg { height: 24px; opacity: 0.92; }

/* 隐藏杂项：SKU/分类 meta、现货绿点行（信息已并入发货行） */
.single-product div.product .product_meta { display: none; }
.np-stock { display: none; }

/* 选项与表单的呼吸感 */
.np-swatches { margin: 22px 0 14px; }
.woocommerce div.product form.cart { margin-top: 20px; }
.np-size-guide-link { color: var(--ink-2); }
.np-size-guide-link:hover { color: var(--ink); }

/* Tabs：干净的底线式页签，去掉圆角胶囊 */
.woocommerce div.product .woocommerce-tabs { margin-top: 56px; }
.woocommerce div.product .woocommerce-tabs ul.tabs::before { border: 0; }
.woocommerce div.product .woocommerce-tabs ul.tabs li {
  background: none; border: 0; border-radius: 0;
  padding: 0 0 10px; margin: 0 28px 0 0;
  font-family: var(--serif); font-size: 15px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active {
  background: none; color: var(--ink); border-bottom: 2px solid var(--ink);
}
.woocommerce div.product .woocommerce-tabs .panel {
  padding: 24px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.75;
  max-width: 820px;
}
.woocommerce div.product .woocommerce-tabs .panel table { max-width: 680px; margin: 16px 0; }

/* 详情图区：杂志式窄栏 */
.np-detail { max-width: 820px; margin: 64px auto 10px; }
.np-detail .eyebrow { display: none; }
.np-detail .h2 { font-size: clamp(20px, 2.6vw, 26px); margin-bottom: 28px; }
.np-detail__item img { max-width: 680px; }
