/*
Theme Name: Tishaa Child (owaribiki)
Theme URI: https://owaribiki.com/
Description: owaribiki.com 外观复刻子主题 —— 父主题 tishaa v1.0.3（本目录父主题为原站真实样式资产 + 最小脚手架重建版），子主题承载 5 类块模板（home / archive-product / single-product / page-cart / page-my-account）与 header/footer 模板部件，按 i1472 复刻包落地。
Author: local landing (intent 1493)
Template: tishaa
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.0
License: GNU General Public License v2 or later
Text Domain: tishaa-child
Tags: e-commerce, full-site-editing, block-patterns
*/

/* Layout stability fixes for the local landing site (kept intentionally minimal:
   the visual language comes from the parent theme stylesheets + theme.json presets). */
.wp-block-template-part > header,
header.wp-block-group {
	position: relative;
	z-index: 20;
}

.wc-block-customer-account__account-icon,
.wp-block-woocommerce-mini-cart {
	display: inline-flex;
	align-items: center;
}

/* Site logo: the original site renders a 154x44 lockup in the header. The only
   obtainable asset is a 1002x1002 square logo (2026/03/logo.png via the site's own
   image CDN), so constrain it to the original header height instead of letting a
   154px square blow up the header. */
.custom-logo-link .custom-logo,
.wp-block-site-logo img.custom-logo {
	width: auto;
	max-width: 154px;
	height: 44px;
	object-fit: contain;
}

/* Product grid cards: keep images inside their cells. */
.wp-block-woocommerce-product-image img,
.wp-block-post-featured-image img {
	max-width: 100%;
	height: auto;
	object-fit: cover;
}

/* Brand index wall (/product-category/brand/) — cards rendered by
   [owaribiki_brand_wall] (28 source brands mapped to local product_cat terms). */
.ow-brand-wall {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
	gap: 14px;
	margin-top: 24px;
}

.ow-brand-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	border: 1px solid var(--wp--preset--color--primary-500, #ddd);
	border-radius: 8px;
	background: #fff;
	color: inherit;
	text-decoration: none;
	transition: box-shadow .15s ease, transform .15s ease;
}

a.ow-brand-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
	transform: translateY(-1px);
}

.ow-brand-card__name {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
}

