/*
Theme Name: MB1-0611
Description: Modern WooCommerce Theme with Tailwind CSS - US Market
Version: 2.0
*/

/* ================================
   Tailwind 补充样式
================================ */

/* 商品卡片悬停效果 */
.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

/* Alpine.js 隐藏 */
[x-cloak] { display: none !important; }

/* WooCommerce 通知 */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 16px 20px 16px 50px;
    margin-bottom: 24px;
    border-radius: 12px;
    list-style: none;
    font-size: 14px;
    position: relative;
    z-index: 9999;
}
.woocommerce-message::before,
.woocommerce-info::before,
.woocommerce-error::before {
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: 18px !important;
}

.woocommerce-message {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.woocommerce-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.woocommerce-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* 分页 */
.woocommerce-pagination ul.page-numbers {
    display: flex;
    justify-content: center;
    gap: 4px;
    list-style: none;
    padding: 0;
}

.woocommerce-pagination ul.page-numbers li span.current,
.woocommerce-pagination ul.page-numbers li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    color: #374151;
    transition: all 0.15s;
}

.woocommerce-pagination ul.page-numbers li span.current {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.woocommerce-pagination ul.page-numbers li a:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* 排序下拉 */
.woocommerce-ordering select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    color: #374151;
    background: white;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* 图片通用 */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* 修复特色产品价格与标题重叠 */
.featured-product .content .price-tag {
    position: static !important;
    margin-top: 6px;
}
.featured-product .content h3 {
    padding-right: 0 !important;
}

/* 商品卡片加入购物车按钮 */
.featured-product .content .add-cart-btn,
.trending-card .content .add-cart-btn {
    margin-top: 12px;
    text-align: right;
}
.featured-product .content .add-cart-btn .default-btn,
.trending-card .content .add-cart-btn .default-btn {
    padding: 6px 18px;
    font-size: 13px;
}

/* 修复手机端导航条 */
@media only screen and (max-width: 991px) {
    /* 导航条改为白色 */
    .mean-container .mean-bar {
        background-color: #ffffff !important;
        border-bottom: 1px solid #e5e7eb;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: -15px !important;
        margin-right: -15px !important;
    }
    /* 导航条外层容器取消手机端 padding */
    .main-nav .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    /* 汉堡按钮改为蓝色 */
    .mean-container a.meanmenu-reveal span {
        background: #0162BD !important;
    }
    /* 汉堡按钮文字颜色（X 关闭图标） */
    .mean-container a.meanmenu-reveal {
        color: #0162BD !important;
    }
    /* 汉堡按钮与 logo 同一水平线 */
    .mean-container a.meanmenu-reveal {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        right: 15px !important;
        padding: 0 !important;
        margin-top: 0 !important;
        height: 30px !important;
        display: flex !important;
        align-items: center !important;
    }
    /* logo 样式 */
    .mobile-nav .logo {
        position: absolute !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        left: 0 !important;
        z-index: 999 !important;
        max-width: 65% !important;
        height: 42px !important;
    }
    .mobile-nav .logo img {
        max-height: 100% !important;
        height: 100% !important;
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
        display: block !important;
    }
    /* 防止导航条遮挡 banner */
    .banner-area,
    .banner-slider-area {
        margin-top: 55px !important;
    }
}

/* Inner Banner 高度减半 */
.inner-banner-area {
    padding: 25px 0 !important;
}
.inner-banner-area::before {
    display: none !important;
}
.inner-banner-content h2 {
    font-size: 28px !important;
}

/* 商品列表页排序下拉 */
.product-category select {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* WooCommerce 分页适配参考模板 */
.woocommerce-pagination ul.page-numbers {
    display: inline-flex !important;
    gap: 4px !important;
    list-style: none !important;
    padding: 0 !important;
}
.woocommerce-pagination ul.page-numbers li {
    display: inline-block !important;
}
.woocommerce-pagination ul.page-numbers li span.current,
.woocommerce-pagination ul.page-numbers li a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 4px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border: 1px solid #e5e7eb !important;
    color: #374151 !important;
    background: #fff !important;
    transition: all 0.2s !important;
    text-decoration: none !important;
}
.woocommerce-pagination ul.page-numbers li span.current {
    background: #0162BD !important;
    color: #fff !important;
    border-color: #0162BD !important;
}
.woocommerce-pagination ul.page-numbers li a:hover {
    background: #0162BD !important;
    color: #fff !important;
    border-color: #0162BD !important;
}

/* 响应式 */
@media (max-width: 640px) {
    .woocommerce-pagination ul.page-numbers li span.current,
    .woocommerce-pagination ul.page-numbers li a {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* ================================
   Checkout 表单修复
================================ */
/* 消除 WooCommerce form-row 浮动/宽度，由 Bootstrap grid 接管 */
.checkout-form .form-row,
.woocommerce-shipping-fields .form-row {
    float: none !important;
    width: 100% !important;
    clear: both !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* 隐藏 WooCommerce 自动生成的 label，模板已提供 */
.checkout-form .form-row > label,
.woocommerce-shipping-fields .form-row > label {
    display: none !important;
}

/* input-wrapper 占满宽度 */
.checkout-form .form-row .woocommerce-input-wrapper,
.woocommerce-shipping-fields .form-row .woocommerce-input-wrapper {
    display: block !important;
    width: 100% !important;
}

/* form-group 内间距 */
.checkout-form .form-group {
    margin-bottom: 18px;
}

/* form-group 内的 label 样式 */
.checkout-form .form-group > label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* form-row 需要 overflow:visible，min-height 确保内容可见 */
.checkout-form .form-row {
    overflow: visible !important;
    min-height: 50px !important;
}

/* Checkout 原生 select 样式 */
.checkout-form select.form-control {
    height: 50px;
    border: 1px solid #E8B43F;
    background: #F1F1F1;
    border-radius: 0;
    font-size: 15px;
    color: #555;
    padding: 10px 20px;
}

/* Cart 页面黄色主题（与 Checkout 统一） */
.cart-accent { color: #E8B43F !important; }
.cart-accent-border { border-color: #E8B43F !important; }
.cart-accent-bg { background-color: #E8B43F !important; }
.hover-cart-accent:hover { color: #E8B43F !important; }
.hover-cart-accent-bg:hover { background-color: #E8B43F !important; color: #fff !important; }
.hover-cart-accent-border:hover { border-color: #E8B43F !important; }
.cart-accent-bg-dark { background-color: #d4a024 !important; }
.hover-cart-accent-bg-dark:hover { background-color: #d4a024 !important; }

/* ================================
   Single Product 页面
================================ */
/* WooCommerce 画廊在参考模板容器内 */
.product-detls-image .woocommerce-product-gallery {
    margin-bottom: 0 !important;
    opacity: 1 !important;
    position: relative;
}
.product-detls-image .woocommerce-product-gallery__wrapper {
    margin: 0 !important;
    padding: 0 !important;
}
.product-detls-image .woocommerce-product-gallery__image {
    display: block;
}
.product-detls-image .woocommerce-product-gallery__image img {
    width: 100%;
    display: block;
}
/* 隐藏画廊缩略图导航（保持简洁单图） */
.product-detls-image .flex-control-nav,
.product-detls-image .flex-direction-nav,
.product-detls-image .woocommerce-product-gallery__trigger {
    display: none !important;
}
/* Sale 标签 */
.product-detls-image .onsale {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
}

/* 数量 +/- 按钮 — 用 button 标签并重置默认样式 */
.input-counter {
    position: relative !important;
    overflow: visible !important;
}
.input-counter .minus-btn,
.input-counter .plus-btn {
    z-index: 10 !important;
    pointer-events: auto !important;
    position: absolute !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    cursor: pointer !important;
    color: #555555 !important;
    font-size: 18px !important;
    width: 50px !important;
    height: 100% !important;
    top: 2px !important;
    line-height: 45px !important;
}
.input-counter .minus-btn {
    left: 0 !important;
}
.input-counter .plus-btn {
    right: 5px !important;
    width: 40px !important;
}
.input-counter input {
    position: relative !important;
    z-index: 1 !important;
}
/* 确保加号不会被右侧元素遮挡 */
.product-desc .input-count-area {
    overflow: visible !important;
}
.product-desc .input-counter {
    overflow: visible !important;
}

