/* SANVELLA Product Detail */
/* ============================================
   About Page Custom Template - SANVELLA Black & White Style
   针对 page-about.php 模板
   ============================================ */

/* Hero Section - 黑色渐变背景 */
.page-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 60px 40px 50px;
    text-align: center;
    color: white;
    margin-bottom: 0;
}

.page-hero h1 {
    font-family: var(--heading-font);
    font-size: 56px;
    font-weight: 400;
    letter-spacing: 3px;
    color: white;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.page-hero p {
    font-family: var(--body-font);
    font-size: 16px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

/* Brand Story Section - 白色背景 */
.about-story {
    background: white;
    padding: 60px 40px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
}

.about-title {
    font-family: var(--heading-font);
    font-size: 36px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #111;
    margin-bottom: 16px;
}

.about-description {
    font-family: var(--body-font);
    font-size: 18px;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 24px;
}

.about-text p {
    font-family: var(--body-font);
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 16px;
}

/* Core Values Section - 浅灰背景 */
.core-values {
    background: #fafafa;
    padding: 60px 40px;
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
}

.section-title {
    font-family: var(--heading-font);
    font-size: 42px;
    font-weight: 400;
    letter-spacing: 2px;
    color: #111;
    margin-bottom: 16px;
}

.section-subtitle {
    font-family: var(--body-font);
    font-size: 16px;
    letter-spacing: 1px;
    color: #666;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.value-card {
    text-align: center;
    padding: 40px 20px;
}

.value-icon {
    width: 80px;
    height: 80px;
    background: #111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    transition: all 0.3s ease;
}

.value-icon i {
    font-size: 32px;
    color: white;
}

.value-card:hover .value-icon {
    background: #333;
    transform: translateY(-4px);
}

.value-card h3 {
    font-family: var(--heading-font);
    font-size: 20px;
    font-weight: 400;
    letter-spacing: 1px;
    color: #111;
    margin-bottom: 12px;
}

.value-card p {
    font-family: var(--body-font);
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

/* Team Section - 白色背景 */
.team-section {
    background: white;
    padding: 60px 40px;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.team-icon {
    width: 100px;
    height: 100px;
    background: #111;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    transition: all 0.3s ease;
}

.team-icon i {
    font-size: 40px;
    color: white;
}

.team-member:hover .team-icon {
    background: #333;
    transform: scale(1.05);
}

.team-member h3 {
    font-family: var(--heading-font);
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 1px;
    color: #111;
    margin-bottom: 8px;
}

.team-member .role {
    font-family: var(--body-font);
    font-size: 14px;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 16px;
    text-transform: uppercase;
}

.team-member .bio {
    font-family: var(--body-font);
    font-size: 15px;
    line-height: 1.6;
    color: #666;
}

/* Contact CTA Section - 黑色渐变背景 */
.contact-cta {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 60px 40px;
    text-align: center;
    color: white;
}

.contact-cta h2 {
    font-family: var(--heading-font);
    font-size: 36px;
    font-weight: 400;
    letter-spacing: 2px;
    color: white;
    margin-bottom: 20px;
}

.contact-cta > p {
    font-family: var(--body-font);
    font-size: 16px;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 40px;
    font-family: var(--body-font);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    font-weight: 400;
}

.btn-secondary {
    background: white;
    color: #111;
    border-color: white;
}

.btn-secondary:hover {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline:hover {
    background: white;
    color: #111;
}

/* About Page Responsive */
@media (max-width: 1024px) {
    .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-content {
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .page-hero {
        padding: 80px 20px 60px;
    }
    
    .page-hero h1 {
        font-size: 36px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .values-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .core-values,
    .team-section,
    .about-story,
    .contact-cta {
        padding: 60px 20px;
    }
}

/* ============================================
   Product Detail Page - SANVELLA Clean & Rational Layout
   产品详情页 - 清晰合理的布局设计
   参考: MR PORTER, SSENSE, NET-A-PORTER
   ============================================ */

/* 隐藏WooCommerce默认元素 */
.single-product .woocommerce-product-gallery__trigger {
    display: none !important;
}

/* 隐藏WooCommerce默认的availability文本（已自定义显示） */
.single-product .product-cart-section p,
.single-product .product-cart-section + p.stock,
.single-product form.cart + p.stock,
.single-product .woocommerce-variation-availability,
.single-product .product-cart-section p.stock,
.single-product .product-info-section > p.stock,
.single-product .product-info-section p:has-text("Availability") {
    display: none !important;
}

/* 只显示购物车表单本身 */
.single-product .product-cart-section .cart {
    display: flex !important;
}

/* ========== 主布局容器 ========== */
.sanvella-single-product {
    background: white;
    --product-shell-max-width: 1360px;
    --product-shell-padding: clamp(24px, 4vw, 60px);
    --product-shell-gap: clamp(36px, 5vw, 72px);
    --product-gallery-height: clamp(460px, 44vw, 680px);
    --product-info-width: min(100%, 520px);
    --product-copy-width: min(100%, 760px);
}

.product-main-container {
    max-width: var(--product-shell-max-width);
    margin: 0 auto;
    padding: clamp(28px, 4vw, 56px) var(--product-shell-padding) clamp(28px, 4vw, 44px);
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
    gap: var(--product-shell-gap);
    align-items: start;
}

/* ========== 左侧：产品图片 ========== */
.product-images-section {
    width: 100%;
    min-height: var(--product-gallery-height);
}

.single-product .product-images-section .woocommerce-product-gallery,
.single-product div.woocommerce-product-gallery {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: var(--product-gallery-height) !important;
    overflow: visible !important;
    opacity: 1 !important; /* 修复：由于注销了WooCommerce的single-product脚本，需要手动设置opacity */
    transition: none !important; /* 禁用过渡效果 */
}

.product-images-section .woocommerce-product-gallery .woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
    margin: 0 !important;
    width: 100% !important;
    height: var(--product-gallery-height) !important;
    position: relative !important; /* 确保FlexSlider定位正常 */
    transform: none !important; /* 禁用FlexSlider的transform，使用opacity切换 */
}

.product-images-section .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image,
.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image {
    margin: 0 !important;
    width: 100% !important;
    height: var(--product-gallery-height) !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    opacity: 0 !important;
    z-index: 1 !important;
    transition: opacity 0.5s ease-in-out !important; /* 增加动画时长和缓动效果 */
}

/* 只有flex-active-slide才可见（多图片产品） */
.product-images-section .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image.flex-active-slide,
.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image.flex-active-slide {
    opacity: 1 !important;
    z-index: 2 !important;
}

/* 单图片产品：第一张或唯一的图片默认可见 */
.product-images-section .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:first-child:last-child,
.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image:first-child:last-child {
    opacity: 1 !important;
    z-index: 2 !important;
}

.product-images-section .woocommerce-product-gallery__image a {
    display: block !important;
    width: 100%;
    height: 100%;
    position: relative !important;
    overflow: hidden;
}

/* 主图样式 - 只针对gallery wrapper中的图片，不影响缩略图 */
.product-images-section .woocommerce-product-gallery__wrapper img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain !important;
    display: block !important;
}

.product-images-section .woocommerce-product-gallery__image.sanvella-product-gallery-slide--video,
.woocommerce-product-gallery__image.sanvella-product-gallery-slide--video {
    background: #111;
}

.sanvella-product-gallery-video,
.sanvella-product-gallery-video video {
    width: 100%;
    height: 100%;
}

.sanvella-product-gallery-video {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111;
}

.sanvella-product-gallery-video video {
    display: block;
    object-fit: cover;
}

/* ========== 产品图库缩略图样式 ========== */
.woocommerce-product-gallery,
.woocommerce-product-gallery *,
.flex-control-thumbs,
.flex-control-thumbs * {
    border: none !important; /* 强制移除所有边框 */
    outline: none !important;
}

.flex-control-thumbs li .sanvella-product-gallery-thumb {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.flex-control-thumbs li .sanvella-product-gallery-thumb--video {
    background: #111;
}

.flex-control-thumbs li .sanvella-product-gallery-thumb__badge {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 4px 6px;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.84);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.flex-control-thumbs {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 80px);
    justify-content: start;
    align-items: start;
    gap: 10px;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    margin-top: 15px !important;
    padding: 0 !important;
    margin-bottom: 0 !important; /* 移除底部边距避免线条 */
    list-style: none !important;
    list-style-type: none !important; /* 彻底去除列表样式 */
    background: transparent !important; /* 透明背景 */
}

.flex-control-thumbs li {
    flex: 0 0 auto;
    width: 80px !important;
    height: 80px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important; /* 完全移除边框避免横线 */
    outline: none !important; /* 移除outline */
    border-radius: 4px !important; /* 添加圆角更美观 */
    cursor: pointer !important;
    overflow: hidden !important;
    transition: opacity 0.2s ease !important;
    list-style: none !important;
    list-style-type: none !important;
    background: none !important; /* 移除背景 */
}

/* 移除任何可能的伪元素（横线、点等） */
.flex-control-thumbs li::before,
.flex-control-thumbs li::after {
    display: none !important;
    content: none !important;
}

.flex-control-thumbs li:hover {
    opacity: 0.8;
}

.flex-control-thumbs li.flex-active {
    opacity: 1;
    box-shadow: 0 0 0 2px #000 !important;
}

.flex-control-thumbs li img {
    position: static !important;
    width: 80px !important; /* 填满容器 */
    height: 80px !important; /* 填满容器 */
    object-fit: cover !important;
    max-width: 100% !important;
    top: auto !important;
    left: auto !important;
    display: block !important;
    border: none !important; /* 确保图片没有边框 */
    outline: none !important;
}

/* Sale标签 - 产品详情页隐藏 */
.single-product .onsale,
.single-product .ast-on-card-button.ast-onsale-card {
    display: none !important;
}

/* ========== 右侧：产品信息 ========== */
.product-info-section {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--product-info-width);
    padding-left: 0;
    justify-self: end;
}

/* 分类标签 */
.product-category-badge {
    font-family: var(--body-font);
    font-size: 10px;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #bbb;
    margin-bottom: 25px;
    font-weight: 400;
}

/* 产品名称 - SANVELLA完全复制 */
.product-name {
    font-family: var(--heading-font);
    font-size: clamp(34px, 3vw, 46px);
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0;
    line-height: 1.16;
    color: #111;
    margin: 0 0 28px 0;
}

/* 价格 - SANVELLA官网样式（减小与SIZE的间距）*/
.product-pricing {
    margin-bottom: 18px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8e8e8;
}

/* 原价 - 红色+删除线 */
.product-pricing del,
.product-pricing del *,
.product-pricing del .woocommerce-Price-amount {
    font-family: var(--body-font) !important;
    font-size: 25px !important; /* SANVELLA: 25px */
    font-weight: 400 !important; /* SANVELLA: 400 */
    color: rgb(255, 0, 0) !important; /* SANVELLA: 纯红色 */
    text-decoration: line-through !important; /* 删除线 */
    margin-right: 10px !important;
    display: inline-block !important;
    letter-spacing: 0px !important;
}

/* 促销价 - 红色+无删除线 */
.product-pricing ins,
.product-pricing ins *,
.product-pricing ins .woocommerce-Price-amount {
    font-family: var(--body-font) !important;
    font-size: 25px !important; /* SANVELLA: 25px */
    font-weight: 400 !important; /* SANVELLA: 400 */
    color: rgb(255, 0, 0) !important; /* SANVELLA: 纯红色 */
    text-decoration: none !important; /* 无删除线 */
    display: inline !important;
    letter-spacing: 0px !important;
}

/* 简短描述 - SANVELLA样式（隐藏，信息在description tab） */
.product-brief-desc {
    display: none;
}

/* 库存状态 - 完全隐藏 */
.product-availability,
.single-product .stock,
.single-product p.stock,
.single-product .product-cart-section + p.stock,
.single-product form.cart + p.stock,
.single-product .woocommerce-variation-availability,
.single-product .product-cart-section p.stock,
.single-product .product-info-section > p.stock,
.single-product .product-cart-section p:has-text("Availability") {
    display: none !important;
}

/* 购物车表单 - SANVELLA样式 */
.product-cart-section {
    margin-bottom: 40px;
}

/* ========================================
   SKU/规格选择器优化 - SANVELLA高端风格（单选按钮）
   ======================================== */

/* 规格选择器整体容器 */
.product-cart-section .sanvella-variations {
    margin-bottom: 40px;
}

/* 每个变体选择项 */
.product-cart-section .variation-item {
    margin-bottom: 30px;
}

/* 规格标签 - 精致简约（斜体）*/
.product-cart-section .variation-label {
	font-family: var(--body-font);
	font-size: 11px;
	font-weight: 500;
	font-style: italic; /* SANVELLA风格斜体 */
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: #111;
	margin-bottom: 20px; /* 增加与选项的间距 */
	display: block;
}

/* 单选按钮组容器 - SANVELLA网格布局（更宽松的间距）*/
.product-cart-section .sanvella-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 15px; /* 增加间距：垂直18px，水平15px */
    max-width: 100%;
}

/* 单个单选按钮选项 */
.product-cart-section .sanvella-radio-option {
    position: relative;
}

/* 隐藏默认单选按钮 */
.product-cart-section .sanvella-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* 单选按钮标签样式 - SANVELLA风格（更宽松的内边距）*/
.product-cart-section .sanvella-radio-option label {
    display: inline-block;
    min-height: 52px; /* 增加最小高度 */
    padding: 16px 26px; /* 更大的内边距，匹配SANVELLA */
    border: 1px solid #ddd;
    background-color: #fff;
    font-family: var(--body-font);
    font-size: 14px; /* 稍微增大字体 */
    font-weight: 400;
    color: #111;
    letter-spacing: 0.3px;
    text-align: left; /* 文字左对齐 */
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 0;
    margin: 0;
    line-height: 1.5; /* 增加行高 */
    white-space: normal; /* 允许长文本换行 */
    width: auto; /* 宽度自适应内容 */
}

/* 鼠标悬停效果 */
.product-cart-section .sanvella-radio-option label:hover {
    border-color: #111;
    background-color: #fafafa;
}

/* 选中状态 - SANVELLA黑色高端风格 */
.product-cart-section .sanvella-radio-option input[type="radio"]:checked + label {
    border-color: #111;
    border-width: 2px;
    background-color: #111;
    color: #fff;
    font-weight: 400;
    padding: 15px 25px; /* 补偿border增加的宽度（16-1=15, 26-1=25） */
}

/* Clear/Reset选择器链接 */
.product-cart-section .reset_variations {
    display: inline-block;
    margin-top: 12px;
    font-family: var(--body-font);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-cart-section .reset_variations:hover {
    color: #111;
    text-decoration: underline;
}

/* 隐藏WooCommerce的表格边框 */
.product-cart-section .variations,
.product-cart-section .variations tbody,
.product-cart-section .variations tr,
.product-cart-section .variations td {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

/* 隐藏购物车区域重复的价格显示 - SANVELLA只在标题下方显示价格 */
.product-cart-section .single_variation_wrap .woocommerce-variation-price,
.product-cart-section .woocommerce-variation-price {
    display: none !important;
}

/* 禁用WooCommerce变体容器的动画，防止抖动 */
.product-cart-section .single_variation_wrap,
.product-cart-section .woocommerce-variation,
.product-cart-section .woocommerce-variation-description,
.product-cart-section .woocommerce-variation-add-to-cart,
.product-cart-section .variations_button,
.woocommerce-variation-add-to-cart-enabled,
.woocommerce-variation-add-to-cart-disabled {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important; /* 强制不透明度为1，避免淡入淡出 */
    transform: none !important; /* 禁用变换效果 */
}

/* ==================== Quick View 变体产品样式 ==================== */

/* Quick View - 单选按钮组容器 */
#sanvella-quick-view-modal .sanvella-radio-group,
.quick-view-summary .sanvella-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 15px;
    max-width: 100%;
    margin-bottom: 20px;
}

/* Quick View - 隐藏WooCommerce默认的数量控制器和按钮（变体产品自动生成的）*/
#sanvella-quick-view-modal .woocommerce-variation-add-to-cart.variations_button,
#sanvella-quick-view-modal div.variations_button,
.quick-view-summary .woocommerce-variation-add-to-cart.variations_button,
.quick-view-summary div.variations_button {
    display: none !important;
    visibility: hidden !important;
}

/* Quick View - 单个单选按钮选项 */
#sanvella-quick-view-modal .sanvella-radio-option,
.quick-view-summary .sanvella-radio-option {
    position: relative;
}

/* Quick View - 隐藏默认单选按钮 */
#sanvella-quick-view-modal .sanvella-radio-option input[type="radio"],
.quick-view-summary .sanvella-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Quick View - 单选按钮标签样式 */
#sanvella-quick-view-modal .sanvella-radio-option label,
.quick-view-summary .sanvella-radio-option label {
    display: inline-block;
    min-height: 52px;
    padding: 16px 26px;
    border: 1px solid #ddd;
    background-color: #fff;
    font-family: var(--body-font);
    font-size: 14px;
    font-weight: 700;
    color: #111;
    letter-spacing: 0.3px;
    text-align: left;
    cursor: pointer;
    transition: all 0.25s ease;
    border-radius: 0;
    margin: 0;
    line-height: 1.5;
    white-space: normal;
    width: auto;
}

/* Quick View - 鼠标悬停效果 */
#sanvella-quick-view-modal .sanvella-radio-option label:hover,
.quick-view-summary .sanvella-radio-option label:hover {
    border-color: #111;
    background-color: #fafafa;
}

/* Quick View - 选中状态 */
#sanvella-quick-view-modal .sanvella-radio-option input[type="radio"]:checked + label,
.quick-view-summary .sanvella-radio-option input[type="radio"]:checked + label {
    border-color: #111;
    border-width: 2px;
    background-color: #111;
    color: #fff;
    font-weight: 700;
    padding: 15px 25px;
}

/* Quick View - 隐藏表格边框 */
#sanvella-quick-view-modal .variations,
#sanvella-quick-view-modal .variations tbody,
#sanvella-quick-view-modal .variations tr,
#sanvella-quick-view-modal .variations td,
.quick-view-summary .variations,
.quick-view-summary .variations tbody,
.quick-view-summary .variations tr,
.quick-view-summary .variations td {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

/* Quick View - 数量和按钮区域布局 */
#sanvella-quick-view-modal .woocommerce-variation-add-to-cart,
#sanvella-quick-view-modal .variations_button,
.quick-view-summary .woocommerce-variation-add-to-cart,
.quick-view-summary .variations_button {
    display: flex !important;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

/* Quick View - 数量选择器 */
#sanvella-quick-view-modal .quantity,
.quick-view-summary .quantity {
    margin: 0 !important;
}

#sanvella-quick-view-modal .quantity input.qty,
.quick-view-summary .quantity input.qty {
    width: 60px;
    height: 50px;
    text-align: center;
    border: 1px solid #ddd;
    font-size: 14px;
}

/* Quick View - Add to cart按钮样式 */
#sanvella-quick-view-modal button.single_add_to_cart_button,
#sanvella-quick-view-modal .single_add_to_cart_button,
.quick-view-summary button.single_add_to_cart_button,
.quick-view-summary .single_add_to_cart_button {
    flex: 1;
    background-color: #111 !important;
    color: #fff !important;
    border: 2px solid #111 !important;
    padding: 15px 30px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    font-family: var(--body-font) !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    min-height: 50px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#sanvella-quick-view-modal button.single_add_to_cart_button:hover,
.quick-view-summary button.single_add_to_cart_button:hover {
    background-color: #000 !important;
    border-color: #000 !important;
}

/* 强制固定购物车区域的所有子元素，防止WooCommerce动态更新时抖动 */
.product-cart-section * {
    transition: none !important;
    animation: none !important;
}

/* 但保留按钮的hover效果 */
.product-cart-section button:hover,
.product-cart-section .single_add_to_cart_button:hover {
    transition: all 0.3s ease !important;
}

/* 隐藏WooCommerce默认输出的库存文本 */
.product-cart-section p,
.product-cart-section + p,
.product-info-section p.stock,
.single-product form.cart ~ p {
    display: none !important;
}

/* 强制购物车区域为垂直块级布局 - 匹配SANVELLA */
.product-cart-section .cart,
.single-product .product-cart-section .cart,
form.cart {
    display: block !important; /* 改为block，实现垂直布局 */
    flex-direction: column !important; /* 如果是flex，也强制垂直 */
    margin-top: 20px !important; /* SIZE区域与价格的间距 - 减小间距 */
}

/* 使用绝对定位防止WooCommerce临时元素导致布局抖动 */
.product-cart-section .single_variation_wrap {
    position: relative !important;
    /* 移除固定高度限制，让内容完整显示 */
}

/* WooCommerce的临时消息容器用绝对定位，不影响布局 */
.product-cart-section .woocommerce-variation.single_variation {
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Quantity和Add to cart按钮的容器 - 垂直堆叠布局 */
.product-cart-section .variations_button,
.product-cart-section .woocommerce-variation-add-to-cart,
.single-product .variations_button,
.single-product .woocommerce-variation-add-to-cart,
.sanvella-vertical-cart {
    display: block !important;
    width: 100% !important;
    clear: both !important; /* 清除浮动 */
    flex-direction: column !important;
    transition: none !important; /* 禁用过渡动画，防止抖动 */
    animation: none !important; /* 禁用动画，防止抖动 */
}

/* SANVELLA自定义包装器 - 强制垂直堆叠 */
.sanvella-quantity-wrapper,
.sanvella-button-wrapper {
    display: block !important;
    width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-bottom: 15px !important;
    /* 防止抖动 - 固定高度过渡 */
    transition: none !important;
}

.sanvella-quantity-wrapper {
    max-width: 150px !important;
    min-height: 50px !important; /* 固定最小高度，防止抖动 */
}

.sanvella-button-wrapper {
    max-width: 100% !important;
    min-height: 50px !important; /* 固定最小高度，防止抖动 */
}

/* Quantity和Add to cart按钮 - 垂直堆叠，每个占一行 */
.product-cart-section .variations_button .quantity,
.product-cart-section .variations_button .single_add_to_cart_button,
.product-cart-section .woocommerce-variation-add-to-cart .quantity,
.product-cart-section .woocommerce-variation-add-to-cart .single_add_to_cart_button,
.single-product .product-cart-section .quantity,
.single-product .product-cart-section .single_add_to_cart_button {
    display: block !important;
    width: 100% !important;
    float: none !important; /* 清除float */
    margin-bottom: 15px !important; /* 元素间的垂直间距 */
    margin-right: 0 !important; /* 清除右边距 */
    margin-left: 0 !important; /* 清除左边距 */
    transition: none !important; /* 禁用过渡动画，防止抖动 */
    animation: none !important; /* 禁用动画，防止抖动 */
}

.product-cart-section .variations_button .quantity,
.product-cart-section .woocommerce-variation-add-to-cart .quantity,
.single-product .product-cart-section .quantity {
    max-width: 150px !important; /* Quantity输入框合适宽度 */
}

/* 旧的详情页数量控制器样式已删除，使用新的SANVELLA风格 */
.product-cart-section .quantity input.qty {
    /* 已使用统一的SANVELLA风格样式 */
    font-family: var(--body-font);
    font-size: 14px;
    font-weight: 400;
    color: #111;
    border-radius: 0;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.product-cart-section .quantity input.qty:hover {
    border-color: #111;
}

.product-cart-section .quantity input.qty:focus {
    outline: none;
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}

.product-cart-section button.single_add_to_cart_button {
    width: 100%; /* 全宽按钮 - 匹配SANVELLA */
    height: 50px;
    background: #111;
    color: white;
    border: 1px solid #111;
    font-family: var(--body-font);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
    position: relative; /* 为loading动画提供定位基准 */
}

.product-cart-section button.single_add_to_cart_button:hover {
    background: #111 !important;
    color: white !important;
    opacity: 0.9; /* 轻微透明度变化表示hover状态 */
}

/* Add to Cart按钮状态 - 始终保持黑色 */
/* 即使是Loading和disabled状态也保持黑色 */
.product-cart-section button.single_add_to_cart_button.loading,
.product-cart-section button.single_add_to_cart_button:disabled,
.product-cart-section button.single_add_to_cart_button.disabled,
.product-cart-section button.single_add_to_cart_button.wc-variation-selection-needed,
.product-cart-section button.single_add_to_cart_button.wc-variation-is-unavailable {
    background: #111 !important;
    background-color: #111 !important;
    color: white !important;
    border-color: #111 !important;
    opacity: 0.6 !important; /* 轻微透明表示不可点击 */
    cursor: not-allowed !important;
}

/* Loading动画 - 居中显示 */
.product-cart-section button.single_add_to_cart_button.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* 水平和垂直都居中 */
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* 成功添加到购物车状态 - 也保持黑色 */
.product-cart-section button.single_add_to_cart_button.added {
    background: #111 !important;
    background-color: #111 !important;
    color: white !important;
    border-color: #111 !important;
    cursor: default !important;
}

/* 产品详细信息 - 隐藏（SANVELLA风格不显示在顶部） */
.product-details-list {
    display: none;
}

/* ========== 产品描述和相关产品 ========== */
.product-extended-content {
    background: white;
    padding: 18px 0 24px;
    border-top: none !important;
}

.product-extended-content .woocommerce-tabs {
    max-width: var(--product-shell-max-width);
    margin: 0 auto;
    padding: 0 var(--product-shell-padding);
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
    column-gap: var(--product-shell-gap);
    align-items: start;
}

.product-extended-content .woocommerce-tabs ul.tabs {
    grid-column: 2;
    display: flex;
    justify-content: flex-start;
    gap: clamp(28px, 4vw, 48px);
    list-style: none;
    border: none;
    border-bottom: 1px solid #e8e8e8;
    margin: 0 0 44px;
    padding: 0;
    width: 100%;
}

.product-extended-content .woocommerce-tabs ul.tabs li {
    background: none;
    border: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.product-extended-content .woocommerce-tabs ul.tabs li a {
    font-family: var(--body-font);
    font-size: 12px;
    font-weight: 500;
    color: #888;
    padding: 0 0 18px 0;
    text-decoration: none;
    border: none;
    transition: color 0.24s ease;
    display: block;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    outline-offset: 6px;
}

.product-extended-content .woocommerce-tabs ul.tabs li.active a,
.product-extended-content .woocommerce-tabs ul.tabs li a:hover,
.product-extended-content .woocommerce-tabs ul.tabs li a:focus-visible {
    color: #111;
}

.product-extended-content .woocommerce-tabs ul.tabs li.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: #111;
}

.product-extended-content .woocommerce-tabs:not(.sanvella-tabs-initialized) .woocommerce-Tabs-panel:not(:first-of-type) {
    display: none !important;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel {
    grid-column: 2;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    width: 100%;
    max-width: var(--product-copy-width) !important;
    margin: 0 !important;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel[hidden],
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel[aria-hidden="true"] {
    display: none !important;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel h2,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel h3 {
    font-family: var(--heading-font);
    color: #111;
    font-weight: 400;
    font-style: normal;
    letter-spacing: 0.02em;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews {
    text-align: left;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description h2 {
    font-size: clamp(38px, 4.2vw, 58px);
    line-height: 1.16;
    margin: 0 0 18px;
    letter-spacing: 0.03em;
    text-wrap: balance;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description h2 + p {
    font-size: 18px !important;
    line-height: 1.85 !important;
    color: var(--color-muted);
    margin: 0 0 26px !important;
    letter-spacing: 0.03em;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description h3 {
    font-size: 20px;
    line-height: 1.45;
    margin: 48px 0 18px !important;
    padding-top: 18px;
    border-top: 1px solid var(--color-line);
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews h2 {
    font-size: 28px;
    line-height: 1.35;
    margin: 0 0 18px;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews h3 {
    font-size: 18px;
    line-height: 1.45;
    margin: 38px 0 16px;
    padding: 0;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description p,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description li {
    font-family: var(--body-font);
    font-size: 16px !important;
    line-height: 1.95 !important;
    color: var(--color-muted);
    letter-spacing: 0.01em;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews p,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews li {
    font-family: var(--body-font);
    font-size: 15px;
    line-height: 1.9;
    color: #666;
    letter-spacing: 0.01em;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description p,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews p {
    margin: 0 0 20px;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description ul,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description ol,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews ul,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews ol {
    margin: 18px 0 28px;
    padding-left: 1.35em;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel ul {
    list-style: disc;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel ol {
    list-style: decimal;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description li,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews li {
    margin-bottom: 12px;
    padding-left: 0.1em;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel strong {
    color: #111;
    font-weight: 600;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description > :last-child,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--reviews > :last-child {
    margin-bottom: 0;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description > .aligncenter {
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
}

.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description > .alignwide,
.product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description > .alignfull {
    max-width: none;
}

.single-product .related.products,
.single-product .upsells.products {
    background: white;
    max-width: var(--product-shell-max-width);
    margin: 0 auto;
    padding: 28px var(--product-shell-padding) 56px;
}

.single-product .related.products h2,
.single-product .upsells.products h2 {
    display: block !important;
    width: 100%;
    margin: 0 0 28px !important;
    padding-bottom: 18px;
    border-bottom: 1px solid #e8e8e8;
    font-family: var(--heading-font);
    font-size: 32px;
    font-weight: 500;
    color: #111;
    letter-spacing: 0.04em;
}

.single-product .related.products ul.products,
.single-product .upsells.products ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 20px !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

.single-product .related.products ul.products li.product,
.single-product .upsells.products ul.products li.product {
    margin: 0 !important;
}

.single-product .related.products ul.products li.product img,
.single-product .upsells.products ul.products li.product img {
    height: clamp(220px, 15vw, 280px);
    object-fit: contain;
    background: var(--color-surface);
}

.single-product .related.products ul.products li.product .woocommerce-loop-product__title,
.single-product .upsells.products ul.products li.product .woocommerce-loop-product__title {
    display: -webkit-box !important;
    min-height: 4.35em !important;
    overflow: hidden;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: var(--font-weight-regular);
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.single-product .related.products ul.products li.product .product-info-wrapper,
.single-product .upsells.products ul.products li.product .product-info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.single-product .related.products ul.products li.product .astra-shop-summary-wrap,
.single-product .upsells.products ul.products li.product .astra-shop-summary-wrap {
    width: 100%;
}

.single-product .related.products ul.products li.product .ast-shop-product-out-of-stock,
.single-product .upsells.products ul.products li.product .ast-shop-product-out-of-stock {
    position: static;
    order: 2;
    margin-top: 8px;
    padding: 0;
    background: transparent;
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    text-transform: uppercase;
}

.single-product .related.products ul.products li.product .ast-woo-product-category,
.single-product .related.products ul.products li.product .woocommerce-loop-category__title,
.single-product .related.products ul.products li.product .button,
.single-product .related.products ul.products li.product .star-rating,
.single-product .upsells.products ul.products li.product .ast-woo-product-category,
.single-product .upsells.products ul.products li.product .woocommerce-loop-category__title,
.single-product .upsells.products ul.products li.product .button,
.single-product .upsells.products ul.products li.product .star-rating {
    display: none !important;
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
    .sanvella-single-product {
        --product-shell-gap: 48px;
        --product-gallery-height: clamp(420px, 48vw, 580px);
        --product-info-width: min(100%, 500px);
        --product-copy-width: min(100%, 700px);
    }

    .product-main-container {
        padding: 44px 50px 40px;
    }

    .product-extended-content {
        padding: 16px 0 20px;
    }

    .product-extended-content .woocommerce-tabs {
        padding: 0 50px;
    }

    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel {
        max-width: var(--product-copy-width) !important;
    }
    
    .single-product .related.products,
    .single-product .upsells.products {
        padding: 24px 50px 44px;
    }
}

/* ========== 评论/评价区域样式 ========== */
#reviews .woocommerce-noreviews,
#reviews .woocommerce-Reviews-title {
    font-family: var(--body-font);
    font-size: 15px;
    color: #999;
    font-style: italic;
    font-weight: 400;
    margin: 0 0 40px 0;
    letter-spacing: 0.3px;
}

/* 评论表单标题 */
#review_form_wrapper .comment-reply-title {
    font-family: var(--heading-font);
    font-size: 20px;
    font-weight: 400;
    color: #111;
    margin: 0 0 30px 0;
    letter-spacing: 0.5px;
}

/* 评分标签 */
#review_form .comment-form-rating label {
    font-family: var(--body-font);
    font-size: 12px;
    color: #666;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: inline-block;
}

/* 星星评分样式 - 隐藏WooCommerce默认星星和自定义星星系统，显示下拉框 */
#review_form .stars {
    display: none !important;
}

#review_form .stars a {
    font-size: 18px;
    color: #ddd !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

#review_form .stars a:hover,
#review_form .stars a.active {
    color: #111 !important;
}

/* 显示自定义星星评分系统 */
#review_form .star-rating-wrapper {
    display: flex !important;
}

/* 评论文本区域标签 */
#review_form .comment-form-comment label {
    font-family: var(--body-font);
    font-size: 12px;
    color: #666;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: block;
}

/* 评论文本框 */
#review_form .comment-form-comment textarea {
    width: 100%;
    min-height: 120px;
    padding: 15px;
    font-family: var(--body-font);
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 0;
    transition: all 0.3s ease;
    resize: vertical;
}

#review_form .comment-form-comment textarea:focus {
    background: white;
    border-color: #111;
    outline: none;
}

/* 提交按钮 */
#review_form .form-submit input[type="submit"],
#review_form .form-submit .submit {
    font-family: var(--body-font);
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: white;
    background: #111;
    border: none;
    padding: 12px 35px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

#review_form .form-submit input[type="submit"]:hover,
#review_form .form-submit .submit:hover {
    background: #333;
}

/* 评论表单整体布局 */
#review_form_wrapper {
    max-width: 600px;
}

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

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

/* 已有评论样式 */
#reviews .commentlist {
    list-style: none;
    padding: 0;
    margin: 40px 0;
}

#reviews .commentlist .comment {
    border-top: 1px solid #e8e8e8;
    padding: 30px 0;
}

#reviews .commentlist .comment .meta {
    font-family: var(--body-font);
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

#reviews .commentlist .comment .description p {
    font-family: var(--body-font);
    font-size: 14px;
    line-height: 1.8;
    color: #666;
}

#reviews .commentlist .star-rating {
    margin-bottom: 10px;
}

#reviews .commentlist .star-rating span {
    color: #111;
}

@media (max-width: 968px) {
    .sanvella-single-product {
        --product-gallery-height: clamp(380px, 72vw, 560px);
        --product-copy-width: 100%;
    }

    .product-main-container {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 40px 50px 36px;
    }
    
    .product-info-section {
        position: static;
        max-width: none;
        justify-self: stretch;
    }
    
    .product-name {
        font-size: 36px;
    }
    
    .product-pricing .price,
    .product-pricing .price * {
        font-size: 18px !important;
    }
    
    .product-extended-content {
        padding: 16px 0 20px;
    }
    
    .product-extended-content .woocommerce-tabs {
        display: block;
        padding: 0 50px;
    }

    .product-extended-content .woocommerce-tabs ul.tabs,
    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel {
        grid-column: auto;
        max-width: 100% !important;
    }

    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description h2 {
        font-size: clamp(32px, 5vw, 46px);
    }

    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description h3 {
        font-size: 18px;
        margin: 40px 0 16px !important;
        padding-top: 14px;
    }
    
    .single-product .related.products,
    .single-product .upsells.products {
        padding: 24px 50px 40px;
    }

    .single-product .related.products ul.products,
    .single-product .upsells.products ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .sanvella-single-product {
        --product-gallery-height: clamp(300px, 92vw, 360px);
    }

    .product-main-container {
        padding: 24px 16px 28px;
        gap: 28px;
    }

    .product-category-badge {
        margin-bottom: 16px;
    }
    
    .product-name {
        font-size: 28px;
    }
    
    .product-pricing .price,
    .product-pricing .price * {
        font-size: 16px !important;
    }
    
    .product-cart-section .cart {
        flex-direction: column;
    }
    
    .product-cart-section .quantity input.qty {
        width: 100%;
    }
    
    .product-extended-content {
        padding: 12px 0 16px;
    }
    
    .product-extended-content .woocommerce-tabs {
        padding: 0 16px;
    }
    
    .product-extended-content .woocommerce-tabs ul.tabs {
        gap: 24px;
        margin-bottom: 32px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .product-extended-content .woocommerce-tabs ul.tabs::-webkit-scrollbar {
        display: none;
    }
    
    .product-extended-content .woocommerce-tabs ul.tabs li a {
        font-size: 11px;
        padding-bottom: 16px;
    }

    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel {
        max-width: 100% !important;
    }

    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description h2 {
        font-size: 30px;
        margin-bottom: 14px;
    }

    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description h2 + p {
        font-size: 16px !important;
        margin-bottom: 22px !important;
    }

    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description h3 {
        font-size: 17px;
        margin: 34px 0 14px !important;
        padding-top: 12px;
    }

    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description p,
    .product-extended-content .woocommerce-tabs .woocommerce-Tabs-panel--description li {
        font-size: 15px !important;
    }
    
    .single-product .related.products,
    .single-product .upsells.products {
        padding: 20px 16px 36px;
    }

    .single-product .related.products h2,
    .single-product .upsells.products h2 {
        font-size: 22px;
        margin-bottom: 20px !important;
    }

    .single-product .related.products ul.products,
    .single-product .upsells.products ul.products {
        gap: 14px !important;
    }

    .single-product .related.products ul.products li.product img,
    .single-product .upsells.products ul.products li.product img {
        height: auto;
        aspect-ratio: 4 / 5;
    }
}

@media (max-width: 380px) {
    .single-product .related.products ul.products,
    .single-product .upsells.products ul.products {
        grid-template-columns: 1fr !important;
    }

    .product-extended-content .woocommerce-tabs ul.tabs {
        gap: 18px;
    }

    .product-name {
        font-size: 26px;
    }
}

/* ========================================
   评论表单优化 - SANVELLA风格
   ======================================== */

/* 评论区域整体样式 */
#reviews .woocommerce-Reviews {
    font-family: var(--body-font);
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* 评论表单容器对齐左侧 */
#review_form_wrapper,
#review_form {
    padding-left: 0 !important;
    margin-left: 0 !important;
    text-align: left !important;
}

/* "There are no reviews yet" 提示文字 - 隐藏 */
#reviews .woocommerce-noreviews {
    display: none !important;
}

/* 评论表单标题 */
#review_form #reply-title {
    font-family: var(--heading-font);
    font-size: 20px;
    font-weight: 400;
    color: #111;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

/* 表单说明文字 */
#review_form .comment-notes {
    font-size: 13px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* 表单字段通用样式 */
#review_form .comment-notes,
#review_form .comment-form-rating,
#review_form .comment-form-comment,
#review_form .comment-form-author,
#review_form .comment-form-email,
#review_form .comment-form-cookies-consent {
    margin-bottom: 25px;
}

/* 标签样式 */
#review_form label {
    font-size: 12px;
    font-weight: 500;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: block;
}

/* 隐藏WooCommerce默认的星星评分系统 */
#review_form .comment-form-rating .stars {
    display: none !important;
}

/* 评分下拉框样式 - 隐藏下拉框，显示自定义星星 */
#review_form .comment-form-rating select {
    display: none !important; /* 隐藏下拉框 */
}

/* 星级评分系统 */
.star-rating-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.stars-container {
    display: flex;
    flex-direction: row-reverse;
    gap: 5px;
}

.stars-container .star {
    position: relative;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: inline-block;
    width: 30px;
    height: 30px;
}

.stars-container .star .sanvella-star-icon {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.2s ease;
}

/* 空心星（默认） */
.stars-container .star .sanvella-star-icon--outline {
    color: #ddd !important;
    opacity: 1 !important;
    display: block !important;
}

/* 实心星（隐藏） */
.stars-container .star .sanvella-star-icon--filled {
    color: #111 !important;
    opacity: 0 !important;
    display: block !important;
}

/* 悬停效果 */
.stars-container .star:hover,
.stars-container .star.hover {
    transform: scale(1.15);
}

.stars-container .star:hover .sanvella-star-icon--outline,
.stars-container .star.hover .sanvella-star-icon--outline {
    opacity: 0 !important;
}

.stars-container .star:hover .sanvella-star-icon--filled,
.stars-container .star.hover .sanvella-star-icon--filled {
    color: #111 !important;
    opacity: 0.6 !important;
}

/* 悬停时，当前星星及其之前的星星都高亮 */
.stars-container .star:hover ~ .star,
.stars-container .star.hover ~ .star {
    transform: scale(1.15);
}

.stars-container .star:hover ~ .star .sanvella-star-icon--outline,
.stars-container .star.hover ~ .star .sanvella-star-icon--outline {
    opacity: 0 !important;
}

.stars-container .star:hover ~ .star .sanvella-star-icon--filled,
.stars-container .star.hover ~ .star .sanvella-star-icon--filled {
    color: #111 !important;
    opacity: 0.6 !important;
}

/* 选中状态 */
.stars-container .star.selected .sanvella-star-icon--outline,
.stars-container .star.active .sanvella-star-icon--outline {
    opacity: 0 !important;
}

.stars-container .star.selected .sanvella-star-icon--filled,
.stars-container .star.active .sanvella-star-icon--filled {
    color: #111 !important;
    opacity: 1 !important;
}

/* 评分文本 */
.rating-text {
    font-size: 13px;
    color: #666;
    font-family: var(--body-font);
    min-width: 120px;
}

/* 文本域样式 */
#review_form textarea {
    width: 100%;
    max-width: 600px;
    min-height: 150px;
    padding: 15px;
    border: 1px solid #ddd;
    background-color: #fafafa;
    font-size: 14px;
    color: #111;
    font-family: var(--body-font);
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s ease;
    border-radius: 0;
}

#review_form textarea:hover {
    background-color: #fff;
}

#review_form textarea:focus {
    border-color: #111;
    background-color: #fff;
    outline: none;
}

/* 输入框样式 */
#review_form input[type="text"],
#review_form input[type="email"] {
    width: 100%;
    max-width: 300px;
    height: 45px;
    padding: 0 15px;
    border: 1px solid #ddd;
    background-color: #fafafa;
    font-size: 14px;
    color: #111;
    font-family: var(--body-font);
    transition: all 0.3s ease;
    border-radius: 0;
}

#review_form input[type="text"]:hover,
#review_form input[type="email"]:hover {
    background-color: #fff;
}

#review_form input[type="text"]:focus,
#review_form input[type="email"]:focus {
    border-color: #111;
    background-color: #fff;
    outline: none;
}

/* Name和Email并排显示 */
#review_form .review-form-contact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    width: 100%;
    margin-bottom: 25px;
}

#review_form .comment-form-author,
#review_form .comment-form-email {
    flex: 1 1 calc(50% - 12px);
    min-width: 0;
    margin-bottom: 0;
}