.ow-brand-card__count {
	font-size: 12px;
	color: var(--wp--preset--color--gray-600, #777);
}

.ow-brand-card--pending {
	opacity: .55;
	border-style: dashed;
}

/* Related products grid on single product (shortcode [owaribiki_related_products]). */
.ow-related-products {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 18px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.ow-related-products li.product {
	margin: 0;
	text-align: center;
}

.ow-related-products li.product img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.ow-related-products .woocommerce-loop-product__title {
	font-size: 13px;
	line-height: 1.4;
	margin: 8px 0 4px;
}

@media (max-width: 781px) {
	.ow-related-products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ── OWARIBIKI-27 (i1559) 模板补齐：home 品牌墙 + product 描述区 ── */

/* Home 品牌墙（各ブランド一覧）：原站 4 列、图 554x388（aspect 16/9、border-radius 30px、object-fit cover）+ 品牌名。
   注意：本主题 wp:column 渲染为 .wp-block-group.wp-block-column-is-layout-flow（无 .wp-block-column 类），
   且 has-global-padding 注入左右内边距，曾导致每列仅 192px（原站约 330px）。 */
.ow-brand-grid .wp-block-columns {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	align-items: flex-start;
}
.ow-brand-grid .wp-block-columns > * {
	flex: 1 1 calc(25% - 18px);
	max-width: calc(25% - 18px);
	min-width: 0;
	padding-left: 0 !important;
	padding-right: 0 !important;
}
.ow-brand-grid .wp-block-image {
	margin: 0 0 12px;
}
.ow-brand-grid .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	object-fit: cover;
	border-radius: 30px;
}

/* Product 描述区：原站实测 #tab-description 内容容器约 890px、内嵌描述图渲染宽 830px@1440
   （baseline x473–1303）；本地此前为容器 1200px / 图 1024px。 */
.wp-block-woocommerce-product-details .woocommerce-Tabs-panel,
.wp-block-woocommerce-product-details .woocommerce-tabs .tabs {
	max-width: 890px;
	margin-left: auto;
	margin-right: auto;
}
.wp-block-woocommerce-product-details .woocommerce-Tabs-panel img {
	max-width: 830px;
	height: auto;
}

@media (max-width: 781px) {
	.ow-brand-grid .wp-block-columns > * {
		flex: 1 1 calc(50% - 12px);
		max-width: calc(50% - 12px);
	}
	.wp-block-woocommerce-product-details .woocommerce-Tabs-panel img {
		max-width: 100%;
	}
}

/* ── OWARIBIKI-27 (i1559) 修正 v2：品牌墙容器宽 & 首页三分类网格栅格 ── */

/* 品牌墙：wp:columns 默认被 constrained 布局压到 contentSize 840px（每列 192px），
   原站约 1330px 容器 / 4 列每列 ~330px。此处放宽到 1330 并保持居中。 */
.ow-brand-grid .wp-block-columns {
	width: 100%;
	max-width: 1330px;
	margin-left: auto;
	margin-right: auto;
}

/* 首页三分类商品网格：原站为 [products] 短代码（ul.products.columns-4 / wc-block-grid 同构），
   但本主题 wc 样式未给 ul.products 提供 columns-N 栅格，导致 8 张卡纵向堆叠（每块 ~2000px）。
   仅作用于短代码块（.wp-block-shortcode），不影响 /shop/ 等归档页。 */
.ow-product-grid ul.products.columns-4 {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ow-product-grid ul.products.columns-4 > li.product {
	width: auto !important;
	float: none !important;
	margin: 0 !important;
}
.ow-product-grid ul.products.columns-4 > li.product img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

@media (max-width: 781px) {
	.ow-product-grid ul.products.columns-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 781px) {
	.ow-product-grid ul.products.columns-4 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ── PROD-5A (i1613)：archive-product（/shop/ 与 /product-category/*）商品网格与源站对齐 ──
   源站实测（i1488/baseline_png/shop__1440x900.png，真实源站 CSS 渲染、1440x900）：
     容器 ~1168px、**4 列**、卡宽 242px、列间距 58px。
   本地此前为 3 列（258.66px×3）的两个原因：
     ① templates/archive-product.html:13 外层 group layout=constrained → contentSize 840px
        （theme.json:8 contentSize=840px）;
     ② 父主题 assets/css/minified/wc.min.css:1（offset 11359）
        .columns-4{grid-template-columns:repeat(auto-fill,minmax(max(200px,25% - var(--wp--preset--spacing--24)),1fr))}
        在 840px 宽下 auto-fill 只排得下 3 列。
   本段把容器放宽到源站 1168px 并显式写死列数（下方 --ow-archive-cols 一处可改 4/5/6）。 */
.ow-archive.wp-block-group {
	max-width: 1168px;
	margin-left: auto;
	margin-right: auto;
}
.ow-archive ul.wc-block-product-template__responsive.columns-4,
.ow-archive ul.wc-block-product-template__responsive.columns-5,
.ow-archive ul.wc-block-product-template__responsive.columns-6 {
	display: grid;
	grid-gap: var(--wp--preset--spacing--32, 32px);
	grid-template-columns: repeat(var(--ow-archive-cols, 4), minmax(0, 1fr));
}
@media (max-width: 781px) {
	.ow-archive ul.wc-block-product-template__responsive.columns-4,
	.ow-archive ul.wc-block-product-template__responsive.columns-5,
	.ow-archive ul.wc-block-product-template__responsive.columns-6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
/* =========================================
   3. OWARIBIKI 分类页 SEO 底部样式
   ========================================= */
.cat-seo-box { 
    background: #fff; 
    padding: 30px 20px; 
    margin-top: 40px; 
    border-top: 1px solid #eee; 
    color: #444; 
    font-family: "Helvetica Neue", Arial, sans-serif; 
    line-height: 1.8; 
}
.cat-seo-box h2 { 
    font-size: 20px; 
    border-bottom: 2px solid #d90429; 
    padding-bottom: 10px; 
    margin-bottom: 20px; 
    font-weight: bold; 
}
.cat-seo-box h3 { 
    font-size: 16px; 
    margin-top: 30px; 
    margin-bottom: 15px; 
    color: #333; 
    font-weight: bold; 
    border-left: 4px solid #333; 
    padding-left: 10px; 
}
.cat-check-list { 
    background: #f8f9fa; 
    padding: 20px; 
    border-radius: 8px; 
    list-style: none; 
    margin: 20px 0; 
    border: 1px solid #eee; 
}
.cat-check-list li { 
    margin-bottom: 15px; 
    position: relative; 
    padding-left: 25px; 
    font-size: 14px; 
}
.cat-check-list li::before { 
    content: "✔"; 
    color: #d90429; 
    position: absolute; 
    left: 0; 
    font-weight: bold; 
    width: auto !important; 
    height: auto !important; 
    line-height: 1 !important; 
    display: inline-block !important; 
}
.cat-faq-details { 
    background: #fff; 
    border: 1px solid #eee; 
    border-radius: 8px; 
    margin-bottom: 10px; 
    padding: 15px; 
    cursor: pointer; 
    transition: all .2s; 
    box-shadow: 0 2px 4px rgba(0,0,0,.02); 
}
.cat-faq-details[open] { 
    background: #fdfdfd; 
    border-color: #ddd; 
}
.cat-faq-summary { 
    font-weight: bold; 
    color: #d90429; 
    outline: none; 
    list-style: none; 
    font-size: 15px; 
}
.cat-faq-summary::-webkit-details-marker { display: none; }
.cat-faq-answer { 
    margin-top: 10px; 
    font-size: 14px; 
    color: #555; 
    padding-left: 10px; 
    border-left: 2px solid #eee; 
}
.cat-link-item { 
    background: #fff; 
    padding: 10px 18px; 
    border-radius: 50px; 
    font-size: 13px; 
    text-decoration: none; 
    color: #333; 
    border: 1px solid #e1e1e1; 
    box-shadow: 0 4px 6px rgba(0,0,0,.05); 
    transition: all .2s ease; 
    font-weight: bold; 
    flex-grow: 1; 
    text-align: center; 
}
.cat-link-item:hover { 
    transform: translateY(-2px); 
    border-color: #d90429; 
    color: #d90429; 
}
.cat-back-top a { 
    display: inline-block !important; 
    width: auto !important; 
    color: #d90429; 
    text-decoration: none; 
    font-weight: bold; 
    font-size: 14px; 
    border-bottom: 1px dashed #d90429; 
    padding-bottom: 2px; 
}
.cat-back-top img,
.cat-back-top a img {
    width: 16px !important;    
    height: 16px !important;   
    max-width: 16px !important;   
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 5px 0 0 !important;
    box-shadow: none !important;   
    border: none !important;      
}


/* == OWARIBIKI P0 layout fix (intent 1735) — begin == */
/* ==========================================================================
   OWARIBIKI P0 layout fix — intent 1735
   Read-only verified against the archived ORIGINAL (owaribiki.com) render.
   Source-of-truth: home grid container 1168px / gap 32px / 4x268px cards,
   card height 464px, title 18px / 21.6px (2 lines); product description panel
   831px wide, body paragraphs 16px / 22.4px; bullets were 13px locally.
   ========================================================================== */

/* ---- (1) Home product grid -------------------------------------------------
   .ow-product-grid block group is constrained to theme.json contentSize 840px
   -> 192px cards + 5-line titles. Restore the source geometry exactly:
   container 1168px, 32px gutters => 4 columns of 268px. */
.ow-product-grid.wp-block-group {
	max-width: 1168px !important;
	margin-left: auto;
	margin-right: auto;
}
.ow-product-grid .woocommerce,
.ow-product-grid .woocommerce.columns-4 {
	max-width: none !important;
	width: 100% !important;
}
.ow-product-grid ul.products.columns-4 {
	max-width: none !important;
	gap: 32px !important;
}

/* ---- (2) Card title rhythm + uniform card height ---------------------------
   Source titles are 18px/21.6px (1.2) and fit on 2 lines giving a uniform
   464px card. Long imported titles otherwise wrap to 4-5 lines (squeezed) and
   inflate card height. Clamp to a hard 2-line box with the source line-height
   (max-height 2.4em = 2 lines) and reserve 2 lines so every card is equal height. */
.ow-product-grid ul.products .woocommerce-loop-product__title {
	font-size: 13px !important;
	line-height: 1.4 !important;
	font-weight: 500;
	display: block !important;
	max-height: none !important;
	min-height: 0 !important;
	overflow: visible !important;
	-webkit-line-clamp: unset !important;
	white-space: normal !important;
	word-break: break-word;
}

/* The Woo loop markup inserts <br> spacers (3 x ~19px) between the onsale badge,
   price and add-to-cart button; they are pure vertical whitespace and inflate the
   card. Remove them inside the home grid (source card is ~464px, ours ~564px). */
.ow-product-grid ul.products > li.product br {
	display: none !important;
}

/* ---- (3) Price block: struck(regular) + current(sale) amounts -----------------
   The loop price is a <span class="price"> with `del  ·  ins` inline; on a card
   the two amounts were separated by only a literal space (~5px), reading as
   crammed. Give the struck amount a clear trailing gap. Never overlaps (verified
   del/ins bounding boxes are disjoint), this only widens the visual gutter. */
li.product .price del {
	margin-inline-end: 8px !important;
	opacity: .75;
}

/* ---- (4) Product-detail description bullet list ----------------------------
   Bullets rendered at 13px / 23.4px; lift to 15px with comfortable leading.
   (Body paragraphs already match the source at 16px — left untouched.) */
.woocommerce-Tabs-panel--description ul li,
.woocommerce-Tabs-panel--description ol li {
	font-size: 15px !important;
	line-height: 1.75 !important;
	margin-bottom: 6px;
}

/* == OWARIBIKI P0 layout fix (intent 1735) — end == */


/* Product-card buttons: one label, aligned to the bottom of the row. */
ul.products li.product {
	display: flex !important;
	flex-direction: column;
}
ul.products li.product > p {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	margin-top: auto;
	margin-bottom: 0;
}
ul.products li.product > p > a.button,
ul.products li.product a.ow-view-detail {
	margin-top: 12px !important;
	width: 100%;
	box-sizing: border-box;
	min-height: 48px;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	text-align: center;
}

ul.products li.product a.button.ow-view-detail {
	background-color: #05422D !important;
	color: #fff !important;
	border: 1px solid #05422D !important;
}
ul.products li.product a.button.ow-view-detail:hover {
	background-color: #03301f !important;
	color: #fff !important;
}

/* ow-archive-view-detail */

/* Category and other block product grids: same bottom line for 詳細を見る */
ul.wc-block-product-template > li.product {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start;
	height: 100%;
	box-sizing: border-box;
}
ul.wc-block-product-template > li.product > .wc-block-components-product-image,
ul.wc-block-product-template > li.product > .wp-block-post-title,
ul.wc-block-product-template > li.product > .wp-block-woocommerce-product-price {
	align-self: stretch;
	width: 100%;
	box-sizing: border-box;
}
ul.wc-block-product-template > li.product > .wp-block-woocommerce-product-price {
	margin-top: auto !important;
}
ul.wc-block-product-template > li.product > a.ow-view-detail {
	margin-top: 0 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 48px;
}
