/* ==========================================================================
   七星柴魚博物館 — E-commerce Demo
   Design: ocean / kuroshio current + warm bonito wood palette
   ========================================================================== */

:root {
  --sea-900: #0b2733;
  --sea-800: #103545;
  --sea-700: #17475b;
  --teal-500: #1f8a9c;
  --teal-400: #2ca6b8;
  --gold-500: #d99b34;
  --gold-400: #e6b355;
  --cream: #faf6ee;
  --cream-2: #f3ece0;
  --ink: #22333b;
  --ink-soft: #52616b;
  --line: #e7ddcd;
  --white: #ffffff;
  --shadow-sm: 0 2px 10px rgba(16, 53, 69, .08);
  --shadow-md: 0 10px 30px rgba(16, 53, 69, .12);
  --shadow-lg: 0 24px 60px rgba(11, 39, 51, .22);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1200px;
  --serif: "Noto Serif TC", serif;
  --sans: "Noto Sans TC", system-ui, -apple-system, "Microsoft JhengHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.section { padding: 88px 0; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head .eyebrow {
  font-family: var(--serif);
  letter-spacing: .35em;
  color: var(--teal-500);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  color: var(--sea-900);
  letter-spacing: .04em;
}
.section-head p { color: var(--ink-soft); margin-top: 14px; max-width: 560px; margin-inline: auto; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 14px 30px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--gold-500); color: #3a2a06; box-shadow: 0 8px 22px rgba(217,155,52,.35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(217,155,52,.45); background: var(--gold-400); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border: 1.5px solid rgba(255,255,255,.55); backdrop-filter: blur(4px); }
.btn-ghost:hover { background: rgba(255,255,255,.28); transform: translateY(-2px); }
.btn-dark { background: var(--sea-800); color: #fff; }
.btn-dark:hover { background: var(--sea-700); transform: translateY(-2px); }

/* ============ announcement bar ============ */
.topbar {
  background: var(--sea-900); color: #d9e6ea; font-size: 13.5px;
  text-align: center; padding: 9px 16px; letter-spacing: .05em;
}
.topbar b { color: var(--gold-400); }

/* ============ header ============ */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,246,238,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .3s;
}
.header.scrolled { box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, var(--teal-500), var(--sea-800));
  color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 22px;
  box-shadow: var(--shadow-sm);
}
.brand .txt strong { display: block; font-family: var(--serif); font-size: 19px; color: var(--sea-900); letter-spacing: .05em; line-height: 1.2; }
.brand .txt span { font-size: 11px; letter-spacing: .28em; color: var(--teal-500); text-transform: uppercase; }

.menu { display: flex; gap: 34px; }
.menu a { font-weight: 500; font-size: 15.5px; color: var(--ink); position: relative; padding: 6px 0; }
.menu a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--gold-500); transition: width .25s;
}
.menu a:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: var(--sea-800); position: relative; transition: background .2s;
}
.icon-btn:hover { background: var(--cream-2); }
.icon-btn svg { width: 23px; height: 23px; }
.cart-count {
  position: absolute; top: 4px; right: 4px; min-width: 19px; height: 19px; padding: 0 5px;
  background: var(--gold-500); color: #3a2a06; border-radius: 999px;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
  transform: scale(0); transition: transform .25s cubic-bezier(.2,1.4,.5,1);
}
.cart-count.show { transform: scale(1); }
.hamburger { display: none; }