/* 复选框样式 */
#review_form .comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

#review_form .comment-form-cookies-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

#review_form .comment-form-cookies-consent label {
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: #666;
    cursor: pointer;
    line-height: 1.5;
    margin-bottom: 0;
}

/* 提交按钮样式 */
#review_form .form-submit {
    margin-top: 30px;
    width: 100%;
}

#review_form button[type="submit"],
#review_form input[type="submit"] {
    min-width: 200px;
    height: 50px;
    padding: 0 40px;
    background-color: #111;
    color: #fff;
    border: 1px solid #111;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--body-font);
    border-radius: 0;
}

#review_form button[type="submit"]:hover,
#review_form input[type="submit"]:hover {
    background-color: #fff;
    color: #111;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #review_form .review-form-contact-row {
        gap: 0;
    }

    #review_form .comment-form-author,
    #review_form .comment-form-email {
        flex-basis: 100%;
    }
    
    #review_form textarea,
    #review_form input[type="text"],
    #review_form input[type="email"] {
        max-width: 100%;
    }
    
    #review_form .comment-form-rating select {
        width: 100%;
    }
}

/* ========================================
   My Account - 我的评价
   ======================================== */

.woocommerce-MyAccount-reviews {
    padding: 0;
}

/* 评价页面标题 */
.reviews-header {
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reviews-page-title {
    font-family: var(--heading-font);
    font-size: 24px;
    font-weight: 400;
    color: #111;
    margin: 0;
    letter-spacing: 1px;
}

.reviews-count {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    margin: 0;
}

.reviews-count i {
    color: #111;
    font-size: 14px;
}

/* 评价列表 */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 单个评价项 */
.review-item {
    background: #fff;
    border: 1px solid #e8e8e8;
    padding: 30px;
    transition: all 0.3s ease;
    position: relative;
}

.review-item:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-color: #ddd;
}

