/* ------------------------------------------------------------------
   HOLY WOOD - front-end skin (Bootstrap 5 layer)
   維持原站棕／米色系與版面骨架，改為 RWD。
   ------------------------------------------------------------------ */

:root {
  --hw-brown-dark: #2e1d07;
  --hw-brown: #5d3c0f;
  --hw-brown-soft: #665440;
  --hw-beige: #ded4c8;
  --hw-beige-light: #f3efe8;
  --hw-line: #e2ddd4;
  --hw-text: #4f4a44;
  --hw-muted: #797979;
  --hw-accent: #c00000;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Trebuchet MS", "Century Gothic", Arial, Helvetica, "Microsoft JhengHei", sans-serif;
  font-size: 0.9rem;
  color: var(--hw-text);
  background: #fff url("../../images/bk.jpg") repeat-x left top;
}

a { color: var(--hw-brown); text-decoration: none; }
a:hover, a:focus { color: var(--hw-accent); text-decoration: underline; }

.hw-skip {
  position: absolute; top: .5rem; left: .5rem; z-index: 1080;
  background: #fff; padding: .4rem .8rem; border-radius: .25rem;
}

/* ------------------------------------------------------------ header */
.hw-header {
  background: linear-gradient(180deg, #241705 0, #4b3313 14%, #93795a 45%, #cdbb9f 78%, #efe7da 100%);
  border-bottom: 1px solid #c9bda9;
}

.hw-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 108px;
  padding: .75rem 0;
}

.hw-brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.hw-brand:hover { text-decoration: none; }
.hw-brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

.hw-brand-text { line-height: 1.1; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55); }
.hw-brand-text strong { display: block; font-size: 1.5rem; letter-spacing: .06em; }
.hw-brand-text em { display: block; font-size: .74rem; font-style: normal; letter-spacing: .18em; color: #f0e3cf; }

.hw-header-tag {
  color: #fffaf0;
  font-size: .78rem;
  letter-spacing: .2em;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
  align-self: center;
}

.hw-banner {
  margin-left: auto;
  width: 320px;
  height: 96px;
}
.hw-banner .carousel-item { height: 96px; }
.hw-banner img {
  height: 96px;
  width: auto;
  max-width: 100%;
  display: block;
  margin-left: auto;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.35));
}

