/*
Theme Name: Petopia
Theme URI: https://example.com/themes/petopia
Author: WorkBuddy
Author URI: https://www.workbuddy.cn
Description: A WooCommerce theme for pet stores, with a warm storefront home page, product cards, category navigation, cart and account styles, mobile support, and theme options.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: petopia
Tags: woocommerce, e-commerce, pet, store, custom-menu, responsive-layout, theme-options
*/

/* --------------------------------------------------------------------------
   1. Design tokens and base reset
   -------------------------------------------------------------------------- */
:root {
    --pet-primary: #f2704a;
    --pet-primary-dark: #d9542f;
    --pet-secondary: #2f9e93;
    --pet-secondary-dark: #23786f;
    --pet-ink: #2d2a32;
    --pet-muted: #77717f;
    --pet-line: #ece6e1;
    --pet-surface: #ffffff;
    --pet-surface-soft: #fff8f3;
    --pet-surface-warm: #fdf1e8;
    --pet-success: #2f9e64;
    --pet-radius: 16px;
    --pet-radius-sm: 10px;
    --pet-shadow: 0 14px 40px rgba(45, 42, 50, 0.08);
    --pet-shadow-sm: 0 4px 16px rgba(45, 42, 50, 0.07);
    --pet-container: 1200px;
    --pet-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--pet-font);
    font-size: 16px;
    line-height: 1.7;
    color: var(--pet-ink);
    background: var(--pet-surface);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--pet-primary-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--pet-primary);
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.6em;
    line-height: 1.25;
    font-weight: 700;
}

p {
    margin: 0 0 1.2em;
}

ul {
    margin: 0 0 1.2em;
    padding-left: 1.2em;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 99999;
    padding: 10px 16px;
    background: var(--pet-ink);
    color: #fff;
    border-radius: 0 0 8px 0;
}

.skip-link:focus {
    left: 0;
    color: #fff;
}

/* --------------------------------------------------------------------------
   2. Layout helpers
   -------------------------------------------------------------------------- */
.pet-container {
    width: min(100% - 40px, var(--pet-container));
    margin-inline: auto;
}

.pet-section {
    padding: 88px 0;
}

.pet-section--soft {
    background: var(--pet-surface-soft);
}

.pet-section--warm {
    background: var(--pet-surface-warm);
}

.pet-section-head {
    max-width: 640px;
    margin: 0 auto 48px;
    text-align: center;
}

.pet-section-head .pet-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--pet-secondary);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pet-section-head h2 {
    font-size: clamp(28px, 4vw, 40px);
}

.pet-section-head p {
    color: var(--pet-muted);
    margin-bottom: 0;
}

.pet-button,
button.pet-button,
a.pet-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: var(--pet-primary);
    color: #fff;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.pet-button:hover,
button.pet-button:hover,
a.pet-button:hover {
    background: var(--pet-primary-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(242, 112, 74, 0.28);
}

.pet-button--ghost {
    background: transparent;
    border: 2px solid var(--pet-primary);
    color: var(--pet-primary-dark);
}

.pet-button--ghost:hover {
    background: var(--pet-primary);
    color: #fff;
}

.pet-button--small {
    min-height: 40px;
    padding: 0 18px;
    font-size: 14px;
}

.pet-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

/* --------------------------------------------------------------------------
   3. Header and navigation
   -------------------------------------------------------------------------- */
.pet-site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--pet-line);
}

.pet-header-inner {
    display: flex;
    align-items: center;
    gap: 28px;
    min-height: 78px;
}

.pet-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--pet-ink);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.pet-brand:hover {
    color: var(--pet-ink);
}

.pet-brand__mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--pet-primary);
    color: #fff;
}

.pet-brand__mark .pet-icon {
    width: 24px;
    height: 24px;
}

.pet-main-nav {
    margin-left: auto;
}

.pet-main-nav ul {
    display: flex;
    align-items: center;
    gap: 26px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pet-main-nav a {
    color: var(--pet-ink);
    font-size: 15px;
    font-weight: 600;
}

.pet-main-nav a:hover,
.pet-main-nav .current-menu-item > a {
    color: var(--pet-primary);
}

.pet-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.pet-header-icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--pet-line);
    color: var(--pet-ink);
    background: #fff;
}

.pet-header-icon:hover {
    border-color: var(--pet-primary);
    color: var(--pet-primary);
}