/* 待审核状态标记 */
.review-item.pending {
    background: #fffbf5;
    border-left: 4px solid #ffc107;
}

.review-item.approved {
    border-left: 4px solid #4caf50;
}

/* 产品信息区域 */
.review-product {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f5f5f5;
}

.product-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.product-thumbnail:hover img {
    opacity: 0.8;
}

.product-details {
    flex: 1;
}

.product-title {
    margin: 0 0 10px 0;
    font-family: var(--heading-font);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.product-title a {
    color: #111;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #666;
}

/* 评价元信息 */
.review-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.review-rating {
    display: flex;
    gap: 3px;
}

.review-rating i {
    font-size: 14px;
    color: #111;
}

.review-rating .far {
    color: #ddd;
}

.review-date {
    font-size: 13px;
    color: #666;
    font-family: var(--body-font);
}

.review-status {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 3px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-status.status-approved {
    background: #e8f5e9;
    color: #2e7d32;
}

.review-status.status-hold {
    background: #fff8e1;
    color: #f57f17;
}

/* 评价内容 */
.review-content {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    font-family: var(--body-font);
    margin-bottom: 15px;
}

.review-content p {
    margin: 0 0 10px 0;
}

.review-content p:last-child {
    margin-bottom: 0;
}

/* 评价操作 */
.review-actions {
    padding-top: 15px;
    border-top: 1px solid #f5f5f5;
}

.view-review-link {
    font-size: 13px;
    color: #111;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.view-review-link:hover {
    color: #666;
    gap: 8px;
}

/* 无评价状态 - SANVELLA 精致风格 */
.no-reviews {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.empty-state {
    max-width: 480px;
    text-align: center;
}

.empty-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f8f8 0%, #fff 100%);
    border: 2px solid #e8e8e8;
    border-radius: 50%;
    position: relative;
}

.empty-icon::before {
    content: '';
    position: absolute;
    inset: -8px;
    border: 1px solid #f0f0f0;
    border-radius: 50%;
}

.empty-icon i {
    font-size: 48px;
    color: #ccc;
}

.empty-title {
    font-family: var(--heading-font);
    font-size: 28px;
    font-weight: 400;
    color: #111;
    margin: 0 0 20px 0;
    letter-spacing: 1px;
}

.empty-description {
    font-size: 15px;
    line-height: 1.8;
    color: #666;
    margin: 0 0 40px 0;
    font-family: var(--body-font);
}

.empty-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.empty-actions .button {
    min-width: 160px;
    height: 50px;
    padding: 0 30px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--body-font);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 0;
}

.empty-actions .button i {
    font-size: 14px;
}

.empty-actions .button-primary {
    background-color: #111;
    color: #fff;
    border: 1px solid #111;
}

.empty-actions .button-primary:hover {
    background-color: #fff;
    color: #111;
}

.empty-actions .button-secondary {
    background-color: transparent;
    color: #111;
    border: 1px solid #ddd;
}

.empty-actions .button-secondary:hover {
    background-color: #f8f8f8;
    border-color: #111;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 评价页面标题 */
    .reviews-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 30px;
    }
    
    .reviews-page-title {
        font-size: 20px;
    }
    
    /* 评价列表 */
    .review-item {
        padding: 20px;
    }
    
    .review-product {
        flex-direction: column;
        gap: 15px;
    }
    
    .product-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .review-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    /* 空状态 */
    .no-reviews {
        min-height: 400px;
        padding: 60px 20px;
    }
    
    .empty-icon {
        width: 100px;
        height: 100px;
        margin-bottom: 30px;
    }
    
    .empty-icon i {
        font-size: 40px;
    }
    
    .empty-title {
        font-size: 24px;
    }
    
    .empty-description {
        font-size: 14px;
    }
    
    .empty-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .empty-actions .button {
        width: 100%;
        max-width: 300px;
    }
}

