/*
Theme Name: 如意寶晨
Theme URI: https://example.com/ruyibaochen
Author: 如意寶晨
Description: 為如意寶晨唐卡與宗教藝術收藏品商店製作的 WooCommerce 響應式主題。
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: ruyibaochen
Tags: e-commerce, custom-logo, custom-menu, featured-images, translation-ready
*/

:root {
  --rybc-ink: #211d18;
  --rybc-muted: #6d655b;
  --rybc-red: #7b2624;
  --rybc-red-dark: #541715;
  --rybc-gold: #b59658;
  --rybc-gold-soft: #d9c391;
  --rybc-ivory: #f7f2e8;
  --rybc-paper: #fffdf8;
  --rybc-line: rgba(87, 64, 35, 0.18);
  --rybc-shadow: 0 18px 50px rgba(62, 44, 24, 0.11);
  --rybc-radius: 4px;
  --rybc-container: 1240px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--rybc-ink);
  background: var(--rybc-paper);
  font-family: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--rybc-red);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.button,
input[type="submit"],
.wp-element-button,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.74rem 1.4rem;
  border: 1px solid var(--rybc-red);
  border-radius: 0;
  color: #fff;
  background: var(--rybc-red);
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

button:hover,
.button:hover,
input[type="submit"]:hover,
.wp-element-button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover {
  color: #fff;
  background: var(--rybc-red-dark);
  transform: translateY(-1px);
}

.rybc-button--ghost {
  color: var(--rybc-ink);
  border-color: var(--rybc-gold);
  background: transparent;
}

.rybc-button--ghost:hover {
  color: #fff;
  border-color: var(--rybc-red);
  background: var(--rybc-red);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 5px;
  left: 5px;
  width: auto;
  height: auto;
  padding: 15px 23px 14px;
  clip: auto;
  color: var(--rybc-ink);
  background: #fff;
}

.rybc-container {
  width: min(calc(100% - 40px), var(--rybc-container));
  margin-inline: auto;
}

.rybc-topbar {
  color: #f8ecd4;
  background: var(--rybc-red-dark);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
}

.rybc-topbar__inner {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.rybc-site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid var(--rybc-line);
  background: rgba(255, 253, 248, 0.96);
  backdrop-filter: blur(14px);
}

.admin-bar .rybc-site-header {
  top: 32px;
}

.rybc-header__inner {
  display: grid;
  min-height: 92px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.rybc-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-self: center;
  line-height: 1;
}

.rybc-brand__name {
  color: var(--rybc-red-dark);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
}

.rybc-brand__en {
  margin-top: 0.55rem;
  color: var(--rybc-muted);
  font-family: Georgia, serif;
  font-size: 0.57rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.rybc-navigation {
  justify-self: start;
}

.rybc-menu {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2vw, 1.8rem);
  padding: 0;
  margin: 0;
  list-style: none;
}

.rybc-menu a {
  position: relative;
  display: block;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.rybc-menu a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--rybc-red);
  transform: scaleX(0);
  transition: transform 180ms ease;
}

.rybc-menu a:hover::after,
.rybc-menu .current-menu-item > a::after {
  transform: scaleX(1);
}

.rybc-header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 0.9rem;
}

.rybc-header-actions a,
.rybc-menu-toggle {
  display: inline-flex;
  min-width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: var(--rybc-ink);
  background: transparent;
}

.rybc-header-actions a:hover,
.rybc-menu-toggle:hover {
  color: var(--rybc-red);
  background: transparent;
  transform: none;
}

.rybc-cart {
  position: relative;
}

.rybc-cart__count {
  position: absolute;
  top: -3px;
  right: -5px;
  display: flex;
  width: 17px;
  height: 17px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--rybc-red);
  font-family: Arial, sans-serif;
  font-size: 10px;
}

.rybc-currency {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--rybc-line);
  color: var(--rybc-muted);
  font-family: Arial, sans-serif;
  font-size: 0.73rem;
  line-height: 1;
}

.rybc-menu-toggle {
  display: none;
}

.rybc-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(247, 242, 232, 0.98) 0%, rgba(247, 242, 232, 0.92) 44%, rgba(247, 242, 232, 0.38) 72%),
    repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(181, 150, 88, 0.06) 20px, rgba(181, 150, 88, 0.06) 21px);
}