.pet-cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--pet-secondary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.pet-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--pet-line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.pet-menu-toggle span,
.pet-menu-toggle span::before,
.pet-menu-toggle span::after {
    display: block;
    width: 20px;
    height: 2px;
    margin-inline: auto;
    background: var(--pet-ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.pet-menu-toggle span::before,
.pet-menu-toggle span::after {
    content: "";
    position: relative;
    top: -6px;
}

.pet-menu-toggle span::after {
    top: 4px;
}

.pet-menu-toggle[aria-expanded="true"] span {
    background: transparent;
}

.pet-menu-toggle[aria-expanded="true"] span::before {
    top: 0;
    transform: translateY(1px) rotate(45deg);
}

.pet-menu-toggle[aria-expanded="true"] span::after {
    top: -2px;
    transform: translateY(-1px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   4. Home hero
   -------------------------------------------------------------------------- */
.pet-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fff8f3 0%, #fff1e6 100%);
}

.pet-hero::after {
    content: "";
    position: absolute;
    right: -120px;
    bottom: -180px;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    background: rgba(47, 158, 147, 0.08);
}

.pet-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 56px;
    padding: 86px 0 92px;
}

.pet-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--pet-secondary-dark);
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--pet-shadow-sm);
}

.pet-hero__badge .pet-icon {
    width: 16px;
    height: 16px;
}

.pet-hero h1 {
    margin: 22px 0 18px;
    font-size: clamp(38px, 5.6vw, 62px);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.pet-hero h1 em {
    font-style: normal;
    color: var(--pet-primary);
}

.pet-hero__lead {
    max-width: 520px;
    color: var(--pet-muted);
    font-size: 18px;
}

.pet-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.pet-hero__trust {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 38px;
    padding: 0;
    list-style: none;
    color: var(--pet-muted);
    font-size: 14px;
}

.pet-hero__trust li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pet-hero__trust .pet-icon {
    width: 18px;
    height: 18px;
    color: var(--pet-secondary);
}

.pet-hero__art {
    position: relative;
}

.pet-hero__art img {
    width: 100%;
    border-radius: 32px;
    box-shadow: var(--pet-shadow);
}

.pet-hero__float {
    position: absolute;
    left: -28px;
    bottom: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--pet-shadow);
}

.pet-hero__float strong {
    display: block;
    font-size: 20px;
    line-height: 1.2;
    color: var(--pet-primary-dark);
}

.pet-hero__float span {
    font-size: 13px;
    color: var(--pet-muted);
}

/* --------------------------------------------------------------------------
   5. Home sections: categories, products, features, testimonials, CTA
   -------------------------------------------------------------------------- */
.pet-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.pet-category-card {
    position: relative;
    display: block;
    padding: 28px 24px;
    border-radius: var(--pet-radius);
    background: #fff;
    border: 1px solid var(--pet-line);
    box-shadow: var(--pet-shadow-sm);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.pet-category-card:hover {
    transform: translateY(-6px);
    border-color: transparent;
    box-shadow: var(--pet-shadow);
}

.pet-category-card__icon {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin-bottom: 22px;
    border-radius: 20px;
    background: var(--pet-surface-warm);
    color: var(--pet-primary);
}

.pet-category-card__icon .pet-icon {
    width: 34px;
    height: 34px;
}

.pet-category-card:nth-child(2) .pet-category-card__icon {
    background: #e8f6f4;
    color: var(--pet-secondary);
}

.pet-category-card:nth-child(3) .pet-category-card__icon {
    background: #eef1fb;
    color: #6b72c9;
}

.pet-category-card:nth-child(4) .pet-category-card__icon {
    background: #fff4d9;
    color: #c98a15;
}

.pet-category-card h3 {
    margin-bottom: 6px;
    font-size: 20px;
}

.pet-category-card p {
    margin: 0;
    color: var(--pet-muted);
    font-size: 14px;
}

.pet-category-card__arrow {
    position: absolute;
    right: 22px;
    top: 30px;
    color: var(--pet-line);
    transition: transform 0.2s ease, color 0.2s ease;
}

.pet-category-card:hover .pet-category-card__arrow {
    color: var(--pet-primary);
    transform: translateX(4px);
}

.pet-product-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.pet-product-strip .pet-product-card {
    border: 1px solid var(--pet-line);
    border-radius: var(--pet-radius);
    background: #fff;
    overflow: hidden;
    box-shadow: var(--pet-shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pet-product-strip .pet-product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--pet-shadow);
}

.pet-product-card__media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--pet-surface-soft);
    overflow: hidden;
}

.pet-product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.pet-product-card:hover .pet-product-card__media img {
    transform: scale(1.05);
}

.pet-product-card__badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--pet-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.pet-product-card__body {
    padding: 20px;
}

.pet-product-card__title {
    margin: 0 0 8px;
    font-size: 17px;
}

.pet-product-card__title a {
    color: var(--pet-ink);
}

.pet-product-card__title a:hover {
    color: var(--pet-primary);
}

.pet-product-card__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--pet-primary-dark);
    font-size: 20px;
    font-weight: 800;
}

.pet-product-card__price del {
    color: var(--pet-muted);
    font-size: 14px;
    font-weight: 500;
}

.pet-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
}

.pet-feature-item {
    text-align: center;
}

.pet-feature-item__icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    border-radius: 24px;
    background: #fff;
    color: var(--pet-secondary);
    box-shadow: var(--pet-shadow-sm);
}

.pet-feature-item__icon .pet-icon {
    width: 34px;
    height: 34px;
}

.pet-feature-item h3 {
    font-size: 18px;
}

