/* ============================================
   Dakzhou Theme - Cart Page
   购物车页面样式
   ============================================ */

/* ===== 购物车页面基础 ===== */
.woocommerce-cart .section{
  padding:32px 0;
}
.woocommerce-cart .page-title{
  margin-bottom:24px;
}

/* ===== 两栏式购物车布局 ===== */
.cart-two-column{
  display:grid;
  grid-template-columns:1fr 320px;
  gap:24px;
  align-items:start;
}

/* ===== 左栏：产品卡片 ===== */
.cart-items-column{
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* 列标题 */
.cart-items-header{
  display:grid;
  grid-template-columns:100px 1fr 120px 90px 40px;
  gap:16px;
  padding:0 8px 10px;
  border-bottom:2px solid var(--border);
  font-size:.75rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.8px;
  color:var(--muted);
}
.cart-items-header .col-product{padding-left:116px;}
.cart-items-header .col-quantity{text-align:center;}
.cart-items-header .col-total{text-align:right;}

/* 产品卡片 */
.dakzhou-cart-page .cart-item-card{
  display:grid !important;
  grid-template-columns:100px 1fr 120px 90px 40px !important;
  gap:16px !important;
  align-items:start !important;
  background:#fff !important;
  border:1px solid var(--border) !important;
  border-radius:var(--radius-lg) !important;
  padding:16px !important;
  transition:box-shadow .2s,border-color .2s;
}
.dakzhou-cart-page .cart-item-card:hover{
  box-shadow:var(--shadow-card);
  border-color:var(--border-2);
}

/* 产品图片 */
.dakzhou-cart-page .cart-item-image{
  width:100px !important;
  height:100px !important;
  border-radius:var(--radius) !important;
  overflow:hidden !important;
  background:var(--bg-soft) !important;
  flex-shrink:0 !important;
  grid-column:1 !important;
  grid-row:1 !important;
  align-self:center !important;
}
.dakzhou-cart-page .cart-item-image img{
  width:100% !important;
  height:100% !important;
  object-fit:contain !important;
  background:#fff !important;
  display:block !important;
}

/* 产品信息 */
.dakzhou-cart-page .cart-item-info{
  min-width:0 !important;
  grid-column:2 !important;
  grid-row:1 !important;
}
.dakzhou-cart-page .cart-item-name{
  font-size:.95rem !important;
  font-weight:600 !important;
  color:var(--ink) !important;
  margin-bottom:4px !important;
  line-height:1.4 !important;
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
  text-decoration:none !important;
  transition:color .2s;
}
.dakzhou-cart-page .cart-item-name:hover{color:var(--emerald) !important;}
.dakzhou-cart-page .cart-item-unit-price{
  font-size:.82rem !important;
  color:var(--muted) !important;
  font-weight:500 !important;
}
.dakzhou-cart-page .cart-item-unit-price .unit-label{color:var(--muted-2) !important;}
.dakzhou-cart-page .cart-item-unit-price .unit-value{color:var(--slate) !important;font-weight:600 !important;}

/* 数量控制 */
.dakzhou-cart-page .cart-item-quantity{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  grid-column:3 !important;
  grid-row:1 !important;
  align-self:center !important;
}
.dakzhou-cart-page .cart-qty-selector{
  display:flex;
  align-items:center;
  border:1.5px solid var(--border-2);
  border-radius:var(--radius);
  overflow:hidden;
  height:40px;
  width:100%;
  max-width:120px;
}
.dakzhou-cart-page .cart-qty-btn{
  width:36px;
  height:100%;
  background:var(--bg-soft);
  border:none;
  font-size:1.1rem;
  cursor:pointer;
  transition:.2s;
  color:var(--ink);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.dakzhou-cart-page .cart-qty-btn:hover{background:var(--border);}
.dakzhou-cart-page .cart-qty-selector input.qty{
  width:100%;
  height:100%;
  border:none;
  border-left:1px solid var(--border);
  border-right:1px solid var(--border);
  text-align:center;
  font-size:.9rem;
  font-weight:600;
  color:var(--ink);
  background:#fff;
  -moz-appearance:textfield;
  -webkit-appearance:none;
  min-width:0;
  padding:0;
  border-radius:0;
}
.dakzhou-cart-page .cart-qty-selector input.qty::-webkit-outer-spin-button,
.dakzhou-cart-page .cart-qty-selector input.qty::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}
.dakzhou-cart-page .cart-qty-selector input.qty:focus{outline:none;}

/* 小计价格 */
.dakzhou-cart-page .cart-item-total{
  grid-column:4 !important;
  grid-row:1 !important;
  align-self:center !important;
  text-align:right !important;
  font-size:1rem !important;
  font-weight:700 !important;
  color:var(--ink) !important;
}

/* 删除按钮 */
.dakzhou-cart-page .cart-item-remove{
  grid-column:5 !important;
  grid-row:1 !important;
  align-self:center !important;
  background:none !important;
  border:none !important;
  color:var(--muted) !important;
  cursor:pointer !important;
  font-size:1.1rem !important;
  padding:4px !important;
  transition:color .2s !important;
  width:auto !important;
  height:auto !important;
}
.dakzhou-cart-page .cart-item-remove:hover{color:var(--orange) !important;}

/* ===== 右栏：订单摘要 ===== */
.cart-summary-column{
  position:sticky;
  top:120px;
}
.cart-summary-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:24px;
  box-shadow:var(--shadow-sm);
}
.cart-summary-title{
  font-size:1.1rem;
  font-weight:700;
  color:var(--ink);
  margin-bottom:16px;
  padding-bottom:12px;
  border-bottom:1px solid var(--border);
}
.cart-summary-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 0;
  font-size:.92rem;
}
.cart-summary-row .label{color:var(--ink-2);}
.cart-summary-row .value{font-weight:600;color:var(--ink);}
.cart-summary-row.total{
  border-top:2px solid var(--border);
  margin-top:8px;
  padding-top:16px;
  font-size:1.1rem;
}
.cart-summary-row.total .value{
  font-size:1.3rem;
  font-weight:800;
  color:var(--emerald);
}