.rybc-hero::after {
  position: absolute;
  top: -240px;
  right: -130px;
  width: 640px;
  height: 640px;
  border: 1px solid rgba(181, 150, 88, 0.26);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 38px rgba(181, 150, 88, 0.04), 0 0 0 76px rgba(181, 150, 88, 0.03);
}

.rybc-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: min(720px, calc(100vh - 126px));
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: 5vw;
  padding-block: 70px;
}

.rybc-eyebrow {
  margin: 0 0 1rem;
  color: var(--rybc-red);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.rybc-hero h1 {
  max-width: 720px;
  margin: 0;
  color: var(--rybc-red-dark);
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.12;
}

.rybc-hero__lead {
  max-width: 590px;
  margin: 1.6rem 0 0;
  color: var(--rybc-muted);
  font-size: clamp(1rem, 1.5vw, 1.2rem);
}

.rybc-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2.2rem;
}

.rybc-hero__visual {
  position: relative;
  min-height: 520px;
}

.rybc-hero__frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(66%, 430px);
  padding: 18px;
  border: 1px solid var(--rybc-gold);
  background: #fff;
  box-shadow: var(--rybc-shadow);
  transform: translate(-50%, -50%);
}

.rybc-hero__frame::before,
.rybc-hero__frame::after {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(181, 150, 88, 0.35);
  content: "";
  pointer-events: none;
}

.rybc-hero__frame::after {
  inset: -16px;
  border-color: rgba(123, 38, 36, 0.18);
}

.rybc-hero__frame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

.rybc-hero__placeholder {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  place-items: center;
  color: var(--rybc-red-dark);
  background:
    radial-gradient(circle at 50% 50%, rgba(181, 150, 88, 0.24) 0 2px, transparent 3px),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 38px, rgba(181, 150, 88, 0.14) 39px 40px);
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
}

.rybc-trustbar {
  border-block: 1px solid var(--rybc-line);
  background: #fff;
}

.rybc-trustbar__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.rybc-trustbar__item {
  padding: 1.05rem 1.5rem;
  text-align: center;
  font-size: 0.88rem;
  letter-spacing: 0.07em;
}

.rybc-trustbar__item + .rybc-trustbar__item {
  border-left: 1px solid var(--rybc-line);
}

.rybc-section {
  padding-block: clamp(70px, 9vw, 120px);
}

.rybc-section--ivory {
  background: var(--rybc-ivory);
}

.rybc-section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.rybc-section__head h2,
.rybc-story h2,
.rybc-entry h1,
.woocommerce-products-header__title {
  margin: 0;
  color: var(--rybc-red-dark);
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 600;
  line-height: 1.25;
}

.rybc-section__head p {
  max-width: 560px;
  margin: 0;
  color: var(--rybc-muted);
}

.rybc-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rybc-line);
  border: 1px solid var(--rybc-line);
}

.rybc-category-card {
  position: relative;
  display: flex;
  min-height: 270px;
  flex-direction: column;
  justify-content: end;
  padding: 2rem;
  overflow: hidden;
  background: #fff;
}

.rybc-category-card::before {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(181, 150, 88, 0.34);
  border-radius: 50%;
  content: "";
  box-shadow: inset 0 0 0 16px rgba(181, 150, 88, 0.04);
  transition: transform 250ms ease;
}

.rybc-category-card:hover::before {
  transform: scale(1.12) rotate(12deg);
}

.rybc-category-card__index {
  color: var(--rybc-gold);
  font-family: Georgia, serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.rybc-category-card h3 {
  margin: 0.45rem 0 0.3rem;
  color: var(--rybc-red-dark);
  font-size: 1.45rem;
  font-weight: 600;
}

.rybc-category-card p {
  margin: 0;
  color: var(--rybc-muted);
  font-size: 0.9rem;
}

.rybc-products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2.4vw, 2rem);
}

.rybc-product-card {
  min-width: 0;
}

.rybc-product-card__image {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--rybc-line);
  background: #fff;
}

.rybc-product-card__image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  transition: transform 300ms ease;
}

.rybc-product-card:hover .rybc-product-card__image img {
  transform: scale(1.035);
}

.rybc-product-card__status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 0.25rem 0.55rem;
  color: #fff;
  background: rgba(84, 23, 21, 0.9);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.rybc-product-card__body {
  padding-top: 1rem;
}

