/* ==========================================================================
   One And Only — theme
   Tokens below are the values read out of the Cyberbiz theme's color_settings
   so the migrated site renders in the same palette as the original store.
   ========================================================================== */

:root {
  --navy: #0c2340;          /* heading_color / text_color / nav & footer bg */
  --gold: #a88b4b;          /* accent_color / button_color / product border */
  --gold-dark: #8e743b;
  --price: #ff0505;         /* discount_price_color */
  --theme-bg: #cccccc;      /* theme_bg_color — badge + announcement bar */
  --nav-text: #ffffff;
  --footer-text: #ffffff;
  --body: #ffffff;
  --muted: #6b7280;
  --line: #e5e7eb;

  --font: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    'PingFang TC', 'Microsoft JhengHei', sans-serif;

  --page-max: 1280px;
  --gutter: 50px;
  --radius: 5px;
  --header-h: 108px;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--navy);
  background: var(--body);
  overflow-wrap: break-word;
}

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

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

a:hover {
  color: var(--gold);
}

button {
  font: inherit;
  cursor: pointer;
}

/* Screen-reader-only, but still focusable — used by the skip link. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  width: auto;
  height: auto;
  clip: auto;
  padding: 10px 16px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
}

.container {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ------------------------------------------------------------ announcement */

.announcement {
  background: var(--theme-bg);
  color: var(--navy);
  font-size: 16px;
  text-align: center;
  padding: 6px 12px;
}

.announcement a {
  display: block;
}

/* ----------------------------------------------------------------- header */

.site-header {
  background: var(--navy);
  color: var(--nav-text);
  position: sticky;
  top: 0;
  z-index: 60;
}

.header-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: 8px;
  flex: 1;
  min-width: 0;
}

.main-nav a {
  font-size: 14.4px;
  color: var(--nav-text);
  white-space: nowrap;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a[aria-current='page'] {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 0;
  color: var(--nav-text);
  border-radius: var(--radius);
  position: relative;
}

.icon-btn:hover {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--gold);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.cart-count[hidden] {
  display: none;
}

.nav-toggle {
  display: none;
}

/* Mobile drawer */
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  background: var(--navy);
  color: var(--nav-text);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}

.drawer[data-open='true'] {
  transform: translateX(0);
}

.drawer a {
  display: block;
  padding: 10px 0;
  font-size: 14.4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.drawer-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin: 20px 0 4px;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.scrim[data-open='true'] {
  opacity: 1;
  pointer-events: auto;
}

/* ------------------------------------------------------------ home banners */

.banner {
  display: block;
  margin-bottom: 5px;
}

.banner img {
  width: 100%;
}

.banner + .banner {
  margin-bottom: 25px;
}

/* ---------------------------------------------------------- section titles */

.section {
  margin: 32px 0 25px;
}

.section-heading {
  text-align: center;
  position: relative;
}

.section-heading h2 {
  display: inline-block;
  position: relative;
  font-size: 24px;
  font-weight: 500;
  color: var(--navy);
  margin: 0;
  padding: 0 20px;
}

/* The original theme draws a 50px hairline either side of the heading. */
.section-heading h2::before,
.section-heading h2::after {
  content: '';
  position: absolute;
  top: 15px;
  width: 50px;
  border-top: 1px solid var(--navy);
}

.section-heading h2::before {
  left: -80px;
}

.section-heading h2::after {
  right: -80px;
}

.btn-seemore {
  display: block;
  margin-top: 24px;
  text-align: center;
  font-weight: 700;
  color: var(--navy);
}

.btn-seemore:hover {
  color: var(--gold);
}

/* ---------------------------------------------------------- product grid */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-top: 32px;
  padding: 0;
  list-style: none;
}

.product-card {
  display: flex;
  flex-direction: column;
}

.product-card .thumb {
  display: block;
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: #fff;
}

.product-card .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s linear;
}

.product-card:hover .thumb img {
  transform: scale(1.04);
}

.product-slogan {
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
  color: var(--gold);
  border: 1px solid var(--gold);
  background: var(--theme-bg);
  padding: 1px 4px;
}

.product-title {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: var(--navy);
}

.price-row {
  margin-top: 4px;
  text-align: center;
  font-size: 15px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
}

.price {
  color: var(--price);
}

.price-compare {
  color: var(--navy);
  text-decoration: line-through;
  opacity: 0.75;
}

.product-card .btn {
  margin-top: auto;
}

.product-card .cta-wrap {
  margin-top: 12px;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  padding: 1px 6px;
  font-size: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: var(--gold);
  color: var(--navy);
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover:not(:disabled) {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  color: #fff;
}

.btn:disabled {
  background: #d4d4d4;
  border-color: #d4d4d4;
  color: #7a7a7a;
  cursor: not-allowed;
}

.btn--outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn--outline:hover:not(:disabled) {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.btn--auto {
  width: auto;
  padding: 8px 24px;
}

/* ------------------------------------------------------------- breadcrumb */

.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin: 20px 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a:hover {
  color: var(--gold);
}

/* ----------------------------------------------------------- product page */

.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 48px;
}

.gallery-main {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #fff;
  border: 1px solid var(--line);
}

.gallery-main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding: 0;
  list-style: none;
}

