/* =====================================================================
   yc_shop.css v11 -- E-buy webshop JD style (home / detail / cart / order-success pages)
   Class names correspond strictly to yc_shop.js v11; all scopes are tightened and do not pollute other pages.
   ===================================================================== */

/* =====================================================================
   Issue 1/7: compress the top whitespace on the home page and tighten the bottom spacing
   ===================================================================== */
body.yc-page-home .page-breadcrumbs { display: none !important; }
body.yc-page-home main.container .page-header-wrapper { display: none !important; }
body.yc-page-home main.container { margin-bottom: 0; padding-bottom: 0; }
body.yc-page-home .page-footer { display: none; }
body.yc-page-home .web-footer { margin-top: 0; padding-top: 10px; }
/* The system .page-content-wrapper defaults to 4rem bottom padding plus 2rem top/bottom margin,
   which is the root cause of the large blank area at the bottom of the home page; tightened for the home page */
body.yc-page-home .page-content-wrapper { padding: 0 4rem 0.5rem !important;
	margin: 0 0 0.5rem !important; }

/* ---------- Home container ---------- */
.yc-home { max-width: 1200px; margin: 0 auto; padding: 6px 0 24px; }

/* Top: left categories plus right search/carousel */
.yc-topbar { display: flex; gap: 10px; align-items: stretch; }

