/*
Theme Name: dogids-clone
Theme URI: http://dogidsu.shop
Author: dogIDs
Description: 1:1 复刻 dogids.com 的 WooCommerce 主题
Version: 1.0.4
Text Domain: dogids-clone
*/

/* ============================================================
   DESIGN TOKENS (取自 dogids.com 实测计算样式)
   正文 #4E3328 / 标题 #856445 / 主按钮 #E07E3C / 页脚 #F5F5F5
   字体 Cabin
   ============================================================ */
:root {
    --dg-text: #4E3328;
    --dg-heading: #856445;
    --dg-primary: #E07E3C;
    --dg-primary-hover: #C96A2C;
    --dg-footer-bg: #F5F5F5;
    --dg-border: #DDDDDD;
    --dg-muted: #777777;
    --dg-white: #FFFFFF;
    --dg-container: 1200px;
    --dg-font: 'Cabin', Arial, Helvetica, sans-serif;
}

/* ============================================================
   RESET
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--dg-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--dg-text);
    background-color: var(--dg-white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--dg-font);
    color: var(--dg-heading);
    margin: 0 0 12px;
    line-height: 1.25;
}

h1 { font-size: 30px; font-weight: 700; }
h2 { font-size: 24px; font-weight: 700; line-height: 30px; text-transform: uppercase; text-align: center; margin-top: 18px; margin-bottom: 30px; }
h3 { font-size: 14px; font-weight: 400; line-height: 21px; margin-bottom: 6px; }
h4 { font-size: 16px; font-weight: 700; }

p { margin: 0 0 12px; }

a {
    color: var(--dg-heading);
    text-decoration: none;
    transition: color .15s ease;
}
a:hover { color: var(--dg-primary); }

img { max-width: 100%; height: auto; display: block; border: 0; }

ul, ol { margin: 0 0 12px; padding-left: 20px; }

button, input, select, textarea {
    font-family: var(--dg-font);
    font-size: 16px;
    color: var(--dg-text);
}

.container {
    width: 100%;
    max-width: var(--dg-container);
    margin: 0 auto;
    padding: 0 15px;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.header {
    background-color: var(--dg-white);
    box-shadow: 0 0 5px 2px #DDDDDD;
    position: relative;
    z-index: 50;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
}

.header-logo {
    display: block;
    flex: 0 0 auto;
    margin: 0;
    font-weight: 700;
}
.header-logo img { height: 60px; width: auto; }
.header-logo-text {
    font-size: 26px;
    font-weight: 700;
    color: var(--dg-heading);
    letter-spacing: -.5px;
}

/* 搜索 */
.header-search {
    flex: 1 1 auto;
    max-width: 520px;
    position: relative;
}
.header-search form {
    display: flex;
    border: 1px solid var(--dg-border);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}
.header-search input[type="search"],
.header-search input[type="text"] {
    flex: 1 1 auto;
    border: 0;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    min-width: 0;
}
.header-search button {
    flex: 0 0 auto;
    border: 0;
    background: var(--dg-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0 20px;
    cursor: pointer;
    letter-spacing: .5px;
}
.header-search button:hover { background: var(--dg-primary-hover); }

/* 右侧工具 */
.header-utils {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 0 0 auto;
}
.header-cart-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--dg-heading);
}
.header-cart-link svg { width: 26px; height: 26px; fill: var(--dg-heading); }
.cart-count-badge {
    position: absolute;
    top: -6px;
    right: -12px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--dg-primary);
    color: #fff;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    font-weight: 700;
}

/* 导航 */
.navPages {
    border-top: 1px solid var(--dg-border);
    background: #fff;
}
.navPages-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}
.navPages-list > li { position: relative; }
.navPages-action {
    display: block;
    font-size: 15px;
    font-weight: 700;
    line-height: 21px;
    color: var(--dg-heading);
    padding: 12px 14px;
}
.navPages-action:hover,
.navPages-list > li.current-menu-item > .navPages-action { color: var(--dg-primary); }