/* ========================================
   Quick View 支付按钮样式
======================================== */

/* 快速支付按钮容器 */
.quick-view-payment-buttons {
    margin: 20px 0 15px;
    padding: 0;
}

/* Stripe Express Checkout Wrapper */
.quick-view-payment-buttons .sanvella-quick-view-express-checkout-wrapper {
    margin: 0;
    padding: 0;
}

/* Stripe Express Checkout 容器 */
.quick-view-payment-buttons #sanvella-quick-view-express-checkout-element {
    min-height: 48px;
    margin: 0 !important;
}

/* Stripe Express Checkout iframe */
.quick-view-payment-buttons .wc-stripe-payment-request-button-element,
.quick-view-payment-buttons .payment-request-button-element,
.quick-view-payment-buttons .sanvella-quick-view-express-checkout-element iframe {
    height: 48px !important;
    border-radius: 4px;
}

/* 确保按钮在Quick View中正确显示 */
.quick-view-content .payment-request-button-element iframe,
.quick-view-content #sanvella-quick-view-express-checkout-element iframe {
    width: 100% !important;
    height: 48px !important;
    border: none !important;
}

/* More payment options 容器 */
.quick-view-more-options-wrapper {
    text-align: center;
    margin: 15px 0 20px;
}

/* More payment options 链接 */
.quick-view-more-options {
    display: inline-block;
    font-size: 14px;
    text-decoration: underline;
    color: #000;
    transition: opacity 0.3s;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.quick-view-more-options:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* Add to cart 按钮优化 */
.quick-view-add-to-cart {
    width: 100%;
    padding: 15px 20px;
    background: #000 !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
    transition: opacity 0.3s;
    margin-bottom: 0;
}

.quick-view-add-to-cart:hover {
    opacity: 0.85;
    background: #000 !important;
    color: #fff !important;
}

.quick-view-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 支付按钮加载状态 */
.quick-view-payment-buttons.loading {
    position: relative;
    min-height: 48px;
}

.quick-view-payment-buttons.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 隐藏支付按钮的情况（当不可用时） */
.quick-view-payment-buttons:empty {
    display: none;
}

/* Google Pay / Apple Pay 按钮的特定样式 */
.quick-view-payment-buttons .gpay-button,
.quick-view-payment-buttons .apple-pay-button {
    width: 100%;
    height: 48px;
    border-radius: 4px;
}

/* Stripe Elements 容器 */
.quick-view-payment-buttons .StripeElement {
    width: 100%;
    padding: 0;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .quick-view-payment-buttons {
        margin: 15px 0 12px;
    }
    
    .quick-view-payment-buttons #sanvella-quick-view-express-checkout-element {
        min-height: 44px;
    }
    
    .quick-view-payment-buttons .payment-request-button-element {
        height: 44px !important;
    }
    
    .quick-view-add-to-cart {
        padding: 13px 20px;
        font-size: 13px;
    }
    
    .quick-view-more-options {
        font-size: 13px;
    }
}

