/* ==========================================
   颜色排列方向 (layout_direction)
   prefix_class "direction-row" / "direction-col" 添加在 Elementor widget 外层
   ========================================== */

/* 横向排列 */
.direction-row .eco-swatch-wrapper {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* 纵向排列 */
.direction-col .eco-swatch-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* ==========================================
   颜色与按钮排列 (swatch_item_layout)
   prefix_class "clear-layout-row" / "clear-layout-col" 添加在 Elementor widget 外层
   仅在显示 Clear All 按钮时生效
   ========================================== */

/* 横向：颜色列表与按钮同行 */
.clear-layout-row .eco-swatch-main-wrapper.has-clear-all {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 15px;
}

/* 纵向：颜色列表与按钮上下排列 */
.clear-layout-col .eco-swatch-main-wrapper.has-clear-all {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px;
}

/* ==========================================
   色板基础样式
   ========================================== */
.eco-swatch-item {
    cursor: pointer;
    transition: all 0.3s;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    /* Elementor Border Control 会自动覆盖下面两个属性 */
    border: 2px solid transparent;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    /* 为浅色提供边框辨识度 */
}

/* 动效 */
.eco-swatch-item:hover {
    transform: scale(1.05);
}

.eco-swatch-item.active {
    transform: scale(1.1);
}

/* ==========================================
   普通文本选项 (Normal Type) 专属默认样式
   ========================================== */
.eco-swatch-item.type-button {
    width: auto;         /* 覆盖默认的定宽 */
    height: auto;        /* 覆盖默认的定高 */
    min-width: 40px;     /* 给个最小宽度更好看 */
    padding: 8px 16px;   /* 默认内边距 */
    border-radius: 4px;  /* 默认微圆角 */
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: #f7f7f7;
    border: 2px solid transparent; /* 预留边框空间，防止hover时跳动 */
}

/* 文字选项的 Active 默认样式 (若后台未配置则兜底) */
.eco-swatch-item.type-button.active {
    background-color: #111;
    color: #fff;
    border-color: #111;
}

/* 确保颜色圆块不受影响 */
.eco-swatch-item.type-color {
    border-radius: 50%;
}

.eco-swatch-clear {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    background-color: #f7f7f7;
    border: 1px solid #e0e0e0;
    color: #555;
    font-size: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* 鼠标悬停效果 */
.eco-swatch-clear:hover {
    background-color: #333;
    color: #fff;
    border-color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* ==========================================
   WooCommerce Add To Cart 核心底层与适配样式
   ========================================== */

.wcs-add-to-cart-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

/* 核心：彻底清除 Input 和 Button 的默认 Outline 与聚焦阴影 */
.wcs-qty-input,
.wcs-qty-btn,
.wcs-add-to-cart-btn {
    outline: none !important;
    box-shadow: none !important;
    border: none;
    /* 按钮默认无边框 */
}

.wcs-qty-input:focus,
.wcs-qty-btn:focus,
.wcs-add-to-cart-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 隐藏所有数字输入框的上下微调箭头 */
.wcs-qty-input::-webkit-outer-spin-button,
.wcs-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wcs-qty-input {
    -moz-appearance: textfield;
    text-align: center;
}

/* Style 1: 独立输入框（默认底色与高宽） */
.wcs-quantity-wrapper.style-style1 .wcs-qty-input {
    width: 70px;
    height: 48px;
    border: 2px solid #eaeaea;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
}

/* Style 2: 左右加减按钮组合（外框） */
.wcs-quantity-wrapper.style-style2 {
    display: flex;
    align-items: center;
    border: 2px solid #eaeaea;
    /* 默认外层颜色 */
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.wcs-quantity-wrapper.style-style2 .wcs-qty-btn {
    width: 48px;
    height: 48px;
    background-color: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: background-color 0.2s ease;
}

.wcs-quantity-wrapper.style-style2 .wcs-qty-btn:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* Style 2：核心优化 —— 内层数字框左右两侧分隔线默认继承外框设置 */
.wcs-quantity-wrapper.style-style2 .wcs-qty-input {
    width: 50px;
    height: 48px;
    border-top: none;
    border-bottom: none;
    border-left: 2px solid #eaeaea;
    /* 后台修改边框粗细或颜色时会完美同步覆盖 */
    border-right: 2px solid #eaeaea;
    /* 后台修改边框粗细或颜色时会完美同步覆盖 */
    background-color: transparent;
    font-size: 16px;
    font-weight: 600;
}

/* Add To Cart 按钮基础架构 */
.wcs-add-to-cart-btn {
    height: 48px;
    padding: 0 36px;
    background-color: #111;
    /* 后台没设置时的默认颜色 */
    color: #fff;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* ------------------------------------------
   Loading 进度条 / 图标与其无限平滑旋转动画
   ------------------------------------------ */
.wcs-btn-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    /* 图标与加载文字的间距 */
}

.wcs-loading-icon {
    display: inline-flex;
    animation: wcsSpin 1s linear infinite;
    /* 1秒一圈无限循环旋转 */
}

@keyframes wcsSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 加载与成功状态控制 */
.wcs-add-to-cart-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.wcs-add-to-cart-btn.added {
    background-color: #00a32a !important;
    color: #fff !important;
    border-color: #00a32a !important;
}

/* ==========================================
   产品信息模式（色板组件 - 是否是产品信息 开启时）
   ========================================== */
.eco-product-info-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13px;
    line-height: 1.6;
}

.eco-product-info-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.eco-product-info-label {
    color: #999;
    font-weight: 400;
}

.eco-product-info-value {
    color: #333;
    font-weight: 500;
}

.eco-product-info-color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.eco-product-info-separator {
    color: #ccc;
}

/* ==========================================
   旧版购物车规格显示（兼容保留）
   ========================================== */
.eco-cart-attr-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13px;
    line-height: 1.6;
}

.eco-cart-attr-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.eco-cart-attr-label {
    color: #999;
    font-weight: 400;
}

.eco-cart-attr-value {
    color: #333;
    font-weight: 500;
}

.eco-cart-attr-color-dot {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.eco-cart-attr-separator {
    color: #ccc;
}

.eco-cart-attr-badge .eco-cart-attr-item {
    align-items: baseline;
}

.eco-cart-attr-badge .eco-cart-attr-value {
    background-color: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}