/**
 * YITU Compare & Wishlist - Frontend Styles
 */

/* 修复鼠标轨迹遮罩层阻止点击的问题 */
.jso-cursor-trail-wrapper {
    pointer-events: none !important;
}

.jso-cursor-trail-shape {
    pointer-events: none !important;
}

/* Header Icons */
.header-icon__compare,
.header-icon__wishlist {
    position: relative;
    z-index: 10001;
}

.header-icon__compare .header-icon-counter,
.header-icon__wishlist .header-icon-counter {
    display: inline-block;
}

/* 确保产品内容容器和图片容器是相对定位 */
.product-inner,
.product-thumbnail {
    position: relative;
}

/* 通用按钮样式 - 使用绝对定位，显示在图片内部 */
.ycw-quickview-btn,
.ycw-compare-btn,
.ycw-wishlist-btn {
    position: absolute;
    right: 0px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
}

/* 鼠标悬停在产品容器上时显示按钮 */
.product-inner:hover .ycw-quickview-btn,
.product-inner:hover .ycw-compare-btn,
.product-inner:hover .ycw-wishlist-btn,
.product-item__inner:hover .ycw-quickview-btn,
.product-item__inner:hover .ycw-compare-btn,
.product-item__inner:hover .ycw-wishlist-btn {
    opacity: 1;
    visibility: visible;
}

/* 眼睛图标(Quick View) - 显示在图片内部顶部 */
.ycw-quickview-btn {
    top: 5px;
}

/* Compare 按钮 - 默认位置 */
.ycw-compare-btn {
    top: 10px;
}

/* 当 Quick View 存在时，Compare 按钮向下移动 */
.product-inner .ycw-quickview-btn ~ .ycw-compare-btn {
    top: 65px;  /* 10px + 55px */
}

/* 收藏图标(Wishlist) - 根据眼睛图标下移55px */
.ycw-wishlist-btn {
    top: 65px;  /* 眼睛图标位置(10px) + 55px */
}

/* 当 Quick View 存在时，Wishlist 按钮保持相对眼睛图标下移55px */
.product-inner .ycw-quickview-btn ~ .ycw-wishlist-btn {
    top: 65px;  /* 10px + 55px */
}

/* 当 Quick View 和 Compare 都存在时，Wishlist 按钮再向下移动 */
.product-inner .ycw-quickview-btn ~ .ycw-compare-btn ~ .ycw-wishlist-btn {
    top: 120px;  /* 10px + 55px + 55px */
}

/* 当只有 Compare 存在时（没有 Quick View），Wishlist 按钮的位置 */
.product-inner:not(:has(.ycw-quickview-btn)) .ycw-compare-btn ~ .ycw-wishlist-btn {
    top: 65px;  /* 10px + 55px */
}

.ycw-quickview-btn:hover,
.ycw-compare-btn:hover,
.ycw-wishlist-btn:hover {
    background: #00abc5 !important;
    color: #fff !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Quick View Button */
.ycw-quickview-btn svg {
    width: 18px;
    height: 18px;
}

.ycw-quickview-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Compare Button */
.ycw-compare-btn.in-compare {
    background: #4CAF50 !important;
    color: #fff !important;
}

.ycw-compare-btn.in-compare:hover {
    background: #00abc5 !important;
    color: #fff !important;
}

.ycw-compare-btn svg {
    width: 18px;
    height: 18px;
}

/* Wishlist Button */
.ycw-wishlist-btn.in-wishlist {
    background: #ff4444 !important;
    color: #fff !important;
}

.ycw-wishlist-btn.in-wishlist:hover {
    background: #00abc5 !important;
    color: #fff !important;
}

.ycw-wishlist-btn svg {
    width: 18px;
    height: 18px;
}

/* Compare Page Styles */
.ycw-compare-page {
    padding: 30px 0;
}

.ycw-compare-actions {
    margin-bottom: 20px;
}

.ycw-compare-table-wrapper {
    overflow-x: auto;
}

.ycw-compare-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.ycw-compare-table th,
.ycw-compare-table td {
    padding: 15px;
    border: 1px solid #ddd;
    text-align: center;
}

.ycw-compare-table th {
    background: #f5f5f5;
    font-weight: bold;
}

.ycw-compare-table th img {
    max-width: 150px;
    height: auto;
}

.ycw-compare-field-label {
    background: #f9f9f9;
    font-weight: bold;
    text-align: left !important;
    min-width: 150px;
}

.ycw-compare-remove {
    background: #ff4444;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.ycw-compare-remove:hover {
    background: #dd3333;
}

/* Tiered Pricing Display */
.ycw-tiered-prices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ycw-tier-price {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    background: #f9f9f9;
    border-radius: 3px;
    font-size: 14px;
}

.ycw-tier-price .tier-qty {
    font-weight: bold;
    color: #666;
    min-width: 40px;
}

.ycw-tier-price .tier-price {
    color: #4CAF50;
    font-weight: bold;
}

/* Wishlist Counter */
.ycw-wishlist-counter {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10001;
}

.ycw-wishlist-counter-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    position: relative;
}

