/**
 * Shinyst Theme - Main CSS (补充样式)
 * 对 style.css 的扩展和特定页面样式
 * @package shinyst
 */

/* =====================================================
   搜索结果下拉
===================================================== */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.search-results::-webkit-scrollbar {
    width: 4px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--color-border);
}

/* =====================================================
   产品页图片过渡
===================================================== */
.gallery-main__img {
    transition: opacity 0.2s ease, transform 0.4s ease;
}

/* =====================================================
   变体按钮激活状态
===================================================== */
.variant-btn.active {
    background: var(--color-text-primary);
    color: var(--color-bg-primary);
    border-color: var(--color-text-primary);
}

/* =====================================================
   产品详情折叠动画精细化
===================================================== */
.detail-body {
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =====================================================
   Hero Swiper 按钮样式覆盖
===================================================== */
.swiper-button-next.hero-swiper__next,
.swiper-button-prev.hero-swiper__prev {
    color: rgba(255, 255, 255, 0.7);
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0;
    transition: background 0.2s;
}

.swiper-button-next.hero-swiper__next:hover,
.swiper-button-prev.hero-swiper__prev:hover {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
}

.swiper-button-next.hero-swiper__next::after,
.swiper-button-prev.hero-swiper__prev::after {
    font-size: 16px;
    font-weight: 700;
}

.swiper-pagination.hero-swiper__pagination .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.swiper-pagination.hero-swiper__pagination .swiper-pagination-bullet-active {
    background: #fff;
    width: 20px;
    border-radius: 2px;
}

/* =====================================================
   评价滚动行间距
===================================================== */
.reviews-track-wrapper + .reviews-track-wrapper {
    margin-top: var(--spacing-md);
}

/* =====================================================
   产品卡片图片无图占位
===================================================== */
.product-card__img[src=""] {
    background: var(--color-bg-card);
}

/* =====================================================
   Cart Empty 状态
===================================================== */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    gap: var(--spacing-md);
}

/* =====================================================
   页面加载进度条（顶部）
===================================================== */
#nprogress .bar {
    background: var(--color-text-primary) !important;
    height: 2px !important;
}

#nprogress .peg {
    box-shadow: 0 0 10px var(--color-text-primary), 0 0 5px var(--color-text-primary) !important;
}

/* =====================================================
   表单错误状态
===================================================== */
.contact-form input:invalid:not(:placeholder-shown),
.contact-form textarea:invalid:not(:placeholder-shown) {
    border-color: var(--color-sale-badge);
}

.contact-form input:valid:not(:placeholder-shown),
.contact-form textarea:valid:not(:placeholder-shown) {
    border-color: #4caf50;
}

/* =====================================================
   过渡：页面切换
===================================================== */
body {
    animation: pageEnter 0.3s ease;
}

@keyframes pageEnter {
    from { opacity: 0.85; transform: translateY(4px); }
    to   { opacity: 1;    transform: translateY(0); }
}

/* =====================================================
   关于页内容区文字样式
===================================================== */
.about-content__text p,
.about-content .wp-block-paragraph {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
}

/* =====================================================
   Taxonomy 分类页 Banner（可选）
===================================================== */
.category-banner {
    position: relative;
    height: 280px;
    overflow: hidden;
    margin-bottom: var(--spacing-xl);
}

.category-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-banner__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: flex-end;
    padding: var(--spacing-xl) var(--spacing-2xl);
}

.category-banner h1 {
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
}

/* =====================================================
   印章/证书风格徽章
===================================================== */
.trust-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 11px;
    color: var(--color-text-muted);
    letter-spacing: 0.06em;
}

.trust-badge svg {
    width: 14px;
    height: 14px;
    color: var(--color-accent-gold);
}

.trust-badges {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

/* =====================================================
   产品页 SKU 信息
===================================================== */
.product-sku {
    font-size: 11px;
    color: var(--color-text-muted);
    letter-spacing: 0.08em;
    margin-bottom: var(--spacing-md);
}

/* =====================================================
   无障碍焦点样式
===================================================== */
:focus-visible {
    outline: 2px solid var(--color-accent-gold);
    outline-offset: 2px;
}

/* =====================================================
   打印样式
===================================================== */
@media print {
    .site-header,
    .announcement-bar,
    .site-footer,
    .cart-drawer,
    .mobile-menu,
    .float-btn,
    .toast {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }
}

/* =====================================================
   移动端优化
===================================================== */
@media (max-width: 768px) {
    /* 产品详情页图片在移动端不 sticky */
    .product-gallery {
        position: relative;
        top: auto;
    }

    /* 调整 atc 区域 */
    .atc-section {
        flex-direction: column;
    }

    .qty-selector {
        width: 100%;
        justify-content: center;
    }

    .btn-atc {
        width: 100%;
    }

    /* 购物车抽屉移动端全宽 */
    .cart-drawer {
        width: 100%;
    }

    /* 搜索面板移动端 */
    .search-panel {
        padding: var(--spacing-lg) var(--spacing-md);
    }

    /* Footer 改为单列 */
    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* 减少 Hero 高度 */
    .hero {
        height: 60vh;
        min-height: 400px;
    }

    /* 品牌特点单列 */
    .brand-features__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .brand-features__grid {
        grid-template-columns: 1fr;
    }

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

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }

    .section-title {
        font-size: 20px;
    }
}
