/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0
*/

/*************** ADD CUSTOM CSS HERE.   ***************/
/* ==============================================
   全局强制圆角样式 (覆盖 Flatsome 默认直角)
   ============================================== */

/* 1. 所有输入框、文本域 (Login, 评论, CF7表单等) */
input[type="text"],
input[type="email"],
input[type="password"], /* Login页面关键 */
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,               /* 评论框和留言框 */
select {
    border-radius: 10px !important;  /* 这里的 10px 是圆角程度，可自行调整 */
}

/* 2. 所有按钮 (包括登录按钮、提交按钮、商城按钮) */
button,
.button,
input[type="submit"],
input[type="button"],
button[type="submit"],
.primary,
.secondary {
    border-radius: 50px !important; /* 50px 会让按钮变成两头圆圆的“胶囊型” */
}

/* 3. 特殊处理：修复 Flatsome 搜索框的圆角 */
/*.search-form .search-field {
    border-top-left-radius: 50px !important;
    border-bottom-left-radius: 50px !important;
}*/
.search-form .search-submit {
    border-top-right-radius: 50px !important;
    border-bottom-right-radius: 50px !important;
}

/* 4. 特殊处理：WooCommerce 数量选择框 (可选) */
.quantity .minus {
    border-radius: 10px 0 0 10px !important;
}
.quantity .plus {
    border-radius: 0 10px 10px 0 !important;
}

/* 针对 ID 为 newsletter-signup-link 的弹窗 */
#newsletter-signup-link {
    background-color: transparent !important; /* 核心：去掉白色背景 */
    box-shadow: none !important;              /* 可选：去掉外层阴影，让卡片更干净 */
}
/* 优化关闭按钮 (可选) */
button.mfp-close {
    color: #fff !important;   /* 改为白色，在蓝色背景上更清晰 */
    top: -10px !important;    /* 稍微往上移一点 */
    right: -10px !important;  /* 稍微往右移一点 */
}

/* ==============================================
   修复 Blog Post 搜索栏错位 & 美化
   ============================================== */

/* 1. 强制容器横向排列并垂直居中 */
.wp-block-search__inside-wrapper {
    display: flex !important;        /* 启用 Flex 布局 */
    align-items: center !important;  /* 垂直方向完全居中 */
    flex-wrap: nowrap !important;    /* 禁止换行 */
    gap: 8px;                        /* 输入框和按钮之间的间距 */
    width: 100%;                     /* 占满宽度 */
}

