/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* 侧边栏样式 */
/* ===============================
   Mini Cart Layout (Based on Image)
================================ */

/* =========================
   Mini Cart – Item Card
========================= */


/* ===============================
   Mini Cart – Style Refinement
================================ */


/* =====================================================
   Cart All In One (VillaTheme) – Mini Cart Style
===================================================== */



/* ===============================
   Mini Cart Item – 强制重排
================================ */
/* ===== Mini Cart Layout ===== */


/* ======================================================
   Mini Cart – Cart All In One Style (VillaTheme-like)
   ====================================================== */



/* ======================================================
   Mini Cart – FINAL FIX (Align + Remove Input +/-)
   ====================================================== */





/* ---------- 基础 ---------- */
.woocommerce-mini-cart,
.woocommerce-mini-cart * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
}

/* ---------- 单个商品 ---------- */
.woocommerce-mini-cart-item {
    display: flex;
    gap: 14px;
    padding: 5px 0; /* 调整上下间距，让item之间间隔10px */
    border-bottom: none;
}

/* 确保li之间的间隔为10px */
.woocommerce-mini-cart > .woocommerce-mini-cart-item + .woocommerce-mini-cart-item {
    margin-top: 10px;
}

/* 图片 */
.mini-cart-thumb {
    flex-shrink: 0;
}

.mini-cart-thumb img {
    width: 90px; /* 改为90px */
    height: 90px; /* 改为90px */
    object-fit: contain;
}

/* 右侧整体 */
.mini-cart-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* 防止文本溢出 */
    padding-left:10px;
}

/* ======================================================
   ⭐ 标题 + 删除按钮 - 两端对齐
   ====================================================== */
.mini-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.mini-cart-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    line-height: 1.45;
    transition: color 0.2s ease;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mini-cart-title:hover {
    color: #333;
}

.mini-cart-remove {
    font-size: 16px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.mini-cart-remove:hover {
    color: #666;
}

/* ======================================================
   ⭐ 价格 + 数量框 - 两端对齐
   ====================================================== */
.mini-cart-footer {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

/* 左：价格 - 改为1.6rem */
.mini-cart-price {
    font-size: 1.6rem; /* 改为1.6rem */
    font-weight: 500;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
    order: 1; /* 确保价格在左边 */
}

.mini-cart-price .amount {
    font-size: 1.6rem; /* 确保内部金额也是1.6rem */
    font-weight: 500;
}

/* 右：数量 */
.fb-quantity-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    height: 30px;
    background: #fff;
    order: 2; /* 确保数量框在右边 */
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

/* 数量按钮 */
.fb-quantity-controls button.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #f7f7f7;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.fb-quantity-controls button.qty-btn:hover:not(:disabled) {
    background: #eee;
}

.fb-quantity-controls button.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 数量输入框 */
.fb-quantity-controls input.qty-input {
    width: 42px;
    height: 30px;
    border: none;
    text-align: center;
    font-size: 13px;
    color: #444;
    outline: none;
    background: #fff;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;

    /* 移除所有内置的 spinner */
    -moz-appearance: textfield;
    appearance: textfield;
}

.fb-quantity-controls input.qty-input:disabled {
    background-color: #f9f9f9;
    color: #999;
}

/* 移除Chrome/Safari/Edge的spinner */
.fb-quantity-controls input.qty-input::-webkit-inner-spin-button,
.fb-quantity-controls input.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 加载状态 */
.fb-quantity-controls.fb-qty--loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ---------- 移动端适配 ---------- */
@media (max-width: 480px) {
    .mini-cart-title {
        font-size: 13px;
    }

    .mini-cart-price {
        font-size: 1.4rem; /* 移动端稍小 */
    }
    
    .mini-cart-price .amount {
        font-size: 1.4rem;
    }

    .mini-cart-footer {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .fb-quantity-controls {
        height: 28px;
    }
    
    .fb-quantity-controls button.qty-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .fb-quantity-controls input.qty-input {
        width: 38px;
        height: 28px;
        font-size: 12px;
    }
}