.navPages-list .sub-menu,
.navPages-list .children {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 60;
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--dg-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
}
.navPages-list li:hover > .sub-menu,
.navPages-list li:hover > .children { display: block; }
.navPages-list .sub-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--dg-text);
}
.navPages-list .sub-menu a:hover { background: #FAF7F4; color: var(--dg-primary); }

/* ============================================================
   HERO
   ============================================================ */
.heroCarousel {
    position: relative;
    min-width: 100%;
    padding-bottom: 40px;
    overflow: hidden;
}
.heroCarousel-slide { position: relative; display: block; min-height: 1px; }
.heroCarousel-slide img { width: 100%; }
.heroCarousel-content {
    position: absolute;
    left: 6%;
    top: 50%;
    transform: translateY(-50%);
    max-width: 520px;
}
.heroCarousel-title {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--dg-heading);
    margin: 0 0 14px;
}
.heroCarousel-slide--dark .heroCarousel-title { color: #fff; }
.heroCarousel-action {
    display: inline-block;
    background: var(--dg-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 28px;
    border-radius: 4px;
    letter-spacing: .5px;
}
.heroCarousel-action:hover { background: var(--dg-primary-hover); color: #fff; }

/* ============================================================
   BUTTONS
   ============================================================ */
.button,
.button--primary,
.dg-btn,
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
    display: inline-block;
    background: var(--dg-primary);
    color: #fff;
    border: 0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    line-height: 21px;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 12px 26px;
    cursor: pointer;
    text-align: center;
    transition: background .15s ease;
}
.button:hover,
.button--primary:hover,
.dg-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
    background: var(--dg-primary-hover);
    color: #fff;
}
.button--secondary,
.woocommerce #respond input#submit.alt,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt {
    background: var(--dg-heading);
}
.button--secondary:hover { background: #6E5040; }

/* ============================================================
   面包屑
   ============================================================ */
.breadcrumbs {
    font-size: 13px;
    color: var(--dg-muted);
    padding: 14px 0;
}
.breadcrumbs ol,
.breadcrumbs ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; color: var(--dg-border); margin-right: 2px; }
.breadcrumbs a { color: var(--dg-muted); }
.breadcrumbs a:hover { color: var(--dg-primary); }

/* ============================================================
   商品网格 / 卡片
   ============================================================ */