.ycw-wishlist-counter-link:hover {
    background: #dd3333;
    transform: scale(1.1);
}

.ycw-wishlist-counter .ycw-wishlist-icon {
    font-size: 24px;
    margin: 0;
}

.ycw-wishlist-counter .ycw-wishlist-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: white;
    color: #ff4444;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
}

/* Wishlist Page */
.ycw-page-title {
    margin-bottom: 30px;
    font-size: 32px;
}

.ycw-empty-message {
    text-align: center;
    padding: 50px 20px;
}

.ycw-empty-message p {
    font-size: 18px;
    margin-bottom: 20px;
}

.ycw-empty-message .button {
    position: relative;
    z-index: 10000;
}

/* Wishlist Page */
.ycw-wishlist-page {
    padding: 30px 0;
}

.ycw-wishlist-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.ycw-wishlist-table th,
.ycw-wishlist-table td {
    padding: 15px;
    border: 1px solid #ddd;
}

.ycw-wishlist-table th {
    background: #f5f5f5;
    font-weight: bold;
}

.ycw-wishlist-table img {
    max-width: 80px;
    height: auto;
}

.ycw-remove-wishlist-item {
    background: #ff4444;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    z-index: 10000;
}

.ycw-remove-wishlist-item:hover {
    background: #dd3333;
}

/* Quick View Modal */
.ycw-quickview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ycw-quickview-modal.show {
    opacity: 1;
    visibility: visible;
}

.ycw-quickview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    cursor: pointer;
}

.ycw-quickview-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    overflow: visible;  /* 改为 visible，允许关闭按钮显示在外部 */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    -webkit-overflow-scrolling: touch;
    /* 使用 window.innerHeight 而不是 vh，通过 JS 动态设置 */
}

/* iOS 毛玻璃风格关闭按钮 - 位于容器外部右上角 */
.ycw-quickview-close {
    position: absolute !important;
    top: -10px !important;
    right: -10px !important;
    z-index: 100 !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    color: #333 !important;
    padding: 0 !important;
}

.ycw-quickview-close:hover {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25) !important;
    color: #000 !important;
    transform: scale(1.05) !important;
}

.ycw-quickview-close:hover svg {
    stroke: #000 !important;
}

.ycw-quickview-close:active {
    transform: scale(0.95) !important;
}

.ycw-quickview-close svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    color: #333 !important;
    stroke: #333 !important;
}

.ycw-quickview-content {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    max-height: 90vh;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overflow: hidden;  /* 确保内容不溢出圆角 */
    border-radius: 8px;  /* 继承父元素的圆角 */
}

.ycw-quickview-images {
    flex: 0 0 50%;
    padding: 30px;
    background: #f9f9f9;
    overflow-y: auto;
}

.ycw-quickview-summary {
    flex: 0 0 50%;
    padding: 30px;
    overflow-y: auto;
    background: #fff;
}

/* 滚动条样式 */
.ycw-quickview-images::-webkit-scrollbar,
.ycw-quickview-summary::-webkit-scrollbar {
    width: 8px;
}

