/**
 * SimpleShop 自定义样式
 *
 * @package SimpleShop
 */

/* ===== 首页主标题区域 ===== */
.homepage-title-section {
    padding: 50px 0;
    background: var(--bg-alt);
    text-align: center;
}

.homepage-title-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.homepage-main-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 15px;
    line-height: 1.3;
}

.homepage-description {
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.7;
    margin: 0;
}

.homepage-products-grid {
    margin-top: 40px;
}

@media (max-width: 768px) {
    .homepage-title-section {
        padding: 35px 0;
    }
    
    .homepage-main-title {
        font-size: 1.8rem;
    }
    
    .homepage-description {
        font-size: 0.95rem;
    }
}

/* ===== 头部滚动效果 ===== */
.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.site-header.hidden {
    transform: translateY(-100%);
}

.site-header {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ===== 顶部栏样式 ===== */
.header-top-content .top-left {
    display: flex;
    gap: 25px;
}

.header-top-content .top-left span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-top-content .top-right a {
    color: rgba(255,255,255,0.9);
}

.header-top-content .top-right a:hover {
    color: var(--white);
}

/* ===== 搜索框聚焦效果 ===== */
.header-search input:focus + button {
    color: var(--primary-color);
}

/* ===== 产品卡片悬停效果 ===== */
.product-card .product-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: var(--transition);
    z-index: 1;
}

.product-card:hover .product-image::before {
    background: rgba(0,0,0,0.05);
}

/* ===== 分类卡片动画 ===== */
.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: 1;
}

.category-card:hover::before {
    opacity: 0.3;
}

.category-overlay {
    z-index: 2;
}

/* ===== 按钮加载状态 ===== */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* ===== 产品详情页面 ===== */
.product-details .product-rating {
    margin-bottom: 15px;
}

.stock.out-of-stock {
    color: #e74c3c;
    font-weight: 600;
    padding: 15px;
    background: #ffeaea;
    border-radius: var(--radius-sm);
}

/* ===== WooCommerce 价格样式覆盖 ===== */
.woocommerce-Price-amount {
    font-weight: 700;
}

.product-price del {
    opacity: 0.6;
}

.product-price ins {
    text-decoration: none;
}

/* ===== 评论样式 ===== */
.woocommerce-Reviews {
    margin-top: 30px;
}

.woocommerce-Reviews .comment_container {
    display: flex;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid var(--border-color);
}

.woocommerce-Reviews .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    flex-shrink: 0;
}

.woocommerce-Reviews .comment-text {
    flex: 1;
}

.woocommerce-Reviews .meta {
    margin-bottom: 10px;
}

.woocommerce-Reviews .woocommerce-review__author {
    font-weight: 600;
}

.woocommerce-Reviews .woocommerce-review__published-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.woocommerce-Reviews .star-rating {
    display: inline-flex;
    color: #f5a623;
    margin-bottom: 10px;
}

/* ===== 评论表单 ===== */
#review_form_wrapper {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

#review_form .comment-form-rating {
    margin-bottom: 20px;
}

#review_form .stars {
    display: inline-flex;
    gap: 5px;
}

#review_form .stars a {
    font-size: 1.5rem;
    color: #ddd;
}

#review_form .stars a:hover,
#review_form .stars a.active {
    color: #f5a623;
}

#review_form input[type="text"],
#review_form input[type="email"],
#review_form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

#review_form input:focus,
#review_form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

#review_form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

#review_form .form-submit input {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 14px 30px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

#review_form .form-submit input:hover {
    background: var(--primary-hover);
}