/* 2. 修复搜索按钮 (去除怪异边距 + 圆角) */
.wp-block-search__button {
    margin: 0 !important;            /* 核心修复：去除导致错位的 16px 底部/左侧边距 */
    padding: 10px 24px !important;   /* 调整按钮大小 */
    height: auto !important;         /* 自动适应高度 */
    min-height: 44px;                /* 设置最小高度，防止太扁 */
    line-height: 1 !important;       /* 防止文字偏上或偏下 */
    border-radius: 50px !important;  /* 保持你的全圆角胶囊风格 */
    border: none !important;         /* 去除边框 */
    
    /* 确保按钮内文字居中 */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 3. 修复输入框 (高度匹配 + 圆角) */
.wp-block-search__input {
    margin-bottom: 0 !important;     /* 去除输入框可能存在的底部间距 */
    border-radius: 10px !important;  /* 保持输入框圆角 (对应你之前的设置) */
    min-height: 44px;                /* 确保和按钮高度一致 */
    flex-grow: 1;                    /* 让输入框自动填满剩余空间 */
}


    /* 1. 基础容器设置 - 这里控制表格的整体宽度 */
    #custom-size-chart-wrapper {
        font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
        /* 修改点1：将最大宽度从 800px 减小到 680px，这样列就不会拉得太宽 */
        max-width: 680px; 
        margin: 0 auto; /* 保持整体居中 */
        color: #333;
        padding: 10px;
        background-color: #fff;
    }

    /* 2. 主标题 */
    #custom-size-chart-wrapper .sc-main-title {
        text-align: center;
        font-size: 22px;
        font-weight: 800;
        margin-bottom: 20px;
        text-transform: uppercase;
        padding-bottom: 10px;
        border-bottom: 2px solid #000;
        letter-spacing: 1px;
    }

    /* 3. 副标题 (Inches / CM) */
    #custom-size-chart-wrapper .sc-subtitle {
        background-color: #f2f2f2;
        color: #333;
        font-weight: bold;
        text-align: center;
        padding: 10px;
        margin-top: 20px;
        border: 1px solid #ddd;
        border-bottom: none;
    }

    /* 4. 滚动视图容器 */
    #custom-size-chart-wrapper .sc-scroll-view {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid #ddd;
        margin-bottom: 10px;
    }

    /* 5. 表格基础设置 */
    #custom-size-chart-wrapper .sc-table {
        width: 100%;
        /* 保持手机端最小宽度，防止挤压 */
        min-width: 550px; 
        border-collapse: collapse;
        margin: 0;
    }

    /* 6. 表头样式 (TH) */
    #custom-size-chart-wrapper .sc-table th {
        background-color: #222 !important;
        color: #ffffff !important;
        padding: 12px 5px; /* 减小一点左右内边距，适应更窄的宽度 */
        font-weight: normal;
        text-transform: uppercase;
        border: 1px solid #444;
        white-space: nowrap;
        
        /* 修改点2：强制表头居中 */
        text-align: center !important; 
        vertical-align: middle !important;
    }

    /* 7. 单元格样式 (TD) */
    #custom-size-chart-wrapper .sc-table td {
        padding: 10px 5px;
        border: 1px solid #ddd;
        color: #333;
        background-color: #fff;
        
        /* 修改点2：强制内容居中 */
        text-align: center !important;
        vertical-align: middle !important;
    }

    /* 8. 斑马纹 */
    #custom-size-chart-wrapper .sc-table tr:nth-child(even) td {
        background-color: #f9f9f9;
    }

    /* ==============================================
   修复产品页图片高度跳动 (Layout Shift Fix)
   [ 统一设置为 3:4 比例，含移动端 ]
   ============================================== */

/* 1. 强制容器为固定比例 (3:4 竖图) */
/* 这段代码现在对电脑和手机都生效 */
.product-gallery-slider .slide {
    aspect-ratio: 3 / 4 !important; 
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: #ffffff; /* 建议保留：防止不同比例图片切换时背景太生硬 */
    overflow: hidden;
}

/* 2. 强制图片适应容器 (不裁剪，显示全貌) */
.product-gallery-slider .slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* 关键：确保长图短图都能完整显示 */
    box-shadow: none !important;
}

/* ==============================================
   3. 修复加载瞬间的布局偏移 (Layout Shift Fix) v2
   ============================================== */

/* --- 父容器修复 --- */
.product-gallery-slider {
    display: flex !important;       /* 强制横排 */
    flex-wrap: nowrap !important;   /* 禁止换行 */
    overflow: hidden !important;    /* 隐藏第2张以后的图 */
    aspect-ratio: 3 / 4 !important; /* 锁定容器比例 */
    width: 100%;
    position: relative;
    align-items: flex-start;        /* 避免因为对齐问题产生的额外间隙 */
}

/* 占位符 (保持不变) */
.product-gallery-slider::before {
    content: "";
    display: block;
    padding-top: 133.33%; 
    width: 0; 
    float: left; 
}

/* --- 子元素 (Slide) 修复 [关键修改] --- */
.product-gallery-slider .slide {
    aspect-ratio: 3 / 4 !important; 
    
    /* 核心修复：防止图片被挤压成缩略图 */
    width: 100% !important;
    min-width: 100% !important;     /* 强制最小宽度为容器的100% */
    flex-shrink: 0 !important;      /* 关键指令：禁止收缩！0表示不缩放 */
    
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    overflow: hidden;
    margin: 0 !important;           /* 清除可能存在的默认间距 */
}

/* 图片本身 */
.product-gallery-slider .slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    box-shadow: none !important;
}



/* 1. 隐藏原下拉菜单 */
table.variations select {
    display: none !important;
}

