/*
Theme Name: moban21_v260519
Description: Custom WooCommerce Theme
Version: 1.0
*/

/* ================================
   WooCommerce + Bootstrap 修复
================================ */
.wc-bootstrap-input-group {
    flex-wrap: nowrap;
}

.wc-bootstrap-input-group .quantity {
    display: flex;
    flex: 0 0 80px;
}

.wc-bootstrap-input-group .quantity input[type="number"] {
    width: 100%;
}

/* 去掉 number 输入框上下箭头（统一写法） */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ================================
   通用图片处理
================================ */
.img-fluid,
.banner-img,
.logo_img,
.content-image {
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
}

/* 商品图片比例 */
.product-img img {
    aspect-ratio: 3 / 4;
    object-fit: cover;
    width: 100%;
}

/* 防止卡片高度错位 */
.product-wrapper {
    height: 100%;
}

/* ================================
   WooCommerce 文本优化
================================ */
p.woocommerce-result-count {
    margin-bottom: 0 !important;
}

.pro-price span {
    font-weight: 500 !important;
    font-size: 14px !important;
    color: #747691 !important;
    margin: 0 !important;
}

/* ================================
   排序下拉框
================================ */
.woocommerce-ordering {
    margin: 0;
}

.woocommerce-ordering select {
    border: 1px solid #ddd;
    height: 45px;
    padding: 0 15px;
    border-radius: 0;
    background-color: #fff;
    font-size: 14px;
    color: #666;
    outline: none;
    cursor: pointer;
}

/* ================================
   分页样式
================================ */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 3rem 0;
}

.pagination-container ul {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.pagination-container ul li a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    background-color: #fff;
    color: #212529;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* hover */
.pagination-container ul li a:hover:not(.disabled):not(.active) {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #DE3163;
    transform: translateY(-2px);
}

/* active */
.pagination-container ul li a.active {
    background-color: #DE3163;
    border-color: #DE3163;
    color: #fff;
    cursor: default;
    box-shadow: 0 4px 10px rgba(222, 49, 99, 0.2);
}

/* disabled */
.pagination-container ul li a.disabled {
    color: #adb5bd;
    pointer-events: none;
    background-color: #f8f9fa;
    border-color: #e9ecef;
    cursor: not-allowed;
}

/* ellipsis */
.pagination-container ul li a[href="javascript:;"] {
    border: none;
    background: transparent;
    cursor: default;
}


/* ================================
   响应式优化
================================ */
@media (max-width: 576px) {

    .pagination-container ul {
        gap: 5px;
    }

    .pagination-container ul li a {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

/* 针对商品卡片头部进行修复 */
.product-item .product-content .head {
    display: flex;
    flex-direction: column; /* 将左右排列强制改为上下排列 */
    align-items: flex-start; /* 左对齐 */
    gap: 8px; /* 标题和下方价格之间留出一点空隙 */
}

/* 确保标题容器宽度占满，不再受挤压 */
.product-item .product-content .head .top {
    width: 100%;
}

/* 确保价格和星星区域占满整行，内部可以再做排版 */
.product-item .product-content .head .bottom {
    width: 100%;
    display: flex;
    justify-content: space-between; /* 价格在左，星星在右 */
    align-items: center;
}


.mini-cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    list-style: none;
    position: relative;
    transition: all 0.3s ease;
}

.mini-cart-item:last-child {
    border-bottom: none;
}

/* 图片区域 */
.item-image {
    position: relative;
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    margin-right: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 删除按钮美化 - 放在图片右上角 */
.remove-item {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d4f;
    color: #fff !important;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.mini-cart-item:hover .remove-item {
    opacity: 1;
    transform: translate(-5px, 5px);
}

/* 内容区域 */
.item-details {
    flex-grow: 1;
}

.product-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 5px;
    transition: color 0.2s;
}

.product-name:hover {
    color: var(--primary-hover-color, #ff7d01);
}

/* 价格与数量 */
.item-meta {
    font-size: 13px;
    color: #777;
}

.item-meta .quantity {
    font-weight: 700;
    color: #222;
}

.item-meta .multiplier {
    margin: 0 4px;
    color: #bbb;
}

.item-meta .price {
    color: var(--primary-hover-color, #ff7d01);
    font-weight: 600;
}
/* 容器设置 */
.header-cart-toggle {
    min-width: 320px;
    padding: 0;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 8px;
    overflow: hidden;
}

/* 列表滚动区：防止购物车太长撑破页面 */
.mini-cart-items-wrapper {
    max-height: 350px;
    overflow-y: auto;
    padding: 10px 0;
}

/* 底部结算区 */
.mini-cart-footer {
    background: #f9f9f9;
    padding: 20px;
    border-top: 1px solid #eee;
}

.totals {
    margin-bottom: 15px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.total-row.grand-total {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
    font-size: 18px;
    font-weight: 700;
    color: #222;
}

.total-row .amount {
    color: #ff7d01; /* 你主题的橙色 */
}

/* 按钮美化 */
.mini-cart-footer .buttons {
    display: flex;
    gap: 10px;
}

.mini-cart-footer .buttons a {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn-view-cart {
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.btn-checkout {
    background: #222; /* 黑色背景 */
    color: #fff;
    border: 1px solid #222;
}

.btn-view-cart:hover {
    background: #eee;
}

.btn-checkout:hover {
    background: #ff7d01;
    border-color: #ff7d01;
    color: #000;
}

/* 空购物车 */
.empty-cart-msg {
    display: flex;
    justify-content: center;
    align-items: center;
    height:200px;
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.empty-cart-msg i {
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
    color: #eee;
}
#mahardhiSearch .woocommerce-product-search {
    display: flex !important;
    width: 100%;
}

#mahardhiSearch .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    flex: 1; /* 让输入框占据剩余空间 */
}

#mahardhiSearch .btn-search .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    height: 100%; /* 确保按钮高度与输入框一致 */
    padding: 0 20px;
}

/* 移除搜索框默认的清除图标 (针对 Chrome/Safari) */
input[type="text"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}