.productGrid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px 20px;
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}
@media (max-width: 991px) { .productGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .productGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card {
    position: relative;
    background: #fff;
    text-align: center;
}
.card-figure {
    position: relative;
    display: block;
    overflow: hidden;
    margin: 0 0 10px;
    background: #FAFAFA;
}
.card-image {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform .25s ease;
}
.card:hover .card-image { transform: scale(1.04); }
.card-title {
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    color: var(--dg-heading);
    margin: 0 0 6px;
    min-height: 42px;
}
.card-title a { color: var(--dg-heading); }
.card-title a:hover { color: var(--dg-primary); }
.card-text--brand { font-size: 12px; color: var(--dg-muted); margin: 0 0 4px; }
.card-price { font-size: 15px; font-weight: 700; color: var(--dg-text); }
.card-price del { font-weight: 400; color: var(--dg-muted); margin-right: 6px; }
.card-price ins { text-decoration: none; color: var(--dg-primary); }
.card .onsale,
.woocommerce span.onsale {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: var(--dg-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 3px;
    min-height: 0;
    line-height: 1.4;
}

/* 商品轮播（首页） */
.productCarousel { position: relative; margin: 0 0 40px; }
.productCarousel-heading {
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    color: var(--dg-heading);
    margin: 18px 0 24px;
}
.productCarousel-track {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 20px;
}
@media (max-width: 991px) { .productCarousel-track { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .productCarousel-track { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ============================================================
   分类页
   ============================================================ */
.page-heading {
    font-size: 28px;
    font-weight: 700;
    color: var(--dg-heading);
    margin: 6px 0 20px;
    text-transform: uppercase;
}
.category-description {
    font-size: 14px;
    line-height: 22px;
    color: var(--dg-text);
    margin-bottom: 24px;
}

/* ============================================================
   商品详情页 PDP
   ============================================================ */
.productView {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    margin: 20px 0 50px;
}
@media (max-width: 800px) { .productView { grid-template-columns: 1fr; } }

.productView-images { position: relative; }
.productView-image--main {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #FAFAFA;
    border: 1px solid var(--dg-border);
}
.productView-thumbnails {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 10px;
}
.productView-thumbnail {
    border: 1px solid var(--dg-border);
    cursor: pointer;
    padding: 0;
    background: #fff;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.productView-thumbnail.is-active { border-color: var(--dg-primary); }
.productView-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.productView-details { min-width: 0; }
.productView-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dg-heading);
    margin: 0 0 10px;
}
.productView-brand,
.productView-sku {
    font-size: 13px;
    color: var(--dg-muted);
    margin: 0 0 6px;
}
.productView-price {
    font-size: 26px;
    font-weight: 700;
    color: var(--dg-primary);
    margin: 10px 0 18px;
}
.productView-price del { font-size: 18px; font-weight: 400; color: var(--dg-muted); margin-right: 8px; }
.productView-price ins { text-decoration: none; }
.productView-rating { font-size: 13px; color: var(--dg-muted); margin-bottom: 10px; }

/* 选项字段集 */
.form-field {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
}
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--dg-heading);
    margin-bottom: 8px;
}
.form-label small { color: #C0392B; font-weight: 700; }
.form-label--inlineSmall { display: inline-block; margin-right: 8px; }

.form-option-group { display: flex; flex-wrap: wrap; gap: 8px; }
.form-option {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin: 0;
}
.form-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.form-option-variant {
    display: inline-block;
    border: 1px solid var(--dg-border);
    border-radius: 4px;
    padding: 8px 14px;
    font-size: 14px;
    line-height: 20px;
    color: var(--dg-text);
    background: #fff;
    min-width: 44px;
    text-align: center;
    transition: all .12s ease;
}
.form-option input:checked + .form-option-variant,
.form-option.is-selected .form-option-variant {
    border-color: var(--dg-primary);
    background: var(--dg-primary);
    color: #fff;
    font-weight: 700;
}
.form-option:hover .form-option-variant { border-color: var(--dg-primary); }

/* 色板 swatch */
.form-option-swatch .form-option-variant {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    text-indent: -9999px;
    overflow: hidden;
    box-shadow: inset 0 0 0 2px #fff;
}
.form-option-swatch input:checked + .form-option-variant {
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--dg-primary);
    background-color: inherit !important;
}
.form-option-swatch .form-option-variant[title] { position: relative; }

/* 下拉 */
.form-select {
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 1px solid var(--dg-border);
    border-radius: 4px;
    background: #fff;
    font-size: 15px;
}

/* 文本输入（刻字） */
.form-input {
    width: 100%;
    max-width: 360px;
    padding: 10px 12px;
    border: 1px solid var(--dg-border);
    border-radius: 4px;
    font-size: 15px;
}
.form-input:focus { outline: none; border-color: var(--dg-primary); }
.form-field--text .form-label { font-size: 13px; }

/* 数量 + 加购 */
.productView-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 14px;
    flex-wrap: wrap;
}
.quantity input.qty {
    width: 64px;
    padding: 11px 8px;
    border: 1px solid var(--dg-border);
    border-radius: 4px;
    text-align: center;
    font-size: 15px;
}
.productView-addToCart { min-width: 220px; padding: 14px 30px; font-size: 15px; }
.productView-stock { font-size: 13px; color: #2E7D32; margin-top: 6px; }

/* 选项摘要（购物车/订单显示） */
.dg-cart-opts { font-size: 12px; line-height: 18px; color: var(--dg-muted); margin: 4px 0 0; }
.dg-cart-opts span { display: block; }

/* ============================================================
   TABS (DESCRIPTION / VIDEOS)
   ============================================================ */
.productView-tabs { margin: 0 0 40px; }
.productView-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--dg-border);
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}
.productView-tabs-nav li { margin: 0; }
.productView-tabs-nav a {
    display: block;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--dg-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}
.productView-tabs-nav a.is-active,
.productView-tabs-nav a:hover { color: var(--dg-primary); border-bottom-color: var(--dg-primary); }
.productView-tabs-panel { display: none; font-size: 15px; line-height: 24px; }
.productView-tabs-panel.is-active { display: block; }
.productView-tabs-panel h2,
.productView-tabs-panel h3 { text-align: left; text-transform: none; margin-top: 18px; }
.productView-tabs-panel img { max-width: 100%; height: auto; }
.productView-tabs-panel iframe { max-width: 100%; }
.dogids-video { position: relative; max-width: 560px; margin: 16px 0; aspect-ratio: 16 / 9; }
.dogids-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ============================================================
   相关 / FBT
   ============================================================ */
.productView-alsoBought { margin: 40px 0; }
.productView-alsoBought .productGrid,
.productView-related .productGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ============================================================
   分类页布局：子分类边栏 + 商品网格（WC 默认 ul.products）
   ============================================================ */