.rybc-product-card__category {
  color: var(--rybc-gold);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.rybc-product-card h3 {
  margin: 0.35rem 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
}

.rybc-product-card .price,
.woocommerce ul.products li.product .price {
  color: var(--rybc-red);
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
}

.rybc-empty-state {
  grid-column: 1 / -1;
  padding: 4rem 2rem;
  border: 1px solid var(--rybc-line);
  text-align: center;
  background: #fff;
}

.rybc-story {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(3rem, 8vw, 8rem);
}

.rybc-story__art {
  position: relative;
  min-height: 480px;
  background:
    linear-gradient(rgba(84, 23, 21, 0.84), rgba(84, 23, 21, 0.84)),
    repeating-linear-gradient(45deg, transparent 0 20px, rgba(255, 255, 255, 0.08) 20px 21px);
}

.rybc-story__art::before {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(217, 195, 145, 0.75);
  content: "";
}

.rybc-story__seal {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 170px;
  height: 170px;
  place-items: center;
  border: 1px solid var(--rybc-gold-soft);
  border-radius: 50%;
  color: #f5e7c7;
  font-size: 2rem;
  letter-spacing: 0.18em;
  text-align: center;
  transform: translate(-50%, -50%);
}

.rybc-story__content p {
  color: var(--rybc-muted);
}

.rybc-story__content .rybc-button--ghost {
  margin-top: 1rem;
}

.rybc-newsletter {
  color: #f8ecd4;
  background: var(--rybc-red-dark);
}

.rybc-newsletter__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 3rem;
  padding-block: 3.8rem;
}

.rybc-newsletter h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.rybc-newsletter p {
  margin: 0.6rem 0 0;
  color: rgba(248, 236, 212, 0.78);
}

.rybc-site-main {
  min-height: 45vh;
}

.rybc-content {
  padding-block: clamp(55px, 8vw, 100px);
}

.rybc-entry {
  width: min(calc(100% - 40px), 850px);
  margin-inline: auto;
}

.rybc-entry__content {
  margin-top: 2rem;
}

.rybc-entry__content h2,
.rybc-entry__content h3 {
  color: var(--rybc-red-dark);
}

.rybc-entry__content a {
  color: var(--rybc-red);
  text-decoration: underline;
}

.rybc-site-footer {
  color: #ddd0b9;
  background: #211a15;
}

.rybc-footer__grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 3rem;
  padding-block: 68px 55px;
}

.rybc-footer__brand .rybc-brand {
  align-items: flex-start;
}

.rybc-footer__brand .rybc-brand__name {
  color: #f7e7c7;
}

.rybc-footer__brand .rybc-brand__en {
  color: #a99d8b;
}

.rybc-footer__brand p {
  max-width: 360px;
  color: #a99d8b;
  font-size: 0.9rem;
}

.rybc-footer__column h2 {
  margin: 0 0 1rem;
  color: #f7e7c7;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
}

.rybc-footer__column ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.rybc-footer__column li {
  margin: 0.45rem 0;
}

.rybc-footer__column a,
.rybc-footer__column p {
  color: #a99d8b;
  font-size: 0.86rem;
}

.rybc-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding-block: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #857a6b;
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
}

.woocommerce .woocommerce-breadcrumb {
  margin: 0 0 2rem;
  color: var(--rybc-muted);
  font-size: 0.82rem;
}

.woocommerce-products-header {
  margin-bottom: 2rem;
}

.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.woocommerce ul.products::before,
.woocommerce ul.products::after {
  display: none;
}

.woocommerce ul.products li.product {
  float: none;
  width: auto;
  margin: 0;
}

.woocommerce ul.products li.product a img {
  margin: 0 0 1rem;
  border: 1px solid var(--rybc-line);
  background: #fff;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title {
  padding: 0;
  color: var(--rybc-ink);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
}

.woocommerce span.onsale {
  min-width: auto;
  min-height: auto;
  padding: 0.35rem 0.65rem;
  border-radius: 0;
  background: var(--rybc-red);
  line-height: 1.4;
}

.woocommerce div.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  gap: clamp(2.5rem, 6vw, 6rem);
}

.woocommerce div.product div.images,
.woocommerce div.product div.summary {
  float: none;
  width: auto;
}

