/*
Theme Name: Pharmacy Starter
Theme URI: https://example.com/pharmacy-starter
Description: 專業藥局電商主題，深度整合 Flavor SEO 和 LY Shop 插件。現代化設計、SEO 優化、響應式佈局。
Author: Developer
Author URI: https://example.com
Version: 1.0.0
Requires at least: 5.9
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pharmacy-starter
Tags: e-commerce, pharmacy, seo-optimized, responsive-layout, custom-menu, custom-logo, featured-images
*/

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --ps-primary: #1b7a3d;
    --ps-primary-dark: #145c2e;
    --ps-primary-light: #e8f5e9;
    --ps-primary-rgb: 27, 122, 61;
    --ps-accent: #ff6b35;
    --ps-accent-dark: #e55a28;
    --ps-text: #333333;
    --ps-text-light: #666666;
    --ps-text-muted: #999999;
    --ps-bg: #ffffff;
    --ps-bg-light: #f8f9fa;
    --ps-bg-section: #f5f5f5;
    --ps-border: #e0e0e0;
    --ps-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --ps-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
    --ps-radius: 8px;
    --ps-radius-lg: 12px;
    --ps-transition: 0.3s ease;
    --ps-container: 1200px;
    --ps-header-height: 64px;
    --ps-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--ps-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ps-text);
    background: var(--ps-bg);
    -webkit-font-smoothing: antialiased;
}

body.has-sticky-header {
    padding-top: var(--ps-header-height);
}

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

a {
    color: var(--ps-primary);
    text-decoration: none;
    transition: color var(--ps-transition);
}

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

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ps-text);
}

h1 { font-size: 2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; }

p {
    margin: 0 0 1em;
}

ul, ol {
    margin: 0 0 1em;
    padding-left: 1.5em;
}

/* ============================================
   Layout
   ============================================ */
.ps-container {
    max-width: var(--ps-container);
    margin: 0 auto;
    padding: 0 20px;
}

.ps-section {
    padding: 60px 0;
}

.ps-section--alt {
    background: var(--ps-bg-section);
}

.ps-section__header {
    text-align: center;
    margin-bottom: 40px;
}

.ps-section__title {
    font-size: 1.75em;
    color: var(--ps-text);
    position: relative;
    display: inline-block;
}

.ps-section__title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--ps-primary);
    margin: 12px auto 0;
    border-radius: 2px;
}

.ps-section__subtitle {
    color: var(--ps-text-light);
    margin-top: 8px;
    font-size: 0.95em;
}

/* ============================================
   Buttons
   ============================================ */
.ps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--ps-radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--ps-transition);
    text-decoration: none;
    line-height: 1.4;
}

.ps-btn--primary {
    background: var(--ps-primary);
    color: #fff;
}

.ps-btn--primary:hover {
    background: var(--ps-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--ps-primary-rgb), 0.3);
}

.ps-btn--outline {
    background: transparent;
    color: var(--ps-primary);
    border: 2px solid var(--ps-primary);
}

.ps-btn--outline:hover {
    background: var(--ps-primary);
    color: #fff;
}

.ps-btn--accent {
    background: var(--ps-accent);
    color: #fff;
}

.ps-btn--accent:hover {
    background: var(--ps-accent-dark);
    color: #fff;
}

.ps-btn--white {
    background: #fff;
    color: var(--ps-primary);
    border: 2px solid #fff;
}

.ps-btn--white:hover {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

.ps-btn--sm {
    padding: 8px 18px;
    font-size: 13px;
}

.ps-btn--lg {
    padding: 14px 36px;
    font-size: 16px;
}

.ps-btn--block {
    width: 100%;
}

/* ============================================
   Header
   ============================================ */
.ps-header {
    background: var(--ps-primary);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--ps-header-height);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.ps-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.ps-header__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 1.25em;
    font-weight: 700;
    text-decoration: none;
    flex-shrink: 0;
}

.ps-header__brand:hover {
    color: #fff;
}

.ps-header__brand img {
    height: 40px;
    width: auto;
}

/* Navigation */
.ps-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ps-nav a {
    color: rgba(255,255,255,0.9);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--ps-transition);
}

.ps-nav a:hover,
.ps-nav a.current {
    color: #fff;
    background: rgba(255,255,255,0.15);
}

/* Header Actions */
.ps-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.ps-header__cart {
    position: relative;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: background var(--ps-transition);
}

.ps-header__cart:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.ps-header__cart-icon {
    font-size: 20px;
    line-height: 1;
}

.ps-header__cart-count {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--ps-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
}

/* Mobile Menu Toggle */
.ps-header__toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
}

/* ============================================
   Hero Section
   ============================================ */
.ps-hero {
    background: linear-gradient(135deg, var(--ps-primary) 0%, var(--ps-primary-dark) 100%);
    color: #fff;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.ps-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    pointer-events: none;
}

.ps-hero__inner {
    display: flex;
    align-items: center;
    gap: 50px;
}

.ps-hero__content {
    flex: 1;
    z-index: 1;
}

.ps-hero__title {
    font-size: 2.2em;
    margin-bottom: 16px;
    color: #fff;
    line-height: 1.3;
}

.ps-hero__desc {
    font-size: 1.05em;
    line-height: 1.8;
    opacity: 0.95;
    margin-bottom: 28px;
}

.ps-hero__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ps-hero__image {
    flex: 0 0 420px;
    z-index: 1;
}

.ps-hero__image img {
    border-radius: var(--ps-radius-lg);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

/* ============================================
   Trust Badges
   ============================================ */
.ps-trust-bar {
    background: var(--ps-bg-light);
    border-bottom: 1px solid var(--ps-border);
    padding: 16px 0;
}

.ps-trust-bar__inner {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.ps-trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--ps-text-light);
    font-weight: 500;
}

.ps-trust-item__icon {
    font-size: 20px;
    color: var(--ps-primary);
}

/* ============================================
   Product Grid
   ============================================ */
.ps-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.ps-product-card {
    background: #fff;
    border-radius: var(--ps-radius-lg);
    overflow: hidden;
    box-shadow: var(--ps-shadow);
    transition: all var(--ps-transition);
    position: relative;
}

.ps-product-card:hover {
    box-shadow: var(--ps-shadow-hover);
    transform: translateY(-4px);
}