.ycw-quickview-images::-webkit-scrollbar-track,
.ycw-quickview-summary::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ycw-quickview-images::-webkit-scrollbar-thumb,
.ycw-quickview-summary::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.ycw-quickview-images::-webkit-scrollbar-thumb:hover,
.ycw-quickview-summary::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 阻止body滚动 */
body.ycw-quickview-open {
    overflow: hidden;
}

/* Quick View 自定义画廊样式 */
.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-main {
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    background: #f9f9f9 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    min-height: 500px !important;
    height: 70vh !important;
    max-height: 700px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    touch-action: pan-x !important;
    cursor: grab !important;
}

.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-main .ycw-gallery-image {
    display: none !important;
    width: 100%;
    max-width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: center;
    justify-content: center;
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s ease;
    transform: translateX(0);
}

.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-main .ycw-gallery-image.active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-image img {
    width: 100% !important;
    height: auto !important;
    max-height: 650px !important;
    max-width: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    margin: 0 auto !important;
}

.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-thumbs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 15px !important;
    justify-content: center !important;
}

.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-thumb {
    width: 70px !important;
    height: 70px !important;
    border: 2px solid transparent !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-thumb:hover {
    border-color: #ddd !important;
}

.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-thumb.active {
    border-color: #00abc5 !important;
}

.ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}


.ycw-quickview-summary .product_title {
    margin-top: 0;
    font-size: 24px;
}

.ycw-quickview-summary .price {
    font-size: 28px;
    color: #00abc5;
    margin-bottom: 20px;
}

.ycw-quickview-summary .woocommerce-product-details__short-description {
    margin-bottom: 20px;
}

.ycw-quickview-summary .cart {
    margin-top: 20px;
}

.ycw-quickview-summary .single_add_to_cart_button {
    width: 100%;
}

/* Quick View 模态框内的愿望单按钮位置 */
.ycw-quickview-modal .ycw-wishlist-btn {
    right: 15px;  /* 调整这个值来左右移动按钮：增加数值=往左移，减少数值=往右移 */
}

/* Tiered Pricing Table in Quick View */
.ycw-quickview-summary .ycw-quickview-tiered-pricing {
    margin: 20px 0;
}

.ycw-quickview-summary .tpt__tiered-pricing {
    margin: 15px 0;
}

.ycw-quickview-summary .tiered-pricing-table {
    width: 100%;
    font-size: 14px;
}

/* 变体选择器样式 - 确保与产品页面一致 */
.ycw-quickview-modal .variations {
    margin-bottom: 20px;
}

.ycw-quickview-modal .variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.ycw-quickview-modal .variations .label {
    margin-bottom: 8px;
}

.ycw-quickview-modal .variations .label label {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    color: #333;
}

.ycw-quickview-modal .variations .value {
    width: 100%;
}

/* Woo Variation Swatches 插件样式支持 */
.ycw-quickview-modal .variable-items-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ycw-quickview-modal .variable-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.ycw-quickview-modal .variable-item:hover {
    border-color: #999;
}

.ycw-quickview-modal .variable-item.selected {
    border-color: #00abc5;
    box-shadow: 0 0 0 2px rgba(0, 171, 197, 0.2);
}

.ycw-quickview-modal .variable-item.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 颜色色块样式 */
.ycw-quickview-modal .variable-item.color-variable-item {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    position: relative;
}

.ycw-quickview-modal .variable-item.color-variable-item.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

/* 图片色块样式 */
.ycw-quickview-modal .variable-item.image-variable-item {
    padding: 2px;
}

.ycw-quickview-modal .variable-item.image-variable-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

/* 按钮/文本样式 */
.ycw-quickview-modal .variable-item.button-variable-item {
    padding: 8px 16px;
    min-width: 60px;
    font-size: 13px;
    font-weight: 500;
}

/* Reset/Clear 链接样式 */
.ycw-quickview-modal .reset_variations {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
    color: #999;
    text-decoration: none;
}

.ycw-quickview-modal .reset_variations:hover {
    color: #00abc5;
    text-decoration: underline;
}

/* 变体描述中的 Model 和 GS1 信息 - 一行显示 */
.ycw-quickview-modal .woocommerce-variation-description .availability {
    display: block;
    margin-bottom: 5px;
}