.gallery-thumbs button {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  aspect-ratio: 1;
  overflow: hidden;
}

.gallery-thumbs button[aria-current='true'] {
  border-color: var(--gold);
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-info h1 {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.4;
}

.product-info .slogan {
  display: inline-block;
  color: var(--gold);
  border: 1px solid var(--gold);
  background: var(--theme-bg);
  font-size: 13px;
  padding: 1px 10px;
  margin-bottom: 12px;
}

.product-info .price-row {
  justify-content: flex-start;
  font-size: 22px;
  margin: 12px 0;
}

.product-info .price-compare {
  font-size: 16px;
}

.product-brief {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.9;
}

.meta-row {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0;
}

.stock-out {
  color: var(--price);
  font-weight: 600;
}

.buy-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-top: 20px;
  flex-wrap: wrap;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.qty button {
  width: 38px;
  height: 40px;
  border: 0;
  background: #fff;
  color: var(--navy);
  font-size: 18px;
  line-height: 1;
}

.qty button:hover {
  background: var(--theme-bg);
}

.qty input {
  width: 48px;
  height: 40px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font: inherit;
  color: var(--navy);
  -moz-appearance: textfield;
}

.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.buy-row .btn {
  flex: 1 1 200px;
  width: auto;
}

.variant-select {
  margin-top: 16px;
}

.variant-select label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.variant-select select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font: inherit;
  color: var(--navy);
  border: 1px solid var(--navy);
  border-radius: var(--radius);
  background: #fff;
}

/* Rich text coming out of the Cyberbiz CKEditor description fields. */
.rte {
  font-size: 15px;
  line-height: 1.9;
}

.rte img {
  margin: 12px auto;
}

.rte p {
  margin: 0 0 12px;
}

.rte hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.rte ul,
.rte ol {
  padding-left: 22px;
}

.rte li {
  margin-bottom: 6px;
}

.rte table {
  width: 100%;
  border-collapse: collapse;
}

.rte td,
.rte th {
  border: 1px solid var(--line);
  padding: 8px;
}

.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tab-nav button {
  border: 1px solid transparent;
  border-bottom: 0;
  background: none;
  padding: 10px 20px;
  font-size: 15px;
  color: var(--muted);
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: -1px;
}

.tab-nav button[aria-selected='true'] {
  color: var(--navy);
  font-weight: 600;
  border-color: var(--line);
  background: #fff;
}

.tab-panel[hidden] {
  display: none;
}

/* ---------------------------------------------------------------- pages */

.page-header {
  text-align: center;
  margin: 32px 0 24px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0;
}

.page-body {
  max-width: 860px;
  margin: 0 auto 64px;
}

/* ------------------------------------------------------------------ cart */

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
  margin-bottom: 64px;
}

.cart-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.cart-line img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 1px solid var(--line);
}

.cart-line .name {
  font-weight: 600;
}

.cart-line .variant {
  font-size: 13px;
  color: var(--muted);
}

.cart-line .line-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.link-remove {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
}

.link-remove:hover {
  color: var(--price);
}

.cart-summary {
  border: 1px solid var(--line);
  padding: 20px;
  position: sticky;
  top: calc(var(--header-h) - 20px);
}

.cart-summary h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 15px;
}

.summary-row.total {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 700;
}

.summary-row.total .price {
  font-size: 20px;
}

.notice {
  background: #fff8e6;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.8;
  margin: 16px 0;
}

.empty-state {
  text-align: center;
  padding: 64px 0;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 24px;
}

/* --------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: var(--navy);
  color: #fff;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 150;
}

.toast[data-open='true'] {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------- footer */

.site-footer {
  background: var(--navy);
  color: var(--footer-text);
  padding: 40px 0;
  font-size: 14px;
  margin-top: 48px;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
}

.site-footer h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 8px;
}

.site-footer a:hover {
  color: var(--gold);
}

.footer-contact p {
  margin: 0 0 6px;
}

.social-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.social-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
}

.social-row svg {
  width: 18px;
  height: 18px;
}

.copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 32px;
  padding-top: 20px;
  font-size: 13px;
  text-align: center;
  opacity: 0.85;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1024px) {
  :root {
    --gutter: 25px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .brand {
    order: -1;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .section-heading h2 {
    font-size: 20px;
  }

  .section-heading h2::before,
  .section-heading h2::after {
    width: 24px;
  }

  .section-heading h2::before {
    left: -34px;
  }

  .section-heading h2::after {
    right: -34px;
  }

  .product-info h1 {
    font-size: 21px;
  }

  .gallery-thumbs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .cart-line {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .cart-line img {
    width: 72px;
    height: 72px;
  }

  .cart-line .line-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media print {
  .site-header,
  .site-footer,
  .announcement,
  .buy-row {
    display: none;
  }
}