.ps-product-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ps-product-card__badge span {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.ps-badge--sale {
    background: #e53935;
}

.ps-badge--new {
    background: var(--ps-primary);
}

.ps-badge--authentic {
    background: var(--ps-accent);
}

.ps-product-card__image {
    display: block;
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: var(--ps-bg-light);
}

.ps-product-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--ps-transition);
}

.ps-product-card__placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--ps-text-muted);
    opacity: 0.4;
}

.ps-product-card:hover .ps-product-card__image img {
    transform: scale(1.05);
}

.ps-product-card__body {
    padding: 16px;
}

.ps-product-card__cat {
    display: inline-block;
    font-size: 12px;
    color: var(--ps-primary);
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.ps-product-card__title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ps-product-card__title a {
    color: var(--ps-text);
}

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

.ps-product-card__price {
    font-size: 16px;
    font-weight: 700;
    color: #e53935;
    margin-bottom: 12px;
}

.ps-product-card__price del {
    color: var(--ps-text-muted);
    font-size: 13px;
    font-weight: 400;
    margin-right: 6px;
}

.ps-product-card__price ins {
    text-decoration: none;
}

.ps-product-card__action .ps-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
}

.ps-product-card__outstock {
    text-align: center;
    color: var(--ps-text-muted);
    font-size: 13px;
    padding: 10px 0;
}

/* Category Grid */
.ps-categories {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 16px;
}

.ps-category-card {
    background: #fff;
    border-radius: var(--ps-radius-lg);
    padding: 24px;
    text-align: center;
    box-shadow: var(--ps-shadow);
    transition: all var(--ps-transition);
    border: 2px solid transparent;
}

.ps-category-card:hover {
    border-color: var(--ps-primary);
    transform: translateY(-2px);
    box-shadow: var(--ps-shadow-hover);
}

.ps-category-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ps-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
    color: var(--ps-primary);
    overflow: hidden;
}

.ps-category-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ps-category-card__name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ps-text);
    margin-bottom: 4px;
}

.ps-category-card__count {
    font-size: 13px;
    color: var(--ps-text-muted);
}

/* ============================================
   Blog Cards
   ============================================ */
.ps-posts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.ps-post-card {
    background: #fff;
    border-radius: var(--ps-radius-lg);
    overflow: hidden;
    box-shadow: var(--ps-shadow);
    transition: all var(--ps-transition);
}

.ps-post-card:hover {
    box-shadow: var(--ps-shadow-hover);
    transform: translateY(-3px);
}

.ps-post-card__image {
    display: block;
    position: relative;
    padding-top: 56%;
    overflow: hidden;
    background: var(--ps-bg-section);
}

.ps-post-card__placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    width: 40px;
    height: 40px;
    color: var(--ps-text-muted);
    opacity: 0.3;
}

.ps-post-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ps-post-card__body {
    padding: 20px;
}

.ps-post-card__meta {
    font-size: 13px;
    color: var(--ps-text-muted);
    margin-bottom: 8px;
}

.ps-post-card__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.ps-post-card__title a {
    color: var(--ps-text);
}

.ps-post-card__title a:hover {
    color: var(--ps-primary);
}

.ps-post-card__excerpt {
    font-size: 14px;
    color: var(--ps-text-light);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   Footer
   ============================================ */
.ps-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.7);
    padding: 50px 0 0;
}

.ps-footer a {
    color: rgba(255,255,255,0.7);
}

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

.ps-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
}

.ps-footer__title {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.ps-footer__about p {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.ps-footer__links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ps-footer__links li {
    margin-bottom: 10px;
}

.ps-footer__links a {
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ps-footer__links a::before {
    content: '›';
    font-weight: 700;
}

.ps-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 13px;
}

/* ============================================
   LINE Floating Button
   ============================================ */
.ps-line-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    background: #06C755;
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(6,199,85,0.4);
    transition: all var(--ps-transition);
    text-decoration: none;
}

.ps-line-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(6,199,85,0.5);
    color: #fff;
}

.ps-line-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* ============================================
   Content Area
   ============================================ */
.ps-content {
    padding: 40px 0;
}

.ps-content__main {
    max-width: 800px;
    margin: 0 auto;
}

.ps-content--sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.ps-content--sidebar .ps-content__main {
    max-width: 100%;
}

/* Single Post */
.ps-entry__header {
    margin-bottom: 30px;
}

.ps-entry__title {
    font-size: 2em;
    margin-bottom: 12px;
}

.ps-entry__meta {
    font-size: 14px;
    color: var(--ps-text-muted);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.ps-entry__content {
    font-size: 16px;
    line-height: 1.8;
}

.ps-entry__content img {
    border-radius: var(--ps-radius);
    margin: 20px 0;
}

.ps-entry__content h2 {
    margin-top: 1.5em;
}

.ps-entry__content blockquote {
    border-left: 4px solid var(--ps-primary);
    margin: 1.5em 0;
    padding: 16px 24px;
    background: var(--ps-primary-light);
    border-radius: 0 var(--ps-radius) var(--ps-radius) 0;
}

.ps-entry__content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.ps-entry__content th,
.ps-entry__content td {
    border: 1px solid var(--ps-border);
    padding: 10px 14px;
    text-align: left;
}

.ps-entry__content th {
    background: var(--ps-bg-section);
    font-weight: 600;
}

/* Sidebar */
.ps-sidebar .widget {
    background: #fff;
    border-radius: var(--ps-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--ps-shadow);
}

.ps-sidebar .widget-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ps-primary);
}

/* Pagination */
.ps-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.ps-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--ps-radius);
    border: 1px solid var(--ps-border);
    font-size: 14px;
    font-weight: 500;
    color: var(--ps-text);
    transition: all var(--ps-transition);
}

.ps-pagination .page-numbers:hover,
.ps-pagination .page-numbers.current {
    background: var(--ps-primary);
    color: #fff;
    border-color: var(--ps-primary);
}

/* ============================================
   Breadcrumb
   ============================================ */
.ps-breadcrumb {
    padding: 10px 0;
    background: var(--ps-bg-light);
    border-bottom: 1px solid var(--ps-border);
    font-size: 13px;
}

.ps-breadcrumb a {
    color: var(--ps-text-muted);
}

.ps-breadcrumb a:hover {
    color: var(--ps-primary);
}

.ps-breadcrumb .sep {
    margin: 0 8px;
    color: var(--ps-text-muted);
}

/* ============================================
   Search
   ============================================ */