/* --------------------------------------------------------------- nav */
.hw-nav {
  background: var(--hw-beige);
  border-bottom: 3px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  padding-top: 0;
  padding-bottom: 0;
}
.hw-nav .nav-link {
  color: #3d2f1c;
  font-weight: 600;
  font-size: .86rem;
  padding: .7rem .85rem;
  border-right: 1px solid rgba(255,255,255,.6);
}
.hw-nav .nav-link:hover,
.hw-nav .nav-link:focus { background: #efe8de; color: var(--hw-accent); text-decoration: none; }
.hw-nav .nav-link.active { background: var(--hw-brown); color: #fff; }
.hw-nav .navbar-toggler { border-color: #b9ac99; padding: .25rem .5rem; margin: .4rem 0; }
.hw-nav-title { font-weight: 700; color: #3d2f1c; letter-spacing: .1em; font-size: .8rem; }

.hw-badge { background: var(--hw-accent); color: #fff; font-size: .68rem; vertical-align: text-top; }

.hw-search { gap: .35rem; padding: .4rem 0; }
.hw-search .form-control { min-width: 9rem; }
.hw-btn {
  background: var(--hw-brown);
  border: 1px solid var(--hw-brown-dark);
  color: #fff;
}
.hw-btn:hover, .hw-btn:focus { background: var(--hw-brown-dark); color: #fff; }

/* ---------------------------------------------------------- titlebar */
.hw-titlebar {
  background: linear-gradient(180deg, #fdfcfa 0, var(--hw-beige-light) 100%);
  border-bottom: 1px solid var(--hw-line);
  padding: .6rem 0;
}
.hw-page-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #2f2416;
  letter-spacing: .02em;
}
.hw-crumbs .breadcrumb { font-size: .8rem; margin: 0; }
.hw-crumbs .breadcrumb-item.active { color: var(--hw-muted); }

/* -------------------------------------------------------------- body */
.hw-body { padding: 1.5rem 0 2.5rem; }

/* ----------------------------------------------------------- sidebar */
.hw-side {
  background: #fff;
  border: 1px solid var(--hw-line);
  border-radius: .35rem;
  overflow: hidden;
}
.hw-side-img { display: block; width: 100%; height: auto; }

/* 手機版的收合按鈕（桌機用 d-lg-none 隱藏） */
.hw-side-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  width: 100%;
  padding: .75rem .9rem;
  border: 0;
  background: var(--hw-brown);
  color: #fff;
  font-weight: 700;
  font-size: .86rem;
  letter-spacing: .03em;
  text-align: left;
  line-height: 1.3;
}
.hw-side-toggle:hover, .hw-side-toggle:focus { background: var(--hw-brown-dark); color: #fff; }
.hw-side-toggle .hw-caret { flex: 0 0 auto; transition: transform .2s ease; }
.hw-side-toggle[aria-expanded="true"] .hw-caret { transform: rotate(180deg); }
.hw-side-toggle-text { overflow: hidden; text-overflow: ellipsis; }

.hw-side-list { list-style: none; margin: 0; padding: 0; }
.hw-side-list li { border-bottom: 1px solid #eee9e1; }
.hw-side-list li:last-child { border-bottom: 0; }
.hw-side-list a {
  display: block;
  padding: .58rem .75rem .58rem 1.9rem;
  font-size: .84rem;
  font-weight: 600;
  font-style: italic;
  color: #111;
  background: url("../../images/left-icon.jpg") no-repeat .5rem center;
  background-size: 14px 14px;
}
.hw-side-list a:hover, .hw-side-list a:focus {
  background-image: url("../../images/left-icon-O.jpg");
  background-color: #faf7f2;
  color: var(--hw-brown);
  text-decoration: none;
}
.hw-side-list li.active > a { background-color: #f2ece2; color: var(--hw-brown); }
.hw-side-list li.hw-side-sub a { padding-left: 2.6rem; font-weight: 400; font-size: .8rem; }

/* ---------------------------------------------------------- contents */
.hw-content { line-height: 1.75; }
.hw-content img { max-width: 100%; height: auto; }
.hw-content table { max-width: 100%; }
.hw-content p { color: #333; }

/* 舊後台編輯器產生的固定寬度表格，在手機上可以橫向捲動 */
.hw-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.hw-section-title {
  background: var(--hw-brown);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .4rem .75rem;
  border-radius: .25rem;
  margin: 1.5rem 0 .75rem;
}

/* ------------------------------------------------------ product grid */
.hw-card {
  height: 100%;
  border: 1px dashed #d8d1c6;
  border-radius: .35rem;
  background: #fff;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.hw-card:hover { border-color: var(--hw-brown); box-shadow: 0 .25rem .75rem rgba(93,60,15,.15); }
.hw-card a { display: block; height: 100%; padding: .6rem; text-align: center; color: #3d3831; }
.hw-card a:hover { text-decoration: none; color: var(--hw-brown); }
.hw-card-img {
  background: url("../../images/pro_bk.jpg") repeat-x top #f3f0ec;
  border: 1px solid #e6e0d6;
  border-radius: .25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  margin-bottom: .5rem;
}
.hw-card-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hw-card-title { font-size: .82rem; font-weight: 600; line-height: 1.35; word-break: break-word; }
.hw-card-serial { display: block; font-size: .74rem; color: var(--hw-muted); font-weight: 400; }

/* ---------------------------------------------------- product detail */
.hw-gallery-main {
  border: 1px solid #ddd6ca;
  border-radius: .35rem;
  background: #fff;
  padding: .5rem;
  text-align: center;
}
.hw-gallery-main img { max-width: 100%; height: auto; }
.hw-thumb {
  border: 1px dashed #e2e2e2;
  padding: 3px;
  background: #fff;
  border-radius: .25rem;
}
.hw-thumb.active, .hw-thumb:hover { border-color: var(--hw-brown); }
.hw-thumb img { width: 74px; height: 60px; object-fit: contain; display: block; }

.hw-meta { list-style: none; padding: 0; margin: 0 0 1rem; }
.hw-meta li { padding: .35rem 0; border-bottom: 1px dotted var(--hw-line); font-size: .88rem; }
.hw-meta strong { color: #2f2416; display: inline-block; min-width: 8.5rem; }

.hw-actions .btn { --bs-btn-font-size: .8rem; }

/* ------------------------------------------------------------ tables */
.hw-table { font-size: .85rem; }
.hw-table > thead > tr > th {
  background: var(--hw-brown-soft) url("../../images/detailBK.jpg") repeat;
  color: #fff;
  font-weight: 600;
  border-color: #56472f;
  white-space: nowrap;
}
.hw-table > tbody > tr > td { vertical-align: middle; }

/* ------------------------------------------------------------- forms */
.hw-form-card {
  background: #fff;
  border: 1px solid var(--hw-line);
  border-radius: .35rem;
  padding: 1.25rem;
}
.hw-req { color: var(--hw-accent); }
.hw-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-label { font-weight: 600; font-size: .84rem; color: #3d3831; margin-bottom: .25rem; }
.form-control, .form-select { font-size: .88rem; }

.hw-side-photo { max-width: 100%; height: auto; border-radius: .35rem; }

/* ------------------------------------------------------------ footer */
.hw-footer { background: #fafafa; border-top: 1px solid #eee; margin-top: 2rem; }
.hw-footer-nav { background: #fff; border-bottom: 5px solid #f7f7f7; }
.hw-footer-nav ul { padding: .6rem 0; text-align: center; }
.hw-footer-nav .list-inline-item { margin: 0; }
.hw-footer-nav a {
  display: inline-block;
  padding: .15rem .6rem;
  border-right: 1px solid #e1e1e1;
  font-size: .8rem;
  color: #4b4237;
}
.hw-footer-nav .list-inline-item:last-child a { border-right: 0; }
.hw-footer-info { padding: 1.25rem 0 1.5rem; text-align: center; }
.hw-footer-text { font-size: .8rem; color: #0e0e0e; line-height: 1.8; }
.hw-footer-text p { margin-bottom: .25rem; }
.hw-copy { font-size: .72rem; color: #8b8b8b; margin-top: .75rem; }

/* ------------------------------------------------------- back to top */
.hw-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1030;
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--hw-brown);
  color: #fff;
  border: 0;
  box-shadow: 0 .25rem .5rem rgba(0,0,0,.25);
}
.hw-top:hover { background: var(--hw-brown-dark); color: #fff; }
.hw-top.show { display: block; }

/* --------------------------------------------------------- responsive */
@media (max-width: 991.98px) {
  .hw-header-inner { min-height: 84px; }
  .hw-brand-text strong { font-size: 1.2rem; }
  .hw-nav .nav-link { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.6); }
  .hw-search { padding-bottom: .75rem; }
  /* 分類多的時候不要把整頁撐長，選單自己捲 */
  .hw-side-list { max-height: 60vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .hw-body { padding-top: 1rem; }
}

@media (max-width: 575.98px) {
  .hw-page-title { font-size: 1.1rem; }
  .hw-brand img { width: 46px; height: 46px; }
  .hw-brand-text strong { font-size: 1.05rem; }
  .hw-meta strong { display: block; min-width: 0; }
}

/* ------------------------------------------------------------- print */
@media print {
  .hw-nav, .hw-footer-nav, .hw-top, .hw-actions, .hw-side, .hw-banner, .hw-crumbs, .hw-skip { display: none !important; }
  body { background: #fff; }
  .hw-header { background: #fff; border-bottom: 1px solid #999; }
  .hw-brand-text { color: #000; text-shadow: none; }
  .hw-brand-text em { color: #444; }
  a[href]:after { content: ""; }
}