/* 优惠券 */
.cart-coupon{
  margin-bottom:16px;
}
.cart-coupon input{
  width:100%;
  padding:10px 14px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  font-size:.9rem;
  margin-bottom:8px;
}
.cart-coupon button{
  width:100%;
  padding:10px;
  background:var(--bg-soft);
  border:1px solid var(--border);
  border-radius:var(--radius);
  font-size:.88rem;
  font-weight:600;
  cursor:pointer;
  transition:background .2s;
}
.cart-coupon button:hover{background:var(--border);}

/* 结账按钮 */
.cart-checkout-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  height:50px;
  background:linear-gradient(135deg,var(--orange) 0%,var(--orange-deep) 100%);
  color:#fff;
  border:none;
  border-radius:var(--radius-lg);
  font-size:1rem;
  font-weight:700;
  cursor:pointer;
  transition:transform .15s,box-shadow .2s;
  box-shadow:0 4px 12px rgba(249,115,22,.25);
  text-decoration:none;
  margin-top:16px;
}
.cart-checkout-btn:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(249,115,22,.35);
  color:#fff;
}

/* ===== WooCommerce 默认表格样式（兼容） ===== */
.woocommerce-cart table.cart{
  border-radius:12px;
  overflow:hidden;
  box-shadow:var(--shadow-sm);
}
.woocommerce-cart table.cart th{
  background:var(--bg-soft);
  padding:14px 16px;
  font-weight:700;
  font-size:.85rem;
  text-transform:uppercase;
  letter-spacing:.5px;
  color:var(--slate);
}
.woocommerce-cart table.cart td{
  padding:16px;
  border-bottom:1px solid var(--border);
}
.woocommerce-cart .cart-collaterals .cart_totals{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:24px;
  box-shadow:var(--shadow-sm);
}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button{
  background:linear-gradient(135deg,var(--orange) 0%,var(--orange-deep) 100%);
  color:#fff;
  border-radius:10px;
  padding:14px 28px;
  font-weight:700;
  text-align:center;
  display:block;
  transition:transform .15s,box-shadow .2s;
  box-shadow:0 4px 12px rgba(249,115,22,.25);
}
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(249,115,22,.35);
}

/* ===== 空购物车 ===== */
.cart-empty-state{
  text-align:center;
  padding:60px 20px;
}
.cart-empty-icon{
  font-size:4rem;
  margin-bottom:16px;
  opacity:.3;
}
.cart-empty-state h2{
  font-size:1.5rem;
  color:var(--ink);
  margin-bottom:8px;
}
.cart-empty-state p{
  color:var(--muted);
  margin-bottom:24px;
}