.ps-search-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.ps-search-form input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--ps-border);
    border-right: none;
    border-radius: var(--ps-radius) 0 0 var(--ps-radius);
    font-size: 15px;
    outline: none;
}

.ps-search-form input[type="search"]:focus {
    border-color: var(--ps-primary);
}

.ps-search-form button {
    padding: 12px 20px;
    background: var(--ps-primary);
    color: #fff;
    border: 2px solid var(--ps-primary);
    border-radius: 0 var(--ps-radius) var(--ps-radius) 0;
    cursor: pointer;
    font-size: 15px;
    transition: background var(--ps-transition);
}

.ps-search-form button:hover {
    background: var(--ps-primary-dark);
    border-color: var(--ps-primary-dark);
}

/* ============================================
   404 Page
   ============================================ */
.ps-404 {
    text-align: center;
    padding: 80px 20px;
}

.ps-404__code {
    font-size: 120px;
    font-weight: 900;
    color: var(--ps-primary-light);
    line-height: 1;
    margin-bottom: 16px;
}

.ps-404__title {
    font-size: 24px;
    margin-bottom: 16px;
}

.ps-404__text {
    color: var(--ps-text-light);
    margin-bottom: 24px;
}

/* ============================================
   LY Shop Theme Overrides
   覆蓋 LY Shop 暗色主題，統一為藥局淺色風格
   ============================================ */

/* 覆蓋 LY Shop CSS 變量 */
:root {
    --ly-shop-primary: #1b7a3d !important;
    --ly-shop-secondary: #145c2e !important;
    --ly-shop-dark: #f5f5f5 !important;
    --ly-shop-dark-light: #ffffff !important;
    --ly-shop-text: #333333 !important;
    --ly-shop-text-muted: #999999 !important;
    --ly-shop-border: #e0e0e0 !important;
    --ly-shop-success: #2e7d32 !important;
    --ly-shop-danger: #e53935 !important;
    --ly-shop-radius: 8px !important;
}

/* 商品列表 */
.ly-shop-products {
    display: grid;
    gap: 24px;
}

.ly-shop-columns-2 { grid-template-columns: repeat(2, 1fr); }
.ly-shop-columns-3 { grid-template-columns: repeat(3, 1fr); }
.ly-shop-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* 商品卡片覆蓋 */
.ly-shop-product {
    background: #fff;
    border: 1px solid var(--ps-border);
    box-shadow: var(--ps-shadow);
}

.ly-shop-product:hover {
    box-shadow: var(--ps-shadow-hover);
    transform: translateY(-4px);
}

.ly-shop-product-info { padding: 16px; }

.ly-shop-product-title a {
    color: var(--ps-text);
}

.ly-shop-product-price {
    color: #e53935;
}

.ly-shop-product-price del {
    color: var(--ps-text-muted);
}

/* 按鈕覆蓋 - 使用 !important 確保覆蓋插件漸變背景 */
body .ly-shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: #1b7a3d !important;
    background-image: none !important;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: none !important;
    transform: none;
}

body .ly-shop-btn:hover {
    background: #145c2e !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(27, 122, 61, 0.3) !important;
    transform: translateY(-1px);
}

body .ly-shop-add-to-cart {
    background: #1b7a3d !important;
    background-image: none !important;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

body .ly-shop-add-to-cart:hover {
    background: #145c2e !important;
}

/* 特價徽章 */
.ly-shop-sale-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

.ly-shop-out-of-stock {
    background: var(--ps-bg-section);
    color: var(--ps-text-muted);
}

/* ── 數量選擇器 ── */
body .ly-shop-quantity {
    display: inline-flex;
    align-items: center;
    background: #fff !important;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

body .ly-shop-quantity button {
    width: 40px;
    height: 40px;
    background: #f8f9fa !important;
    border: none;
    color: #333 !important;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

body .ly-shop-quantity button:hover {
    background: #e8f5e9 !important;
    color: #1b7a3d !important;
}

body .ly-shop-qty-input {
    width: 60px;
    text-align: center;
    border: none;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    font-size: 16px;
    height: 40px;
    outline: none;
    background: #fff !important;
    color: #333 !important;
    -moz-appearance: textfield;
    appearance: textfield;
}

.ly-shop-qty-input::-webkit-inner-spin-button,
.ly-shop-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

/* 刪除按鈕 */
body .ly-shop-remove-item {
    width: 32px;
    height: 32px;
    border: none;
    background: #fce4ec !important;
    color: #e53935 !important;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

body .ly-shop-remove-item:hover {
    background: #e53935 !important;
    color: #fff !important;
}

/* ── 自訂購物車佈局（ps-cart）── */
.ps-cart-empty {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--ps-shadow);
}

.ps-cart-empty h2 {
    color: var(--ps-text);
    margin: 20px 0 8px;
}

.ps-cart-empty p {
    color: var(--ps-text-muted);
    margin-bottom: 24px;
}

.ps-cart {
    width: 100vw;
    max-width: 1200px;
    margin-left: 50%;
    transform: translateX(-50%);
}

.ps-cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

/* 商品卡片列表 */
.ps-cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ps-cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--ps-shadow);
    transition: box-shadow 0.3s ease;
}

.ps-cart-item:hover {
    box-shadow: var(--ps-shadow-hover);
}

.ps-cart-item__image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: block;
    align-self: center;
}

.ps-cart-item__image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
    display: block;
}

.ps-cart-item__body {
    flex: 1;
    min-width: 0;
}

.ps-cart-item__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 2px;
}

.ps-cart-item__name {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ps-cart-item__name a {
    color: #333;
    text-decoration: none;
}

.ps-cart-item__name a:hover {
    color: #1b7a3d;
}

.ps-cart-item__variation {
    margin: 2px 0 10px;
}

.ps-cart-item__attr {
    display: inline-block;
    font-size: 12px;
    color: var(--ps-primary-dark, #15632f);
    background: #e8f5e9;
    padding: 3px 10px;
    border-radius: 4px;
    margin-right: 6px;
    line-height: 1.5;
}

.ps-cart-item__price {
    display: none;
}

.ps-cart-item__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 6px;
}

.ps-cart-item__subtotal {
    font-size: 18px;
    font-weight: 700;
    color: #e53935;
    white-space: nowrap;
}

.ps-cart-item__remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: #ccc;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
    transition: all 0.3s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-cart-item__remove:hover {
    background: #fce4ec;
    color: #e53935;
}

/* 訂單摘要卡片 */
.ps-cart-summary {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--ps-shadow);
    position: sticky;
    top: 84px;
}

