/* =============================================================================
   Lumenizer 222 — Shop Page Styles  ·  深紫主题（对齐首页）
   --shop-bg:       #120C1E  页面背景
   --shop-card:     #1e1040  卡片背景
   --shop-brand:    #7B3FA0  品牌紫
   --shop-text:     #FFFFFF  主文字
   --shop-muted:    #a78bca  副文字/价格
   --shop-dim:      #6b6b8a  极淡文字
   ============================================================================= */

/* -----------------------------------------------------------------------------
   0. 页面容器背景
   ----------------------------------------------------------------------------- */

body.woocommerce,
body.woocommerce-page {
    background: #120C1E !important;
}

.woo-content-wrap {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 24px 20px !important;
}

/* -----------------------------------------------------------------------------
   1. 隐藏 WooCommerce 默认「商店」页面标题区
   ----------------------------------------------------------------------------- */

.woocommerce-products-header,
body.woocommerce .woocommerce-products-header,
body.woocommerce-page .woocommerce-products-header {
    display: none !important;
}

/* 保留主题自定义 H1（lmz-shop-h1）*/
.lmz-shop-h1 {
    color: #ffffff;
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    text-align: center;
    margin: 0 0 2rem;
    padding-bottom: 1.125rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    line-height: 1.25;
}

.lmz-shop-h1 .lmz-shop-h1-sub {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #a78bca;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 8px;
}

/* -----------------------------------------------------------------------------
   2. 结果计数 & 排序工具栏
   ----------------------------------------------------------------------------- */

.woocommerce-result-count {
    color: #6b6b8a !important;
    font-size: 0.82rem !important;
    margin-bottom: 0 !important;
}

.woocommerce-ordering {
    margin-bottom: 0 !important;
}

.woocommerce-ordering select,
.woocommerce-page .woocommerce-ordering select {
    background: #1e1040 !important;
    border: 1px solid #7B3FA0 !important;
    color: #a78bca !important;
    border-radius: 8px !important;
    padding: 7px 28px 7px 10px !important;
    font-size: 0.82rem !important;
    transition: border-color 0.2s !important;
}

.woocommerce-ordering select:focus {
    outline: none !important;
    border-color: #a78bca !important;
}

/* -----------------------------------------------------------------------------
   3. 商品网格（3列 → 2列 → 1列）
   ----------------------------------------------------------------------------- */

.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    float: none !important;
    clear: both !important;
}

@media (max-width: 900px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 540px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    clear: none !important;
}

/* -----------------------------------------------------------------------------
   4. 商品卡片（WooCommerce 默认 .products .product）
   ----------------------------------------------------------------------------- */

.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    background: #1e1040 !important;
    border-radius: 12px !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    transition: transform 0.2s ease !important;
}

.woocommerce ul.products li.product:hover,
.woocommerce-page ul.products li.product:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 32px rgba(123,63,160,0.25) !important;
}

/* -----------------------------------------------------------------------------
   5. 商品图片
   ----------------------------------------------------------------------------- */

.woocommerce ul.products li.product a img,
.woocommerce-page ul.products li.product a img {
    width: 100% !important;
    height: 320px !important;
    object-fit: contain !important;
    background: #0d1020 !important;
    border-radius: 12px 12px 0 0 !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* -----------------------------------------------------------------------------
   6. 商品标题
   ----------------------------------------------------------------------------- */

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    padding: 1rem 1.25rem 0.25rem !important;
    margin: 0 !important;
    border: none !important;
    line-height: 1.4 !important;
}

/* -----------------------------------------------------------------------------
   7. 价格
   ----------------------------------------------------------------------------- */

.woocommerce ul.products li.product .price,
.woocommerce-page ul.products li.product .price {
    color: #a78bca !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 0 1.25rem 0.75rem !important;
    display: block !important;
}

.woocommerce ul.products li.product .price ins,
.woocommerce-page ul.products li.product .price ins {
    color: #a78bca !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.woocommerce ul.products li.product .price del,
.woocommerce-page ul.products li.product .price del {
    color: rgba(167,139,202,0.5) !important;
    font-size: 12px !important;
}

/* -----------------------------------------------------------------------------
   8. 购买按钮
   ----------------------------------------------------------------------------- */

.woocommerce ul.products li.product .button,
.woocommerce-page ul.products li.product .button {
    display: block !important;
    background: #7B3FA0 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    margin: 0 1.25rem 1.25rem !important;
    width: calc(100% - 2.5rem) !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
    box-sizing: border-box !important;
}

.woocommerce ul.products li.product .button:hover,
.woocommerce-page ul.products li.product .button:hover {
    background: #5e2d80 !important;
    color: #ffffff !important;
}

/* -----------------------------------------------------------------------------
   9. 自定义卡片（lmz-product-card）同步深紫风格
   ----------------------------------------------------------------------------- */

.lmz-product-card {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    background: #1e1040 !important;
    border: none !important;
    border-radius: 12px !important;
    overflow: hidden;
    padding: 0 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    text-decoration: none !important;
}

.lmz-product-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 32px rgba(123,63,160,0.25) !important;
}