.cat-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
.cat-layout--full { grid-template-columns: minmax(0, 1fr); }
.cat-sidebar-list { list-style: none; margin: 0; padding: 0; }
.cat-sidebar-list li { margin: 0 0 2px; }
.cat-sidebar-list a {
    display: block; padding: 7px 10px; font-size: 15px;
    color: var(--dg-text); text-decoration: none; border-radius: 3px;
}
.cat-sidebar-list a:hover { background: #F7F3EF; color: var(--dg-accent); }

ul.products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px 20px;
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}
@media (max-width: 991px) { ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { ul.products { grid-template-columns: minmax(0, 1fr); } }
ul.products li.card {
    position: relative;
    background: #fff;
    border: 1px solid var(--dg-border);
    border-radius: 4px;
    padding: 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}
ul.products li.card .card-figure {
    display: block; width: 100%; margin: 0 0 10px; position: relative;
}
ul.products li.card .card-image {
    width: 100%; max-width: 260px; height: auto; object-fit: contain;
}
ul.products li.card .card-title {
    font-size: 15px; font-weight: 600; margin: 4px 0 6px; line-height: 1.35;
}
ul.products li.card .card-title a { color: var(--dg-accent); text-decoration: none; }
ul.products li.card .card-title a:hover { text-decoration: underline; }
ul.products li.card .card-price { font-size: 15px; color: var(--dg-heading); margin: 0 0 10px; }
ul.products li.card .button { margin-top: auto; }
ul.products li.card .onsale {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    background: var(--dg-accent); color: #fff; font-size: 12px;
    padding: 2px 8px; border-radius: 2px;
}

.bc-sep { color: #B08A5F; padding: 0 2px; }

/* ============================================================
   首页居中标题段
   ============================================================ */
.dg-homeintro { text-align: center; max-width: 860px; margin: 44px auto 8px; }
.dg-homeintro h2 {
    color: var(--dg-heading); font-size: 30px; font-weight: 700;
    text-transform: none; letter-spacing: 0; line-height: 1.3;
}
.dg-homeintro-tag { margin-top: 22px; font-size: 15px; color: var(--dg-heading); }
.dg-homeintro p:last-child { font-size: 15px; color: var(--dg-text); margin-bottom: 26px; }

/* ============================================================
   页脚（甲方要求：4 个纯文字政策页，无社交图标）
   ============================================================ */
.footer {
    background-color: var(--dg-footer-bg);
    border-top: 1px solid var(--dg-border);
    padding: 34px 0 20px;
    margin-top: 50px;
}
.footer-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 26px;
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
}
.footer-info a {
    font-size: 14px;
    color: var(--dg-text);
}
.footer-info a:hover { color: var(--dg-primary); text-decoration: underline; }
.footer-copyright {
    font-size: 13px;
    color: var(--dg-muted);
    text-align: center;
    margin: 0;
}

/* ============================================================
   政策页正文
   ============================================================ */
.policy-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 0 60px;
    font-size: 15px;
    line-height: 25px;
}
.policy-content h1,
.policy-content h2 { text-align: left; text-transform: none; }
.policy-content h2 { font-size: 20px; margin-top: 26px; }
.policy-content ul { margin-bottom: 16px; }

/* ============================================================
   购物车 / 结账 基础兼容
   ============================================================ */
.woocommerce-cart-form,
.woocommerce-checkout { font-size: 15px; }
.woocommerce table.shop_table th,
.woocommerce table.shop_table td { padding: 12px 10px; }
.woocommerce .quantity input.qty { width: 64px; }
.woocommerce-message,
.woocommerce-info { border-top-color: var(--dg-primary); }
.woocommerce-message::before,
.woocommerce-info::before { color: var(--dg-primary); }
.woocommerce-error { border-top-color: #C0392B; }

/* 分页 */
.woocommerce-pagination ul.page-numbers {
    display: flex;
    gap: 6px;
    list-style: none;
    justify-content: center;
    margin: 30px 0;
    padding: 0;
}
.woocommerce-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--dg-border);
    border-radius: 4px;
    font-size: 14px;
}
.woocommerce-pagination .page-numbers.current { background: var(--dg-primary); border-color: var(--dg-primary); color: #fff; }

/* 移动端菜单按钮 */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--dg-border);
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--dg-heading);
    cursor: pointer;
}
@media (max-width: 800px) {
    .header-main { flex-wrap: wrap; }
    .header-search { order: 3; max-width: 100%; flex-basis: 100%; }
    .nav-toggle { display: inline-block; }
    .navPages-list { display: none; flex-direction: column; }
    .navPages-list.is-open { display: flex; }
    .navPages-list .sub-menu,
    .navPages-list .children { position: static; box-shadow: none; border: 0; padding-left: 12px; }
}