.ycw-quickview-modal .woocommerce-variation-description .availability p.stock {
    display: inline;
    margin: 0;
    padding: 0;
}

.ycw-quickview-modal .woocommerce-variation-description .availability p.stock b {
    font-weight: 600;
}

/* 所有 availability 元素中的 electro-stock-availability 和 p.stock 都内联显示 */
.ycw-quickview-modal .availability .electro-stock-availability {
    display: inline;
}

.ycw-quickview-modal .availability .electro-stock-availability p.stock {
    display: inline;
    margin: 0;
    padding: 0;
}

/* 仓库库存信息样式 */
.ycw-quickview-modal .warehouse-stocks-wrapper {
    margin-top: 15px;
}

.ycw-quickview-modal .warehouse-stocks-wrapper .availability {
    font-size: 13px;
    margin-bottom: 5px;
    color: #666;
}

/* 确保顶部的主库存信息显示正常 */
.ycw-quickview-summary > .availability {
    margin-bottom: 10px;
    font-size: 14px;
}

.ycw-quickview-summary > .availability .stock {
    color: #46b450;
    font-weight: 600;
}

/* Summary 内部元素样式 */
.ycw-quickview-modal .summary.entry-summary {
    font-size: 14px;
    line-height: 1.6;
}

.ycw-quickview-modal .summary.entry-summary .product_title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.3;
}

/* WooCommerce 原生库存可用性显示 */
.ycw-quickview-modal .summary.entry-summary > .availability {
    margin: 15px 0;
    font-size: 14px;
    line-height: 1.6;
}

.ycw-quickview-modal .summary.entry-summary > .availability .electro-stock-availability {
    display: inline;
}

.ycw-quickview-modal .summary.entry-summary > .availability .stock,
.ycw-quickview-modal .summary.entry-summary > .availability p.stock {
    display: inline;
    margin: 0;
    padding: 0;
    font-weight: 600;
    font-size: 14px;
}

.ycw-quickview-modal .summary.entry-summary > .availability .stock.in-stock,
.ycw-quickview-modal .summary.entry-summary > .availability p.stock.in-stock {
    color: #46b450;
}

.ycw-quickview-modal .summary.entry-summary > .availability .stock.out-of-stock,
.ycw-quickview-modal .summary.entry-summary > .availability p.stock.out-of-stock {
    color: #e2401c;
}

/* 库存信息容器 - 与产品页面样式一致 */
.ycw-quickview-modal .summary.entry-summary .stocks-info {
    margin: 15px 0;
}

.ycw-quickview-modal .summary.entry-summary .stocks-info .availability {
    display: block;
    color: #76909e;
    margin-bottom: 5px;
}

.ycw-quickview-modal .summary.entry-summary .stocks-info .availability:last-child {
    margin-bottom: 0;
}

.ycw-quickview-modal .summary.entry-summary .stocks-info .availability span {
    font-weight: bold;
}

.ycw-quickview-modal .summary.entry-summary .stocks-info .availability .warehouse-name {
    color: #76909e;
    font-weight: normal;
}

.ycw-quickview-modal .summary.entry-summary .stocks-info .availability .stock,
.ycw-quickview-modal .summary.entry-summary .stocks-info .availability p.stock {
    display: inline;
    font-weight: bold;
}

.ycw-quickview-modal .summary.entry-summary .stocks-info .availability .stock.in-stock,
.ycw-quickview-modal .summary.entry-summary .stocks-info .availability p.stock.in-stock {
    color: #46b450;
}

.ycw-quickview-modal .summary.entry-summary .stocks-info .availability .stock.out-of-stock,
.ycw-quickview-modal .summary.entry-summary .stocks-info .availability p.stock.out-of-stock {
    color: #e2401c;
}

/* 价格样式 */
.ycw-quickview-modal .summary.entry-summary .price {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin: 20px 0;
}

.ycw-quickview-modal .summary.entry-summary .price ins {
    text-decoration: none;
    color: #00abc5;
}

.ycw-quickview-modal .summary.entry-summary .price del {
    opacity: 0.6;
    font-size: 22px;
    margin-left: 10px;
}