.lmz-card-img-link {
    display: block;
    text-decoration: none !important;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.lmz-card-img-wrap {
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: #0d1020;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lmz-card-img-wrap img,
.lmz-card-img-wrap .lmz-card-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
    transition: transform 0.4s ease !important;
}

.lmz-product-card:hover .lmz-card-img-wrap img,
.lmz-product-card:hover .lmz-card-img-wrap .lmz-card-img {
    transform: scale(1.03) !important;
}

.lmz-product-card span.onsale,
.lmz-card-img-wrap .onsale {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    z-index: 3 !important;
    background: #7B3FA0 !important;
    color: #fff !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
}

.lmz-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
    gap: 10px;
}

.lmz-card-title {
    font-size: 0.975rem !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    color: #ffffff !important;
}

.lmz-card-title a {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lmz-card-title a:hover {
    color: #a78bca !important;
}

.lmz-card-price {
    flex: 1;
    min-height: 32px;
}

.lmz-card-price .price {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #a78bca !important;
    display: flex !important;
    align-items: baseline !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.lmz-card-price .price ins {
    text-decoration: none !important;
    color: #a78bca !important;
}

.lmz-card-price .price del {
    font-size: 0.82rem !important;
    font-weight: 400 !important;
    color: rgba(167,139,202,0.5) !important;
    text-decoration: line-through !important;
}

.lmz-card-price .woocommerce-Price-amount,
.lmz-card-price .woocommerce-Price-currencySymbol {
    color: inherit !important;
}

.lmz-buy-btn {
    display: block !important;
    width: 100% !important;
    min-height: 46px !important;
    line-height: 46px !important;
    padding: 0 16px !important;
    background: #7B3FA0 !important;
    color: #fff !important;
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    transition: background 0.2s ease, transform 0.15s ease !important;
    -webkit-tap-highlight-color: transparent;
}

.lmz-buy-btn:hover {
    background: #5e2d80 !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}

.lmz-buy-btn:active {
    transform: translateY(0) !important;
}

/* -----------------------------------------------------------------------------
   10. 分页
   ----------------------------------------------------------------------------- */

.woocommerce nav.woocommerce-pagination {
    text-align: center !important;
    margin-top: 40px !important;
}

.woocommerce nav.woocommerce-pagination ul {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 10px !important;
    background: #1e1040 !important;
    border: 1px solid rgba(123,63,160,0.4) !important;
    border-radius: 8px !important;
    color: #a78bca !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: all 0.2s !important;
}

.woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li span.current {
    background: #7B3FA0 !important;
    border-color: #7B3FA0 !important;
    color: #ffffff !important;
}

/* -----------------------------------------------------------------------------
   11. 手机端额外优化
   ----------------------------------------------------------------------------- */

@media (max-width: 540px) {
    .lmz-shop-h1 {
        font-size: 1.35rem;
        margin-bottom: 1.25rem;
    }

    .lmz-card-body {
        padding: 16px;
        gap: 9px;
    }

    .lmz-card-title {
        font-size: 0.92rem !important;
    }

    .lmz-buy-btn {
        min-height: 50px !important;
        line-height: 50px !important;
        font-size: 1rem !important;
    }

    .woocommerce ul.products li.product a img,
    .woocommerce-page ul.products li.product a img {
        height: 220px !important;
    }

    .lmz-card-img-wrap {
        height: 220px !important;
    }
}

/* -----------------------------------------------------------------------------
   12. 产品详情页主图
   ----------------------------------------------------------------------------- */

.woocommerce div.product div.images img {
    max-height: 480px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.woocommerce div.product div.images .woocommerce-product-gallery__image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e1040;
    border-radius: 12px;
    min-height: 320px;
    max-height: 480px;
    overflow: hidden;
}

/* -----------------------------------------------------------------------------
   13. 去掉详情页图片 zoom 晃动
   ----------------------------------------------------------------------------- */

.woocommerce div.product div.images .woocommerce-product-gallery__image a img,
.woocommerce div.product .woocommerce-product-gallery img {
    transition: none !important;
    transform: none !important;
}

.woocommerce div.product .woocommerce-product-gallery img:hover {
    transform: none !important;
    transition: none !important;
}

/* 悬浮购物车 */
.lmz-float-cart {
    position: fixed;
    bottom: 5.5rem;   /* 从 2rem 上移至 5.5rem，避免与页面底部结账按钮重叠 */
    right: 2rem;
    background: #7B3FA0;
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    text-decoration: none;
    z-index: 900;      /* 从 999 降至 900，低于页面原有按钮的层级 */
    box-shadow: 0 4px 20px rgba(123,63,160,0.4);
    transition: transform 0.2s;
}
.lmz-float-cart:hover {
    transform: scale(1.1);
}
.lmz-cart-count {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #fff;
    color: #7B3FA0;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 购物车页面已在购物车，隐藏悬浮购物车按钮 */
body.woocommerce-cart .lmz-float-cart {
    display: none !important;
}

/* 移动端：悬浮购物车再上移，避免遮挡底部结账栏 */
@media (max-width: 768px) {
    .lmz-float-cart {
        bottom: 7rem;
        right: 1.25rem;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

/* -----------------------------------------------------------------------------
   14. 购物车页面 — 隐藏商品行中的产品描述文字
   ----------------------------------------------------------------------------- */

/* 隐藏 td.product-name 下方的描述段落（产品参数等） */
.woocommerce-cart-form .cart_item td.product-name .product-description,
.woocommerce-cart-form .cart_item td.product-name p:not(.product-name),
.woocommerce-cart-form .cart_item td.product-name > *:not(a):not(dl) {
    display: none !important;
}

/* WooCommerce 有时用 dl.variation 输出规格，保留；其余描述隐藏 */
.woocommerce-cart-form .cart_item td.product-name .wc-item-meta-label,
.woocommerce-cart-form .cart_item td.product-name .wc-item-meta {
    font-size: 0.8rem !important;
    color: #a78bca !important;
}

/* 补充：兜底选择器，覆盖 dl.variation 之后的描述段落及宽泛的 product-description */
.cart_item .product-description,
.cart_item dl.variation ~ p,
.woocommerce-cart-form .cart_item td.product-name p {
    display: none !important;
}

/* -----------------------------------------------------------------------------
   15. 购物车页面 — 优惠券输入框 & 按钮样式
   ----------------------------------------------------------------------------- */

.woocommerce-cart .coupon input#coupon_code {
    background: #1e1040 !important;
    border: 1px solid rgba(123,63,160,0.4) !important;
    color: #e8e0f0 !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    font-size: 0.9rem !important;
    outline: none !important;
    transition: border-color 0.2s !important;
}

.woocommerce-cart .coupon input#coupon_code::placeholder {
    color: #6b6b8a !important;
}

.woocommerce-cart .coupon input#coupon_code:focus {
    border-color: #7B3FA0 !important;
    box-shadow: 0 0 0 3px rgba(123,63,160,0.15) !important;
}

.woocommerce-cart .coupon button[name="apply_coupon"],
.woocommerce-cart .coupon .button {
    background: #7B3FA0 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
}

.woocommerce-cart .coupon button[name="apply_coupon"]:hover,
.woocommerce-cart .coupon .button:hover {
    background: #6a2f8f !important;
    color: #ffffff !important;
}

/* -----------------------------------------------------------------------------
   16. 购物车页面 — 商品缩略图尺寸
   ----------------------------------------------------------------------------- */

.woocommerce-cart-form .cart_item td.product-thumbnail img,
.woocommerce-cart-form .cart_item img {
    width: 80px !important;
    height: auto !important;
    border-radius: 6px !important;
    display: block !important;
}

/* -----------------------------------------------------------------------------
   17. 购物车页面 — 「继续结账」按钮品牌化
   ----------------------------------------------------------------------------- */

.wc-proceed-to-checkout a.checkout-button,
.woocommerce .wc-proceed-to-checkout .checkout-button {
    display: block !important;
    background: #7B3FA0 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background 0.2s ease, transform 0.15s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.wc-proceed-to-checkout a.checkout-button:hover,
.woocommerce .wc-proceed-to-checkout .checkout-button:hover {
    background: #6a2f8f !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

/* -----------------------------------------------------------------------------
   18. 购物车页面 — 隐藏产品描述文字
   ----------------------------------------------------------------------------- */

.woocommerce-cart .product-description,
.woocommerce-cart .cart_item .product-description {
    display: none !important;
}

/* -----------------------------------------------------------------------------
   19. 商城选型导览 — 卡片内容区内边距 & 维护提示行
   ----------------------------------------------------------------------------- */

.lmz-product-info {
    padding: 20px;
}

@media (max-width: 768px) {
    .lmz-product-info {
        padding: 16px;
    }
}

.product-maint {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
    line-height: 1.5;
}

/* -----------------------------------------------------------------------------
   20. 手机端商城产品卡片单列
   ----------------------------------------------------------------------------- */

@media (max-width: 768px) {
    .lmz-product-cards,
    .lmz-products-grid,
    [class*="lmz-product-cards"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .lmz-product-card,
    [class*="lmz-product-card"] {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}
