/*
Theme Name: SpideRarmor
Theme URI: https://spiderarmor.com
Author: SpideRarmor Team
Author URI: https://spiderarmor.com
Description: Modern WordPress block theme with multi-language support and WooCommerce integration, optimized for the European and American markets.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spiderarmor
Tags: e-commerce, block-theme, responsive, multi-language, woocommerce, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ========================================
   Basic Style Reset
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background-color: #0a0a0a;
    overflow-x: hidden;
    max-width: 100vw;
}

/* ========================================
   Link Styles
   ======================================== */
a {
    color: #e60012;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #ff3344;
    text-decoration: none;
}

/* ========================================
   Image Styles
   ======================================== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

/* ========================================
   Heading Styles
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #ffffff;
}

h1, h2 {
    color: #e60012;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.5rem;
}

/* ========================================
   Utility Classes
   ======================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.text-center { text-align: center; }

/* ========================================
   Button Styles
   ======================================== */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background-color: #e60012;
    color: #ffffff;
    border-color: #e60012;
    box-shadow: 0 4px 6px rgba(230, 0, 18, 0.3);
}

.btn-primary:hover {
    background-color: transparent;
    color: #e60012;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(230, 0, 18, 0.5);
}

.btn-secondary {
    background-color: transparent;
    color: #ffffff;
    border-color: #ffffff;
}

.btn-secondary:hover {
    background-color: #ffffff;
    color: #111111;
    transform: translateY(-3px);
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #111111 0%, #000000 100%);
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M50 0 L50 100 M0 50 L100 50 M25 25 L75 75 M25 75 L75 25" stroke="rgba(230, 0, 18, 0.1)" stroke-width="1" fill="none"/></svg>');
    background-repeat: repeat;
    opacity: 0.3;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    color: #e60012;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 20px rgba(230, 0, 18, 0.5);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #ffffff;
    margin-bottom: 2rem;
}

/* ========================================
   Product Card Styles
   ======================================== */
.product-card {
    background-color: #111111;
    border: 1px solid #222222;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(230, 0, 18, 0.2);
    border-color: #e60012;
}

.product-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-card .product-info {
    padding: 1.5rem;
}

.product-card .product-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.product-card .product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e60012;
}

/* ========================================
   WooCommerce Add to Cart Notifications
   ======================================== */

/* 加入购物车成功提示 */
.woocommerce-message,
.wc-block-components-notice-banner {
    background: #1a1a1a !important;
    border: 1px solid #333 !important;
    border-left: 4px solid #4caf50 !important;
    color: #fff !important;
    padding: 1rem 1.5rem !important;
    margin-bottom: 1rem !important;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInDown 0.3s ease, fadeOut 0.3s ease 4s forwards;
}

.woocommerce-message::before {
    content: '✓' !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #4caf50 !important;
    color: #fff !important;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.woocommerce-message a,
.wc-block-components-notice-banner a {
    color: #e60012 !important;
    font-weight: 600;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; pointer-events: none; }
}

/* ========================================
   Add to Cart Button & View Cart
   ======================================== */
.added_to_cart {
    display: none !important;
}

/* 加入购物车按钮状态 */
.add_to_cart_button {
    position: relative;
    transition: all 0.3s ease;
}

.add_to_cart_button.added {
    background: #4caf50 !important;
}

.add_to_cart_button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.add_to_cart_button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 迷你购物车侧边栏 */
.wc-block-mini-cart__drawer {
    background: #111;
    border-left: 1px solid #333;
}

.wc-block-mini-cart__title {
    color: #fff;
    border-bottom: 1px solid #333;
}

/* ========================================
   Site Logo Styles
   ======================================== */
.site-logo-container {
    display: flex;
    align-items: center;
}

.site-logo-image img {
    max-width: 180px;
    height: auto;
    display: block;
}

.wp-block-site-title {
    display: none;
}

/* ========================================
   WooCommerce Product Grid
   ======================================== */