.ps-cart-summary__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--ps-primary);
    color: var(--ps-text);
}

.ps-cart-summary__rows {
    margin-bottom: 16px;
}

.ps-cart-summary__row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.ps-cart-summary__label {
    color: var(--ps-text-light);
}

.ps-cart-summary__value {
    font-weight: 600;
    color: var(--ps-text);
}

.ps-cart-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 20px;
    border-top: 2px solid var(--ps-text);
}

.ps-cart-summary__total-label {
    font-size: 16px;
    font-weight: 700;
    color: var(--ps-text);
}

.ps-cart-summary__total-value {
    font-size: 22px;
    font-weight: 800;
    color: #e53935;
}

.ps-cart-summary__checkout {
    margin-bottom: 12px;
}

.ps-cart-summary__continue {
    display: block;
    text-align: center;
    font-size: 14px;
    color: var(--ps-text-muted);
    transition: color 0.3s;
}

.ps-cart-summary__continue:hover {
    color: var(--ps-primary);
}

/* 購物車響應式 */
@media (max-width: 900px) {
    .ps-cart-layout {
        grid-template-columns: 1fr;
    }

    .ps-cart-summary {
        position: static;
    }
}

@media (max-width: 640px) {
    .ps-cart-item {
        padding: 16px;
        gap: 12px;
    }

    .ps-cart-item__image {
        width: 80px;
        height: 80px;
    }

    .ps-cart-item__image img {
        width: 80px;
        height: 80px;
    }

    .ps-cart-item__name {
        font-size: 14px;
    }

    .ps-cart-item__subtotal {
        font-size: 16px;
    }
}

/* 保留舊版購物車表格覆蓋（兼容插件直出） */
.ly-shop-cart-empty {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    color: var(--ps-text-light);
}

body .ly-shop-cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--ps-shadow);
}

body .ly-shop-cart-table th,
body .ly-shop-cart-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

body .ly-shop-cart-table thead th {
    background: #1b7a3d !important;
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
}

body .ly-shop-cart-table .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

body .ly-shop-cart-table .product-name a {
    color: #333;
    font-weight: 600;
    text-decoration: none;
}

body .ly-shop-cart-table .product-subtotal {
    font-weight: 700 !important;
    color: #e53935 !important;
}

body .ly-shop-cart-totals {
    max-width: 420px;
    margin-left: auto;
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    box-shadow: var(--ps-shadow);
    border: none;
}

body .ly-shop-cart-totals h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #333;
    padding-bottom: 14px;
    border-bottom: 2px solid #1b7a3d;
}

body .ly-shop-cart-totals th {
    color: #666;
    font-weight: 500;
}

body .ly-shop-cart-totals td {
    color: #333;
    font-weight: 600;
}

body .ly-shop-cart-totals .order-total td {
    font-size: 20px;
    color: #e53935 !important;
}

body .ly-shop-btn-checkout {
    width: 100%;
    text-align: center;
    padding: 14px 24px;
    font-size: 16px;
    background: #1b7a3d !important;
    background-image: none !important;
    border-radius: 8px;
}

body .ly-shop-btn-checkout:hover {
    background: #145c2e !important;
}

/* ── 自訂結帳佈局（ps-checkout）── */
.ps-checkout {
    width: 100vw;
    max-width: 1200px;
    margin-left: 50%;
    transform: translateX(-50%);
}

.ps-checkout__grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 20px;
    align-items: start;
}

.ps-checkout__card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: var(--ps-shadow);
    margin-bottom: 10px;
}

.ps-checkout__card--sticky {
    position: sticky;
    top: 84px;
}

.ps-checkout__heading {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1b7a3d;
    color: #333;
}

.ps-checkout__heading-note {
    font-weight: 400;
    color: #999;
    font-size: 14px;
    margin-left: 6px;
}

.ps-checkout__subheading {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #333;
}

/* 結帳表單覆蓋 */
.ps-checkout .ly-shop-form-row {
    margin-bottom: 12px;
}

.ps-checkout .ly-shop-form-row label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.ps-checkout .ly-shop-form-row .required {
    color: #e53935;
}

.ps-checkout .ly-shop-form-row input,
.ps-checkout .ly-shop-form-row select,
.ps-checkout .ly-shop-form-row textarea {
    width: 100%;
    padding: 10px 12px;
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    color: #333;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.ps-checkout .ly-shop-form-row input:focus,
.ps-checkout .ly-shop-form-row select:focus,
.ps-checkout .ly-shop-form-row textarea:focus {
    outline: none;
    border-color: #1b7a3d;
    box-shadow: 0 0 0 3px rgba(27, 122, 61, 0.1);
}

.ps-checkout .ly-shop-form-row input.error,
.ps-checkout .ly-shop-form-row select.error {
    border-color: #e53935;
}

.ps-checkout .ly-shop-form-row textarea {
    min-height: 70px;
    resize: vertical;
}

/* 地址字段覆蓋 */
.ps-checkout .ly-shop-address-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ps-checkout .ly-shop-address-fields .ly-shop-form-row:last-child {
    grid-column: 1 / -1;
}

/* 結帳商品列表 */
.ps-checkout__items {
    margin-bottom: 16px;
}

.ps-checkout__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ps-checkout__item-img {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
}

.ps-checkout__item-img img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    display: block;
}

.ps-checkout__item-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    min-width: 0;
}

.ps-checkout__item-qty {
    color: #999;
    font-size: 12px;
}

.ps-checkout__item-price {
    font-weight: 600;
    white-space: nowrap;
    color: #333;
    font-size: 13px;
}

/* 費用明細 */
.ps-checkout__totals {
    margin-bottom: 20px;
    padding-top: 8px;
}

.ps-checkout__totals-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: #666;
}

.ps-checkout__totals-row span:last-child {
    font-weight: 600;
    color: #333;
}

.ps-checkout__free-shipping {
    color: #2e7d32 !important;
}

.ps-checkout__totals-row--discount {
    color: #2e7d32;
}

.ps-checkout__totals-row--discount span:last-child {
    color: #2e7d32 !important;
}

.ps-checkout__coupon-code {
    background: #e8f5e9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
}

.ps-checkout__remove-coupon {
    color: #e53935;
    text-decoration: none;
    margin-left: 4px;
    font-size: 16px;
}

