/*
Theme Name:   Justbooks
Theme URI:    https://www.justbooks.myscicube.net/
Description:  義守書店 Justbooks — Storefront child theme for an e-reader shop.
Author:       義守書店 Justbooks
Template:     storefront
Version:      1.1.0
Text Domain:  justbooks
*/

:root {
	--jb-paper:   #f6f4ef;
	--jb-paper-2: #ece8df;
	--jb-card:    #ffffff;
	--jb-ink:     #1b1b1b;
	--jb-ink-2:   #5a574f;
	--jb-line:    #d9d4c8;
	--jb-seal:    #a8261d;
	--jb-seal-2:  #8a1e17;
	--jb-on-seal: #ffffff;
	--jb-radius:  6px;
	--jb-serif:   "Noto Serif TC", "Songti TC", "PMingLiU", serif;
	--jb-sans:    "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

/* ---------------------------------------------------------------- base */
body,
button, input, select, textarea { font-family: var(--jb-sans); }
body { background: var(--jb-paper); color: var(--jb-ink); }
h1, h2, h3, h4, .site-title, .jb-serif,
.woocommerce-loop-product__title, .product_title { font-family: var(--jb-serif); font-weight: 700; letter-spacing: .01em; }
a { color: var(--jb-seal); }
a:hover, a:focus { color: var(--jb-seal-2); }
.site-content { background: var(--jb-paper); }

/* ---------------------------------------------------------------- header */
.site-header { background: var(--jb-card); border-bottom: 1px solid var(--jb-line); padding-top: 1.25em; }
.site-header .site-branding .site-title a { color: var(--jb-ink); font-size: 1.6rem; }
.site-header .site-branding .site-description { color: var(--jb-ink-2); font-family: var(--jb-sans); }
.site-header .site-branding .site-title a::before {
	content: "義"; display: inline-grid; place-items: center;
	width: 1.5em; height: 1.5em; margin-right: .45em; vertical-align: -.25em;
	background: var(--jb-seal); color: var(--jb-on-seal); border-radius: 4px; font-size: .9em;
}
.storefront-primary-navigation { background: var(--jb-card); }
.main-navigation ul li a, .site-header-cart .cart-contents { color: var(--jb-ink); }
.main-navigation ul li a:hover, .main-navigation ul li.current-menu-item > a { color: var(--jb-seal); }
.site-search .widget_product_search form input[type=search] { background: var(--jb-paper); border: 1px solid var(--jb-line); }

/* ---------------------------------------------------------------- buttons */
button, input[type=button], input[type=reset], input[type=submit],
.button, .added_to_cart, .widget a.button, .wc-block-components-button:not(.is-link) {
	background: var(--jb-ink); border-color: var(--jb-ink); color: #fff; border-radius: var(--jb-radius); font-weight: 600;
}
button:hover, .button:hover, input[type=submit]:hover, .added_to_cart:hover { background: #000; border-color: #000; color: #fff; }
button.alt, .button.alt, .single_add_to_cart_button, .checkout-button, #place_order,
.wc-block-cart__submit-button, .wc-block-components-checkout-place-order-button {
	background: var(--jb-seal) !important; border-color: var(--jb-seal) !important; color: var(--jb-on-seal) !important;
}
button.alt:hover, .button.alt:hover, .single_add_to_cart_button:hover { background: var(--jb-seal-2) !important; border-color: var(--jb-seal-2) !important; }

/* ---------------------------------------------------------------- full-width shop */
.jb-full .content-area { width: 100%; float: none; margin-right: 0; }
.jb-full .widget-area { display: none; }

/* ---------------------------------------------------------------- product grid */
ul.products li.product {
	background: var(--jb-card); border: 1px solid var(--jb-line); border-radius: var(--jb-radius);
	padding: 1em 1em 1.25em; text-align: left; transition: box-shadow .15s, transform .15s;
}
ul.products li.product:hover { box-shadow: 0 6px 22px rgba(27,27,27,.08); transform: translateY(-2px); }
ul.products li.product img { margin-bottom: .75em; border-radius: 4px; }
ul.products li.product .woocommerce-loop-product__title { font-size: 1.05rem; color: var(--jb-ink); padding: 0; margin-bottom: .35em; }
ul.products li.product .price { color: var(--jb-ink); font-weight: 700; font-size: 1.05rem; margin-bottom: .25em; }
ul.products li.product .price del { color: var(--jb-ink-2); font-weight: 400; }
ul.products li.product .price ins { color: var(--jb-seal); text-decoration: none; }
ul.products li.product .button { width: 100%; text-align: center; margin-top: .6em; }
.onsale, .jb-member-flash {
	background: var(--jb-seal); color: var(--jb-on-seal); border: 0; border-radius: 3px;
	font-size: .75rem; font-weight: 700; padding: .2em .6em; letter-spacing: .05em;
}
.jb-brand-tag { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--jb-ink-2); margin-bottom: .2em; }
.jb-spec-line { display: block; font-size: .82rem; color: var(--jb-ink-2); margin: 0 0 .5em; line-height: 1.5; }

/* ---------------------------------------------------------------- member notes */
.jb-member-note { font-size: .82rem; color: var(--jb-ink-2); margin: 0 0 .4em; line-height: 1.5; }
.jb-member-note strong, .jb-member-note .amount { color: var(--jb-seal); }
.single-product .summary .jb-member-note {
	font-size: .95rem; background: var(--jb-paper-2); border-left: 3px solid var(--jb-seal);
	padding: .7em .9em; border-radius: 0 var(--jb-radius) var(--jb-radius) 0; margin: .5em 0 1.25em;
}
.jb-member-note--active { color: var(--jb-ink) !important; }

/* ---------------------------------------------------------------- single product */
.single-product div.product .product_title { font-size: 2rem; margin-bottom: .2em; }
.single-product div.product p.price { color: var(--jb-ink); font-size: 1.6rem; font-weight: 700; }
.single-product div.product p.price ins { color: var(--jb-seal); text-decoration: none; }
.single-product div.product .woocommerce-product-details__short-description { color: var(--jb-ink-2); }
.single-product div.product .woocommerce-product-gallery { background: var(--jb-card); border: 1px solid var(--jb-line); border-radius: var(--jb-radius); padding: 1em; }
.jb-keyspecs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5em; margin: 0 0 1.25em; padding: 0; list-style: none; }
.jb-keyspecs li { background: var(--jb-card); border: 1px solid var(--jb-line); border-radius: var(--jb-radius); padding: .55em .75em; margin: 0; }
.jb-keyspecs li span { display: block; font-size: .72rem; color: var(--jb-ink-2); letter-spacing: .05em; }
.jb-keyspecs li strong { font-size: .95rem; }
.jb-trust { list-style: none; margin: 1.25em 0 0; padding: 1em 0 0; border-top: 1px solid var(--jb-line); font-size: .88rem; color: var(--jb-ink-2); }
.jb-trust li { margin: 0 0 .35em; padding-left: 1.3em; position: relative; }
.jb-trust li::before { content: ""; position: absolute; left: 0; top: .55em; width: .55em; height: .55em; background: var(--jb-seal); border-radius: 50%; }