/* ============ hero ============ */
.hero { position: relative; height: min(88vh, 760px); min-height: 520px; overflow: hidden; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.2s ease, transform 6s ease;
  transform: scale(1.08);
}
.hero-slide.active { opacity: 1; transform: scale(1); }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(11,39,51,.82) 0%, rgba(11,39,51,.5) 45%, rgba(11,39,51,.2) 100%);
}
.hero-inner {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px; color: #fff;
}
.hero .tagline {
  font-family: var(--serif); letter-spacing: .4em; color: var(--gold-400);
  font-size: 14px; font-weight: 600; margin-bottom: 20px;
  opacity: 0; animation: rise .8s .2s forwards;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700; letter-spacing: .04em;
  font-size: clamp(34px, 6vw, 66px); line-height: 1.15; max-width: 15ch;
  text-shadow: 0 4px 30px rgba(0,0,0,.35);
  opacity: 0; animation: rise .8s .35s forwards;
}
.hero p {
  margin: 22px 0 34px; font-size: clamp(16px, 2vw, 19px); max-width: 42ch;
  color: #e7f0f2; opacity: 0; animation: rise .8s .5s forwards;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; opacity: 0; animation: rise .8s .65s forwards; }
.hero-dots { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 10px; }
.hero-dots button { width: 10px; height: 10px; border-radius: 999px; background: rgba(255,255,255,.4); transition: all .3s; }
.hero-dots button.active { background: var(--gold-400); width: 30px; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ============ feature strip ============ */
.features { background: var(--sea-900); color: #dceaee; }
.features .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.feature { display: flex; align-items: center; gap: 16px; padding: 30px 20px; }
.feature svg { width: 38px; height: 38px; color: var(--gold-400); flex-shrink: 0; }
.feature b { display: block; color: #fff; font-size: 16px; }
.feature span { font-size: 13.5px; color: #9fb8bf; }

/* ============ product filters ============ */
.filters { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }
.filter-btn {
  padding: 10px 24px; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  color: var(--ink-soft); background: var(--white); border: 1.5px solid var(--line);
  transition: all .2s;
}
.filter-btn:hover { border-color: var(--teal-400); color: var(--teal-500); }
.filter-btn.active { background: var(--sea-800); color: #fff; border-color: var(--sea-800); }

/* ============ product grid ============ */
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .3s, box-shadow .3s;
  display: flex; flex-direction: column; position: relative;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.card-media { position: relative; aspect-ratio: 1/1; overflow: hidden; background: var(--cream-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card-media img { transform: scale(1.07); }
.badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: var(--gold-500); color: #3a2a06; font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.badge.limited { background: #c0562f; color: #fff; }
.badge.sale { background: var(--teal-500); color: #fff; }
.quickview {
  position: absolute; inset: auto 0 0 0; background: rgba(16,53,69,.92); color: #fff;
  text-align: center; padding: 12px; font-weight: 600; font-size: 14px;
  transform: translateY(100%); transition: transform .3s; backdrop-filter: blur(2px);
}
.card:hover .quickview { transform: translateY(0); }
.card-body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.card .cat { font-size: 12px; color: var(--teal-500); letter-spacing: .1em; font-weight: 600; margin-bottom: 6px; }
.card h3 { font-size: 16.5px; font-weight: 700; color: var(--sea-900); line-height: 1.5; margin-bottom: 4px; }
.card .desc { font-size: 13px; color: var(--ink-soft); flex: 1; margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-family: var(--serif); font-weight: 700; }
.price .cur { font-size: 13px; color: var(--ink-soft); }
.price .num { font-size: 23px; color: var(--sea-900); }
.price .old { font-size: 13px; color: #a9a196; text-decoration: line-through; margin-left: 6px; }
.add-btn {
  width: 46px; height: 46px; border-radius: 12px; background: var(--sea-800); color: #fff;
  display: grid; place-items: center; transition: all .2s; flex-shrink: 0;
}
.add-btn:hover { background: var(--gold-500); color: #3a2a06; transform: scale(1.06); }
.add-btn svg { width: 22px; height: 22px; }

/* ============ story ============ */
.story { background: var(--cream-2); overflow: hidden; }
.story .grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 64px; align-items: center; }
.story-imgs { position: relative; }
.story-imgs .main { border-radius: var(--radius); box-shadow: var(--shadow-md); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.story-imgs .badge-round {
  position: absolute; bottom: -28px; right: -14px; width: 148px; height: 148px; border-radius: 50%;
  background: var(--gold-500); color: #3a2a06; display: grid; place-items: center; text-align: center;
  box-shadow: var(--shadow-md); font-family: var(--serif); line-height: 1.3; padding: 16px;
}
.story-imgs .badge-round b { font-size: 32px; display: block; }
.story-imgs .badge-round span { font-size: 13px; }
.story-text .eyebrow { font-family: var(--serif); letter-spacing: .35em; color: var(--teal-500); font-weight: 600; font-size: 13px; margin-bottom: 14px; }
.story-text h2 { font-family: var(--serif); font-size: clamp(26px,3.4vw,38px); color: var(--sea-900); line-height: 1.3; margin-bottom: 22px; }
.story-text p { color: var(--ink-soft); margin-bottom: 16px; font-size: 15.5px; }
.story-text .sign { font-family: var(--serif); color: var(--sea-800); font-weight: 700; margin-top: 8px; }

/* ============ DIY ============ */
.diy .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.diy-card { border-radius: var(--radius); overflow: hidden; position: relative; height: 380px; box-shadow: var(--shadow-sm); }
.diy-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.diy-card:hover img { transform: scale(1.08); }
.diy-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,39,51,.92) 6%, rgba(11,39,51,.15) 60%); }
.diy-card .info { position: absolute; inset: auto 0 0 0; z-index: 2; padding: 26px; color: #fff; }
.diy-card .info h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 6px; }
.diy-card .info .p-line { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.diy-card .info .p { font-family: var(--serif); font-size: 20px; color: var(--gold-400); font-weight: 700; }
.diy-card .book { padding: 9px 20px; border-radius: 999px; background: var(--gold-500); color: #3a2a06; font-weight: 600; font-size: 14px; transition: all .2s; }
.diy-card .book:hover { background: #fff; }

/* ============ store info ============ */
.store { background: var(--sea-900); color: #dceaee; }
.store .grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; }
.store h2 { font-family: var(--serif); font-size: clamp(26px,3.4vw,38px); color: #fff; margin-bottom: 26px; }
.store .info-row { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.store .info-row svg { width: 24px; height: 24px; color: var(--gold-400); flex-shrink: 0; margin-top: 3px; }
.store .info-row b { color: #fff; display: block; font-size: 15px; }
.store .info-row span { color: #9fb8bf; font-size: 14.5px; }
.store .map { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); height: 400px; }
.store .map iframe { width: 100%; height: 100%; border: 0; filter: saturate(.9); }

/* ============ newsletter ============ */
.news { background: var(--gold-500); text-align: center; }
.news h2 { font-family: var(--serif); font-size: clamp(24px,3vw,34px); color: #3a2a06; margin-bottom: 12px; }
.news p { color: #5c451a; margin-bottom: 28px; }
.news form { display: flex; gap: 10px; max-width: 480px; margin: 0 auto; }
.news input {
  flex: 1; padding: 15px 22px; border-radius: 999px; border: none; font-size: 15px;
  font-family: inherit; background: #fff; color: var(--ink);
}
.news input:focus { outline: 2px solid var(--sea-800); }

/* ============ footer ============ */
.footer { background: #071c25; color: #8fa8b0; padding: 60px 0 30px; }
.footer .grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 40px; margin-bottom: 44px; }
.footer .brand .mark { background: linear-gradient(135deg, var(--teal-500), var(--gold-500)); }
.footer .brand .txt strong { color: #fff; }
.footer .fdesc { margin-top: 18px; font-size: 14px; max-width: 34ch; line-height: 1.8; }
.footer h4 { color: #fff; font-size: 15px; margin-bottom: 18px; font-weight: 600; letter-spacing: .05em; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 11px; }
.footer ul a { font-size: 14px; transition: color .2s; }
.footer ul a:hover { color: var(--gold-400); }
.footer .contact-li { font-size: 14px; margin-bottom: 11px; display: flex; gap: 10px; }
.footer .contact-li svg { width: 18px; height: 18px; color: var(--gold-400); flex-shrink: 0; margin-top: 3px; }
.footer .bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; }
.footer .bottom .demo-tag { color: var(--gold-400); }

/* ============ cart drawer ============ */
.overlay {
  position: fixed; inset: 0; background: rgba(11,39,51,.5); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: all .3s; z-index: 200;
}
.overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%);
  background: var(--cream); z-index: 300; transform: translateX(100%);
  transition: transform .38s cubic-bezier(.4,0,.1,1); display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-family: var(--serif); font-size: 21px; color: var(--sea-900); }
.drawer-close { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--ink); transition: background .2s; }
.drawer-close:hover { background: var(--cream-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 24px; }
.cart-empty { text-align: center; color: var(--ink-soft); padding: 70px 20px; }
.cart-empty svg { width: 64px; height: 64px; color: var(--line); margin: 0 auto 16px; }
.cart-item { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; }
.cart-item .ci-body { flex: 1; }
.cart-item .ci-name { font-weight: 600; font-size: 14.5px; color: var(--sea-900); line-height: 1.4; }
.cart-item .ci-price { color: var(--teal-500); font-weight: 700; font-size: 14px; margin-top: 2px; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; margin-top: 10px; background: #fff; }
.qty button { width: 30px; height: 30px; font-size: 17px; color: var(--sea-800); display: grid; place-items: center; }
.qty span { width: 32px; text-align: center; font-weight: 600; font-size: 14px; }
.ci-remove { color: #b0a99d; font-size: 12.5px; margin-top: 8px; display: inline-block; transition: color .2s; }
.ci-remove:hover { color: #c0562f; }
.drawer-foot { padding: 22px 24px; border-top: 1px solid var(--line); background: #fff; }
.drawer-foot .row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14.5px; color: var(--ink-soft); }
.drawer-foot .total { font-size: 17px; color: var(--sea-900); font-weight: 700; margin: 12px 0 6px; }
.drawer-foot .total .amt { font-family: var(--serif); font-size: 24px; color: var(--gold-500); }
.drawer-foot .note { font-size: 12px; color: var(--ink-soft); text-align: center; margin-top: 12px; }
.checkout-btn { width: 100%; margin-top: 8px; }

/* ============ quick-view modal ============ */
.modal {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: all .3s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal-card {
  background: #fff; border-radius: var(--radius); max-width: 820px; width: 100%; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(.98); transition: transform .35s; max-height: 90vh;
}
.modal.open .modal-card { transform: translateY(0) scale(1); }
.modal-card .m-media { background: var(--cream-2); }
.modal-card .m-media img { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }
.modal-card .m-body { padding: 40px 36px; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--ink); transition: background .2s; }
.modal-close:hover { background: var(--cream-2); }
.modal-card .cat { color: var(--teal-500); font-weight: 600; letter-spacing: .1em; font-size: 13px; }
.modal-card h3 { font-family: var(--serif); font-size: 27px; color: var(--sea-900); margin: 8px 0 14px; line-height: 1.4; }
.modal-card .m-price { font-family: var(--serif); font-size: 30px; color: var(--gold-500); font-weight: 700; margin-bottom: 20px; }
.modal-card .m-desc { color: var(--ink-soft); font-size: 15px; line-height: 1.9; margin-bottom: 28px; }
.modal-card .m-actions { display: flex; gap: 12px; align-items: center; }

/* ============ toast ============ */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(140%);
  background: var(--sea-900); color: #fff; padding: 15px 26px; border-radius: 999px;
  box-shadow: var(--shadow-lg); z-index: 500; font-weight: 600; font-size: 14.5px;
  display: flex; align-items: center; gap: 10px; transition: transform .4s cubic-bezier(.2,1.3,.4,1);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast svg { width: 20px; height: 20px; color: var(--gold-400); }

/* ============ reveal on scroll ============ */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============ responsive ============ */
@media (max-width: 1024px) {
  .products { grid-template-columns: repeat(3, 1fr); }
  .features .grid { grid-template-columns: repeat(2, 1fr); }
  .story .grid, .store .grid { grid-template-columns: 1fr; gap: 40px; }
  .story-imgs .badge-round { width: 120px; height: 120px; }
}
@media (max-width: 760px) {
  .section { padding: 60px 0; }
  .menu, .nav-actions .desktop-only { display: none; }
  .hamburger { display: grid; }
  .products { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .diy .grid { grid-template-columns: 1fr; }
  .footer .grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .modal-card { grid-template-columns: 1fr; max-height: 92vh; }
  .modal-card .m-media img { min-height: 200px; max-height: 240px; }
  .card-body { padding: 15px 15px 17px; }
  .card h3 { font-size: 15px; }
  .price .num { font-size: 20px; }
  .add-btn { width: 42px; height: 42px; }

  /* mobile menu */
  .menu.mobile-open {
    display: flex; position: absolute; top: 76px; left: 0; right: 0; flex-direction: column;
    background: var(--cream); padding: 20px 24px; gap: 4px; box-shadow: var(--shadow-md); border-bottom: 1px solid var(--line);
  }
  .menu.mobile-open a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
}
@media (max-width: 420px) {
  .footer .grid { grid-template-columns: 1fr; }
  .news form { flex-direction: column; }
}