/* 2. 容器样式 */
.flatsome-custom-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* 3. 通用方块样式 */
.flatsome-custom-swatches .swatch-item {
    border: 2px solid #ddd; /* 边框稍微加粗一点 */
    background-color: #fff;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    border-radius: 3px;
    overflow: hidden; /* 保证图片不出界 */
}

/* 4. 纯文字按钮 (如尺码 XS, S, M) */
.flatsome-custom-swatches .swatch-item.no-image {
    padding: 6px 14px;
    min-width: 40px;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 5. 图片缩略图按钮 (如颜色) */
.flatsome-custom-swatches .swatch-item.has-image {
    width: 50px; /* 控制缩略图大小 */
    height: 50px;
    padding: 0;
}

.flatsome-custom-swatches .swatch-item.has-image img.swatch-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保证图片填满方块不被拉伸 */
    display: block;
}

/* 6. 鼠标悬停 */
.flatsome-custom-swatches .swatch-item:hover {
    border-color: #777;
}

/* 7. 选中状态 (高亮边框) */
.flatsome-custom-swatches .swatch-item.selected {
    border-color: #000; /* 选中后的黑框 */
}

/* 选中后的文字按钮变成黑底白字 */
.flatsome-custom-swatches .swatch-item.no-image.selected {
    background-color: #000;
    color: #fff;
    font-weight: bold;
}

/* 8. 缺货/不可用状态 (带红色删除线) */
.flatsome-custom-swatches .swatch-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: #eee;
}
.flatsome-custom-swatches .swatch-item.disabled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 1.5px;
    background: red;
    transform: rotate(-45deg);
}



/*
 * =============================================================
 * 产品页独立 FAQ 手风琴样式 (匹配 GOAT 网格系统)
 * =============================================================
 */

/* 1. 主容器：与 Tabs 宽度和边框完美对齐 */
.matchbeast-faqs-wrapper {
    position: relative;
    background: #fff;
    padding: 25px 20px;
    z-index: 5;
    /* 向上位移 1px 覆盖 Tabs 底边框，防止出现双实线 */
    margin-top: -1px !important; 
    margin-bottom: 30px;
    border: 1px solid rgba(0,0,0,0.7);
    box-sizing: border-box !important;
}

/* 移动端修正，匹配 Tabs 的无底边框设计 */
@media (max-width: 849px) {
    .matchbeast-faqs-wrapper {
        border-left: 1px solid rgba(0,0,0,0.7) !important;
        border-right: 1px solid rgba(0,0,0,0.7) !important;
        border-top: 1px solid rgba(0,0,0,0.7) !important;
        border-bottom: none !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 0 !important;
        width: 100% !important;
        padding: 20px 15px !important;
    }
}

/* 2. 标题样式 */
.mb-faq-heading {
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    color: #000;
}

/* 3. 每一个折叠项目 */
.mb-faq-item {
    border-top: 1px solid rgba(0,0,0,0.15);
}
.mb-faq-item:last-child {
    border-bottom: 1px solid rgba(0,0,0,0.15);
}

/* 4. 问题头部 (点击区域) */
.mb-faq-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: #222;
    transition: color 0.2s ease;
}
.mb-faq-title:hover { color: #666; }

/* 加减号 Icon */
.mb-faq-icon {
    font-size: 1.4em;
    font-weight: 400;
    line-height: 1;
    color: #000;
}

/* 5. 答案内容区：使用 CSS Grid 实现丝滑折叠展开动画 */
.mb-faq-content-wrapper {
    display: grid;
    grid-template-rows: 0fr; /* 默认折叠 */
    transition: grid-template-rows 0.3s ease-out;
}

/* 当父元素拥有 active 类时展开 */
.mb-faq-item.active .mb-faq-content-wrapper {
    grid-template-rows: 1fr;
}

.mb-faq-content-inner {
    overflow: hidden;
    font-size: 0.9em;
    line-height: 1.6;
    color: #444;
}

/* 内部间距修正 */
.mb-faq-content-inner p {
    margin-bottom: 15px;
}
.mb-faq-item.active .mb-faq-content-inner {
    padding-bottom: 5px; /* 展开后的底部留白 */
}

@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/


}