:root{
  --bg:#efe6d6;
  --panel:#d9c6aa;
  --text:#1f1f1f;
  --muted:#6b5d4a;
  --brand:#f2c45b;
  --danger:#ff6b6b;
  --card:#f7f1e6;
}
*{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Noto Sans","PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--text)}
a{color:inherit;text-decoration:none}
.container{max-width:1100px;margin:0 auto;padding:18px}
.topbar{position:sticky;top:0;z-index:10;background:rgba(198,180,148,.96);backdrop-filter: blur(8px);border-bottom:1px solid rgba(0,0,0,.08)}
.topbar-inner{display:flex;align-items:center;gap:14px;justify-content:space-between;padding:10px 18px;max-width:1100px;margin:0 auto}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.4px}
.brand-logo{height:28px;width:auto;display:block}
.nav{display:flex;gap:14px;align-items:center}
.nav a{padding:8px 10px;border-radius:10px;color:var(--muted)}
.nav a:hover{background:rgba(0,0,0,.05);color:var(--text)}
.pill{padding:8px 12px;border-radius:999px;background:var(--panel);color:var(--text)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:999px;padding:10px 14px;cursor:pointer}
.btn-primary{background:var(--danger);color:white;font-weight:700}
.btn-bulk-yellow,.btn-yellow{background:#ffeb3b;color:#3d3300;font-weight:700;border:1px solid rgba(200,170,0,.55)}
.btn-bulk-yellow:hover,.btn-yellow:hover{filter:brightness(1.03)}
.btn-ghost{background:rgba(0,0,0,.05);color:var(--text)}
.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
@media (max-width: 980px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width: 520px){.grid{grid-template-columns:repeat(1,minmax(0,1fr))}}
.card{background:var(--card);border:1px solid rgba(0,0,0,.08);border-radius:16px;overflow:hidden;box-shadow:0 10px 25px rgba(0,0,0,.05)}
.card .img{aspect-ratio: 4/3;background:#e8dcc7;display:flex;align-items:center;justify-content:center;color:rgba(0,0,0,.35);font-weight:700}
.card .body{padding:12px}
.product-detail-media{background:#fff!important;padding:10px;border-radius:16px;display:flex;align-items:center;justify-content:center}
.product-detail-media img{width:100%;height:100%;object-fit:contain;display:block;background:#fff}

/* Lightbox */
.lightbox-overlay{position:fixed;inset:0;z-index:120;background:rgba(0,0,0,.85);display:none;align-items:center;justify-content:center;padding:18px}
.lightbox-overlay.open{display:flex}
.lightbox-card{position:relative;max-width:min(1100px,96vw);max-height:92vh;width:100%;height:100%;display:flex;align-items:center;justify-content:center}
.lightbox-img{max-width:100%;max-height:100%;object-fit:contain;background:#fff;border-radius:12px}
.lightbox-close{position:absolute;top:10px;right:10px;width:44px;height:44px;border-radius:999px;border:1px solid rgba(255,255,255,.35);background:rgba(0,0,0,.35);color:#fff;font-size:22px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.lightbox-close:hover{background:rgba(0,0,0,.55)}
.kv{display:grid;grid-template-columns:64px 1fr;gap:6px 10px;color:var(--muted);font-size:13px}
.title{font-size:18px;font-weight:800;margin:8px 0 10px}
.row{display:flex;gap:12px;align-items:center;justify-content:space-between}
.panel{background:rgba(0,0,0,.08);border-radius:18px;padding:18px}
.form{max-width:420px;background:var(--card);border:1px solid rgba(0,0,0,.08);border-radius:18px;padding:18px}
label{display:block;font-size:13px;color:var(--muted);margin:10px 0 6px}
input,select,textarea{width:100%;padding:10px 12px;border-radius:12px;border:1px solid rgba(0,0,0,.12);background:white}
.right{display:flex;align-items:center;gap:10px}
.dropdown{position:relative}
.dropdown button{background:var(--panel);border:0;border-radius:999px;padding:8px 12px;cursor:pointer}
.menu{position:absolute;right:0;top:44px;min-width:190px;background:white;border:1px solid rgba(0,0,0,.12);border-radius:14px;box-shadow:0 12px 30px rgba(0,0,0,.10);overflow:hidden;display:none}
.menu a{display:block;padding:10px 12px;color:var(--text)}
.menu a:hover{background:rgba(0,0,0,.05)}
.dropdown.open .menu{display:block}
.table{width:100%;border-collapse:collapse;background:white;border-radius:14px;overflow:hidden;border:1px solid rgba(0,0,0,.12)}
.table th,.table td{padding:10px 12px;border-bottom:1px solid rgba(0,0,0,.08);text-align:left;font-size:14px}
.muted{color:var(--muted)}
.flash{padding:10px 12px;border-radius:14px;background:rgba(255,107,107,.15);border:1px solid rgba(255,107,107,.35);margin:12px 0;white-space:pre-line}

/* Support chat */
.support-chat-msg{max-width:80%;border:1px solid rgba(0,0,0,.08);border-radius:12px;padding:8px 10px}
.support-chat-meta{font-size:11px;margin-bottom:4px;opacity:.9}
.support-chat-body{font-size:14px;line-height:1.45;white-space:pre-wrap;word-break:break-word}
.support-chat-img{margin-top:8px}
.support-chat-img img{max-width:100%;border-radius:10px;border:1px solid rgba(0,0,0,.10);display:block}
.support-chat-receipt{display:inline-block;margin-top:8px;font-size:11px;line-height:1.25;font-weight:800;padding:4px 8px;border-radius:999px;border:1px solid rgba(0,0,0,.10);background:rgba(255,255,255,.16);color:rgba(0,0,0,.82)}
.support-chat-receipt.unread{color:#7a2b2b;background:rgba(209,74,74,.12);border-color:rgba(209,74,74,.35)}

.modal-overlay{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.48);display:flex;align-items:center;justify-content:center;padding:18px}
.modal-overlay[hidden]{display:none!important}
.modal-card{width:100%;max-width:560px;max-height:78vh;display:flex;flex-direction:column;background:var(--card);border:1px solid rgba(0,0,0,.12);border-radius:18px;padding:18px 18px 16px;box-shadow:0 18px 48px rgba(0,0,0,.18)}
.modal-card-head{margin-bottom:10px}
.modal-title-zh{font-weight:900;font-size:17px}
.modal-title-en{font-size:13px;margin-top:4px}
.modal-body-scroll{overflow:auto;flex:1;min-height:0;padding-right:4px}
.modal-msg-block{padding:10px 0;border-bottom:1px solid rgba(0,0,0,.08)}
.modal-msg-block:last-child{border-bottom:0}
.modal-msg-zh{font-size:14px;line-height:1.55;margin-bottom:6px}
.modal-msg-en{font-size:13px;line-height:1.5}

.dropzone{border:2px dashed rgba(0,0,0,.22);border-radius:18px;padding:26px;text-align:center;background:rgba(255,255,255,.35);cursor:pointer}
.dropzone.dz-active{border-color:rgba(255,107,107,.55);background:rgba(255,107,107,.08)}

/* Home hero carousel */
.hero{margin:12px 0 10px}
.carousel{position:relative;height:75vh;min-height:420px;max-height:820px;border-radius:22px;overflow:hidden;border:1px solid rgba(0,0,0,.10);box-shadow:0 18px 40px rgba(0,0,0,.10);background:#e8dcc7}
.carousel .track{height:100%;display:flex;transition:transform .55s cubic-bezier(.2,.8,.2,1);will-change:transform}
.carousel .slide{min-width:100%;height:100%;position:relative;background:#fff}
.carousel img{width:100%;height:100%;object-fit:contain;display:block;background:#fff;padding:18px;box-sizing:border-box}
.carousel .placeholder{width:100%;height:100%;position:relative}
.carousel .overlay{position:absolute;left:18px;right:18px;bottom:18px;background:rgba(0,0,0,.28);backdrop-filter: blur(8px);border:1px solid rgba(255,255,255,.25);border-radius:18px;padding:16px;color:#fff}
.carousel .kicker{opacity:.9;font-weight:700;letter-spacing:.3px}
.carousel .headline{font-size:28px;font-weight:900;margin-top:6px}
.carousel .nav{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;border-radius:999px;border:1px solid rgba(255,255,255,.35);background:rgba(0,0,0,.25);color:#fff;font-size:28px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.carousel .nav:hover{background:rgba(0,0,0,.35)}
.carousel .nav.prev{left:12px}
.carousel .nav.next{right:12px}
.carousel .dots{position:absolute;left:50%;transform:translateX(-50%);bottom:14px;display:flex;gap:10px;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.22);border:1px solid rgba(255,255,255,.38)}
.carousel .dot{width:10px;height:10px;border-radius:999px;border:0;background:rgba(255,255,255,.55);cursor:pointer}
.carousel .dot.active{background:rgba(255,255,255,.95)}
@media (max-width: 680px){
  .carousel{height:72vh;min-height:360px}
  .carousel .headline{font-size:22px}
}

.checkout-cart{display:flex;flex-direction:column;gap:14px;margin-top:14px}
.checkout-row{display:flex;gap:16px;align-items:flex-start;background:var(--card);padding:14px 16px;border-radius:16px;border:1px solid rgba(0,0,0,.08)}
.checkout-thumb{width:96px;height:96px;border-radius:14px;overflow:hidden;background:#e8dcc7;flex-shrink:0;display:flex;align-items:center;justify-content:center;text-align:center;font-size:11px;padding:6px;color:rgba(0,0,0,.45)}
.checkout-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.checkout-middle{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}
.checkout-name{font-weight:800;font-size:15px;line-height:1.35;color:inherit;text-decoration:none}
.checkout-name:hover{text-decoration:underline}
.checkout-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;width:100%}
.checkout-qty-wrap{display:flex;align-items:center;gap:8px}
.checkout-inline-form{display:inline;margin:0;padding:0;border:0}
.checkout-qty-btn{min-width:38px;height:38px;padding:0;border-radius:999px;border:1px solid rgba(0,0,0,.14);background:rgba(255,255,255,.55);cursor:pointer;font-size:18px;line-height:1;font-weight:800;color:var(--text)}
.checkout-qty-btn:hover{background:rgba(255,255,255,.85)}
.checkout-qty-num{min-width:2rem;text-align:center;font-weight:900;font-size:15px}
.checkout-line-sub{font-weight:700;color:var(--muted);font-size:14px}
.checkout-remove-form{margin-left:auto;display:flex}
.checkout-remove-btn{font-size:13px;padding:8px 14px;border-radius:999px;border:1px solid rgba(160,53,53,.45);background:rgba(255,255,255,.35);color:#8b2c2c;cursor:pointer;font-weight:700}
.checkout-remove-btn:hover{filter:brightness(1.05)}
@media (max-width:560px){
  .checkout-toolbar{flex-direction:column;align-items:flex-start}
  .checkout-remove-form{margin-left:0;width:100%;justify-content:flex-end}
}

/* Mobile polish (do not change behavior, only layout) */
@media (max-width: 720px){
  .container{padding:12px}
  .topbar-inner{padding:10px 12px;flex-wrap:wrap;gap:10px}
  .brand{flex:1 1 100%}
  .nav{flex:1 1 100%;flex-wrap:wrap;gap:8px}
  .nav a{padding:8px 10px}
  .right{flex:1 1 100%;justify-content:flex-end;flex-wrap:wrap}

  .panel{padding:14px;border-radius:16px}
  .card{border-radius:16px}
  .form{max-width:100%;padding:14px;border-radius:16px}
  input,select,textarea{font-size:16px}

  .row{flex-direction:column;align-items:stretch}
  .row > *{width:100%}

  .btn{width:auto;max-width:100%;flex:0 0 auto}
  .btn-primary{width:100%}

  .kv{grid-template-columns:72px 1fr}

  /* Tables: allow horizontal scroll instead of squishing */
  .table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .table th,.table td{white-space:nowrap}

  /* Admin products bulk buttons: compact wrap instead of vertical stack */
  .admin-products-bulkbar{flex-direction:row;flex-wrap:wrap;align-items:center}
  .admin-products-bulkbar .btn{width:auto}
  .admin-products-bulkbar .btn-primary{width:auto}
  .admin-products-bulkbar .muted{flex:1 1 100%}

  /* Product detail: stack image and info vertically */
  .product-detail-panel{grid-template-columns:1fr !important;gap:12px !important}
  .product-detail-panel .product-detail-media{padding:8px}
  .product-detail-panel #js-price{font-size:32px !important;margin:6px 0 !important}

  /* Product detail add-to-order form: keep button visible */
  .product-detail-panel .product-add-form{flex-direction:column;align-items:stretch}
  .product-detail-panel .product-add-form > div{width:100%;justify-content:center}
  .product-detail-panel .product-add-form .btn-primary{width:100%}
}