/* ===== 购物车页面 ===== */
.woocommerce-cart-form table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-cart-form th {
    background: var(--bg-alt);
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.woocommerce-cart-form td {
    padding: 20px 15px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.woocommerce-cart-form .product-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.woocommerce-cart-form .quantity .qty {
    width: 60px;
    padding: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.woocommerce-cart-form .remove {
    color: #e74c3c;
    font-size: 1.2rem;
}

/* ===== 结账页面 ===== */
.woocommerce-checkout .form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.woocommerce-checkout .input-text,
.woocommerce-checkout select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.woocommerce-checkout .input-text:focus,
.woocommerce-checkout select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.woocommerce-checkout #payment {
    background: var(--bg-alt);
    padding: 30px;
    border-radius: var(--radius-md);
}

.woocommerce-checkout .place-order .button {
    width: 100%;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.woocommerce-checkout .place-order .button:hover {
    background: var(--primary-hover);
}

/* ===== 我的账户页面 ===== */
.woocommerce-MyAccount-navigation {
    background: var(--bg-alt);
    border-radius: var(--radius-md);
    padding: 20px;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
}

.woocommerce-MyAccount-navigation li {
    margin-bottom: 5px;
}

.woocommerce-MyAccount-navigation a {
    display: block;
    padding: 12px 15px;
    color: var(--text-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.woocommerce-MyAccount-navigation a:hover,
.woocommerce-MyAccount-navigation .is-active a {
    background: var(--primary-color);
    color: var(--white);
}

/* ===== 消息提示 ===== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.woocommerce-message {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.woocommerce-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.woocommerce-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* ===== 加载动画 ===== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* ===== 社交分享 ===== */
.social-share {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.social-share .share-label {
    font-weight: 600;
    color: var(--text-light);
}

.social-share a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: var(--transition);
}

.social-share a:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* ===== 分页样式 ===== */
.pagination-nav {
    margin-top: 40px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination li {
    list-style: none;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-color);
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.pagination .current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* ===== 文章列表 ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}

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

.post-card .post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card .post-content {
    padding: 25px;
}

.post-card .post-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.post-card .post-title a {
    color: var(--text-color);
}

.post-card .post-title a:hover {
    color: var(--primary-color);
}

.post-card .post-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.post-card .post-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.post-card .read-more {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== 无结果页面 ===== */
.no-results {
    text-align: center;
    padding: 80px 20px;
}

.no-results h2 {
    margin-bottom: 15px;
}

.no-results p {
    color: var(--text-light);
}

/* ===== Variable Product Variations ===== */
.variations {
    margin-bottom: 25px;
}

.variation-row {
    margin-bottom: 20px;
}

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

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

.variation-btn {
    padding: 10px 20px;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
    overflow: visible;
}

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

.variation-btn.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.variation-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

.reset_variations {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.reset_variations:hover {
    color: var(--primary-color);
}

.single_variation {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-alt);
    border-radius: var(--radius-sm);
}

.single_variation:empty {
    display: none;
}

.single_variation .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.product-buttons .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.woocommerce-variation-add-to-cart {
    display: none;
}

.woocommerce-variation-add-to-cart.woocommerce-variation-add-to-cart-enabled {
    display: block;
}

/* ===== 响应式补充 ===== */
@media (max-width: 992px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-top {
        display: none;
    }
    
    .woocommerce-cart-form .product-thumbnail {
        display: none;
    }
}

@media (max-width: 480px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .social-share {
        flex-wrap: wrap;
    }
}

/* ===== 移动端底部导航栏 ===== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.mobile-bottom-nav {
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 6px 12px;
    position: relative;
    transition: color 0.2s ease;
    min-width: 60px;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
    transition: transform 0.2s ease;
}

.mobile-nav-item span:not(.nav-badge) {
    white-space: nowrap;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: var(--primary-color);
}

.mobile-nav-item.active i {
    transform: scale(1.1);
}

/* 导航徽章 */
.mobile-nav-item .nav-badge {
    position: absolute;
    top: 0;
    right: 50%;
    transform: translateX(12px);
    background: #e74c3c;
    color: var(--white);
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    border-radius: 50%;
    padding: 0 4px;
}

/* 心愿单徽章 - 红色小圆点 */
.mobile-nav-item .nav-badge.wishlist-count {
    background: #e74c3c;
}

/* 购物车徽章 */
.mobile-nav-item .nav-badge.cart-count {
    background: var(--primary-color);
}

/* 仅在移动端显示 */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }
    
    /* 为底部导航留出空间 */
    body {
        padding-bottom: 70px;
    }
    
    /* 调整 footer 底部间距 */
    .site-footer {
        margin-bottom: 0;
    }
    
    /* 确保弹窗和模态框不被遮挡 */
    .simpleshop-toast {
        bottom: 85px !important;
    }
}

/* 更小屏幕的适配 */
@media (max-width: 400px) {
    .mobile-nav-item {
        padding: 6px 8px;
        min-width: auto;
        font-size: 0.65rem;
    }
    
    .mobile-nav-item i {
        font-size: 1.1rem;
    }
}

/* ===== 联系我们页面样式 ===== */
.contact-page {
    padding-bottom: 60px;
}

.contact-page .page-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
    margin-bottom: 50px;
}

.contact-page .page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.contact-page .page-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 50px;
}

/* 联系信息 */
.contact-info {
    background: var(--bg-alt);
    padding: 40px;
    border-radius: var(--radius-lg);
}

.contact-info h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--text-color);
}

.contact-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-color);
}

.contact-content p {
    color: var(--text-light);
    margin: 0;
    line-height: 1.6;
}

.contact-content a {
    color: var(--text-light);
    transition: var(--transition);
}

.contact-content a:hover {
    color: var(--primary-color);
}

/* 社交媒体 */
.contact-social {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.contact-social h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.contact-social .social-links {
    display: flex;
    gap: 12px;
}

.contact-social .social-links a {
    width: 42px;
    height: 42px;
    background: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.contact-social .social-links a:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-3px);
}

/* 联系表单 */
.contact-form-wrapper {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.contact-form-wrapper h2 {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--text-color);
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.contact-form label .required {
    color: #e74c3c;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--white);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.contact-form .form-submit {
    margin-top: 10px;
}

.contact-form .btn {
    padding: 14px 35px;
    font-size: 1rem;
    font-weight: 600;
    min-width: 180px;
}

.contact-form .btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 表单消息 */
.contact-form .form-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.contact-form .form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.contact-form .form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 地图区域 */
.contact-map {
    margin-top: 50px;
}

.contact-map h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    text-align: center;
    color: var(--text-color);
}

.contact-map .map-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.contact-map .map-container iframe {
    width: 100%;
    height: 400px;
    border: none;
    display: block;
}

/* 响应式 */
@media (max-width: 992px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .contact-info {
        order: 2;
    }
    
    .contact-form-wrapper {
        order: 1;
    }
}

@media (max-width: 768px) {
    .contact-page .page-hero {
        padding: 40px 0;
    }
    
    .contact-page .page-title {
        font-size: 1.8rem;
    }
    
    .contact-info,
    .contact-form-wrapper {
        padding: 25px;
    }
    
    .contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .contact-map .map-container iframe {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .contact-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .contact-icon {
        margin: 0 auto;
    }
    
    .contact-social .social-links {
        justify-content: center;
    }
}