.ps-checkout__totals-row--total {
    padding-top: 14px;
    margin-top: 6px;
    border-top: 2px solid #333;
    font-size: 16px;
    font-weight: 700;
}

.ps-checkout__totals-row--total span:first-child {
    color: #333;
}

.ps-checkout__totals-row--total span:last-child {
    font-size: 20px;
    color: #e53935 !important;
}

/* 優惠券 */
.ps-checkout__coupon {
    margin-bottom: 20px;
}

.ps-checkout__coupon-form {
    display: flex;
    gap: 8px;
}

.ps-checkout__coupon-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    text-transform: uppercase;
    color: #333;
}

.ps-checkout__coupon-input:focus {
    border-color: #1b7a3d;
    outline: none;
}

/* 付款方式 */
.ps-checkout__payment {
    margin-bottom: 20px;
}

.ps-checkout__payment-option {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ps-checkout__payment-option:has(input:checked) {
    border-color: #1b7a3d;
    background: #e8f5e9;
}

.ps-checkout__payment-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #1b7a3d;
    margin: 0;
}

.ps-checkout__payment-label {
    font-weight: 600;
    color: #333;
}

.ps-checkout__payment-desc {
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 13px;
    color: #999;
    margin-left: 26px;
}

/* 運送方式選擇器 */
.ps-checkout__shipping-methods {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.ps-checkout__shipping-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
    font-size: 13px;
}

.ps-checkout__shipping-option:has(input:checked),
.ps-checkout__shipping-option.selected {
    border-color: #1b7a3d;
    background: #e8f5e9;
}

.ps-checkout__shipping-option input[type="radio"] {
    display: none;
}

.ps-checkout__shipping-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ps-checkout__shipping-title {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    line-height: 1.3;
}

.ps-checkout__shipping-desc {
    font-size: 11px;
    color: #999;
    line-height: 1.3;
    display: none;
}

.ps-checkout__shipping-cost {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    color: #1b7a3d;
}

/* store-picker 插件樣式覆蓋 */
.ly-store-picker {
    margin-top: 12px;
}

body .ly-store-picker .store-picker-block {
    background: #fff;
    border: 1.5px solid #c8e6c9;
    border-radius: 8px;
    overflow: hidden;
}

body .ly-store-picker .store-picker-title {
    background: #e8f5e9;
    border-color: #a5d6a7;
    color: #1b7a3d;
    padding: 10px 14px;
    font-size: 13px;
}

body .ly-store-picker .store-picker-title .required {
    color: #e53935;
}

body .ly-store-picker .store-picker-field {
    background: #fff;
    padding: 14px;
}

body .store-picker-btn {
    background: #1b7a3d !important;
    background-image: none !important;
    border: none !important;
    border-radius: 6px !important;
    color: #fff !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
}

body .store-picker-btn:hover {
    background: #145c2e !important;
}

body .store-picker-tip {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* store-picker 彈窗主題色覆蓋 */
body .store-picker-search-input:focus {
    border-color: #1b7a3d;
}

body .store-picker-smart-btn {
    background: #1b7a3d;
    border-color: #1b7a3d;
}

body .store-picker-smart-btn:hover {
    background: #145c2e;
}

body .store-picker-item:hover {
    border-color: #1b7a3d;
    background: #f8faf8;
}

body .store-picker-item-select {
    border-color: #1b7a3d;
    color: #1b7a3d;
}

body .store-picker-item-select:hover {
    background: #1b7a3d;
    color: #fff;
}

body .store-picker-loading::before {
    border-top-color: #1b7a3d;
}

/* 結帳響應式 */
@media (max-width: 900px) {
    .ps-checkout__grid {
        grid-template-columns: 1fr;
    }

    .ps-checkout__card--sticky {
        position: static;
    }
}

@media (max-width: 640px) {
    .ps-checkout__card {
        padding: 20px;
    }

    .ps-checkout .ly-shop-address-fields {
        grid-template-columns: 1fr;
    }

    .ps-checkout__coupon-form {
        flex-direction: column;
    }

    .ps-checkout__shipping-methods {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 保留舊版結帳覆蓋（兼容插件直出） */
.ly-shop-checkout-columns {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
}

.ly-shop-checkout h3 {
    margin: 0 0 24px;
    font-size: 20px;
    color: #333;
    padding-bottom: 14px;
    border-bottom: 2px solid #1b7a3d;
}

.ly-shop-checkout-order {
    background: #fff;
    padding: 28px;
    border-radius: 12px;
    box-shadow: var(--ps-shadow);
    position: sticky;
    top: 84px;
}

.ly-shop-form-row {
    margin-bottom: 18px;
}

.ly-shop-form-row label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.ly-shop-form-row .required {
    color: #e53935;
}

.ly-shop-form-row input,
.ly-shop-form-row select,
.ly-shop-form-row textarea {
    width: 100%;
    padding: 12px 14px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.ly-shop-form-row input:focus,
.ly-shop-form-row select:focus,
.ly-shop-form-row textarea:focus {
    outline: none;
    border-color: #1b7a3d;
}

body .ly-shop-btn-place-order {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    background: #1b7a3d !important;
    background-image: none !important;
}

body .ly-shop-btn-place-order:hover {
    background: #145c2e !important;
}

/* ── 訂單完成頁 ── */
.ly-shop-order-received {
    max-width: 700px;
    margin: 0 auto;
}

.ly-shop-order-received-header {
    text-align: center;
    padding: 40px;
    background: var(--ps-primary-light);
    border-radius: var(--ps-radius-lg);
    margin-bottom: 30px;
}

.ly-shop-success-icon {
    width: 64px;
    height: 64px;
    line-height: 64px;
    background: var(--ps-primary);
    color: #fff;
    font-size: 28px;
    border-radius: 50%;
    margin: 0 auto 16px;
}

.ly-shop-order-received-header h2 {
    margin: 0 0 8px;
    font-size: 24px;
    color: var(--ps-text);
}

.ly-shop-order-received-header p {
    margin: 0;
    color: var(--ps-text-light);
}

.ly-shop-order-overview ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
    background: #fff;
    border-radius: var(--ps-radius-lg);
    box-shadow: var(--ps-shadow);
    overflow: hidden;
}

.ly-shop-order-overview li {
    flex: 1;
    padding: 20px;
    text-align: center;
    border-right: 1px solid var(--ps-border);
}

.ly-shop-order-overview li:last-child {
    border-right: none;
}

.ly-shop-order-overview .label {
    display: block;
    font-size: 13px;
    color: var(--ps-text-muted);
    margin-bottom: 4px;
}

.ly-shop-order-overview .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--ps-text);
}

.ly-shop-order-details,
.ly-shop-customer-details {
    background: #fff;
    padding: 24px;
    border-radius: var(--ps-radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--ps-shadow);
}

.ly-shop-order-details h3,
.ly-shop-customer-details h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: var(--ps-text);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ps-primary);
}