.woocommerce div.product .product_title {
  color: var(--rybc-red-dark);
  font-size: clamp(1.8rem, 3.8vw, 3rem);
  line-height: 1.3;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--rybc-red);
  font-family: Arial, sans-serif;
  font-size: 1.35rem;
}

.woocommerce div.product .woocommerce-product-details__short-description {
  color: var(--rybc-muted);
}

.woocommerce div.product .woocommerce-tabs,
.woocommerce div.product .related {
  grid-column: 1 / -1;
}

.woocommerce div.product .woocommerce-tabs ul.tabs {
  padding: 0;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li {
  border-radius: 0;
  background: var(--rybc-ivory);
}

.woocommerce table.shop_table {
  border-color: var(--rybc-line);
  border-radius: 0;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.woocommerce .quantity .qty,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
textarea,
select {
  min-height: 46px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--rybc-line);
  border-radius: 0;
  background: #fff;
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-top-color: var(--rybc-red);
  background: var(--rybc-ivory);
}

.woocommerce-message::before,
.woocommerce-info::before {
  color: var(--rybc-red);
}

@media (max-width: 1100px) {
  .rybc-header__inner {
    grid-template-columns: auto 1fr auto;
  }

  .rybc-brand {
    justify-self: start;
  }

  .rybc-brand__name {
    font-size: 1.65rem;
  }

  .rybc-brand__en {
    display: none;
  }

  .rybc-navigation {
    position: fixed;
    z-index: 99;
    inset: 126px 0 0;
    display: none;
    padding: 2rem;
    background: rgba(255, 253, 248, 0.99);
  }

  .admin-bar .rybc-navigation {
    inset-block-start: 158px;
  }

  .menu-open .rybc-navigation {
    display: block;
  }

  .rybc-menu {
    flex-direction: column;
    align-items: stretch;
  }

  .rybc-menu a {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--rybc-line);
    font-size: 1.05rem;
  }

  .rybc-menu-toggle {
    display: inline-flex;
    justify-self: start;
  }

  .rybc-currency {
    display: none;
  }

  .rybc-products,
  .woocommerce ul.products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 782px) {
  .admin-bar .rybc-site-header {
    top: 46px;
  }

  .admin-bar .rybc-navigation {
    inset-block-start: 172px;
  }

  .rybc-container {
    width: min(calc(100% - 28px), var(--rybc-container));
  }

  .rybc-header__inner {
    min-height: 78px;
  }

  .rybc-hero__inner,
  .rybc-story,
  .rybc-newsletter__inner {
    grid-template-columns: 1fr;
  }

  .rybc-hero__inner {
    min-height: auto;
    padding-block: 55px;
  }

  .rybc-hero__visual {
    min-height: 430px;
  }

  .rybc-trustbar__inner {
    grid-template-columns: 1fr;
  }

  .rybc-trustbar__item + .rybc-trustbar__item {
    border-top: 1px solid var(--rybc-line);
    border-left: 0;
  }

  .rybc-section__head {
    align-items: start;
    flex-direction: column;
  }

  .rybc-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .rybc-products,
  .woocommerce ul.products {
    grid-template-columns: repeat(2, 1fr);
  }

  .rybc-newsletter__inner {
    gap: 1.5rem;
  }

  .rybc-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .woocommerce div.product {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .rybc-topbar__inner {
    min-height: 30px;
    font-size: 0.7rem;
  }

  .rybc-brand__name {
    font-size: 1.35rem;
    letter-spacing: 0.18em;
    text-indent: 0.18em;
  }

  .rybc-header-actions {
    gap: 0.25rem;
  }

  .rybc-header-actions .rybc-account {
    display: none;
  }

  .rybc-navigation {
    inset-block-start: 108px;
  }

  .admin-bar .rybc-navigation {
    inset-block-start: 154px;
  }

  .rybc-hero h1 {
    font-size: 2.45rem;
  }

  .rybc-hero__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .rybc-hero__visual {
    min-height: 360px;
  }

  .rybc-hero__frame {
    width: 78%;
  }

  .rybc-category-grid,
  .rybc-products,
  .woocommerce ul.products,
  .rybc-footer__grid {
    grid-template-columns: 1fr;
  }

  .rybc-category-card {
    min-height: 220px;
  }

  .rybc-story__art {
    min-height: 360px;
  }

  .rybc-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }
}