/* 确保 WooCommerce 容器使用全宽 */
.woocommerce .woocommerce-products-header,
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering,
.woocommerce ul.products,
.woocommerce-page ul.products {
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* 覆盖 WordPress 默认的 content-size 限制 */
.wp-block-group.alignwide .woocommerce,
.wp-block-group.alignwide .woocommerce ul.products,
main.alignwide .woocommerce,
main.alignwide .woocommerce ul.products {
    max-width: 1400px !important;
}

.woocommerce ul.products,
.woocommerce ul.products.columns-4,
.woocommerce-page ul.products,
.woocommerce-page ul.products.columns-4 {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.5rem;
    margin: 0 auto !important;
    padding: 0 1rem;
    list-style: none;
    max-width: 1400px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.woocommerce ul.products li.product,
.woocommerce ul.products.columns-4 li.product,
.woocommerce-page ul.products li.product,
.woocommerce-page ul.products.columns-4 li.product {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #111111;
    border: 1px solid #222222;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex !important;
    flex-direction: column;
    float: none !important;
}

.woocommerce ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(230, 0, 18, 0.2);
    border-color: #e60012;
}

.woocommerce ul.products li.product a {
    display: block;
    text-decoration: none;
}

.woocommerce ul.products li.product a img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    object-position: center;
    margin: 0;
    border-radius: 0;
    background: #1a1a1a;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
    padding: 1rem 1.5rem 0.5rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.3;
    /* 两行截断，超出显示省略号 */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: 3.6em !important;  /* 严格限制最大高度为两行 */
    height: auto !important;       /* 高度自适应内容，但不超过max-height */
}

/* 商品价格 - 紧凑布局 */
.woocommerce ul.products li.product .price {
    padding: 0.25rem 1.5rem 0 !important;
    color: #e60012;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 !important;
    display: block !important;
}

/* 隐藏价格和按钮之间的 <br> 标签 - 减少多余高度 */
.woocommerce ul.products li.product .woocommerce-loop-product__link br,
.woocommerce ul.products li.product .screen-reader-text {
    display: none !important;  /* 完全隐藏这些元素 */
}

/* 商品卡片内的 p 容器 - 紧凑布局 */
.woocommerce ul.products li.product p {
    margin: 0 !important;
    padding: 0 !important;
}

/* 商品按钮 - 紧凑布局 */
.woocommerce ul.products li.product .button {
    display: block !important;
    margin: 0.5rem 1.5rem 1rem !important;  /* 减少顶部间距 */
    background: #e60012;
    color: #fff !important;
    border: none;
    padding: 0.6rem 1rem !important;  /* 减少垂直padding */
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.woocommerce ul.products li.product .button:hover {
    background: #ff3344;
    transform: translateY(-2px);
}

.woocommerce ul.products li.product .onsale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e60012;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

.woocommerce ul.products li.product {
    position: relative;
}

.woocommerce-result-count,
.woocommerce-ordering {
    color: #888888;
    margin-bottom: 1rem;
}

/* Clear floats */
.woocommerce ul.products::after,
.woocommerce ul.products::before {
    content: none !important;
}

/* ========================================
   WooCommerce Pages (Cart, Checkout, Account)
   ======================================== */
.woocommerce-page .wp-block-group.is-layout-constrained,
.woocommerce-page main[data-block-name="woocommerce/page-content-wrapper"],
.wc-block-components-sidebar-layout {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 2rem !important;
}

/* 购物车页面内容包装器 */
.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout,
.wp-block-woocommerce-account-content {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 2rem !important;
}

/* 购物车页面主容器 */
.wc-block-cart,
.wc-block-checkout {
    max-width: 1400px !important;
    margin: 0 auto !important;
}

/* ========================================
   WooCommerce Single Product Page
   ======================================== */
/* 版心宽度统一在 functions.php 中定义 */

/* 面包屑导航 */
.woocommerce .woocommerce-breadcrumb,
.wc-block-breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

.woocommerce .woocommerce-breadcrumb a {
    color: #ccc;
    text-decoration: none;
}

.woocommerce .woocommerce-breadcrumb a:hover {
    color: #e60012;
}

/* 商品图片画廊 - 基础样式（详细样式在 functions.php 中定义） */
.woocommerce-product-gallery {
    background: #111;
    border-radius: 8px;
}

/* 商品标题 */
.product-detail-page .wp-block-post-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* 商品价格 */
.wc-block-components-product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e60012;
    margin-bottom: 1.5rem;
}