.ly-shop-order-items-table {
    width: 100%;
}

.ly-shop-order-items-table th,
.ly-shop-order-items-table td {
    padding: 12px 0;
    border-bottom: 1px solid var(--ps-border);
    color: var(--ps-text);
}

.ly-shop-order-items-table .quantity {
    color: var(--ps-text-muted);
}

.ly-shop-order-items-table tfoot .order-total td {
    color: #e53935;
    font-size: 18px;
}

.ly-shop-order-actions {
    text-align: center;
    margin-top: 30px;
}

.ly-shop-address p {
    color: var(--ps-text-light);
    margin: 4px 0;
}

/* ── 通知 ── */
.ly-shop-notice {
    padding: 16px 20px;
    border-radius: var(--ps-radius);
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--ps-text);
}

.ly-shop-notice-info {
    background: var(--ps-primary-light);
    color: var(--ps-primary-dark);
    border: 1px solid var(--ps-primary);
}

.ly-shop-notice-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

.ly-shop-notice-error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef5350;
}

/* ── 麵包屑 ── */
.ly-shop-breadcrumb {
    padding: 12px 0;
    font-size: 14px;
    color: var(--ps-text-muted);
}

.ly-shop-breadcrumb a {
    color: var(--ps-text-muted);
    text-decoration: none;
}

.ly-shop-breadcrumb a:hover {
    color: var(--ps-primary);
}

.ly-shop-breadcrumb .sep {
    margin: 0 8px;
    opacity: 0.5;
}

/* ── 分頁 ── */
.ly-shop-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.ly-shop-pagination a,
.ly-shop-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--ps-radius);
    border: 1px solid var(--ps-border);
    background: #fff;
    color: var(--ps-text);
    text-decoration: none;
    font-size: 14px;
}

.ly-shop-pagination .current,
.ly-shop-pagination a:hover {
    background: var(--ps-primary);
    color: #fff;
    border-color: var(--ps-primary);
}

/* ── 搜索表單 ── */
.ly-shop-search-form {
    display: flex;
    max-width: 400px;
}

.ly-shop-search-input {
    flex: 1;
    padding: 10px 14px;
    background: #fff;
    border: 2px solid var(--ps-border);
    border-right: none;
    border-radius: var(--ps-radius) 0 0 var(--ps-radius);
    color: var(--ps-text);
    font-size: 14px;
    outline: none;
}

.ly-shop-search-input:focus {
    border-color: var(--ps-primary);
}

.ly-shop-search-btn {
    padding: 10px 16px;
    background: var(--ps-primary);
    color: #fff;
    border: none;
    border-radius: 0 var(--ps-radius) var(--ps-radius) 0;
    cursor: pointer;
    transition: background var(--ps-transition);
}

.ly-shop-search-btn:hover {
    background: var(--ps-primary-dark);
}

/* ── 商品分類 ── */
.ly-shop-category-item a {
    background: #fff;
    color: var(--ps-text);
    border: 1px solid var(--ps-border);
}

.ly-shop-category-item a:hover {
    box-shadow: var(--ps-shadow-hover);
}

.ly-shop-category-info h3 {
    color: var(--ps-text);
}

.ly-shop-category-info .count {
    color: var(--ps-text-muted);
}

/* ── 迷你購物車 ── */
.ly-shop-mini-cart-empty {
    color: var(--ps-text-muted);
}

.ly-shop-mini-cart-item-name {
    color: var(--ps-text);
}

.ly-shop-mini-cart-item-qty {
    color: var(--ps-text-muted);
}

.ly-shop-mini-cart-total {
    color: var(--ps-text);
}

/* ── 購物車圖標 ── */
.ly-shop-cart-icon {
    color: var(--ps-text);
}

.ly-shop-cart-icon .ly-shop-cart-count {
    background: var(--ps-primary);
}

/* ── 地址字段 ── */
.ly-shop-address-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.ly-shop-address-fields .ly-shop-form-row:last-child {
    grid-column: 1 / -1;
}

/* ── 訂單追蹤 ── */
.ly-shop-order-tracking {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border-radius: var(--ps-radius-lg);
    box-shadow: var(--ps-shadow);
}

.ly-shop-tracking-form label {
    color: var(--ps-text);
}

.ly-shop-tracking-form input[type="text"],
.ly-shop-tracking-form input[type="email"] {
    background: #fff;
    border: 2px solid var(--ps-border);
    color: var(--ps-text);
}

.ly-shop-tracking-form input:focus {
    border-color: var(--ps-primary);
    outline: none;
}

.ly-shop-order-result h3 {
    color: var(--ps-primary);
}

/* ── 加入購物車短代碼 ── */
.ly-shop-add-to-cart-shortcode .price {
    color: #e53935;
}

/* ── 複選框/單選 ── */
.ly-shop-checkbox input,
.ly-shop-radio input {
    accent-color: var(--ps-primary);
}

/* ── 運送方式 ── */
.ly-shipping-option {
    background: #fff;
    border: 2px solid var(--ps-border);
    border-radius: var(--ps-radius);
    padding: 14px;
    margin-bottom: 10px;
    transition: border-color var(--ps-transition);
}

.ly-shipping-option.selected {
    border-color: var(--ps-primary);
    background: var(--ps-primary-light);
}