/* ===== 响应式 ===== */
@media (max-width:1024px){
  .cart-two-column{
    grid-template-columns:1fr;
  }
  .cart-summary-column{
    position:static;
  }
}
@media (max-width:768px){
  .cart-items-header{
    display:none;
  }
  .dakzhou-cart-page .cart-item-card{
    grid-template-columns:80px 1fr !important;
    grid-template-rows:auto auto auto !important;
  }
  .dakzhou-cart-page .cart-item-image{
    width:80px !important;
    height:80px !important;
    grid-column:1 !important;
    grid-row:1 / span 2 !important;
  }
  .dakzhou-cart-page .cart-item-info{
    grid-column:2 !important;
    grid-row:1 !important;
  }
  .dakzhou-cart-page .cart-item-quantity{
    grid-column:2 !important;
    grid-row:2 !important;
    justify-content:flex-start !important;
  }
  .dakzhou-cart-page .cart-item-total{
    grid-column:1 / span 2 !important;
    grid-row:3 !important;
    text-align:left !important;
    margin-top:8px;
  }
  .dakzhou-cart-page .cart-item-remove{
    grid-column:2 !important;
    grid-row:1 !important;
    justify-self:end !important;
  }
}


/* ============================================
   购物车侧边栏 (Slide-in Cart)
   ============================================ */

/* 侧边栏容器 */
.dz-cart-sidebar{
  position:fixed;
  top:0;
  right:0;
  width:420px;
  max-width:90vw;
  height:100vh;
  background:#fff;
  box-shadow:-8px 0 30px rgba(15,23,42,.15);
  z-index:10002;
  display:flex;
  flex-direction:column;
  transform:translateX(100%);
  transition:transform .3s var(--ease);
}
.dz-cart-sidebar.open{
  transform:translateX(0);
}

/* 侧边栏头部 */
.dz-cart-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 20px;
  border-bottom:1px solid #e2e8f0;
}
.dz-cart-title{
  font-size:1.1rem;
  font-weight:700;
  color:var(--ink);
}
.dz-cart-close{
  background:none;
  border:none;
  font-size:1.5rem;
  cursor:pointer;
  color:var(--muted);
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  transition:.2s;
}
.dz-cart-close:hover{
  background:var(--bg-soft);
  color:var(--ink);
}

/* 侧边栏商品列表 */
.dz-cart-items{
  flex:1;
  overflow-y:auto;
  padding:16px 20px;
}
.dz-cart-item{
  display:flex;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid #f1f5f9;
  position:relative;
}
.dz-cart-item-img{
  width:72px;
  height:72px;
  object-fit:contain;
  border-radius:8px;
  background:#f8fafc;
  flex-shrink:0;
}
.dz-cart-item-info{
  flex:1;
  min-width:0;
}
.dz-cart-item-name{
  font-size:.88rem;
  font-weight:600;
  color:var(--ink);
  margin-bottom:4px;
  line-height:1.3;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.dz-cart-item-price{
  font-size:.85rem;
  font-weight:700;
  color:var(--emerald);
  margin-bottom:6px;
}

/* 侧边栏数量选择器 */
.dz-cart-item-qty{
  display:flex;
  align-items:center;
  gap:4px;
}
.dz-cart-item-qty button{
  width:30px;
  height:32px;
  border:1px solid #e2e8f0;
  background:#fff;
  border-radius:6px;
  cursor:pointer;
  font-size:.95rem;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:.2s;
  color:var(--ink-2);
  flex-shrink:0;
}
.dz-cart-item-qty button:hover{
  background:var(--bg-soft);
  border-color:var(--emerald);
  color:var(--emerald);
}
.dz-cart-item-qty input{
  width:44px;
  height:32px;
  border:1px solid #e2e8f0;
  border-radius:6px;
  text-align:center;
  font-size:.9rem;
  font-weight:600;
  color:var(--ink);
  background:#fff;
  padding:0;
  min-width:44px;
  flex-shrink:0;
}
.dz-cart-item-qty input:focus{
  outline:none;
  border-color:var(--emerald);
  box-shadow:0 0 0 2px rgba(4,120,87,.1);
}
/* 隐藏 number 箭头 */
.dz-cart-item-qty input::-webkit-outer-spin-button,
.dz-cart-item-qty input::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}
.dz-cart-item-qty input[type=number]{
  -moz-appearance:textfield;
}

.dz-cart-item-remove{
  background:none;
  border:none;
  color:#ef4444;
  font-size:.85rem;
  cursor:pointer;
  padding:0;
  margin-left:auto;
  align-self:flex-start;
  width:24px;
  height:24px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  transition:.2s;
}
.dz-cart-item-remove:hover{
  background:#fef2f2;
}