/* Quick View 分隔线优化 */
.quick-view-divider {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 20px 0;
}

/* 支付错误提示 */
.quick-view-payment-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #f5c6cb;
}

.quick-view-payment-error::before {
    content: "⚠️ ";
    margin-right: 5px;
}

/* 支付成功提示 */
.quick-view-payment-success {
    background-color: #d4edda;
    color: #155724;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #c3e6cb;
}

.quick-view-payment-success::before {
    content: "✓ ";
    margin-right: 5px;
}

/* ============================================
   再次订购按钮优化样式
   ============================================ */
/* 按钮容器居中 */
.woocommerce-order-details .order-again {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.woocommerce-order-details .order-again .button,
.woocommerce-order-details .woocommerce-button {
    display: inline-block;
    background-color: #000000;
    color: #ffffff !important;
    padding: 14px 32px;
    font-family: var(--heading-font), -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none !important;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.woocommerce-order-details .order-again .button:hover,
.woocommerce-order-details .woocommerce-button:hover {
    background-color: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.woocommerce-order-details .order-again .button:active,
.woocommerce-order-details .woocommerce-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 订单详情页整体优化 */
.woocommerce-order-details {
    margin-top: 30px;
}

.woocommerce-order-details__title {
    font-family: var(--heading-font), -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.woocommerce-customer-details {
    margin-top: 40px;
}

.woocommerce-customer-details .woocommerce-column__title {
    font-family: var(--heading-font), -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

/* Inline SVG star icons */
.stars-container .star .sanvella-star-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.2s ease;
}

.stars-container .star .far {
    color: #ddd !important;
    opacity: 1 !important;
}

.stars-container .star .fas {
    color: #111 !important;
    opacity: 0 !important;
}

.stars-container .star:hover .far,
.stars-container .star.hover .far,
.stars-container .star:hover ~ .star .far,
.stars-container .star.hover ~ .star .far,
.stars-container .star.selected .far,
.stars-container .star.active .far {
    opacity: 0 !important;
}

.stars-container .star:hover .fas,
.stars-container .star.hover .fas,
.stars-container .star:hover ~ .star .fas,
.stars-container .star.hover ~ .star .fas {
    color: #111 !important;
    opacity: 0.6 !important;
}

.stars-container .star.selected .fas,
.stars-container .star.active .fas {
    color: #111 !important;
    opacity: 1 !important;
}

.review-rating .sanvella-star-icon {
    width: 14px;
    height: 14px;
    color: #111;
}


/* SANVELLA quantity hydration guard: avoid a wide empty field before +/- buttons attach. */
.single-product form.cart .quantity:not(.sanvella-buttons-added) {
    display: inline-flex !important;
    width: auto !important;
    max-width: 110px !important;
    border: 1px solid #111 !important;
    background: #fff !important;
}

.single-product form.cart .quantity:not(.sanvella-buttons-added) input.qty {
    width: 96px !important;
    height: 48px !important;
    border: 0 !important;
    box-shadow: none !important;
}

.single-product form.cart .quantity.sanvella-buttons-added {
    display: inline-flex !important;
    width: auto !important;
    max-width: 152px !important;
    border: 1px solid #111 !important;
    background: #fff !important;
}

.single-product form.cart .quantity.sanvella-buttons-added input.qty {
    width: 60px !important;
    height: 48px !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* SANVELLA gallery hard boundary: thumbnails must never paint into the product info column. */
.single-product .product-main-container {
    overflow-x: clip;
}

.single-product .product-images-section {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.single-product .product-images-section .woocommerce-product-gallery {
    max-width: 100% !important;
    overflow: hidden !important;
}

.single-product .product-images-section .woocommerce-product-gallery > .flex-control-thumbs {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(72px, 80px)) !important;
    justify-content: start !important;
    align-items: start !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.single-product .product-images-section .woocommerce-product-gallery > .flex-control-thumbs > li {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
}

@media (max-width: 640px) {
    .single-product .product-images-section .woocommerce-product-gallery--has-thumbnails {
        min-height: calc(var(--product-gallery-height) + 87px) !important;
    }

    .single-product .product-images-section .woocommerce-product-gallery > .flex-control-thumbs {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        min-height: 72px;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .single-product .product-images-section .woocommerce-product-gallery > .flex-control-thumbs::-webkit-scrollbar {
        display: none;
    }

    .single-product .product-images-section .woocommerce-product-gallery > .flex-control-thumbs > li,
    .single-product .product-images-section .woocommerce-product-gallery > .flex-control-thumbs > li img {
        flex: 0 0 72px;
        width: 72px !important;
        height: 72px !important;
        max-width: 72px !important;
        scroll-snap-align: start;
    }
}
