/*
Theme Name: Porto Child
Theme URI: https://www.portotheme.com/wordpress/porto
Author: P-THEMES
Author URI: https://www.portotheme.com/
Description: Porto Responsive WordPress + eCommerce Theme.
Version: 1.1
Template: porto
License: Commercial
License URI: http://themeforest.net/licenses/regular_extended
Tags: woocommerce, corporate, ecommerce, responsive, blue, black, green, white, light, dark, red, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
*/

/*************** ADD YOUR CUSTOM CSS HERE  ***************/
.mfp-close, .mfp-close-btn-in .mfp-close{color: #000; width: 50px; height: 50px;}
.single_add_to_cart_button, .view-cart-btn{
    font-weight: 400;
}
.product-summary-wrap .single_add_to_cart_button{
    border-radius: 8px;
}
.filter-item-list .filter-item, .woocommerce-widget-layered-nav-list a:not(.filter-color){
    border: 1px solid rgba(0, 0, 0, .25);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400;
    margin: 3px 10px 3px 0;
}
.filter-item-list .active .filter-item, .filter-item-list .filter-item:not(.disabled):hover, .woocommerce-widget-layered-nav-list .chosen a:not(.filter-color){
    border-color: #000;
    background: none;
    color: #000;
}
.post-type-archive-faq #main .container{max-width: 1400px;}

#login-form-popup .featured-box{
    /*background: url(/images/loginbg.jpg);*/
    background-size: cover;
    padding: 50px;
    border-radius: 30px;
}
#login-form-popup .featured-box .box-content{
    background: #fff;
    border-radius: 20px;
    padding: 30px 36px 20px;
}
#login-form-popup .login-btn{
    background: linear-gradient(270deg, #3d3d3d 0%, #3d3d3d 100%);
    border-radius: 266px;
}
@media (max-width:992px){
    #login-form-popup .featured-box{
        padding: 20px 10px;
    }
    #login-form-popup .featured-box .box-content{
        padding: 15px;
    }
}
.custom-login-text{font-weight:600; color:#3d3d3d}

#user-registration{margin:30px auto}
.checkout-order-review .custom-coupon-at-order-top.my-coupon:not(:has(form.checkout_coupon)) {
    display:none !important;
}

.woocommerce-account .box-with-icon .col-md-4:has(.icon-featured.Simple-Line-Icons-cloud-download) {
    display: none;
}
.share-links .share-instagram{
    background-color: #000;
}
#side-nav-panel{
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.porto-wide-sub-menu li.sub li.menu-item>a{margin-left: 0;}
.share-tiktok {
    display: inline-block;
    width: 20px;
    height: 20px;
}
.share-tiktok::before {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;

    background-image: url("data:image/svg+xml;utf8,<svg fill='currentColor' viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'><path d='...' /></svg>");
}

/*
 * 
 * remove view cart
*/
a.added_to_cart.wc_forward{
display: none important!;
}


.widget .woocommerce-mini-cart__buttons a:not(.checkout) {
    display: none !important;
}

.widget .woocommerce-mini-cart__buttons a:not(.checkout) {
    display: none important!;
}


add_filter( 'woocommerce_checkout_fields', 'bbloomer_shipping_phone_checkout' );

function bbloomer_shipping_phone_checkout( $fields ) {
   $fields['shipping']['shipping_phone'] = array(
      'label' => 'Phone',
      'type' => 'tel',
      'required' => false,
      'class' => array( 'form-row-wide' ),
      'validate' => array( 'phone' ),
      'autocomplete' => 'tel',
      'priority' => 25,
   );
   return $fields;
}
  
add_action( 'woocommerce_admin_order_data_after_shipping_address', 'bbloomer_shipping_phone_checkout_display' );
 
function bbloomer_shipping_phone_checkout_display( $order ){
    echo '<p><b>Shipping Phone:</b> ' . get_post_meta( $order->get_id(), '_shipping_phone', true ) . '</p>';
}
		

/* Hide "View cart" link/button after adding to cart */
.woocommerce-message a.button.wc-forward,
a.added_to_cart.wc-forward {
  display: none !important;
}



/* ================================
   LOST in PARK - Popup Cart Tuning (SAFE)
   1) Hide "View cart"
   2) Make "Checkout" primary CTA
   3) Ensure Checkout always visible (sticky footer + safe-area)
   Scope: only inside Porto popup cart
   ================================ */


/* ---------- 1) 顶部栏右侧 "VIEW CART"（文字链接）隐藏 ---------- */
.cart-popup.widget_shopping_cart .mini-cart-header a,
.cart-popup.widget_shopping_cart .mini-cart-header .view-cart,
.cart-popup.widget_shopping_cart .mini-cart-header a[href*="/cart"]{
  display: none !important;
}

/* ---------- 2) 底部灰色 "VIEW CART" 按钮隐藏 ---------- */
.cart-popup.widget_shopping_cart .woocommerce-mini-cart__buttons a.button:not(.checkout),
.cart-popup.widget_shopping_cart .woocommerce-mini-cart__buttons a:not(.checkout)[href*="/cart"],
.cart-popup.widget_shopping_cart a.button.view-cart,
.cart-popup.widget_shopping_cart a[href$="/cart/"]{
  display: none !important;
}

/* ---------- 3) 强化 Checkout（全端通用：更像主按钮） ---------- */
.cart-popup.widget_shopping_cart .woocommerce-mini-cart__buttons a.checkout,
.cart-popup.widget_shopping_cart .woocommerce-mini-cart__buttons a.button.checkout{
  width: 100% !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
}


/* =========================================================
   4) CRITICAL: 保证 Checkout 在移动端不被浏览器 UI 遮挡
   - 把按钮区变成 popup 内部 sticky footer
   - 给内容区加 padding-bottom，避免被 sticky 挡住
   - 兼容 iPhone safe-area
   ========================================================= */

/* 4.1 让弹窗内部可滚动（不强改你主题结构，只做“兜底”） */
.cart-popup.widget_shopping_cart{
  /* 不改变主题定位逻辑，只避免内部 sticky 失效 */
  overflow: hidden !important;
}

/* 4.2 给 mini cart 内容区预留底部空间（避免 checkout 被挡住/被挤出可视区） */
.cart-popup.widget_shopping_cart .woocommerce-mini-cart,
.cart-popup.widget_shopping_cart .widget_shopping_cart_content{
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
}

/* 4.3 按钮区做 sticky 底栏（核心） */
.cart-popup.widget_shopping_cart .woocommerce-mini-cart__buttons{
  position: sticky !important;
  bottom: 0 !important;
  z-index: 999 !important;

  /* 视觉与可点击性 */
  background: #fff !important;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)) !important;

  /* 防止少按钮时空隙异常 */
  display: block !important;

  /* 顶部分隔，避免“浮在内容上”显乱 */
  border-top: 1px solid rgba(0,0,0,0.08) !important;
}

/* 4.4 让按钮在 sticky 区域内更好点（移动端优先，但不伤 PC） */
.cart-popup.widget_shopping_cart .woocommerce-mini-cart__buttons a.checkout,
.cart-popup.widget_shopping_cart .woocommerce-mini-cart__buttons a.button.checkout{
  min-height: 48px !important;
  line-height: 48px !important;
  font-size: 15px !important;
}

/* ---------- 5) 手机端再微调间距（可选但稳） ---------- */
@media (max-width: 768px){
  .cart-popup.widget_shopping_cart .woocommerce-mini-cart__buttons{
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}





/* Express Checkout快速支付格式 - fluid grid */

body.woocommerce-checkout fieldset.lip-express-checkout{
  border: 0 !important;
  padding: 0 !important;
  margin: 0 0 16px !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Grid container */
body.woocommerce-checkout fieldset.lip-express-checkout ul.wc_stripe_checkout_banner_gateways{
  display: grid !important;
  gap: 12px !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;

  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;

  justify-content: stretch !important;
  justify-items: stretch !important;
  align-items: stretch !important;
}

/* Mobile: allow 3 columns around ~358px */
@media (max-width: 420px){
  body.woocommerce-checkout fieldset.lip-express-checkout ul.wc_stripe_checkout_banner_gateways{
    gap: 10px !important;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)) !important;
  }
}

/* IMPORTANT: kill placeholder/empty items */
body.woocommerce-checkout fieldset.lip-express-checkout ul.wc_stripe_checkout_banner_gateways > li:empty{
  display: none !important;
}
@supports selector(:has(*)){
  body.woocommerce-checkout fieldset.lip-express-checkout ul.wc_stripe_checkout_banner_gateways > li:not(:has(*)){
    display: none !important;
  }
}

/* CRITICAL: remove the 240px cap on LI itself and force it to fill the grid cell */
body.woocommerce-checkout fieldset.lip-express-checkout ul.wc_stripe_checkout_banner_gateways > li{
  margin: 0 !important;
  padding: 0 !important;

  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  justify-self: stretch !important;
  align-self: stretch !important;

  display: flex !important;
  align-items: stretch !important;
}

/* Force any first child wrapper to fill */
body.woocommerce-checkout fieldset.lip-express-checkout ul.wc_stripe_checkout_banner_gateways > li > *{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  flex: 1 1 auto !important;
  justify-self: stretch !important;
  align-self: stretch !important;
}

/* PayPal wrappers: force full width */
body.woocommerce-checkout fieldset.lip-express-checkout .paypal-buttons,
body.woocommerce-checkout fieldset.lip-express-checkout .paypal-buttons > *,
body.woocommerce-checkout fieldset.lip-express-checkout .paypal-buttons-container,
body.woocommerce-checkout fieldset.lip-express-checkout .paypal-button-container{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.woocommerce-checkout fieldset.lip-express-checkout .paypal-buttons iframe{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  display: block !important;
}

/* Google Pay wrappers: force full width */
body.woocommerce-checkout fieldset.lip-express-checkout .gpay-card-info-container,
body.woocommerce-checkout fieldset.lip-express-checkout .gpay-card-info-container-fill{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

body.woocommerce-checkout fieldset.lip-express-checkout .gpay-card-info-iframe{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  display: block !important;
}
body.woocommerce-checkout fieldset.lip-express-checkout,
body.woocommerce-checkout fieldset.lip-express-checkout *{
  box-sizing: border-box !important;
}



/* =========================================================
   LIP Product Breadcrumb (single product)
   - Hide Porto breadcrumb (avoid duplicates)
   - Reduce top blank space caused by Porto page-top container
   - Style our breadcrumb (matches PHP output exactly)
   ========================================================= */

/* 1) Hide Porto breadcrumb elements on single product */
body.single-product .breadcrumbs-wrap,
body.single-product .breadcrumb,
body.single-product .porto-breadcrumbs,
body.single-product .page-top .breadcrumb,
body.single-product .page-top .breadcrumbs-wrap {
  display: none !important;
}

/* 2) Reduce the big blank bar above product (Porto "page-top" spacing)
   Keep this conservative to avoid breaking other header pieces. */
body.single-product .page-top {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  margin-bottom: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.single-product .page-top .container,
body.single-product .page-top .page-title-wrap,
body.single-product .page-top .page-title {
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* 3) Our breadcrumb (matches nav.lip-breadcrumb + classes from PHP) */
body.single-product .lip-breadcrumb {
  margin: 0 0 10px !important;
  padding: 0 !important;
  padding-left: 1rem !important; /* ← 新增：左边距 */
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
  line-height: 1.2 !important;
}

body.single-product .lip-breadcrumb-link,
body.single-product .lip-breadcrumb-current,
body.single-product .lip-breadcrumb-sep {
  font-size: 12px !important;
}

body.single-product .lip-breadcrumb-link {
  color: #666 !important;
  text-decoration: none !important;
}

body.single-product .lip-breadcrumb-link:hover {
  color: #111 !important;
  text-decoration: underline !important;
}

body.single-product .lip-breadcrumb-sep {
  color: #bbb !important;
}

body.single-product .lip-breadcrumb-current {
  color: #111 !important;
  font-weight: 500 !important;
}

/* 4) Small screens: keep tidy */
@media (max-width: 420px) {
  body.single-product .lip-breadcrumb {
    margin-bottom: 8px !important;
  }
}