.wc-block-components-product-price .woocommerce-Price-currencySymbol {
    font-size: 1.25rem;
}

/* 商品简介 */
.product-detail-page .wp-block-post-excerpt {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* 加入购物车表单 */
.wc-block-add-to-cart-form {
    margin-bottom: 1.5rem;
}

.wc-block-add-to-cart-form .quantity {
    display: inline-flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
}

.wc-block-add-to-cart-form .quantity input {
    background: transparent;
    border: none;
    color: #fff;
    width: 60px;
    text-align: center;
    padding: 0.75rem;
    font-size: 1rem;
}

.wc-block-add-to-cart-form .single_add_to_cart_button {
    background: #e60012;
    color: #fff;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wc-block-add-to-cart-form .single_add_to_cart_button:hover {
    background: #ff1a2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.3);
}

/* 库存信息 */
.wc-block-add-to-cart-form .stock {
    color: #4caf50;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* 商品元信息 */
.wp-block-woocommerce-product-meta {
    padding-top: 1.5rem;
    border-top: 1px solid #222;
}

/* 商品描述区域 */
.product-description-section {
    margin-top: 3rem;
}

.product-description-section h2 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e60012;
    display: inline-block;
}

.product-description-section .wp-block-post-content {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.8;
}

.product-description-section .wp-block-post-content p {
    margin-bottom: 1rem;
}

.product-description-section .wp-block-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

/* 相关产品区域 */
.related-products-section {
    margin-top: 4rem;
}

.related-products-section h2 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .product-detail-page .wp-block-columns {
        flex-direction: column;
    }
    
    .product-detail-page .wp-block-column {
        flex-basis: 100% !important;
    }
    
    .product-detail-page .wp-block-post-title {
        font-size: 1.5rem;
    }
    
    .wc-block-components-product-price {
        font-size: 1.25rem;
    }
}

/* ========================================
   Footer Styles
   ======================================== */
.site-footer {
    background-color: #0a0a0a;
    border-top: 1px solid #222222;
    padding: 4rem 0 2rem;
    color: #ffffff;
}

.site-footer h3 {
    color: #e60012;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.site-footer p {
    color: #888888;
    line-height: 1.8;
}

.site-footer a {
    color: #ffffff;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #e60012;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e60012;
    margin-bottom: 1rem;
}

.footer-tagline {
    color: #888888;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #ffffff;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #e60012;
}

.footer-bottom {
    border-top: 1px solid #222222;
    padding-top: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.footer-bottom p {
    color: #666666;
    font-size: 0.875rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #222222;
    border-radius: 50%;
    color: #ffffff;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: #e60012;
    transform: translateY(-3px);
}

/* ========================================
   Cart Icon Styles
   ======================================== */
.cart-icon {
    position: relative;
}

.cart-icon .cart-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: color 0.3s ease;
}

.cart-icon .cart-link:hover {
    color: #e60012;
}

.cart-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.cart-icon .cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #e60012;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ========================================
   Navigation Menu Styles
   ======================================== */