/* 侧边栏底部 */
.dz-cart-footer{
  padding:18px 20px;
  border-top:1px solid #e2e8f0;
  background:var(--bg-soft);
  flex-shrink:0;
}
.dz-cart-subtotal{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:6px;
}
.dz-cart-subtotal span:first-child{
  font-size:.95rem;
  font-weight:600;
  color:var(--ink);
}
.dz-cart-subtotal-price{
  font-size:1.15rem;
  font-weight:700;
  color:var(--emerald);
}
.dz-cart-shipping-note{
  font-size:.78rem;
  color:var(--muted);
  margin-bottom:14px;
}
.dz-cart-actions{
  display:flex;
  gap:10px;
}
.dz-cart-btn{
  flex:1;
  padding:12px;
  text-align:center;
  border-radius:8px;
  font-weight:600;
  font-size:.9rem;
  text-decoration:none;
  cursor:pointer;
  border:none;
  transition:.2s;
}
.dz-cart-btn-outline{
  background:#fff;
  color:var(--emerald);
  border:1.5px solid var(--emerald);
}
.dz-cart-btn-outline:hover{
  background:var(--mint);
}
.dz-cart-btn-primary{
  background:var(--emerald);
  color:#fff;
}
.dz-cart-btn-primary:hover{
  background:var(--emerald-deep);
}

/* 免运费进度条 */
.dz-shipping-bar{
  padding:12px 16px;
  background:linear-gradient(135deg,var(--mint),var(--mint-2));
  border-radius:10px;
  margin-bottom:14px;
  border:1px solid #a7f3d0;
}
.dz-shipping-text{
  font-size:.78rem;
  color:var(--emerald-deep);
  margin-bottom:6px;
  font-weight:500;
  line-height:1.4;
}
.dz-shipping-text strong{
  color:var(--emerald);
  font-weight:700;
}
.dz-shipping-progress{
  height:6px;
  background:rgba(255,255,255,.6);
  border-radius:999px;
  overflow:hidden;
}
.dz-shipping-progress-bar{
  height:100%;
  background:var(--emerald);
  border-radius:999px;
  transition:width .3s;
}

/* 遮罩层 */
.dz-cart-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.5);
  z-index:10001;
  opacity:0;
  visibility:hidden;
  transition:.3s;
}
.dz-cart-overlay.open{
  opacity:1;
  visibility:visible;
}

/* 响应式 */
@media (max-width:768px){
  .dz-cart-sidebar{
    width:100%;
    max-width:100%;
  }
}

/* ============================================================
   空状态 + 骨架屏（2026-09-25）
   ------------------------------------------------------------
   1) .dz-cart-empty 由 JS 用 display:flex 显示，但没有任何 flex-direction
      规则 —— flex 默认 row，于是「🛒图标 / 文案 / Continue Shopping 按钮」
      被排成一行。这里补成纵向居中。
   2) .dz-cart-skeleton 是购物车抽屉的加载占位：首次打开（无 sessionStorage
      缓存）时显示，避免「先显示 Your cart is empty、后跳出商品」的跳变。
   ============================================================ */
.dz-cart-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.dz-cart-skeleton{
  padding:16px 0;
}
.dz-cart-skel-row{
  display:flex;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid #f1f5f9;
}
.dz-cart-skel-img,
.dz-cart-skel-lines i{
  display:block;
  background:linear-gradient(90deg,#eef2f7 25%,#e2e8f0 37%,#eef2f7 63%);
  background-size:400% 100%;
  animation:dzCartSkel 1.1s ease-in-out infinite;
  border-radius:8px;
}
.dz-cart-skel-img{
  width:72px;
  height:72px;
  flex-shrink:0;
}
.dz-cart-skel-lines{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:10px;
}
.dz-cart-skel-lines i{
  height:12px;
  border-radius:6px;
}
.dz-cart-skel-lines i:first-child{ width:78%; }
.dz-cart-skel-lines i:last-child{ width:42%; }

@keyframes dzCartSkel{
  0%{ background-position:100% 50%; }
  100%{ background-position:0 50%; }
}
@media (prefers-reduced-motion: reduce){
  .dz-cart-skel-img,
  .dz-cart-skel-lines i{ animation:none; }
}

/* 购物车抽屉：条目优惠提示（与购物车页的 Bundle/Tier saving 同源） */
.dz-cart-item-saving{
  display:inline-block;
  margin:-2px 0 6px;
  padding:1px 7px;
  border-radius:10px;
  background:var(--emerald-light, #ecfdf5);
  color:var(--emerald-deep, #065f46);
  font-size:.7rem;
  font-weight:700;
  line-height:1.5;
}
