/*
 * style.css — ปะการังซัพพลาย
 * Custom overrides บน Bootstrap 5
 */

/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;800;900&family=Sarabun:wght@400;600;700;800;900&display=swap');

/* ===== CSS Variables ===== */
:root {
  --brand:       #173988;
  --brand-dark:  #0f2560;
  --brand-mid:   #2048b0;
  --brand-light: #afcae8;
  --brand-xlight:#eef3fb;

  --pork-bg:           #fff0f0; --pork-text:           #9b2226;
  --pork-processed-bg: #ffe8e8; --pork-processed-text: #7f1d1d;
  --pork-shabu-bg:     #fff3e0; --pork-shabu-text:     #7c4700;
  --chicken-bg:        #fffde7; --chicken-text:        #5d3a00;
  --beef-bg:           #fef3c7; --beef-text:           #78350f;
  --beef-processed-bg: #fef9c3; --beef-processed-text: #713f12;
  --shrimp-bg:         #fff0f9; --shrimp-text:         #831843;
  --squid-bg:          #ede7f6; --squid-text:          #311b92;
  --crab-bg:           #e8f5e9; --crab-text:           #1b5e20;
  --fish-bg:           #eef3fb; --fish-text:           #0f2560;
  --seafood-bg:        #ede7f6; --seafood-text:        #311b92;
}

/* ===== Base ===== */
* { box-sizing: border-box; }

body {
  font-family: 'Sarabun', 'Segoe UI', sans-serif;
  background: #f5f4f2;
  color: #1a1a2e;
}

/* ===== Logo Image ===== */
.site-logo-img {
  height: 44px;
  width: auto;
}
@media (max-width: 576px) {
  .site-logo-img { height: 36px; }
}

/* ===== Navbar ===== */
#mainNav {
  border-bottom: 3px solid var(--brand);
  backdrop-filter: blur(8px);
  background: rgba(255,255,255,.97) !important;
  padding: 8px 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.navbar-brand {
  flex-shrink: 0;
  min-width: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* About link */
.nav-about-link {
  color: #555;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  padding: 6px 8px;
  white-space: nowrap;
}
.nav-about-link:hover { color: var(--brand); }

/* Auth nav buttons — compact on mobile */
#authNav .btn { font-size: .8rem; padding: 6px 10px; white-space: nowrap; }
#authNav .dropdown-toggle { font-size: .8rem; padding: 6px 10px; }

.logo-icon  { font-size: 2rem; line-height: 1; filter: drop-shadow(0 2px 4px rgba(23,57,136,.3)); flex-shrink: 0; }
.logo-title { font-size: 1.05rem; font-weight: 900; color: var(--brand); line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
.logo-sub   { font-size: .65rem; color: #aaa; letter-spacing: .02em; white-space: nowrap; }

/* ===== Cart Button ===== */
.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: .88rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(23,57,136,.35);
  transition: all .2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cart-btn:hover {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  box-shadow: 0 6px 20px rgba(23,57,136,.45);
  transform: translateY(-1px);
}
.cart-btn:active { transform: translateY(0); }

.cart-count {
  background: #fff;
  color: var(--brand);
  border-radius: 50px;
  padding: 1px 8px;
  font-size: .75rem;
  font-weight: 900;
  min-width: 22px;
  text-align: center;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.1);
}

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #0b1e57 0%, #173988 50%, #2048b0 85%, #afcae8 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(175,202,232,.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(32,72,176,.2) 0%, transparent 50%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 60px;
  background: #f5f4f2;
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-title {
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 3px 12px rgba(0,0,0,.3);
  letter-spacing: -.02em;
}
.hero-sub {
  font-size: 1.1rem;
  opacity: .88;
  font-weight: 500;
}
.hero-cta-btn {
  color: var(--brand) !important;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  transition: all .2s;
}
.hero-cta-btn:hover {
  background: var(--brand-light) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  transform: translateY(-2px);
}

/* ===== Filter Bar ===== */
.filter-bar {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(23,57,136,.12);
  z-index: 1010;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  overflow: visible;
}
.filter-bar .container { overflow: visible; }
.filter-bar .d-flex {
  flex-wrap: nowrap !important;
  overflow-x: auto;
  padding: 6px 2px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filter-bar .d-flex::-webkit-scrollbar { display: none; }

.filter-btn {
  border: 1.5px solid #dde;
  color: #555;
  font-weight: 600;
  font-size: .82rem;
  padding: 5px 14px;
  transition: all .18s;
  background: #fff;
  white-space: nowrap;
}
.filter-btn:hover  { border-color: var(--brand); color: var(--brand); background: var(--brand-xlight); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(23,57,136,.3);
}

/* ===== Section title ===== */
#productSection .container > .section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 1.5rem;
  padding-bottom: .6rem;
  border-bottom: 3px solid var(--brand-light);
}

/* ===== Product Card ===== */
.product-card {
  border-radius: 18px !important;
  overflow: hidden;
  transition: transform .22s cubic-bezier(.34,1.56,.64,1), box-shadow .22s, z-index 0s;
  border-top: 4px solid var(--brand) !important;
  background: #fff;
  position: relative;
  z-index: 1;
}
.product-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 40px rgba(23,57,136,.2) !important;
}

/* Badge รหัส */
.badge-wrap { position: absolute; top: 0; right: 0; z-index: 2; }
.product-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 0 0 0 12px;
  letter-spacing: .04em;
  box-shadow: -2px 2px 8px rgba(0,0,0,.15);
}