/* 添加到购物车按钮 */
.ycw-quickview-modal .summary.entry-summary .cart {
    margin: 20px 0;
}

.ycw-quickview-modal .summary.entry-summary .cart .quantity {
    display: inline-block;
    margin-right: 10px;
}

.ycw-quickview-modal .summary.entry-summary .cart .single_add_to_cart_button {
    background: #00abc5 !important;
    color: #fff !important;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.ycw-quickview-modal .summary.entry-summary .cart .single_add_to_cart_button:hover {
    background: #00abc5 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 171, 197, 0.3);
}

/* 变体表格样式 */
.ycw-quickview-modal .summary.entry-summary .variations {
    margin: 20px 0;
    border: none;
}

.ycw-quickview-modal .summary.entry-summary .variations tr {
    border-bottom: 1px solid #f0f0f0;
}

.ycw-quickview-modal .summary.entry-summary .variations th {
    padding: 12px 0;
    font-weight: 600;
    text-align: left;
    width: 30%;
}

.ycw-quickview-modal .summary.entry-summary .variations td {
    padding: 12px 0;
}

/* 产品描述 */
.ycw-quickview-modal .summary.entry-summary .woocommerce-product-details__short-description {
    margin: 15px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Model 和 GS1 信息 */
.ycw-quickview-modal .summary.entry-summary .model-text {
    margin: 10px 0;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .ycw-wishlist-counter {
        top: auto;
        bottom: 80px;
        right: 10px;
    }

    .ycw-wishlist-table {
        font-size: 14px;
    }

    .ycw-wishlist-table th,
    .ycw-wishlist-table td {
        padding: 10px;
    }

    /* Quick View Mobile - 简化方案，避免重新渲染 */
    .ycw-quickview-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        height: 100%;
    }

    .ycw-quickview-container {
        /* 简单的固定定位，更小的尺寸 */
        position: absolute !important;
        top: 8% !important;
        left: 5% !important;
        right: 5% !important;
        bottom: auto !important;
        transform: none !important;
        width: 90% !important;
        max-width: 90% !important;
        height: auto !important;
        max-height: 80% !important;
        overflow: visible !important;  /* 允许关闭按钮显示在外部 */
        display: flex;
        flex-direction: column;
    }

    .ycw-quickview-content {
        flex-direction: column;
        overflow-y: scroll !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        flex: 1;
        min-height: 0;
        border-radius: 8px;  /* 保持圆角 */
    }

    .ycw-quickview-images,
    .ycw-quickview-summary {
        flex-shrink: 0;
        padding: 20px;
        width: 100%;
        box-sizing: border-box;
    }

    /* 防止移动端输入时自动缩放 - 关键修复 */
    .ycw-quickview-modal input[type="number"],
    .ycw-quickview-modal input[type="text"],
    .ycw-quickview-modal input[type="email"],
    .ycw-quickview-modal input[type="tel"],
    .ycw-quickview-modal textarea,
    .ycw-quickview-modal select {
        font-size: 16px !important;
    }

    .ycw-quickview-close {
        top: -10px !important;
        right: -10px !important;
    }

    /* 移动端主图高度优化 - 减少主图占用空间 */
    .ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-main {
        min-height: 300px !important;
        height: 50vh !important;
        max-height: 500px !important;
        overflow: hidden !important;
        touch-action: pan-x !important;
        cursor: auto !important;
    }

    /* 移动端缩略图优化 - 减小尺寸节省空间 */
    .ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-thumb {
        width: 60px !important;
        height: 60px !important;
    }

    .ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-thumbs {
        gap: 6px !important;
    }

    /* 移动端图片适配 */
    .ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-image img {
        max-height: 450px !important;
    }
}