table.jb-spec-table { width: 100%; border-collapse: collapse; background: var(--jb-card); border: 1px solid var(--jb-line); border-radius: var(--jb-radius); overflow: hidden; margin: 0 0 1em; }
table.jb-spec-table th, table.jb-spec-table td { padding: .7em 1em; border-bottom: 1px solid var(--jb-line); text-align: left; vertical-align: top; font-size: .95rem; }
table.jb-spec-table tr:last-child th, table.jb-spec-table tr:last-child td { border-bottom: 0; }
table.jb-spec-table th { width: 32%; background: var(--jb-paper-2); font-weight: 600; color: var(--jb-ink); }
.jb-note { font-size: .8rem; color: var(--jb-ink-2); }

/* ---------------------------------------------------------------- filter chips */
.jb-chips { display: flex; flex-wrap: wrap; gap: .5em; margin: 0 0 1.75em; align-items: center; }
.jb-chips__label { font-size: .8rem; color: var(--jb-ink-2); margin-right: .25em; }
.jb-chips__sep { width: 1px; height: 1.4em; background: var(--jb-line); margin: 0 .35em; }
.jb-chip {
	display: inline-block; padding: .35em .9em; border: 1px solid var(--jb-line); border-radius: 999px;
	background: var(--jb-card); color: var(--jb-ink); font-size: .88rem; text-decoration: none; line-height: 1.4;
}
.jb-chip:hover { border-color: var(--jb-ink); color: var(--jb-ink); }
.jb-chip.is-active { background: var(--jb-ink); border-color: var(--jb-ink); color: #fff; }
.jb-chip small { color: inherit; opacity: .6; margin-left: .25em; }

/* ---------------------------------------------------------------- homepage */
.jb-home .site-main > *:not(:last-child) { margin-bottom: 0; }
.jb-section { padding: 3.5em 0; border-bottom: 1px solid var(--jb-line); }
.jb-section:last-child { border-bottom: 0; }
.jb-section__head { display: flex; justify-content: space-between; align-items: end; gap: 1em; margin-bottom: 1.5em; flex-wrap: wrap; }
.jb-section__head h2 { font-size: 1.75rem; margin: 0; }
.jb-section__head p { margin: .35em 0 0; color: var(--jb-ink-2); max-width: 42em; }
.jb-section__more { white-space: nowrap; font-weight: 600; text-decoration: none; }

.jb-hero { padding: 4em 0 3.5em; display: grid; grid-template-columns: 1.15fr 1fr; gap: 3em; align-items: center; }
.jb-hero__eyebrow { display: inline-block; font-size: .8rem; letter-spacing: .14em; color: var(--jb-seal); font-weight: 700; margin-bottom: 1em; }
.jb-hero h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.2; margin: 0 0 .5em; }
.jb-hero p { font-size: 1.1rem; color: var(--jb-ink-2); margin: 0 0 1.75em; max-width: 34em; }
.jb-hero__ctas { display: flex; gap: .75em; flex-wrap: wrap; }
.jb-hero__ctas .button { padding: .85em 1.6em; }
.jb-hero__ctas .button.jb-ghost { background: transparent; color: var(--jb-ink); border: 1px solid var(--jb-ink); }
.jb-hero__ctas .button.jb-ghost:hover { background: var(--jb-ink); color: #fff; }
.jb-hero__art { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75em; }
.jb-hero__art a { display: block; background: var(--jb-card); border: 1px solid var(--jb-line); border-radius: var(--jb-radius); padding: .5em; }
.jb-hero__art a:nth-child(2) { transform: translateY(1.5em); }
.jb-hero__art img { display: block; width: 100%; height: auto; }
.jb-hero__stats { display: flex; gap: 2em; margin-top: 2em; padding-top: 1.5em; border-top: 1px solid var(--jb-line); flex-wrap: wrap; }
.jb-hero__stats div { font-size: .85rem; color: var(--jb-ink-2); }
.jb-hero__stats strong { display: block; font-family: var(--jb-serif); font-size: 1.6rem; color: var(--jb-ink); line-height: 1.2; }

.jb-needs { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 1em; }
.jb-need {
	display: flex; flex-direction: column; background: var(--jb-card); border: 1px solid var(--jb-line); border-radius: var(--jb-radius);
	padding: 1.25em; text-decoration: none; color: var(--jb-ink); transition: border-color .15s, box-shadow .15s;
}
.jb-need:hover { border-color: var(--jb-ink); color: var(--jb-ink); box-shadow: 0 6px 22px rgba(27,27,27,.06); }
.jb-need__count { font-family: var(--jb-serif); font-size: 2rem; font-weight: 700; line-height: 1; color: var(--jb-seal); }
.jb-need__count small { font-size: .9rem; font-family: var(--jb-sans); color: var(--jb-ink-2); font-weight: 400; margin-left: .2em; }
.jb-need h3 { font-size: 1.1rem; margin: .6em 0 .25em; }
.jb-need p { font-size: .85rem; color: var(--jb-ink-2); margin: 0; }

.jb-member {
	display: grid; grid-template-columns: 1fr auto; gap: 2em; align-items: center;
	background: var(--jb-ink); color: #fff; border-radius: var(--jb-radius); padding: 2.25em 2.5em; margin: 3.5em 0;
}
.jb-member h2 { color: #fff; font-size: 1.6rem; margin: 0 0 .35em; }
.jb-member p { margin: 0; color: rgba(255,255,255,.75); }
.jb-member__figure { text-align: right; }
.jb-member__figure strong { display: block; font-family: var(--jb-serif); font-size: 2.4rem; color: #fff; line-height: 1.1; }
.jb-member__figure span { font-size: .85rem; color: rgba(255,255,255,.7); }
.jb-member .button { margin-top: 1.1em; background: var(--jb-seal); border-color: var(--jb-seal); }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--jb-card); border-top: 1px solid var(--jb-line); color: var(--jb-ink-2); }
.site-footer a { color: var(--jb-ink); }
.jb-footer-note { font-size: .85rem; }
.site-info { padding: 1.5em 0; }

/* ---------------------------------------------------------------- archive */
.woocommerce-products-header__title.page-title { font-size: 2rem; }
.term-description { color: var(--jb-ink-2); max-width: 46em; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
	.jb-needs { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 767px) {
	.jb-hero { grid-template-columns: 1fr; gap: 2em; padding: 2.25em 0 2em; }
	.jb-hero__art { order: -1; }
	.jb-hero__art a:nth-child(2) { transform: none; }
	.jb-needs { grid-template-columns: repeat(2, minmax(0,1fr)); }
	.jb-member { grid-template-columns: 1fr; padding: 1.75em 1.5em; }
	.jb-member__figure { text-align: left; }
	.jb-section { padding: 2.5em 0; }
	.jb-section__head h2 { font-size: 1.4rem; }
	.jb-keyspecs { grid-template-columns: 1fr 1fr; }
	table.jb-spec-table th { width: 38%; }
	table.jb-spec-table th, table.jb-spec-table td { padding: .6em .7em; font-size: .9rem; }
	.jb-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .4em; margin-left: -1em; margin-right: -1em; padding-left: 1em; padding-right: 1em; }
	.jb-chip { white-space: nowrap; }
	.jb-chips__sep { flex: 0 0 1px; }
	.site-header .site-branding .site-title a { font-size: 1.3rem; }

	/* Two-up product grid on phones; Storefront's clearfix pseudo-elements would become grid cells. */
	.site-main ul.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75em; }
	.site-main ul.products::before, .site-main ul.products::after { display: none; }
	.site-main ul.products li.product { width: auto !important; margin: 0 !important; float: none !important; padding: .6em .6em .8em; }
	ul.products li.product .woocommerce-loop-product__title { font-size: .92rem; }
	ul.products li.product .price { font-size: .95rem; }
	.jb-spec-line, .jb-member-note { font-size: .74rem; }
	ul.products li.product .button { padding: .55em .4em; font-size: .82rem; }
}

