/*
Theme Name: Walrus Classic
Description: Lightweight recreation of the original walrus.com.hk design (2017-2019 layout) on a clean, secure, SEO-friendly code base. No page builder.
Version: 2.0.2
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: walrus
*/

:root {
	--wr-orange: #f26e22;
	--wr-ink: #000;
	--wr-text: #303030;
	--wr-muted: #777;
	--wr-line: #e5e5e5;
	--wr-bar: #f6f6f6;
	--wr-foot: #1b1b1b;
	--wr-w: 1100px;
	--wr-font: "Microsoft JhengHei", "微軟正黑體", "PingFang TC", "Heiti TC", "Noto Sans TC", "Noto Sans CJK TC", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--wr-font); font-size: 15px; line-height: 26px; color: var(--wr-ink); background: #fff; }
img { max-width: 100%; height: auto; border: 0; vertical-align: middle; }
a { color: var(--wr-orange); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { color: var(--wr-text); font-weight: 600; margin: 0 0 .6em; line-height: 1.35; }
h2 { font-size: 24px; }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--wr-orange); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; clip-path: none; background: #fff; color: #000; padding: 8px 14px; }
.wr-wrap { width: var(--wr-w); max-width: calc(100% - 40px); margin: 0 auto; }

/* ---------- Header ---------- */
.wr-header { background: #fff; position: relative; z-index: 50; }
.wr-header .wr-wrap { display: flex; align-items: center; height: 120px; }
.wr-logo { flex: 0 0 auto; margin-right: 26px; line-height: 0; }
.wr-logo img { height: 64px; width: auto; }
.wr-nav { flex: 1 1 auto; height: 100%; }
.wr-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; height: 100%; }
.wr-nav > ul > li { position: relative; height: 100%; }
.wr-nav > ul > li > a { display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 0 17px 4px; color: #000; text-decoration: none; position: relative; }
.wr-nav .wr-l { font-size: 18px; font-weight: 600; line-height: 22px; white-space: nowrap; }
.wr-nav .wr-s { font-size: 11px; line-height: 14px; color: #777; margin-top: 3px; white-space: nowrap; }
.wr-nav > ul > li > a::after { content: ""; position: absolute; left: 17px; right: 17px; bottom: 18px; height: 2px; background: var(--wr-orange); transform: scaleX(0); transition: transform .2s ease; }
.wr-nav > ul > li.current > a::after, .wr-nav > ul > li:hover > a::after { transform: scaleX(1); }
.wr-nav ul ul { list-style: none; margin: 0; padding: 8px 0; position: absolute; top: 100%; left: 0; min-width: 180px; background: #262626; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s ease, transform .15s ease, visibility .15s; }
.wr-nav li:hover > ul, .wr-nav li:focus-within > ul { opacity: 1; visibility: visible; transform: none; }
.wr-nav ul ul a { display: block; padding: 7px 20px; color: #ccc; font-size: 13px; line-height: 20px; text-decoration: none; }
.wr-nav ul ul a:hover { color: #fff; }
.wr-search { position: relative; display: flex; align-items: center; margin: 0 8px 0 0; }
.wr-search-btn { background: none; border: 0; padding: 8px; cursor: pointer; color: #999; line-height: 0; }
.wr-search-btn svg { width: 14px; height: 14px; }
.wr-search form { position: absolute; right: 0; top: 100%; display: none; background: #fff; border: 1px solid var(--wr-line); padding: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.wr-search.open form { display: flex; }
.wr-search input[type=search] { width: 220px; font: inherit; font-size: 16px; padding: 6px 8px; border: 1px solid #ccc; }
.wr-lang { flex: 0 0 auto; display: flex; align-items: center; margin-left: auto; font-size: 13px; }
.wr-lang a { color: #000; display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; }
.wr-lang a[aria-current] { color: #000; }
.wr-lang span.sep { width: 1px; height: 16px; background: #000; margin: 0 10px; }
.wr-burger { display: none; }

/* ---------- Title bar ---------- */
.wr-titlebar { background: var(--wr-bar); }
.wr-titlebar .wr-wrap { min-height: 100px; padding: 18px 0; display: flex; flex-direction: column; justify-content: center; }
.wr-titlebar h1 { font-size: 20px; font-weight: 600; line-height: 26px; color: #303030; margin: 0 0 5px; }
.wr-crumbs { font-size: 15px; color: #595959; }
.wr-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.wr-crumbs li + li::before { content: ">"; margin: 0 6px; }
.wr-crumbs a { color: #595959; }
.wr-crumbs a:hover { color: #000; }

/* ---------- Layout ---------- */
.wr-main { padding: 45px 0 60px; }
.wr-cols { display: flex; gap: 46px; align-items: flex-start; }
.wr-side { flex: 0 0 205px; }
.wr-body { flex: 1 1 auto; min-width: 0; }
.wr-subnav { list-style: none; margin: 0; padding: 0; }
.wr-subnav li { border-bottom: 1px solid var(--wr-line); }
.wr-subnav a { display: block; padding: 8px 0; color: #000; font-size: 14px; }
.wr-subnav a[aria-current] { color: var(--wr-orange); }
.wr-page-body { max-width: 670px; }
.wr-page-body h2 { font-size: 17px; margin-top: 1.4em; }
.wr-page-body h3 { font-size: 16px; margin-top: 1.2em; }
.wr-page-body img { margin-bottom: 1em; }
.wr-page-body ul { padding-left: 1.2em; }

/* ---------- Category sidebar (accordion) ---------- */
.wr-catnav { list-style: none; margin: 0; padding: 0; }
.wr-catnav > li { border-bottom: 1px solid var(--wr-line); }
.wr-catnav summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 6px 0; }
.wr-catnav summary::-webkit-details-marker { display: none; }
.wr-catnav summary a, .wr-catnav > li > a { color: #000; font-weight: 600; font-size: 15px; line-height: 26px; display: block; padding: 0; }
.wr-catnav > li > a { padding: 6px 0; }
.wr-catnav .tog { width: 24px; text-align: center; font-size: 16px; color: #000; }
.wr-catnav details[open] .tog { transform: rotate(45deg); }
.wr-catnav ul { list-style: none; margin: 0 0 8px; padding: 0 0 0 12px; }
.wr-catnav ul a { display: block; color: #555; font-size: 14px; padding: 3px 0; }
.wr-catnav a[aria-current] { color: var(--wr-orange); }
.wr-count { text-align: right; margin: -10px 0 18px; }

/* ---------- Product grid ---------- */
.wr-pgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 46px 18px; }
.wr-pgrid a { display: block; text-align: center; color: var(--wr-text); text-decoration: none; }
.wr-pgrid .im { display: block; aspect-ratio: 1; overflow: hidden; }
.wr-pgrid .im img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s ease; }
.wr-pgrid a:hover .im img { transform: scale(1.06); }
.wr-pgrid .md, .wr-pgrid .nm { display: block; font-size: 15px; font-weight: 500; line-height: 20px; }
.wr-pgrid .md { margin-top: 12px; }
.wr-ctiles .nm { margin-top: 12px; font-weight: 600; }

/* ---------- Single product ---------- */
.wr-prod { display: flex; gap: 40px; align-items: flex-start; padding-bottom: 15px; border-bottom: 1px solid rgba(0,0,0,.22); }
.wr-gal { flex: 0 0 48%; display: flex; gap: 14px; align-items: center; padding-left: 4%; }
.wr-thumbs { flex: 0 0 88px; display: flex; flex-direction: column; gap: 6px; }
.wr-thumbs button { padding: 0; border: 1px solid transparent; background: #fff; cursor: pointer; line-height: 0; }
.wr-thumbs button[aria-pressed=true] { border-color: #ccc; }
.wr-thumbs img { width: 86px; height: 82px; object-fit: cover; }
.wr-stage { flex: 1 1 auto; text-align: center; position: relative; }
.wr-stage img { max-height: 420px; width: auto; }
.wr-zoom { display: inline-block; margin-top: 18px; color: #000; line-height: 0; }
.wr-zoom svg { width: 22px; height: 22px; }
.wr-info { flex: 1 1 auto; min-width: 0; padding-top: 10px; }
.wr-info h2 { font-size: 24px; color: var(--wr-text); margin-bottom: 26px; }
.wr-spec { width: 95%; margin: 0; }
.wr-spec dt { background: rgba(128,128,128,.22); font-weight: 600; font-size: 16.5px; line-height: 24px; padding: 2px 10px; color: #000; }
.wr-spec dd { margin: 0; padding: 4px 10px 20px; }
.wr-spec dd ul { margin: 0; padding-left: 1.2em; }
.wr-spec dd li { padding-top: 0; }
.wr-inl { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 4px 5px 12px; }
.wr-inl .lb { font-weight: 600; font-size: 16.5px; min-width: 70px; }
.wr-inl a[href$=".pdf"] { display: inline-flex; align-items: center; gap: 0; }
.wr-inl a[href$=".pdf"]::before { content: ""; width: 30px; height: 30px; background: url(assets/pdf.jpg) center / 30px 30px no-repeat; }
.wr-inl img { width: 40px; height: auto; margin-right: 4px; }
.wr-buy { margin: 6px 5px 0; }

/* ---------- Home ---------- */
.wr-hero { position: relative; height: 600px; overflow: hidden; background: #eee; }
.wr-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.wr-hero img.on { opacity: 1; }
.wr-hero-dots { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 10px; }
.wr-hero-dots button { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; background: transparent; padding: 0; cursor: pointer; }
.wr-hero-dots button[aria-pressed=true] { background: #fff; }
.wr-cards { display: flex; justify-content: center; gap: 30px; padding: 20px 0 52px; }
.wr-card { width: 221px; background: #777; color: #fff; text-decoration: none; display: block; }
.wr-card:hover { text-decoration: none; background: #6a6a6a; }
.wr-card img { width: 221px; height: 206px; object-fit: cover; display: block; }
.wr-card .tx { display: block; padding: 14px 7px 16px; min-height: 127px; }
.wr-card .h { display: block; font-size: 20px; font-weight: 500; line-height: 26px; margin-bottom: 10px; color: #fff; }
.wr-card .d { display: block; font-size: 15px; line-height: 21px; color: #fff; }
.wr-card .d::after { content: " \203A"; font-weight: 700; }
.wr-note { border-top: 1px solid #eee; text-align: center; font-style: italic; font-size: 14px; padding: 2px 10px; margin: 0; }

/* ---------- News ---------- */
.wr-news { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.wr-news a { color: var(--wr-text); }
.wr-news h2 { font-size: 17px; margin: 10px 0 4px; }
.wr-news time { font-size: 13px; color: var(--wr-muted); }
.wr-pager { margin-top: 30px; display: flex; gap: 8px; }
.wr-pager .page-numbers { padding: 2px 9px; border: 1px solid var(--wr-line); color: #000; }
.wr-pager .current { background: var(--wr-orange); color: #fff; border-color: var(--wr-orange); }

/* ---------- Forms (CF7) ---------- */
.wpcf7 label { display: block; margin-bottom: 12px; }
.wpcf7 input[type=text], .wpcf7 input[type=email], .wpcf7 input[type=tel], .wpcf7 textarea { width: 100%; font: inherit; font-size: 16px; padding: 7px 10px; border: 0; background: #f2f2f2; }
.wpcf7 input[type=submit] { background: var(--wr-orange); color: #fff; border: 0; padding: 8px 28px; font: inherit; cursor: pointer; }

.wpcf7 fieldset.hidden-fields-container { display: none; border: 0; padding: 0; margin: 0; }
.wpcf7 select { font: inherit; padding: 4px 6px; }
.wpcf7-not-valid-tip { color: #c00; font-size: 13px; }
.wr-page-body:has(.wp-block-columns) { max-width: none; }
.wr-page-body .wp-block-columns { gap: 40px; }
.wr-page-body .wp-block-button__link { display: inline-block; background: #c2510f; color: #fff; padding: 7px 22px; border-radius: 0; text-decoration: none; }

/* ---------- Footer ---------- */
.wr-footer { background: var(--wr-foot); color: #fff; font-size: 12px; font-weight: 300; }
.wr-footer .in { position: relative; display: flex; align-items: center; min-height: 83px; padding: 10px 100px 22px; }
.wr-footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.wr-footer nav li + li::before { content: "|"; margin: 0 10px; color: #aaa; }
.wr-footer a { color: #fff; text-transform: uppercase; }
.wr-footer .cp { position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; margin: 0; }
.wr-top { position: fixed; right: 22px; bottom: 22px; width: 42px; height: 42px; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; opacity: 0; visibility: hidden; transition: opacity .2s; }
.wr-top.show { opacity: 1; visibility: visible; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
	.wr-header .wr-wrap { height: 80px; }
	.wr-logo img { height: 36px; }
	.wr-burger { display: block; margin-left: 12px; background: none; border: 0; padding: 10px; cursor: pointer; }
	.wr-burger span { display: block; width: 22px; height: 2px; background: #000; margin: 4px 0; }
	.wr-nav { position: absolute; top: 80px; left: 0; right: 0; height: auto; background: #fff; border-top: 1px solid var(--wr-line); display: none; box-shadow: 0 8px 18px rgba(0,0,0,.08); }
	.wr-header.open .wr-nav { display: block; }
	.wr-nav > ul { flex-direction: column; height: auto; }
	.wr-nav > ul > li { height: auto; border-bottom: 1px solid var(--wr-line); }
	.wr-nav > ul > li > a { flex-direction: row; align-items: baseline; gap: 10px; padding: 12px 20px; }
	.wr-nav > ul > li > a::after { display: none; }
	.wr-nav ul ul { position: static; opacity: 1; visibility: visible; transform: none; background: #f7f7f7; padding: 0 0 6px 20px; }
	.wr-nav ul ul a { color: #444; }
	.wr-search { margin-left: auto; }
	.wr-lang { margin-left: 4px; }
	.wr-lang .t { display: none; }
	.wr-cols { flex-direction: column; gap: 26px; }
	.wr-side { flex: none; width: 100%; }
	.wr-side:has(.wr-catnav) { order: 2; }
	.wr-pgrid { grid-template-columns: repeat(3, 1fr); }
	.wr-prod { flex-direction: column; }
	.wr-gal { flex: none; width: 100%; padding-left: 0; }
	.wr-hero { height: auto; aspect-ratio: 2048 / 841; }
	.wr-news { grid-template-columns: repeat(2, 1fr); }
	.wr-footer .in { flex-direction: column; padding: 18px 20px; gap: 8px; }
	.wr-footer .cp { position: static; }
}
@media (max-width: 600px) {
	.wr-pgrid { grid-template-columns: repeat(2, 1fr); gap: 30px 12px; }
	.wr-cards { flex-direction: column; align-items: center; gap: 20px; }
	.wr-gal { flex-direction: column-reverse; }
	.wr-thumbs { flex-direction: row; flex: none; }
	.wr-news { grid-template-columns: 1fr; }
	.wr-spec { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