/* 超小屏幕优化（iPhone SE 等设备） */
@media (max-width: 480px) {
    .ycw-quickview-container {
        /* 更小的尺寸 */
        top: 10% !important;
        left: 5% !important;
        right: 5% !important;
        width: 90% !important;
        max-width: 90% !important;
        max-height: 75% !important;
    }

    /* 防止移动端输入时自动缩放 - 关键修复 */
    .ycw-quickview-modal input[type="number"],
    .ycw-quickview-modal input[type="text"],
    .ycw-quickview-modal input[type="email"],
    .ycw-quickview-modal input[type="tel"],
    .ycw-quickview-modal textarea,
    .ycw-quickview-modal select {
        font-size: 16px !important;
    }

    /* 进一步减少主图高度 */
    .ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-main {
        min-height: 250px !important;
        height: 45vh !important;
        max-height: 400px !important;
        overflow: hidden !important;
        touch-action: pan-x !important;
        cursor: auto !important;
    }

    /* 缩小缩略图 */
    .ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-thumb {
        width: 50px !important;
        height: 50px !important;
    }

    .ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-thumbs {
        gap: 5px !important;
    }

    /* 减少内边距节省空间 */
    .ycw-quickview-images,
    .ycw-quickview-summary {
        padding: 15px !important;
        flex: 0 0 auto !important;
        overflow: visible !important;
        min-height: auto !important;
    }

    /* 图片高度调整 */
    .ycw-quickview-modal .ycw-quickview-images .ycw-custom-gallery .ycw-gallery-image img {
        max-height: 350px !important;
    }

    /* 关闭按钮调整 - 位于容器外部右上角 */
    .ycw-quickview-close {
        width: 32px !important;
        height: 32px !important;
        top: -8px !important;
        right: -8px !important;
    }

    .ycw-quickview-close svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* 标题字体调整 */
    .ycw-quickview-modal .summary.entry-summary .product_title {
        font-size: 20px !important;
    }

    /* 价格字体调整 */
    .ycw-quickview-modal .summary.entry-summary .price {
        font-size: 24px !important;
    }
}

/* ============================================
   AJAX Add to Cart Styles
   ============================================ */

/* 通知样式 */
.ycw-ajax-cart-notice {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    animation: ycwSlideDown 0.3s ease-out;
    position: relative;
}

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

/* 成功通知 */
.ycw-ajax-cart-notice--success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* "Ver carrito" 按钮样式 - 醒目强调 */
.ycw-ajax-cart-notice .added_to_cart {
    display: inline-block;
    margin-left: 10px;
    padding: 8px 20px;
    background-color: #28a745;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    border: 2px solid #28a745;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ycw-ajax-cart-notice .added_to_cart:hover {
    background-color: #218838;
    border-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    color: #ffffff !important;
}

.ycw-ajax-cart-notice .added_to_cart:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

/* 为按钮添加图标 */
.ycw-ajax-cart-notice .added_to_cart::before {
    content: '🛒';
    margin-right: 6px;
    font-size: 16px;
}

/* 错误通知 */
.ycw-ajax-cart-notice--error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* 按钮加载状态 */
.single_add_to_cart_button.loading {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
    pointer-events: none;
}

.single_add_to_cart_button.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ycwSpin 0.6s linear infinite;
}

@keyframes ycwSpin {
    to {
        transform: rotate(360deg);
    }
}

/* 按钮添加成功状态 */
.single_add_to_cart_button.added {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
    transition: background-color 0.3s ease;
}

.single_add_to_cart_button.added::after {
    content: '✓';
    margin-left: 8px;
    font-weight: bold;
}

/* 响应式 */
@media (max-width: 768px) {
    .ycw-ajax-cart-notice {
        padding: 12px 15px;
        font-size: 13px;
        margin-left: 5%;
        margin-right: 5%;
        width: 90%;
        max-width: 90%;
    }

    /* 移动端 "Ver carrito" 按钮优化 */
    .ycw-ajax-cart-notice .added_to_cart {
        display: block;
        margin-top: 10px;
        margin-left: 0;
        text-align: center;
        padding: 10px 16px;
        font-size: 14px;
        width: 100%;
        box-sizing: border-box;
    }

    .single_add_to_cart_button.loading::before {
        left: 10px;
        width: 14px;
        height: 14px;
        margin-top: -7px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .ycw-ajax-cart-notice {
        padding: 10px 12px;
        font-size: 12px;
        margin-left: 3%;
        margin-right: 3%;
        width: 94%;
        max-width: 94%;
    }

    .ycw-ajax-cart-notice .added_to_cart {
        padding: 8px 12px;
        font-size: 13px;
    }
}