/* ── 響應式覆蓋 ── */
@media (max-width: 991px) {
    .ly-shop-checkout-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ly-shop-cart-table {
        font-size: 14px;
    }

    .ly-shop-cart-table thead {
        display: none;
    }

    .ly-shop-cart-table tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 16px;
        border-bottom: 1px solid var(--ps-border);
        gap: 8px;
    }

    .ly-shop-cart-table td {
        border: none;
        padding: 4px;
    }

    .ly-shop-cart-table .product-thumbnail {
        width: 70px;
    }

    .ly-shop-cart-table .product-thumbnail img {
        width: 70px;
        height: 70px;
    }

    .ly-shop-cart-table .product-name {
        flex: 1;
        min-width: 0;
    }

    .ly-shop-cart-table .product-price,
    .ly-shop-cart-table .product-quantity,
    .ly-shop-cart-table .product-subtotal {
        width: auto;
        text-align: center;
    }

    .ly-shop-cart-table .product-remove {
        position: absolute;
        right: 12px;
        top: 12px;
    }

    .ly-shop-cart-item {
        position: relative;
    }

    .ly-shop-cart-totals {
        max-width: 100%;
    }

    .ly-shop-order-overview ul {
        flex-direction: column;
    }

    .ly-shop-order-overview li {
        border-right: none;
        border-bottom: 1px solid var(--ps-border);
    }

    .ly-shop-order-overview li:last-child {
        border-bottom: none;
    }

    .ly-shop-address-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ly-shop-coupon-form {
        flex-direction: column;
    }

    .ly-shop-coupon-form .ly-shop-btn {
        width: 100%;
    }
}

/* ============================================
   Mobile Bottom Navigation
   ============================================ */
.ps-mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid var(--ps-border);
    z-index: 998;
    padding: 6px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

.ps-mobile-nav__inner {
    display: flex;
    justify-content: space-around;
}

.ps-mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--ps-text-muted);
    font-size: 11px;
    padding: 6px 12px;
    text-decoration: none;
    position: relative;
    transition: color var(--ps-transition);
}

.ps-mobile-nav__item:hover,
.ps-mobile-nav__item.active {
    color: var(--ps-primary);
}

.ps-mobile-nav__icon {
    font-size: 20px;
    line-height: 1;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .ps-nav {
        display: none;
    }

    .ps-header__toggle {
        display: block;
    }

    .ps-nav--open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--ps-header-height);
        left: 0;
        right: 0;
        background: var(--ps-primary-dark);
        padding: 12px 20px;
        gap: 4px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }

    .ps-nav--open a {
        padding: 12px 16px;
        font-size: 15px;
    }

    .ps-hero__inner {
        flex-direction: column;
        text-align: center;
    }

    .ps-hero__image {
        flex: none;
        max-width: 100%;
    }

    .ps-hero__actions {
        justify-content: center;
    }

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

    .ly-shop-columns-3,
    .ly-shop-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .ps-content--sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --ps-header-height: 56px;
    }

    .ps-hero {
        padding: 40px 0;
    }

    .ps-hero__title {
        font-size: 1.6em;
    }

    .ps-section {
        padding: 40px 0;
    }

    .ps-section__title {
        font-size: 1.4em;
    }

    .ps-trust-bar__inner {
        gap: 20px;
    }

    .ps-categories {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .ps-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .ly-shop-columns-2,
    .ly-shop-columns-3,
    .ly-shop-columns-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .ps-posts {
        grid-template-columns: 1fr;
    }

    .ps-footer__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ps-mobile-nav {
        display: block;
    }

    body.has-sticky-header {
        padding-bottom: 64px;
    }

    .ps-line-btn {
        bottom: 80px;
    }

    .ps-entry__title {
        font-size: 1.5em;
    }
}