/* ---------------------------------------------------------------- v1.1: badges, gifts, options */
.jb-badges { display: flex; gap: .3em; margin: 0 0 .35em; }
.jb-badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; padding: .15em .5em; border-radius: 3px; line-height: 1.4; }
.jb-badge--new { background: var(--jb-ink); color: #fff; }
.jb-badge--pre { background: transparent; color: var(--jb-seal); border: 1px solid var(--jb-seal); }
.single-product .summary .jb-badges { margin-bottom: .6em; }
.jb-tagline { color: var(--jb-seal); font-weight: 600; margin: -.2em 0 .6em; }
.jb-gift { background: var(--jb-card); border: 1px dashed var(--jb-seal); border-radius: var(--jb-radius); padding: .85em 1em; margin: 0 0 1.25em; }
.jb-gift__title { font-size: .75rem; letter-spacing: .12em; color: var(--jb-seal); font-weight: 700; margin: 0 0 .25em; }
.jb-gift__item { font-weight: 600; margin: 0 0 .4em; }
.jb-gift__list { list-style: none; margin: 0 0 .4em; padding: 0; }
.jb-gift__list li { margin: 0 0 .2em; font-weight: 600; }
.jb-gift__list li span { display: inline-block; min-width: 3.5em; color: var(--jb-ink-2); font-weight: 400; margin-right: .5em; }
.jb-gift__how { font-size: .85rem; color: var(--jb-ink-2); margin: 0; }
.jb-gift__how a { white-space: nowrap; font-weight: 600; }
.jb-includes { font-size: .9rem; margin: 0 0 .75em; }
.jb-includes strong { display: inline-block; margin-right: .6em; color: var(--jb-ink-2); font-weight: 600; }
.jb-stock-note, .woocommerce-variation-description p { color: var(--jb-seal); font-size: .9rem; font-weight: 600; white-space: pre-line; }
.single-product div.product form.cart .variations { margin-bottom: .75em; }
.single-product div.product form.cart .variations select { min-width: 12em; padding: .5em .7em; border: 1px solid var(--jb-line); border-radius: var(--jb-radius); background: var(--jb-card); }
.single-product div.product .woocommerce-variation-price .price { font-size: 1.3rem; font-weight: 700; }