.pet-feature-item p {
    margin: 0;
    color: var(--pet-muted);
    font-size: 14px;
}

.pet-testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.pet-testimonial {
    padding: 32px;
    border-radius: var(--pet-radius);
    background: #fff;
    border: 1px solid var(--pet-line);
    box-shadow: var(--pet-shadow-sm);
}

.pet-testimonial__stars {
    color: #f2a93b;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

.pet-testimonial__stars .pet-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.pet-testimonial blockquote {
    margin: 0 0 20px;
    color: var(--pet-ink);
    font-size: 16px;
}

.pet-testimonial__author {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--pet-muted);
    font-size: 14px;
}

.pet-testimonial__avatar {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--pet-surface-warm);
    color: var(--pet-primary-dark);
    font-weight: 800;
}

.pet-cta {
    position: relative;
    overflow: hidden;
    padding: 72px 0;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--pet-primary) 0%, #f49b5d 100%);
}

.pet-cta::before,
.pet-cta::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 28px solid rgba(255, 255, 255, 0.12);
}

.pet-cta::before {
    top: -120px;
    left: -60px;
}

.pet-cta::after {
    bottom: -150px;
    right: -40px;
}

.pet-cta-inner {
    position: relative;
    z-index: 1;
}

.pet-cta h2 {
    font-size: clamp(30px, 4vw, 44px);
}

.pet-cta p {
    max-width: 560px;
    margin: 0 auto 28px;
    color: rgba(255, 255, 255, 0.9);
}

.pet-cta .pet-button {
    background: #fff;
    color: var(--pet-primary-dark);
}

.pet-cta .pet-button:hover {
    background: var(--pet-ink);
    color: #fff;
}

/* --------------------------------------------------------------------------
   6. Generic content pages
   -------------------------------------------------------------------------- */
.pet-page-header {
    padding: 64px 0 44px;
    background: var(--pet-surface-soft);
    border-bottom: 1px solid var(--pet-line);
}

.pet-page-header h1 {
    margin-bottom: 8px;
    font-size: clamp(30px, 4vw, 42px);
}

.pet-page-header p {
    margin: 0;
    color: var(--pet-muted);
}

.pet-content-area {
    padding: 64px 0;
}

.pet-content-area .pet-entry {
    max-width: 820px;
    margin-inline: auto;
}

.pet-entry img {
    border-radius: var(--pet-radius);
    margin-bottom: 24px;
}

.pet-entry h2 {
    margin-top: 40px;
    font-size: 28px;
}

/* --------------------------------------------------------------------------
   7. Footer
   -------------------------------------------------------------------------- */
.pet-site-footer {
    padding: 68px 0 0;
    background: var(--pet-ink);
    color: rgba(255, 255, 255, 0.72);
}

.pet-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 40px;
    padding-bottom: 52px;
}

.pet-footer-brand .pet-brand {
    color: #fff;
    margin-bottom: 18px;
}

.pet-footer-brand p {
    max-width: 300px;
    font-size: 14px;
}

.pet-footer-col h3 {
    margin-bottom: 18px;
    color: #fff;
    font-size: 16px;
}

.pet-footer-col ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pet-footer-col li {
    margin-bottom: 10px;
    font-size: 14px;
}

.pet-footer-col a {
    color: rgba(255, 255, 255, 0.72);
}

.pet-footer-col a:hover {
    color: #fff;
}

.pet-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   8. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .pet-hero-inner {
        grid-template-columns: 1fr;
        gap: 44px;
        padding: 64px 0 72px;
    }

    .pet-hero__art {
        max-width: 620px;
    }

    .pet-category-grid,
    .pet-product-strip,
    .pet-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pet-testimonial-grid {
        grid-template-columns: 1fr;
    }

    .pet-footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .pet-container {
        width: min(100% - 28px, var(--pet-container));
    }

    .pet-section,
    .pet-content-area {
        padding: 56px 0;
    }

    .pet-header-inner {
        gap: 12px;
        min-height: 68px;
        flex-wrap: wrap;
    }

    .pet-menu-toggle {
        display: block;
        order: 3;
    }

    .pet-main-nav {
        order: 4;
        display: none;
        width: 100%;
        margin-left: 0;
        padding: 10px 0 18px;
    }

    .pet-main-nav.is-open {
        display: block;
    }

    .pet-main-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .pet-main-nav a {
        display: block;
        padding: 8px 0;
    }

    .pet-header-actions {
        margin-left: auto;
    }

    .pet-hero__art {
        display: none;
    }

    .pet-hero h1 {
        font-size: 40px;
    }

    .pet-hero__lead {
        font-size: 16px;
    }

    .pet-category-grid,
    .pet-product-strip,
    .pet-feature-grid,
    .pet-footer-grid {
        grid-template-columns: 1fr;
    }

    .pet-product-strip .pet-product-card:nth-child(n+3) {
        display: none;
    }

    .pet-cta {
        padding: 56px 0;
    }
}