/* 桌面端导航容器 */
@media (min-width: 768px) {
    .wp-block-navigation__responsive-container-open {
        display: none !important;
    }
    
    .wp-block-navigation__responsive-container {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        border: none !important;
        overflow: visible !important;
    }
    
    .wp-block-navigation__responsive-container-content {
        position: static !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .wp-block-navigation__responsive-dialog {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .wp-block-navigation__responsive-close {
        display: none !important;
    }
}

/* ========================================
   Header Styles
   ======================================== */

/* Header 外层容器 */
header.wp-block-template-part {
    width: 100%;
}

/* Header 第一层容器 - 实际渲染的HTML结构 */
header.wp-block-template-part > .wp-block-group.is-layout-flow,
header.wp-block-template-part > .wp-block-group {
    padding: 1.5rem 80px !important;
}

/* Header 主容器 */
.header-main {
    display: flex !important;
    align-items: center !important;
    max-width: 1400px;
    margin: 0 auto;
    gap: 0 !important;
    border-bottom: 1px solid #222222 !important;
}

/* Logo */
.site-logo-image {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* 导航菜单 */
.primary-nav {
    display: flex;
    align-items: center;
    margin-left: 2rem;
    flex-shrink: 0;
}

.primary-nav .primary-navigation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-nav .primary-navigation li {
    margin: 0;
}

.primary-nav .primary-navigation a {
    color: #ffffff;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.primary-nav .primary-navigation a:hover {
    color: #e60012;
    background: rgba(230, 0, 18, 0.1);
}

/* 右侧工具栏 - 靠右 */
.header-tools {
    margin-left: auto !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Logo 图片垂直居中 */
.site-logo-image,
.site-logo-image img {
    display: flex;
    align-items: center;
}

/* 购物车图标垂直居中 */
.header-cart-icon {
    display: flex;
    align-items: center;
}

.header-cart-icon .cart-link {
    display: flex;
    align-items: center;
    line-height: 1;
}

.wp-block-navigation__container,
.primary-navigation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wp-block-navigation__container ul,
.primary-navigation ul {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wp-block-navigation__container li,
.primary-navigation li {
    margin: 0;
}

.wp-block-navigation__container a,
.primary-navigation a {
    color: #ffffff;
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    transition: color 0.3s ease;
    font-size: 0.85rem;
    border-radius: 4px;
    display: block;
}

.wp-block-navigation__container a:hover,
.primary-navigation a:hover {
    color: #e60012;
    background: rgba(230, 0, 18, 0.1);
}

/* ========================================
   Polylang Language Switcher Styles
   ======================================== */

/* 语言选择器容器 */
.language-switcher {
    position: relative;
    margin-right: 1rem;
    display: flex !important;
    align-items: center !important;
}

/* 右侧工具栏容器 - 实际的动态类名 */
header.wp-block-template-part .wp-block-group.is-nowrap,
header.wp-block-template-part .wp-container-core-group-is-layout-08b87c7b,
.header-tools {
    display: flex !important;
    align-items: center !important;  /* 垂直居中所有子元素 */
}

/* Header 所有层级的 flex 容器都垂直居中 */
header.wp-block-template-part .wp-block-group.is-layout-flex {
    align-items: center !important;
}

/* 下拉菜单容器 */
.lang-dropdown {
    position: relative;
    display: flex !important;  /* 确保内部也是flex布局 */
    align-items: center !important;  /* 垂直居中 */
}

.lang-dropdown-toggle {
    display: flex !important;
    align-items: center !important;  /* 垂直居中图标和文字 */
    gap: 0.4rem;
    background: #111111;
    color: #ffffff;
    border: 1px solid #333333;
    border-radius: 4px;
    padding: 8px 12px;  /* 使用固定像素值，确保高度一致 */
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    height: auto;  /* 让高度自适应内容 */
    line-height: 1;  /* 消除行高影响 */
}

.lang-dropdown-toggle:hover {
    border-color: #e60012;
}

.lang-flag {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
}

.lang-name {
    flex: 1;
    text-align: left;
}

.lang-arrow {
    transition: transform 0.3s ease;
}

.lang-dropdown:hover .lang-arrow {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #111111;
    border: 1px solid #333333;
    border-radius: 4px;
    margin-top: 4px;
    padding: 0.35rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 0.75rem;
}

.lang-dropdown:hover .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.lang-option:hover {
    background: rgba(230, 0, 18, 0.1);
    color: #e60012;
}

.lang-option.active {
    color: #e60012;
    background: rgba(230, 0, 18, 0.05);
}

/* 旧版 select 样式保留 */
.wp-block-polylang-language-switcher ul {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wp-block-polylang-language-switcher li {
    margin: 0;
    padding: 0;
}

.wp-block-polylang-language-switcher a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.wp-block-polylang-language-switcher a:hover {
    color: #e60012;
    background: rgba(230, 0, 18, 0.1);
}

.wp-block-polylang-language-switcher a.active,
.wp-block-polylang-language-switcher .current-lang a {
    color: #e60012;
    font-weight: 600;
}

.wp-block-polylang-language-switcher img {
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
}

/* 下拉菜单样式 */
.wp-block-polylang-language-switcher select,
.language-switcher select {
    background: #111111;
    color: #ffffff;
    border: 1px solid #333333;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    min-width: 120px;
}

.wp-block-polylang-language-switcher select:hover,
.language-switcher select:hover {
    border-color: #e60012;
}

.wp-block-polylang-language-switcher select:focus,
.language-switcher select:focus {
    border-color: #e60012;
    box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.2);
}

.wp-block-polylang-language-switcher select option,
.language-switcher select option {
    background: #111111;
    color: #ffffff;
    padding: 0.5rem;
}

/* ========================================
   WooCommerce Pagination Styles
   ======================================== */

.woocommerce-pagination {
    margin-top: 3rem !important;
    margin-bottom: 2rem !important;
    text-align: center;
    clear: both;
}

.woocommerce-pagination .page-numbers {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.woocommerce-pagination .page-numbers li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    background: none !important;
    border: none !important;
    border-right: none !important;
    border-left: none !important;
}

/* 覆盖 WooCommerce 默认的 border-right 样式 */
.woocommerce nav.woocommerce-pagination ul li,
.woocommerce-page nav.woocommerce-pagination ul li,
nav.woocommerce-pagination ul li {
    border-right: none !important;
    border-left: none !important;
    border: none !important;
}

.woocommerce-pagination .page-numbers li a,
.woocommerce-pagination .page-numbers li span.page-numbers {
    display: inline-block !important;
    width: 40px !important;
    height: 40px !important;
    line-height: 36px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #aaa !important;
    background: transparent !important;
    border: 1px solid #333 !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
}

.woocommerce-pagination .page-numbers li a:hover {
    color: #fff !important;
    border-color: #e60012 !important;
    background: #e60012 !important;
}

.woocommerce-pagination .page-numbers li span.page-numbers.current {
    color: #fff !important;
    background: #e60012 !important;
    border-color: #e60012 !important;
}

.woocommerce-pagination .page-numbers li a.next,
.woocommerce-pagination .page-numbers li a.prev {
    width: auto !important;
    padding: 0 16px !important;
    border-radius: 4px !important;
}

@media (max-width: 768px) {
    .woocommerce-pagination .page-numbers {
        gap: 6px !important;
    }
    
    .woocommerce-pagination .page-numbers li a,
    .woocommerce-pagination .page-numbers li span.page-numbers {
        width: 36px !important;
        height: 36px !important;
        line-height: 32px !important;
        font-size: 13px !important;
    }
}

/* ========================================
   Scrollbar Styles
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #111111;
}

::-webkit-scrollbar-thumb {
    background: #e60012;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff3344;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 1200px) {
    .woocommerce ul.products,
    .woocommerce ul.products.columns-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 992px) {
    .woocommerce ul.products,
    .woocommerce ul.products.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .woocommerce ul.products,
    .woocommerce ul.products.columns-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .hero-section {
        min-height: 500px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
    .woocommerce ul.products,
    .woocommerce ul.products.columns-4 {
        grid-template-columns: 1fr !important;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    html {
        font-size: 14px;
    }
}