/* รูปสินค้า */
.product-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-light), #f0fffe);
  position: relative;
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s cubic-bezier(.25,.46,.45,.94);
}
.product-card:hover .product-img { transform: scale(1.08); }

/* gradient overlay ล่างรูป */
.product-img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,.08), transparent);
  pointer-events: none;
}

/* Tag หมวด */
.product-tag {
  display: inline-block;
  padding: 2px 11px;
  border-radius: 50px;
  font-size: .7rem;
  font-weight: 800;
  width: fit-content;
  letter-spacing: .03em;
}
.tag-pork           { background: var(--pork-bg);           color: var(--pork-text);           }
.tag-pork_processed { background: var(--pork-processed-bg); color: var(--pork-processed-text); }
.tag-pork_shabu     { background: var(--pork-shabu-bg);     color: var(--pork-shabu-text);     }
.tag-chicken        { background: var(--chicken-bg);        color: var(--chicken-text);        }
.tag-beef           { background: var(--beef-bg);           color: var(--beef-text);           }
.tag-beef_processed { background: var(--beef-processed-bg); color: var(--beef-processed-text); }
.tag-shrimp         { background: var(--shrimp-bg);         color: var(--shrimp-text);         }
.tag-squid          { background: var(--squid-bg);          color: var(--squid-text);          }
.tag-crab           { background: var(--crab-bg);           color: var(--crab-text);           }
.tag-fish           { background: var(--fish-bg);           color: var(--fish-text);           }
.tag-seafood        { background: var(--seafood-bg);        color: var(--seafood-text);        }
.tag-veg            { background: #e8f5e9; color: #2e7d32; }
.tag-snack          { background: #fff8e1; color: #f57f17; }
.tag-other          { background: #f3e5f5; color: #6a1b9a; }

/* ชื่อสินค้า */
.product-name { font-size: 1rem; font-weight: 800; line-height: 1.3; color: #1a1a2e; }

/* ราคา */
.product-price {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--brand);
  letter-spacing: -.02em;
}
.product-price small { font-size: .7rem; font-weight: 500; color: #aaa; }
.product-price-tbd {
  font-size: .82rem;
  font-weight: 600;
  color: #aaa;
  font-style: italic;
}

/* ขายส่ง */
.product-wholesale {
  font-size: .82rem;
  font-weight: 600;
  color: #666;
  background: var(--brand-xlight);
  padding: 3px 10px;
  border-radius: 6px;
}

/* Disclaimer */
.product-disclaimer {
  font-size: .68rem;
  color: #bbb;
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
  margin-top: 2px;
  line-height: 1.5;
}

/* Input จำนวน */
.qty-input {
  font-weight: 800;
  border-color: #dde;
  text-align: center;
}
.qty-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(0,109,119,.18);
}

/* ปุ่มใส่ตะกร้า */
.btn-add {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: .82rem;
  transition: all .18s;
}
.btn-add:hover {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(23,57,136,.35);
}

/* ===== Btn Brand ===== */
.btn-brand {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  color: #fff;
  border: none;
  font-weight: 700;
  transition: all .2s;
  box-shadow: 0 4px 14px rgba(23,57,136,.3);
}
.btn-brand:hover {
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,109,119,.4);
  transform: translateY(-1px);
}

/* ===== Cart Offcanvas ===== */
#cartOffcanvas {
  width: min(440px, 100vw);
  border-left: none;
  box-shadow: -8px 0 40px rgba(0,0,0,.12);
}

.cart-total-note {
  font-size: .76rem;
  color: #bbb;
  text-align: center;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--brand-xlight);
  border: 1px solid rgba(0,109,119,.1);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: background .15s;
}
.cart-item:hover { background: var(--brand-light); }
.cart-item-name   { font-weight: 800; font-size: .92rem; color: #1a1a2e; }
.cart-item-detail { font-size: .76rem; color: #888; margin-top: 2px; }
.cart-item-price  { font-weight: 900; color: var(--brand); white-space: nowrap; }
.cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  font-size: .9rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all .15s;
  flex-shrink: 0;
}
.cart-item-remove:hover { color: #e53935; background: #fee2e2; }

/* ===== Toast ===== */
.toast-brand { background: var(--brand-dark) !important; box-shadow: 0 8px 24px rgba(0,0,0,.2); }

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(135deg, #080f2a 0%, #0f2560 60%, #173988 100%);
  color: #afcae8;
  padding: 32px 0;
  font-size: .85rem;
}
.footer-logo {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.01em;
}

/* ===== Loading skeleton ===== */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f8f8f8 50%, #eee 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

/* ===== Mobile Filter Hamburger ===== */
.filter-active-label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--brand);
}