/* Left categories */
.yc-cats-side { width: 200px; flex: 0 0 200px; background: #fff; border-radius: 6px;
	overflow: visible; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.yc-cats-title { background: #e1251b; color: #fff; font-weight: 700; font-size: 15px;
	padding: 10px 14px; border-radius: 6px 6px 0 0; }
.yc-cats-list { list-style: none; margin: 0; padding: 6px 0; position: relative; }
.yc-cats-loading { padding: 10px 14px; color: #999; font-size: 13px; }

.yc-cat-item { position: static; padding: 7px 28px 7px 14px; font-size: 13.5px;
	color: #333; cursor: pointer; white-space: nowrap; }
.yc-cat-arrow { position: absolute; right: 10px; color: #bbb; font-style: normal; }
.yc-cat-item { position: relative; }
.yc-cat-item:hover, .yc-cat-item.active { color: #e1251b; background: #fdf2f2; }

/* Flyout: full-column second-level category overlay */
.yc-flyout { display: none; position: absolute; left: 200px; top: -6px; z-index: 60;
	width: 520px; min-height: 200px; background: #fff; border: 1px solid #eee;
	border-radius: 0 6px 6px 0; box-shadow: 4px 4px 16px rgba(0,0,0,.1);
	padding: 14px 18px; }
.yc-cat-item:hover .yc-flyout { display: block; }
.yc-fly-sub { display: inline-block; min-width: 130px; padding: 6px 10px; font-size: 13px;
	color: #555; cursor: pointer; border-radius: 4px; }
.yc-fly-sub:hover { color: #e1251b; background: #fdf2f2; }

/* Right main column */
.yc-main-col { flex: 1 1 auto; min-width: 0; }
.yc-searchrow { display: flex; height: 40px; margin-bottom: 10px; }
.yc-search-input { flex: 1 1 auto; border: 2px solid #e1251b; border-right: 0;
	border-radius: 4px 0 0 4px; padding: 0 14px; font-size: 14px; outline: none; }
.yc-search-btn { flex: 0 0 90px; background: #e1251b; color: #fff; border: 0;
	border-radius: 0 4px 4px 0; font-size: 15px; font-weight: 700; cursor: pointer; }
.yc-search-btn:hover { background: #c81f17; }

/* Carousel */
.yc-carousel { position: relative; height: 300px; border-radius: 6px; overflow: hidden;
	background: #f5f5f5; }
.yc-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s;
	pointer-events: none; }
.yc-slide.active { opacity: 1; pointer-events: auto; }
.yc-slide-track { position: absolute; inset: 0; }
.yc-slide img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }

/* Manual controls: arrows + dots (only rendered when 2+ slides) */
.yc-slide-arrow { position: absolute; top: 50%; transform: translateY(-50%);
	z-index: 3; width: 40px; height: 40px; border: 0; border-radius: 50%;
	background: rgba(0,0,0,.38); color: #fff; font-size: 15px; line-height: 40px;
	text-align: center; cursor: pointer; padding: 0; opacity: 0;
	transition: opacity .2s, background .2s; }
.yc-carousel.is-controllable:hover .yc-slide-arrow,
.yc-slide-arrow:focus { opacity: 1; }
.yc-slide-arrow:hover { background: #e1251b; }
.yc-slide-prev { left: 12px; }
.yc-slide-next { right: 12px; }
.yc-slide-dots { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 3;
	display: flex; justify-content: center; gap: 8px; }
.yc-slide-dot { width: 9px; height: 9px; border: 0; border-radius: 50%;
	background: rgba(255,255,255,.55); cursor: pointer; padding: 0;
	transition: width .2s, background .2s; }
.yc-slide-dot.on { width: 20px; border-radius: 5px; background: #fff; }
@media (max-width: 768px) {
	/* touch devices have no hover: keep a dimmed, tappable arrow */
	.yc-slide-arrow { opacity: .65; width: 34px; height: 34px; line-height: 34px; }
	.yc-slide-dots { bottom: 7px; gap: 6px; }
}

/* Product title area */
.yc-products-head { display: flex; align-items: baseline; gap: 14px; margin: 18px 0 10px; }
.yc-products-head h2 { font-size: 19px; font-weight: 700; margin: 0; color: #222; }
.yc-crumb { font-size: 12.5px; color: #999; }

/* Product grid, 5 columns */
.yc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.yc-empty { grid-column: 1 / -1; text-align: center; color: #999;
	padding: 40px 0; font-size: 14px; }

.yc-card { position: relative; background: #fff; border-radius: 6px; padding: 10px 10px 12px;
	display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.yc-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.12); transform: translateY(-2px); }

/* Heart wishlist (issue 6) */
.yc-heart { position: absolute; top: 6px; right: 6px; z-index: 5; width: 26px;
	height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,.85);
	box-shadow: 0 1px 4px rgba(0,0,0,.12); cursor: pointer; font-size: 15px;
	line-height: 26px; text-align: center; color: #bbb; padding: 0; }
.yc-heart:hover { color: #e1251b; }
.yc-heart.on { color: #e1251b; }

/* Square image area */
.yc-card-img { position: relative; display: block; width: 100%; padding-top: 100%;
	overflow: hidden; background: #f7f7f7; border-radius: 4px; margin-bottom: 8px; }
.yc-card-img img { position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: cover; transition: transform .35s ease; }
.yc-card:hover .yc-card-img img { transform: scale(1.08); }
.yc-card-noimg { position: absolute; inset: 0; display: flex; align-items: center;
	justify-content: center; color: #bbb; font-size: 12.5px; }

/* Badges */
.yc-card-badge { position: absolute; top: 0; left: 0; z-index: 3; display: inline-block;
	font-size: 11px; line-height: 1; color: #fff; padding: 4px 6px; border-radius: 3px;
	font-weight: 700; background: #e1251b; }

/* Text lines, compact */
.yc-card-name { font-size: 13.5px; color: #333; line-height: 1.35; height: 1.35em;
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: none;
	display: block; }
.yc-card-name:hover { color: #e1251b; }
.yc-card-sub { font-size: 12px; color: #999; margin-top: 3px; white-space: nowrap;
	overflow: hidden; text-overflow: ellipsis; }

.yc-card-price { margin-top: 6px; color: #e1251b; font-weight: 700; font-size: 17px;
	line-height: 1.2; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.yc-currency { font-size: 12.5px; font-weight: 600; }
.yc-price-old { font-size: 12.5px; color: #a4a4a4; font-weight: 400; text-decoration: line-through; }
.yc-stock-ok { font-size: 11.5px; color: #2eaa45; font-weight: 400; }
.yc-stock-no { font-size: 11.5px; color: #999; font-weight: 400; }

.yc-card-foot { margin-top: auto; padding-top: 8px; display: flex;
	justify-content: space-between; align-items: center; }
.yc-sales { font-size: 12px; color: #999; }
.yc-btn-add { height: 28px; border: 1px solid #e1251b; background: #fff;
	color: #e1251b; border-radius: 14px; font-size: 12.5px; padding: 0 12px; cursor: pointer; }
.yc-btn-add:hover { background: #e1251b; color: #fff; }

/* Pagination (centered, numbered buttons) */
.yc-pager { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
.yc-page { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid #ddd;
	background: #fff; border-radius: 4px; font-size: 13.5px; color: #555; cursor: pointer; }
.yc-page:hover { border-color: #e1251b; color: #e1251b; }
.yc-page.active { background: #e1251b; border-color: #e1251b; color: #fff; }
.yc-prev, .yc-next { height: 34px; padding: 0 16px; border: 1px solid #ddd;
	background: #fff; border-radius: 4px; font-size: 13.5px; color: #555; cursor: pointer; }
.yc-prev:hover, .yc-next:hover { border-color: #e1251b; color: #e1251b; }
.yc-prev.disabled, .yc-next.disabled { color: #bbb; cursor: not-allowed;
	background: #f7f7f7; border-color: #e8e8e8; }

/* Belt-and-suspenders hiding of the native pagination/toolbar (we replace them with the JD-style pager) */
body.yc-page-home .product-paging-area,
body.yc-page-home #product-listing > .toolbar { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .yc-grid { grid-template-columns: repeat(4,1fr); } }
@media (max-width: 768px) {
	.yc-topbar { flex-direction: column; }
	/* Hide the category panel on phones (per user request: desktop web only); everything else unchanged */
	.yc-cats-side { display: none; }
	.yc-flyout { display: none !important; }
	.yc-carousel { height: 180px; }
	.yc-grid { grid-template-columns: repeat(2,1fr); }
}

/* =====================================================================
   Detail page: spec-parameter injection block (the native review section is left untouched)
   ===================================================================== */
.yc-spec-block { background: #fff; border-radius: 6px; padding: 18px 22px;
	margin-bottom: 14px; }
.yc-spec-title { font-size: 16px; font-weight: 700; color: #222; margin: 0 0 12px; }
.yc-spec-table { width: 100%; border-collapse: collapse; }
.yc-spec-table th, .yc-spec-table td { border: 1px solid #eee; padding: 9px 14px;
	font-size: 13.5px; text-align: left; }
.yc-spec-table th { width: 180px; background: #fafafa; color: #666; font-weight: 600; }

/* =====================================================================
   Detail page: multi-image gallery plus hover magnifier (JD style)
   ===================================================================== */

/* Main image stage */
.item-main .yc-zoom-stage { position: relative; cursor: crosshair; }
.item-main .yc-zoom-stage .website-image { pointer-events: auto; }

/* Small tip at bottom right */
.yc-zoom-hint { position: absolute; right: 8px; bottom: 8px; z-index: 5;
	background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 1;
	padding: 5px 9px; border-radius: 3px; pointer-events: none;
	transition: opacity .15s; }
.yc-zoom-hint.off { opacity: 0; }

/* Selection box */
.yc-zoom-lens { display: none; position: absolute; z-index: 6;
	background: rgba(225,37,27,.12);
	border: 1px solid rgba(225,37,27,.65);
	box-shadow: 0 0 0 9999px rgba(255,255,255,.0);
	pointer-events: none; }
.yc-zoom-lens.on { display: block; }

/* Zoom panel */
.yc-zoom-panel { display: none; position: absolute; z-index: 1060;
	background: #fff no-repeat center center;
	border: 1px solid #e8e8e8; border-radius: 4px;
	box-shadow: 0 6px 24px rgba(0,0,0,.18);
	overflow: hidden; }
.yc-zoom-panel.on { display: block; }

/* Thumbnail strip */
.yc-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.yc-thumb { width: 58px; height: 58px; border: 2px solid #e5e5e5;
	border-radius: 4px; overflow: hidden; cursor: pointer; background: #fff;
	padding: 2px; transition: border-color .15s; }
.yc-thumb img { width: 100%; height: 100%; object-fit: contain; }
.yc-thumb:hover { border-color: #f99; }
.yc-thumb.active { border-color: #e1251b; }

/* No resource cost on touchscreens; hide the tip label */
@media (hover: none) { .yc-zoom-hint { display: none; } }

/* =====================================================================
   Detail page: Product Introduction / Spec Parameters / User Reviews tabs
   ===================================================================== */
.yc-tabs-wrap { max-width: 1200px; margin: 24px auto 0; background: #fff;
	border-radius: 6px; overflow: hidden; }
.yc-detail-tabs { display: flex; border-bottom: 1px solid #eee; padding: 0 24px; }
.yc-detail-tabs button { position: relative; padding: 16px 26px; border: 0;
	background: none; font-size: 15px; color: #555; cursor: pointer; }
.yc-detail-tabs button:hover { color: #e1251b; }
.yc-detail-tabs button.active { color: #e1251b; font-weight: 600; }
.yc-detail-tabs button.active::after { content: ""; position: absolute;
	left: 26px; right: 26px; bottom: -1px; height: 2px; background: #e1251b; }
.yc-tab-pane { padding: 24px 28px; }
.yc-tab-pane.hidden { display: none; }
.yc-tab-pane .product-description { margin-bottom: 14px; }
.yc-tab-pane .yc-spec-block { margin: 0; }
.yc-tab-pane .yc-spec-title { font-size: 16px; margin-bottom: 12px; }

/* =====================================================================
   Detail page: JD-red Add to Cart button (the default btn-primary looks blackish)
   Real DOM: <button><span class="mr-2"><svg class="icon icon-md"></svg></span>加入购物车</button>

   三层对齐陷阱，必须全部破解：
   1) Bootstrap .btn { display: inline-block; line-height: 1.5 }
      → 改成 inline-flex，span 和裸文本 node 都当 flex item 处理
   2) frappe .icon { margin-top: -2px; margin-left: 4px; display: inline-block }
      → 必须在按钮内把这些覆盖掉：margin 全部归零，display 改 block
      inline-block 的 SVG 会坐落在基线上，下方有 descender 预留空间 → display:block 消掉它
   3) frappe .icon-assets 是 stroke（描边）图标，不是 fill 图标
      frappe 原生只给 stroke 上深色、fill 留透明
      → 必须同时设 fill:#fff + stroke:#fff
   ===================================================================== */
/* 最大特异性：.btn-add-to-cart.btn-add-to-cart 把 (0,1,0) 拉到 (0,2,0)，
   加上 svg/use/path 元素选择器 → (0,2,2)，轻松盖过 frappe 的
   .icon use (0,1,1) 和 webshop 的 .product-container .product-details .btn-add-to-cart 等规则 */
.btn-add-to-cart.btn-add-to-cart {
	background: #e1251b !important; border-color: #e1251b !important;
	color: #fff !important; border-radius: 4px;
	font-weight: 600; padding: 10px 24px;
	box-shadow: 0 2px 6px rgba(225,37,27,.25);
	font-size: 16px !important;
	line-height: 1 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	transition: background .15s;
}
.btn-add-to-cart.btn-add-to-cart > span {
	margin: 0 !important;
	display: inline-flex !important;
	align-items: center !important;
}
/* 覆盖 frappe .icon { margin-top:-2px; margin-left:4px; display:inline-block } */
.btn-add-to-cart.btn-add-to-cart svg.icon.icon,
.btn-add-to-cart.btn-add-to-cart svg {
	display: block !important;
	margin: 0 !important;
	width: 20px !important;
	height: 20px !important;
	fill: #fff !important;
	stroke: #fff !important;
	background: none !important;
}
/* 覆盖 frappe .icon use { stroke: var(--text-muted) } 和 webshop svg use 变量 */
.btn-add-to-cart.btn-add-to-cart svg use,
.btn-add-to-cart.btn-add-to-cart svg path {
	fill: #fff !important;
	stroke: #fff !important;
	stroke-width: 1.5px !important;
	--icon-stroke: #fff !important;
	--icon-fill: #fff !important;
}
.btn-add-to-cart.btn-add-to-cart:hover {
	background: #c81f17 !important; border-color: #c81f17 !important; }

/* Stock text */
.product-details .in-green { color: #37a149; font-weight: 600; font-size: 13.5px; }

/* =====================================================================
   Detail page: product introduction body (written by product_intros.py)
   ===================================================================== */
.yc-intro { color: #333; font-size: 14px; line-height: 1.8; }
.yc-intro h3 { font-size: 16px; font-weight: 700; color: #333;
	margin: 18px 0 10px; padding-left: 10px; border-left: 3px solid #e1251b; }
.yc-intro h3:first-child { margin-top: 0; }
.yc-intro-points, .yc-intro-pack { list-style: none; margin: 0; padding: 0; }
.yc-intro-points li { position: relative; padding-left: 18px; margin-bottom: 6px; }
.yc-intro-points li::before { content: "✓"; position: absolute; left: 0;
	color: #e1251b; font-weight: 700; }
.yc-intro-params { width: 100%; border-collapse: collapse; background: #fafafa;
	border-radius: 4px; overflow: hidden; }
.yc-intro-params th, .yc-intro-params td { padding: 9px 14px; font-weight: 400;
	border-bottom: 1px solid #f0f0f0; text-align: left; font-size: 13.5px; }
.yc-intro-params th { width: 160px; color: #888; background: #f5f5f5; }
.yc-intro-pack li { position: relative; padding-left: 18px; margin-bottom: 6px;
	color: #555; }
.yc-intro-pack li::before { content: "•"; position: absolute; left: 4px;
	color: #e1251b; }
.yc-intro-note { margin-top: 18px; padding: 10px 14px; background: #fdf2f2;
	border-radius: 4px; color: #b3534d; font-size: 13px; }

/* =====================================================================
   Detail page: JD-style colors for the user review section (the native block colors look dated)
   ===================================================================== */
.yc-tab-pane .ratings-reviews-section,
.ratings-reviews-section { background: #fff; border-top: 1px solid #f0f0f0;
	padding: 20px 0 4px; margin-top: 16px; }
.ratings-reviews-section .reviews-header,
.ratings-reviews-section .review-section-header { color: #333; font-size: 16px;
	font-weight: 700; margin-bottom: 14px; }
.ratings-reviews-section .rating-summary-section { background: #fafafa;
	border-radius: 6px; padding: 16px 20px; margin-bottom: 16px; }
/* Large rating numbers (the system macro outputs .rating-summary-numbers h2 with no class) */
.ratings-reviews-section .rating-summary-numbers h2 { color: #e1251b;
	font-size: 32px !important; font-weight: 700; line-height: 1.1; margin: 0; }
.ratings-reviews-section .rating-summary-numbers { color: #888; font-size: 13px; }
/* Stars: selected stars .star-click are JD orange, unselected light gray (svg use is colored via fill) */
.ratings-reviews-section .rating .icon { fill: #e3e3e3; }
.ratings-reviews-section .rating .star-click { fill: #ff9f1c; }
/* Rating distribution progress bars */
.ratings-reviews-section .rating-progress-bar { background: #eee; }
.ratings-reviews-section .progress-bar-cosmetic { background: #ff9f1c !important; }
.ratings-reviews-section .rating-bar-title,
.ratings-reviews-section .rating-progress-bar-section .small { color: #888; }
.ratings-reviews-section .btn-write-review,
.ratings-reviews-section .write-a-review-btn .btn {
	background: #fff; border: 1px solid #e1251b; color: #e1251b;
	border-radius: 4px; padding: 7px 20px; font-size: 13.5px; font-weight: 600; }
.ratings-reviews-section .btn-write-review:hover,
.ratings-reviews-section .write-a-review-btn .btn:hover {
	background: #fdf2f2; }
.ratings-reviews-section .review-item,
.ratings-reviews-section .review-content { padding: 14px 0;
	border-bottom: 1px solid #f3f3f3; }
.ratings-reviews-section .review-item:last-child { border-bottom: 0; }
.ratings-reviews-section .review-author,
.ratings-reviews-section .reviewer-name { color: #555; font-size: 13px;
	font-weight: 600; }
.ratings-reviews-section .review-text,
.ratings-reviews-section .review-comment { color: #333; font-size: 13.5px;
	line-height: 1.7; margin-top: 6px; }
.ratings-reviews-section .review-date,
.ratings-reviews-section .text-muted { color: #999 !important; font-size: 12px; }
/* Actual review entries: .review / .user-review-title / .reviewer */
.ratings-reviews-section .user-reviews .review { padding: 14px 0;
	border-bottom: 1px solid #f3f3f3; }
.ratings-reviews-section .user-review-title { color: #333; font-size: 14px;
	font-weight: 600; margin: 0 0 4px; }
.ratings-reviews-section .review .product-description p { color: #333;
	font-size: 13.5px; line-height: 1.7; margin: 0 0 6px; }
.ratings-reviews-section .review-signature .reviewer { color: #999;
	font-size: 12.5px; margin-right: 8px; }
.ratings-reviews-section .review-signature .indicator.grey { background: #ddd; }

/* =====================================================================
   Issue 2: JD-style skin for the cart page
   ===================================================================== */
body.yc-page-cart { background: #f5f5f5; }
body.yc-page-cart main.container { max-width: 1200px; }
body.yc-page-cart .frappe-card { border: 0; border-radius: 8px;
	box-shadow: 0 1px 4px rgba(0,0,0,.06); margin-bottom: 14px; }

/* Offline payment notice bar */
.yc-cart-notice { background: #fff8e6; border: 1px solid #ffe1a8; color: #8a5a00;
	border-radius: 6px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; }

/* Fine-tuning of product rows */
body.yc-page-cart .cart-item { padding: 14px 0; border-bottom: 1px solid #f0f0f0; }
body.yc-page-cart .cart-item-name { color: #333; font-size: 14px; }
body.yc-page-cart .cart-item-name:hover { color: #e1251b; }
body.yc-page-cart .cart-item-price { color: #e1251b; font-weight: 700; }

/* Quantity input */
body.yc-page-cart .input-group.qty-cp { width: 130px; }

/* Place Order: JD-red primary button */
body.yc-page-cart #btn-place-order,
body.yc-page-cart .btn-place-order {
	background: #e1251b; border-color: #e1251b; color: #fff; font-weight: 700;
	height: 46px; padding: 0 38px; border-radius: 4px; font-size: 16px; }
body.yc-page-cart #btn-place-order:hover,
body.yc-page-cart .btn-place-order:hover {
	background: #c81f17; border-color: #c81f17; }

/* Quote-mode buttons (should not appear after checkout is enabled; hidden as a belt-and-suspenders measure) */
body.yc-page-cart #btn-request-quotation,
body.yc-page-cart .btn-request-for-quotation { display: none !important; }

/* Address cards */
body.yc-page-cart .address-container { border: 1px solid #eee; border-radius: 6px;
	padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
body.yc-page-cart .address-container[data-active] { border-color: #e1251b;
	background: #fdf2f2; }
body.yc-page-cart .btn-new-address { color: #e1251b; font-size: 13px; }

/* Summary area */
body.yc-page-cart .cart-payment-summary { text-align: right; }
body.yc-page-cart .cart-grand-total, body.yc-page-cart .grand-total {
	color: #e1251b; font-size: 22px; font-weight: 700; }

/* =====================================================================
   Order success page /orders/<SO> (offline payment mode)
   ===================================================================== */
.yc-order-tip { margin-top: 14px; background: #edf9f0; border: 1px solid #b7e4c2;
	color: #1d6b35; border-radius: 6px; padding: 12px 16px; font-size: 14px;
	line-height: 1.7; }
body.yc-page-order #pay-online,
body.yc-page-order .btn-pay-online { display: none !important; }

/* Reviews moved to the order dimension: hide the standalone "Write a Review" entry on the product detail page */
.write-a-review-btn { display: none !important; }

/* =====================================================================
   v20 mobile home fix: tiny images / large blank margins on both sides / content offset right and off-center
   mountHome injects .yc-home into main.container, which is still wrapped by
   .page-content-wrapper and another .container; on phones the stacked containers'
   max-width and padding stack up, making content narrow with large, asymmetric whitespace.
   Here on narrow screens all layers collapse to full width with small symmetric padding and forced centering.
   ===================================================================== */
@media (max-width: 768px) {
	/* All container levels: drop fixed max-width, use small symmetric padding, force centering */
	body.product-page .container,
	body.product-page main.container,
	body.product-page .breadcrumb-container {
		width: 100% !important;
		max-width: 100% !important;
		padding-left: 10px !important;
		padding-right: 10px !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}
	/* Outer page wrapper: clear possibly large padding / margins */
	body.product-page .page-content-wrapper {
		padding: 0 !important;
		margin: 0 !important;
	}
	/* Breadcrumbs take no space on phones */
	body.product-page .breadcrumb-container { display: none !important; }

	/* Home body: full width, symmetric, centered */
	body.product-page .yc-home {
		width: 100%;
		max-width: 100%;
		padding: 8px 0 20px;
		margin: 0 auto;
	}
	body.product-page .yc-topbar { gap: 0; }
	body.product-page .yc-main-col,
	body.product-page .yc-searchrow,
	body.product-page .yc-carousel,
	body.product-page #product-listing { width: 100%; min-width: 0; }

	/* Search row flush to the edge, with a slightly narrower button */
	body.product-page .yc-searchrow { height: 38px; margin-bottom: 10px; }
	body.product-page .yc-search-btn { flex-basis: 72px; }

	/* Full-width carousel with a fitting height */
	body.product-page .yc-carousel { height: 150px; margin: 0; border-radius: 6px; }

	/* Two-column grid with tightened gaps */
	body.product-page .yc-grid { gap: 8px; }
	body.product-page .yc-card { padding: 8px 8px 10px; }

	/* Compact title area */
	body.product-page .yc-products-head { gap: 8px; margin: 16px 0 10px; }
}

/* Tablets/foldables (769-991, WeChat Pad / landscape mode): stay unbiased, symmetric and centered,
   do not force the phone column count; only remove the abnormal fixed widths and left offset. */
@media (min-width: 769px) and (max-width: 991px) {
	body.product-page .container,
	body.product-page main.container,
	body.product-page .yc-home {
		margin-left: auto !important;
		margin-right: auto !important;
	}
}

/* Cart shipping address card */
.yc-cart-ship {
     border: 1px solid #eee;
     border-radius: 10px;
     background: #fafafa;
}
.yc-cart-ship-title {
     font-size: 13px;
     font-weight: 600;
     color: #333;
     margin-bottom: 6px;
}
.yc-cart-ship-title::before {
     content: "\2691";
     margin-right: 6px;
     color: #e1251b;
}
.yc-cart-ship-body {
     font-size: 13px;
     line-height: 1.6;
     color: #444;
}
.yc-cart-ship-loading { color: #999; }
.yc-cart-ship-empty { color: #e1251b; }
.yc-cart-ship-link {
     display: inline-block;
     margin-top: 8px;
     font-size: 12.5px;
     color: #e1251b;
}

/* =====================================================================
   v27 navbar: align brand row with the 1200px shop content; badge locked
   to the cart icon wrapper; app-style mobile hamburger panel.
   ===================================================================== */

/* Shop pages use a 1200px content grid; the stock bootstrap navbar container
   caps at 1140px, which made "商城首页" protrude left of the content below. */
@media (min-width: 1200px) {
	body.yc-page-shop nav.navbar > .container {
		max-width: 1200px;
	}
	body.yc-page-shop main.container,
	body.yc-page-cart main.container {
		max-width: 1200px;
	}
}

/* Fixed-size line icons: never stretch with the flex nav row. */
.yc-nav-svg {
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	display: block;
}

/* Cart / orders nav anchors: icon and text stay aligned. */
li.cart-icon a.nav-link,
li.yc-orders-nav a.nav-link,
li.yc-admin-nav a.nav-link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 7px;
}
/* Icon + badge share one positioning box so the badge always hugs the
   icon's top-right corner regardless of anchor width. */
.yc-cart-ic {
	position: relative;
	display: inline-flex;
}
li.cart-icon a.nav-link .shopping-badge {
	position: absolute;
	top: -7px;
	right: -8px;
	left: auto;
	min-width: 16px;
	height: 16px;
	padding: 0 3px;
	margin: 0;
	line-height: 16px;
	text-align: center;
	font-size: 10px;
	border-radius: 8px;
	border: 1.5px solid #fff;
	box-sizing: border-box;
	z-index: 2;
}
li.cart-icon a.nav-link .shopping-badge:empty {
	display: none;
}

/* The inline text label is superseded by the mobile menu grid; keep the
   desktop nav icon-only. */
.yc-cart-label {
	display: none;
}

/* ---------------------------------------------------------------------
   Mobile hamburger panel (app-style card): shortcuts grid + account rows.
   Only rendered inside #navbarSupportedContent; desktop keeps the stock nav.
   --------------------------------------------------------------------- */
.yc-mobile-menu {
	display: none;
}
@media (max-width: 991.98px) {
	/* Swap the stock nav lists for our card menu inside the panel. */
	#navbarSupportedContent > *:not(.yc-mobile-menu) {
		display: none !important;
	}
	#navbarSupportedContent {
		padding: 10px 2px 4px;
	}
	.yc-mobile-menu {
		display: block;
		background: #fff;
		border-radius: 14px;
		box-shadow: 0 6px 22px rgba(0, 0, 0, .08);
		overflow: hidden;
		margin: 2px 2px 8px;
	}

	/* Shortcut tiles */
	.yc-m-grid {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		padding: 16px 8px 14px;
		border-bottom: 8px solid #f6f7f9;
	}
	.yc-m-cell {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 8px;
		color: #333;
		font-size: 13px;
		line-height: 1.2;
	}
	.yc-m-ic {
		position: relative;
		width: 44px;
		height: 44px;
		border-radius: 13px;
		background: #f4f5f7;
		display: flex;
		align-items: center;
		justify-content: center;
		color: #444;
	}
	.yc-m-ic .yc-nav-svg {
		width: 21px;
		height: 21px;
		flex: 0 0 21px;
	}
	.yc-m-ic-red {
		background: #fdeceb;
		color: #e1251b;
	}
	.yc-m-badge {
		position: absolute;
		top: -6px;
		right: -7px;
		min-width: 16px;
		height: 16px;
		padding: 0 3px;
		background: #e1251b;
		color: #fff;
		font-size: 10px;
		font-style: normal;
		font-weight: 600;
		line-height: 16px;
		text-align: center;
		border-radius: 8px;
		border: 1.5px solid #fff;
		box-sizing: border-box;
	}

	/* Secondary rows */
	.yc-m-list {
		padding: 4px 16px 12px;
	}
	.yc-m-row {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 14px 2px;
		color: #333;
		font-size: 15px;
		border-bottom: 1px solid #f1f2f4;
	}
	.yc-m-row:last-child {
		border-bottom: 0;
	}
	.yc-m-ic-sm {
		display: inline-flex;
		color: #6b7280;
	}
	.yc-m-ic-sm .yc-nav-svg {
		width: 18px;
		height: 18px;
		flex-basis: 18px;
	}
	.yc-m-logout {
		color: #e1251b;
	}
	.yc-m-logout .yc-m-ic-sm {
		color: #e1251b;
	}
}

/* Logged-in-only rows inside the mobile panel. */
body:not([frappe-session-status="logged-in"]) .yc-m-auth {
	display: none !important;
}
body[frappe-session-status="logged-in"] .yc-m-login {
	display: none !important;
}
