/* =====================================================
   金饌美食 — Product & Order Site
   Responsive stylesheet
   ===================================================== */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  color: #2a2a2a;
  background: #fbf7f0;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: #0a3a67; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; margin: 0; }
h1, h2, h3, h4, h5 { margin: 0 0 .6em; line-height: 1.35; font-weight: 700; color: #1a2b45; }

.container {
  width: min(1200px, calc(100% - 32px));
  margin-inline: auto;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 999px;
  border: 0;
  font-weight: 600;
  letter-spacing: .05em;
  transition: transform .15s ease, box-shadow .2s ease, background .2s;
}
.btn-primary {
  background: linear-gradient(135deg, #0a3a67, #1976c8);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(10,58,103,.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(10,58,103,.7); color: #fff; }
.btn-lg { padding: 16px 40px; font-size: 1.05rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid #ececec;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 20px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #0a3a67, #1976c8);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0;
  box-shadow: 0 6px 16px -8px rgba(10,58,103,.6);
}
.brand-text { display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.05rem; color: #1a2b45; letter-spacing: .05em; }
.brand-text em { font-style: normal; font-size: .68rem; color: #7d7d7d; letter-spacing: .18em; }

.site-nav ul { display: flex; gap: 24px; }
.site-nav a {
  position: relative;
  font-weight: 500;
  color: #333;
  padding: 8px 2px;
}
.site-nav a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 2px;
  background: #d4a017;
  transition: width .25s;
}
.site-nav a:hover::after { width: 100%; }

.header-tools { display: flex; align-items: center; gap: 12px; }
.cart-btn {
  position: relative;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #f5efe4;
  color: #0a3a67;
}
.cart-btn:hover { background: #ece3d0; }
.cart-count {
  position: absolute; top: -4px; right: -4px;
  background: #e04a3d;
  color: #fff; font-size: .72rem; font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: 999px;
  display: grid; place-items: center;
  padding: 0 6px;
}
.menu-toggle {
  display: none;
  width: 42px; height: 42px;
  border: 0; background: transparent;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px; background: #1a2b45; border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: clamp(520px, 72vh, 760px);
  overflow: hidden;
  background: #0a3a67;
}
.hero-slides { position: absolute; inset: 0; }
.slide {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.1s ease;
  display: flex;
  align-items: flex-end;
}
.slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.55));
  pointer-events: none;
}
.slide.active { opacity: 1; z-index: 1; }
.slide-caption {
  position: relative; z-index: 2;
  color: #fff;
  padding: 40px 32px;
  width: min(760px, 100%);
  margin: 0 auto 30px;
  text-align: center;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 1s .3s ease, opacity 1s .3s ease;
}
.slide.active .slide-caption { transform: translateY(0); opacity: 1; }
.slide-caption .eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(212,160,23,.9);
  color: #fff;
  letter-spacing: .3em;
  font-size: .78rem;
  border-radius: 4px;
  margin-bottom: 14px;
}
.slide-caption h2 { font-size: clamp(1.8rem, 4vw, 3rem); color: #fff; margin: 0 0 10px; text-shadow: 0 4px 24px rgba(0,0,0,.35); }
.slide-caption p { font-size: 1.05rem; margin: 0 0 22px; }

.hero-dots {
  position: absolute; z-index: 3;
  left: 50%; bottom: 20px;
  transform: translateX(-50%);
  display: flex; gap: 10px;
}
.hero-dots button {
  width: 34px; height: 4px; border-radius: 4px;
  border: 0; background: rgba(255,255,255,.4);
  transition: background .25s, width .25s;
}
.hero-dots button.active { background: #d4a017; width: 48px; }

.hero-arrow {
  position: absolute; z-index: 3;
  top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.2);
  color: #fff;
  backdrop-filter: blur(6px);
  font-size: 1rem;
  transition: background .2s;
}
.hero-arrow:hover { background: rgba(255,255,255,.35); }
.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }

/* Desktop carousel: 30% taller than the standard hero height. */
@media (min-width: 721px) {
  .hero { height: clamp(676px, 93.6vh, 988px); }
}

/* ---------- Section titles ---------- */
.section { padding: 90px 0; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title span {
  display: inline-block;
  color: #d4a017;
  letter-spacing: .35em;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.section-title h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  position: relative;
  display: inline-block;
  padding-bottom: 14px;
}
.section-title h2::after {
  content: "";
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 48px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, #0a3a67, #d4a017);
}
.section-title .sub { color: #6b6b6b; margin-top: 14px; }
.section-title.light span { color: #ffd77a; }
.section-title.light h2 { color: #fff; }
.section-title.light h2::after { background: linear-gradient(90deg, #ffd77a, #fff); }

/* ---------- About ---------- */
.about-sect { background: linear-gradient(180deg, #fbf7f0 0%, #fff 100%); }
.about-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 60px;
  align-items: center;
}
.about-text h3 { font-size: 1.5rem; color: #1a2b45; }
.about-text p { color: #464646; }
.about-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 28px;
}
.about-badges li {
  background: #fff;
  border: 1px solid #efe6d1;
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
  box-shadow: 0 12px 24px -20px rgba(10,58,103,.25);
}
.about-badges i {
  display: block;
  font-style: normal;
  font-weight: 800;
  font-size: 1.6rem;
  color: #0a3a67;
  margin-bottom: 4px;
}
.about-badges span { font-size: .9rem; color: #6b6b6b; }
.about-pic img {
  border-radius: 18px;
  box-shadow: 0 30px 60px -30px rgba(10,58,103,.35);
}

/* ---------- Product blocks ---------- */
.product-sect { background: #fff; }
.product-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 40px 0;
  border-bottom: 1px dashed #ece3d0;
}
.product-block:last-child { border-bottom: 0; }
.product-block.reverse .product-media { order: 2; }

.product-media .pm-main {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(10,58,103,.35);
  background: #f5efe4;
}
.product-media .pm-main img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .6s ease;
}
.product-media .pm-main:hover img { transform: scale(1.04); }

.pm-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.pm-thumbs button {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  transition: border-color .2s, transform .2s;
}
.pm-thumbs button:hover { transform: translateY(-2px); }
.pm-thumbs button.active { border-color: #d4a017; }
.pm-thumbs img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }

.product-info .tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: .25em;
  font-weight: 700;
  margin-bottom: 12px;
}
.tag-blue  { background: #e7f0fa; color: #0a3a67; }
.tag-amber { background: #fdf0d6; color: #a37600; }

.product-info h3 { font-size: 1.9rem; }
.product-info .lead { color: #555; }

.highlight-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
  margin: 22px 0 28px;
}
.highlight-list li { display: flex; gap: 12px; align-items: flex-start; }
.highlight-list i {
  flex: 0 0 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0a3a67, #1976c8);
  color: #fff; font-style: normal;
  font-weight: 700; font-size: .85rem;
}
.product-block[data-product="ricemilk"] .highlight-list i {
  background: linear-gradient(135deg, #b17a1e, #d4a017);
}
.highlight-list div { font-size: .93rem; color: #464646; line-height: 1.55; }
.highlight-list strong { display: block; color: #1a2b45; margin-bottom: 2px; }

.buy-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: #f9f4e8;
  border: 1px solid #eee1c6;
  border-radius: 16px;
}
.buy-bar .price { display: flex; flex-direction: column; }
.buy-bar .now { font-size: 1.6rem; font-weight: 800; color: #d4a017; }
.buy-bar .combo { font-size: .8rem; color: #7d7d7d; }
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d8ccae;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.qty-btn {
  width: 36px; height: 36px;
  border: 0; background: transparent;
  font-size: 1.15rem; color: #0a3a67;
}
.qty-btn:hover { background: #f5efe4; }
.qty-input {
  width: 46px; height: 36px;
  border: 0; text-align: center;
  font-size: 1rem;
  background: transparent;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-cart { margin-left: auto; }

/* ---------- Features ---------- */
.features-sect {
  background:
    linear-gradient(135deg, rgba(10,58,103,.92), rgba(25,118,200,.88)),
    url('../images/rice-milk/16430_0.jpg') center/cover no-repeat;
  color: #fff;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.feat {
  padding: 30px 22px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  text-align: center;
  backdrop-filter: blur(6px);
  transition: transform .25s, background .25s;
}
.feat:hover { transform: translateY(-6px); background: rgba(255,255,255,.15); }
.feat .ico {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,215,122,.2);
  color: #ffd77a;
}
.feat h4 { color: #fff; margin-bottom: 6px; }
.feat p { margin: 0; color: rgba(255,255,255,.85); font-size: .95rem; }

/* ---------- Order ---------- */
.order-sect { background: #fbf7f0; }
.order-grid {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 30px;
  align-items: start;
}
.card {
  background: #fff;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 30px 60px -40px rgba(10,58,103,.35);
  border: 1px solid #f0e7d5;
}
.cart-box h3, .order-form h3 { font-size: 1.25rem; padding-bottom: 14px; border-bottom: 2px solid #f0e7d5; }
.cart-list { min-height: 120px; margin: 16px 0; }
.cart-empty { text-align: center; color: #8a8a8a; padding: 22px 0; }
.cart-item {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed #efe6d1;
  align-items: center;
}
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 62px; height: 62px; border-radius: 10px; object-fit: cover; }
.cart-item .ci-name { font-weight: 600; color: #1a2b45; }
.cart-item .ci-meta { font-size: .85rem; color: #7d7d7d; margin-top: 2px; }
.cart-item .ci-qty {
  display: inline-flex; align-items: center; margin-top: 6px;
  border: 1px solid #e3d9be; border-radius: 999px; overflow: hidden;
}
.cart-item .ci-qty button { width: 26px; height: 26px; border: 0; background: transparent; color: #0a3a67; }
.cart-item .ci-qty button:hover { background: #f5efe4; }
.cart-item .ci-qty span { min-width: 26px; text-align: center; font-size: .9rem; }
.cart-item .ci-price { text-align: right; }
.cart-item .ci-price strong { color: #d4a017; font-size: 1.05rem; }
.cart-item .ci-remove {
  display: block; margin-top: 6px;
  background: transparent; border: 0;
  color: #9a9a9a; font-size: .8rem;
}
.cart-item .ci-remove:hover { color: #e04a3d; }

.cart-summary { margin-top: 12px; padding-top: 14px; border-top: 2px solid #f0e7d5; }
.cart-summary .row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: .95rem; color: #555;
}
.cart-summary .row.total {
  font-size: 1.15rem; color: #1a2b45; font-weight: 700;
  border-top: 1px dashed #efe6d1; margin-top: 6px; padding-top: 12px;
}
.cart-summary .row.total span:last-child { color: #d4a017; font-size: 1.4rem; }
.ship-note { color: #a08c58; font-size: .8rem; margin-top: 10px; }

/* Order form */
.order-form label {
  display: block;
  margin-bottom: 14px;
  font-size: .9rem; color: #1a2b45; font-weight: 600;
}
.order-form input,
.order-form select,
.order-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid #e3d9be;
  border-radius: 10px;
  background: #fbf7f0;
  font-family: inherit;
  font-size: 1rem;
  color: #1a2b45;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.order-form input:focus,
.order-form select:focus,
.order-form textarea:focus {
  outline: none;
  border-color: #d4a017;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(212,160,23,.18);
}
.order-form textarea { resize: vertical; min-height: 80px; }
.order-form .req { color: #e04a3d; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.order-form .check {
  display: flex; align-items: flex-start; gap: 8px;
  font-weight: 400; color: #555; font-size: .88rem;
}
.order-form .check input { width: auto; margin: 3px 0 0; }
.order-form .check a { color: #0a3a67; text-decoration: underline; }
.form-msg {
  margin-top: 12px; font-size: .9rem;
}
.form-msg.err { color: #e04a3d; }
.form-msg.ok  { color: #2f8a3f; }

/* ---------- Footer ---------- */
.site-footer {
  background: #1a2b45;
  color: rgba(255,255,255,.75);
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.2fr .8fr;
  gap: 40px;
  padding: 70px 0 40px;
}
.brand-footer .brand-mark { background: linear-gradient(135deg, #d4a017, #f2c351); }
.brand-footer .brand-text strong { color: #fff; }
.brand-footer .brand-text em { color: rgba(255,255,255,.55); }
.f-desc { margin-top: 14px; color: rgba(255,255,255,.65); font-size: .95rem; }
.f-col h5 {
  color: #fff;
  font-size: .95rem; letter-spacing: .12em;
  padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.f-list li { padding: 4px 0; font-size: .93rem; }
.f-list.two-col {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px;
}
.f-list a:hover { color: #d4a017; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: .78rem; font-weight: 700; letter-spacing: .05em;
  transition: background .2s, transform .2s;
}
.socials a:hover { background: #d4a017; transform: translateY(-3px); color: #fff; }
.footer-bar {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 18px 0;
  font-size: .82rem; color: rgba(255,255,255,.55);
}
.footer-bar .container {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ---------- Go top ---------- */
.go-top {
  position: fixed;
  right: 20px; bottom: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(135deg, #0a3a67, #1976c8);
  color: #fff; font-size: 1.1rem;
  box-shadow: 0 12px 30px -12px rgba(10,58,103,.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  z-index: 80;
}
.go-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---------- Modal ---------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(10,20,40,.55);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  z-index: 200;
}
.modal.open { display: flex; }
.modal-panel {
  background: #fff;
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.4);
  animation: pop .28s ease;
}
.modal-panel h3 { color: #0a3a67; font-size: 1.4rem; }
@keyframes pop {
  from { transform: scale(.9); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .about-grid { grid-template-columns: 1fr; gap: 30px; }
  .product-block { grid-template-columns: 1fr; gap: 30px; }
  .product-block.reverse .product-media { order: 0; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .order-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .section { padding: 60px 0; }
  .site-nav {
    position: fixed;
    top: 68px; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #ececec;
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
    box-shadow: 0 20px 30px -20px rgba(0,0,0,.2);
  }
  .site-nav.open { max-height: 400px; }
  .site-nav ul { flex-direction: column; padding: 12px 20px; gap: 0; }
  .site-nav li { border-bottom: 1px solid #f0eadb; }
  .site-nav li:last-child { border-bottom: 0; }
  .site-nav a { display: block; padding: 14px 4px; }
  .menu-toggle { display: inline-flex; }

  .slide-caption { padding: 22px 20px; margin-bottom: 20px; }
  .slide-caption p { font-size: .95rem; }
  .hero-arrow { display: none; }

  .highlight-list { grid-template-columns: 1fr; }
  .about-badges { grid-template-columns: repeat(3, 1fr); font-size: .85rem; }

  .buy-bar { flex-direction: column; align-items: stretch; }
  .buy-bar .price { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .add-cart { margin-left: 0; width: 100%; }
  .qty { align-self: center; }

  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; padding: 50px 0 20px; }
  .footer-bar .container { flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
  .feature-grid { grid-template-columns: 1fr; }
  .brand-text em { display: none; }
  .about-badges { grid-template-columns: 1fr 1fr; }
}