@media (max-width: 480px) {
    .ps-products,
    .ly-shop-columns-2,
    .ly-shop-columns-3,
    .ly-shop-columns-4 {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .ps-product-card__body {
        padding: 12px;
    }

    .ps-product-card__title {
        font-size: 13px;
    }

    .ps-product-card__price {
        font-size: 14px;
    }

    .ps-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================
   WordPress Default Classes
   ============================================ */
.alignleft { float: left; margin: 0 1.5em 1.5em 0; }
.alignright { float: right; margin: 0 0 1.5em 1.5em; }
.aligncenter { display: block; margin: 1.5em auto; }
.alignwide { margin-left: -40px; margin-right: -40px; max-width: calc(100% + 80px); }
.alignfull { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); max-width: 100vw; }

.wp-block-image { margin: 1.5em 0; }
.wp-block-image img { border-radius: var(--ps-radius); }

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* ============================================
   Single Product Page
   ============================================ */
.ps-single-product {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.ps-single-product__gallery {
    flex: 1;
    max-width: 50%;
}

.ps-single-product__main-image img {
    width: 100%;
    border-radius: var(--ps-radius-lg);
    background: var(--ps-bg-light);
}

.ps-single-product__thumbs {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ps-single-product__thumb {
    width: 72px;
    height: 72px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--ps-transition);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
}

.ps-single-product__thumb.active,
.ps-single-product__thumb:hover {
    opacity: 1;
    border-color: var(--ps-primary);
}

.ps-single-product__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ps-single-product__summary {
    flex: 1;
}

.ps-single-product__title {
    font-size: 1.75em;
    margin: 0 0 16px;
    line-height: 1.3;
}

.ps-single-product__price {
    font-size: 1.5em;
    font-weight: 700;
    color: #e53935;
    margin-bottom: 20px;
}

.ps-single-product__price del {
    color: var(--ps-text-muted);
    font-size: 0.75em;
    margin-right: 8px;
}

.ps-single-product__price ins {
    text-decoration: none;
}

.ps-single-product__excerpt {
    margin-bottom: 24px;
    color: var(--ps-text-light);
    line-height: 1.7;
}

.ps-single-product__cart {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: stretch;
}

.ps-single-product__cart .ps-btn {
    flex: 1;
}

.ps-single-product__outstock {
    color: var(--ps-text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

.ps-single-product__trust {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 16px 0;
    margin-bottom: 20px;
    border-top: 1px solid var(--ps-border);
    border-bottom: 1px solid var(--ps-border);
}

.ps-single-product__variations {
    margin: 20px 0;
}

.ps-variation-group {
    margin-bottom: 16px;
}

.ps-variation-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--ps-text);
    margin-bottom: 8px;
}

.ps-variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ps-variation-btn {
    padding: 8px 20px;
    border: 2px solid var(--ps-border);
    border-radius: var(--ps-radius);
    background: #fff;
    color: var(--ps-text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.ps-variation-btn:hover {
    border-color: var(--ps-primary);
    color: var(--ps-primary);
}

.ps-variation-btn.active {
    border-color: var(--ps-primary);
    background: var(--ps-primary);
    color: #fff;
}

.ps-single-product__meta {
    padding-top: 16px;
}

.ps-single-product__meta p {
    margin: 6px 0;
    font-size: 14px;
    color: var(--ps-text-light);
}

.ps-single-product__meta a {
    color: var(--ps-primary);
}

.ps-single-product__description {
    background: var(--ps-bg-light);
    padding: 32px;
    border-radius: var(--ps-radius-lg);
    margin-top: 40px;
}

.ps-single-product__description h2 {
    font-size: 1.25em;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ps-primary);
}

/* ============================================
   Flavor SEO - Product GEO Visible Content
   ============================================ */
.fseo-product-takeaways,
.fseo-product-howto,
.fseo-product-faq {
    background: var(--ps-bg-light);
    padding: 28px 32px;
    border-radius: var(--ps-radius-lg);
    margin-top: 24px;
}

.fseo-product-takeaways h3,
.fseo-product-howto h3,
.fseo-product-faq h3 {
    font-size: 1.15em;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--ps-primary);
    color: var(--ps-text);
}

.fseo-takeaways-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.fseo-takeaways-list li {
    padding: 10px 14px 10px 36px;
    background: #fff;
    border-radius: var(--ps-radius);
    border-left: 3px solid var(--ps-primary);
    position: relative;
    font-size: 0.95em;
    line-height: 1.6;
}

.fseo-takeaways-list li::before {
    content: "\2713";
    position: absolute;
    left: 12px;
    color: var(--ps-primary);
    font-weight: 700;
}

.fseo-howto-steps {
    padding-left: 0;
    margin: 0;
    counter-reset: howto-step;
    list-style: none;
}

.fseo-howto-steps li {
    counter-increment: howto-step;
    padding: 12px 14px 12px 48px;
    background: #fff;
    border-radius: var(--ps-radius);
    margin-bottom: 8px;
    position: relative;
    font-size: 0.95em;
    line-height: 1.6;
}

.fseo-howto-steps li::before {
    content: counter(howto-step);
    position: absolute;
    left: 12px;
    top: 12px;
    width: 26px;
    height: 26px;
    background: var(--ps-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 0.85em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fseo-howto-steps li strong {
    color: var(--ps-primary);
}

.fseo-faq-item {
    background: #fff;
    border-radius: var(--ps-radius);
    margin-bottom: 8px;
    overflow: hidden;
}

.fseo-faq-item summary {
    padding: 14px 40px 14px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    line-height: 1.5;
    position: relative;
    list-style: none;
    color: var(--ps-text);
    transition: background 0.2s;
}

.fseo-faq-item summary::-webkit-details-marker {
    display: none;
}

.fseo-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3em;
    font-weight: 300;
    color: var(--ps-primary);
}

.fseo-faq-item[open] summary::after {
    content: "\2212";
}

.fseo-faq-item summary:hover {
    background: rgba(27, 122, 61, 0.04);
}

.fseo-faq-answer {
    padding: 0 16px 14px;
}

.fseo-faq-answer p {
    margin: 0;
    font-size: 0.92em;
    line-height: 1.7;
    color: #555;
}

.fseo-disclaimer {
    font-size: 0.82em;
    color: #999;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-style: italic;
}

@media (max-width: 768px) {
    .fseo-product-takeaways,
    .fseo-product-howto,
    .fseo-product-faq {
        padding: 20px 16px;
        margin-top: 16px;
    }
}

@media (max-width: 768px) {
    .ps-single-product {
        flex-direction: column;
    }

    .ps-single-product__gallery {
        max-width: 100%;
    }

    .ps-single-product__title {
        font-size: 1.4em;
    }

    .ps-single-product__cart {
        flex-direction: column;
    }
}

/* 隱藏 LY Shop 頁面的頁面標題 */
.ps-order-received ~ .ps-entry__header,
.ps-checkout ~ .ps-entry__header,
.ps-cart ~ .ps-entry__header {
    display: none;
}

/* 當頁面包含這些組件時隱藏標題 */
body:has(.ps-order-received) .ps-entry__header,
body:has(.ps-checkout) .ps-entry__header,
body:has(.ps-cart) .ps-entry__header {
    display: none;
}

/* ── 訂單完成頁（ps-order-received）── */
.ps-order-received {
    width: 100vw;
    max-width: 900px;
    margin-left: 50%;
    transform: translateX(-50%);
}

.ps-order-received__header {
    text-align: center;
    padding: 32px 20px 24px;
}

.ps-order-received__icon {
    margin-bottom: 12px;
}

.ps-order-received__title {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin: 0 0 6px;
}

.ps-order-received__subtitle {
    font-size: 14px;
    color: #999;
    margin: 0;
}

.ps-order-received__summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--ps-shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

.ps-order-received__summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border-right: 1px solid #f0f0f0;
}

.ps-order-received__summary-item:last-child {
    border-right: none;
}

.ps-order-received__summary-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}

.ps-order-received__summary-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-align: center;
    word-break: break-all;
}

.ps-order-received__summary-value--total {
    color: #1b7a3d;
    font-size: 16px;
}

.ps-order-received__grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.ps-order-received__card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--ps-shadow);
}

.ps-order-received__card-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1b7a3d;
}

.ps-order-received__items {
    margin-bottom: 12px;
}

.ps-order-received__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 12px;
}

.ps-order-received__item:last-child {
    border-bottom: none;
}

.ps-order-received__item-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    line-height: 1.4;
}

.ps-order-received__item-qty {
    color: #999;
    font-size: 12px;
    margin-left: 4px;
}

.ps-order-received__item-price {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    color: #333;
}

.ps-order-received__totals {
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.ps-order-received__totals-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: #666;
}

.ps-order-received__totals-row--total {
    border-top: 1px solid #eee;
    margin-top: 4px;
    padding-top: 10px;
    font-size: 16px;
    font-weight: 700;
    color: #1b7a3d;
}

.ps-order-received__info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ps-order-received__info-row {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.ps-order-received__info-label {
    flex-shrink: 0;
    width: 70px;
    color: #999;
    font-weight: 500;
}

.ps-order-received__actions {
    text-align: center;
    padding: 8px 0 20px;
}

.ps-order-received__actions .ps-btn {
    min-width: 200px;
}

@media (max-width: 768px) {
    .ps-order-received__summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .ps-order-received__summary-item:nth-child(2) {
        border-right: none;
    }

    .ps-order-received__summary-item:nth-child(1),
    .ps-order-received__summary-item:nth-child(2) {
        border-bottom: 1px solid #f0f0f0;
    }

    .ps-order-received__grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Toast Notification
   ============================================ */
.ps-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    background: var(--ps-primary);
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--ps-radius);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.ps-toast .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}