.filter-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  background: var(--brand);
  border: none;
  border-radius: 10px;
  padding: 8px 7px;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.filter-hamburger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  transform-origin: center;
}
/* X animation */
.filter-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.filter-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.filter-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.filter-mobile-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s cubic-bezier(.4,0,.2,1);
  background: #fff;
  border-top: 1px solid rgba(23,57,136,.08);
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
}
.filter-mobile-panel.open { max-height: 560px; overflow-y: auto; }

.filter-mobile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.filter-mobile-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 6px;
  background: var(--brand-xlight);
  border: 1.5px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: all .18s;
}
.filter-mobile-item:hover {
  border-color: var(--brand-light);
  background: #e0eaf8;
}
.filter-mobile-item.active {
  background: var(--brand);
  border-color: var(--brand);
}
.filter-mobile-item.active .fmi-label { color: #fff; }
.fmi-emoji { font-size: 1.5rem; line-height: 1; }
.fmi-label { font-size: .72rem; font-weight: 700; color: var(--brand-dark); text-align: center; line-height: 1.3; }

/* ===== About Page ===== */
.about-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 28px 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  border-top: 4px solid var(--brand);
}
.about-card--accent { border-top-color: var(--brand-mid); background: var(--brand-xlight); }
.about-card--contact { border-top-color: var(--brand-dark); }

.about-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; color: #fff;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(23,57,136,.3);
}
.about-heading {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--brand-dark);
  margin-bottom: 10px;
}
.about-text {
  color: #666;
  font-size: .9rem;
  line-height: 1.7;
  margin: 0;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--brand-xlight);
  border-radius: 12px;
  padding: 12px 14px;
}
.contact-item > .bi {
  font-size: 1.2rem;
  color: var(--brand);
  margin-top: 2px;
  flex-shrink: 0;
}
.contact-label { font-size: .72rem; color: #999; font-weight: 600; }
.contact-value { font-size: .9rem; font-weight: 700; color: #1a1a2e; }

/* ===== Pagination ===== */
.pg-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pg-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1.5px solid #dde;
  border-radius: 10px;
  background: #fff;
  color: #555;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pg-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-xlight);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(23,57,136,.15);
}
.pg-btn.pg-active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-mid) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(23,57,136,.35);
  transform: translateY(-1px);
}
.pg-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.pg-arrow {
  color: var(--brand);
  border-color: rgba(0,109,119,.25);
}
.pg-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  color: #aaa;
  font-size: .9rem;
  user-select: none;
}
.pg-info {
  text-align: center;
  color: #aaa;
  font-size: .78rem;
  margin-top: 12px;
  margin-bottom: 0;
}

/* ===== Responsive ===== */
@media (max-width: 576px) {
  .hero        { padding: 44px 0 56px !important; }
  .product-img-wrap { aspect-ratio: 1; }
  .hero-title  { font-size: 1.7rem; }

  /* ซ่อน label "ตะกร้า" บนมือถือเล็ก เหลือแค่ icon + badge */
  .cart-label  { display: none; }
  .cart-btn    { padding: 8px 12px; }

  /* logo ย่อเล็กลงนิด */
  .logo-icon   { font-size: 1.7rem; }
  .logo-title  { font-size: .95rem; }
  .logo-sub    { display: none; }

  /* nav-actions ชิดขวาสุด ซ่อน "เกี่ยวกับเรา" */
  .nav-about-link { display: none; }
  .nav-actions { margin-left: auto; }

  /* filter bar — mobile sticky เหมือนเดิม */

  /* pagination ปุ่มเล็กลง */
  .pg-btn { min-width: 34px; height: 34px; font-size: .8rem; padding: 0 8px; }
}
