/**
 * PawPopo Theme - Additional Styles & Animations
 * 墨绿色森林主题 - 补充样式
 */

/* ============ 增强的滚动动画 ============ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 延迟动画类 */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* ============ 产品网格交错动画 ============ */
.products-grid .product-card:nth-child(1) { transition-delay: 0s; }
.products-grid .product-card:nth-child(2) { transition-delay: 0.08s; }
.products-grid .product-card:nth-child(3) { transition-delay: 0.16s; }
.products-grid .product-card:nth-child(4) { transition-delay: 0.24s; }

/* ============ 场景卡片渐变背景 ============ */
.scenes-grid .scene-card {
    background-size: 200% 200%;
}

.scenes-grid .scene-card:hover {
    background-position: 100% 100%;
}

/* ============ Logo 圆 SVG 图标悬停 ============ */
.logo-circle svg {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-wrapper:hover .logo-circle svg {
    transform: scale(1.1) rotate(8deg);
}

/* ============ 按钮涟漪效果 ============ */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    pointer-events: none;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* ============ Hero 标题渐变文字 ============ */
.accent-text {
    background: linear-gradient(135deg, #1A4D2E 0%, #3A7D5A 40%, #FFC857 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    transition: filter 0.3s ease;
}

/* ============ 输入框聚焦样式 ============ */
.newsletter-input-wrap:focus-within {
    box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.15), 0 4px 12px rgba(26, 77, 46, 0.1);
    transform: translateY(-1px);
}

.newsletter-input-wrap {
    transition: all 0.3s ease;
}

/* ============ 产品图标动画 ============ */
.product-icon {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.4s ease;
}

/* ============ 数字徽标动画 ============ */
.cart-count {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ============ 品牌故事区域文字排版优化 ============ */
.brand-story-text .brand-quote::before {
    content: '"';
    opacity: 0.3;
    font-size: 2em;
    margin-right: 4px;
    vertical-align: -0.3em;
    color: var(--accent);
}

/* ============ 尺码表 hover 效果增强 ============ */
.size-chart-table tbody tr {
    transition: background-color 0.2s ease;
}

/* ============ Social Link Hover Icon ============ */
.social-link svg {
    transition: transform 0.3s ease;
}

.social-link:hover svg {
    transform: scale(1.15);
}

/* ============ 空状态提示动画 ============ */
@keyframes bounce-in {
    0% { opacity: 0; transform: scale(0.8) translateY(10px); }
    60% { opacity: 1; transform: scale(1.05) translateY(0); }
    100% { transform: scale(1) translateY(0); }
}

/* ============ 加载动画 ============ */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============ 响应式微调：小屏幕触摸优化 ============ */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.98);
    }

    .product-card:active {
        transform: scale(0.98);
    }

    .scene-card:active .scene-overlay {
        opacity: 1;
    }
}

/* ============ 非常小屏幕优化 ============ */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.625rem !important;
    }

    .product-main-title {
        font-size: 1.25rem !important;
    }

    .price-big {
        font-size: 1.5rem !important;
    }

    .section-title {
        font-size: 1.25rem !important;
    }
}

/* ============ 打印样式增强 ============ */
@media print {
    .btn,
    .hover-btn,
    .menu-toggle {
        display: none !important;
    }

    .product-card,
    .category-card,
    .scene-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ============ 无障碍：键盘焦点样式 ============ */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============ 深色模式支持 (自动) ============ */
@media (prefers-color-scheme: dark) {
    /* 暗色模式保持森林主题配色 */
    body {
        background: #1A231D;
        color: #E8EDE5;
    }

    .section-products,
    .section-scenes,
    .features-row,
    .hero {
        background: #252F28 !important;
    }

    .section-categories,
    .trust-bar,
    .breadcrumb-section,
    .size-chart-section {
        background: #2D3A30 !important;
    }

    .product-card,
    .category-card,
    .tip-card,
    .price-panel,
    .purchase-panel,
    .spec-item {
        background: #324236 !important;
        border-color: #3D5243 !important;
        color: #E8EDE5 !important;
    }

    .product-title-text,
    .section-title {
        color: #FFFFFF !important;
    }

    .product-desc-text,
    .section-subtitle,
    .brand-bio,
    .info-description {
        color: #B8C4B8 !important;
    }

    .current-price {
        color: #FFC857 !important;
    }
}

/* ============ 滚动条美化增强 (Firefox) ============ */
* {
    scrollbar-width: thin;
    scrollbar-color: #3A7D5A #E8EDE5;
}

/* ============ 文本选中颜色 ============ */
::selection {
    background: rgba(255, 200, 87, 0.6);
    color: #1A4D2E;
}
