/* ============================================
   GLOBAL VARIABLES & RESET
============================================ */
:root {
  --gold: #c8a84b;
  --gold-light: #e8d5a0;
  --gold-dark: #a08030;
  --bg-dark: #0f0c08;
  --bg-card: #1a1510;
  --bg-modal: #1a1510;
  --text-light: #e8dfc8;
  --text-muted: #b0996a;
  --text-dark: #7a6840;
  --border-gold: rgba(200,168,75,0.18);
  --border-gold-light: rgba(200,168,75,0.3);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.text-muted { color:#fff !important; }

body {
  background: var(--bg-dark);
  font-family: 'Sarabun', sans-serif;
  color: var(--text-light);
}

/* ============================================
   TYPOGRAPHY
============================================ */
h1, h2, h3, h4, h5, .nav-logo, .hero-title, .card-title, .modal-title-h {
  font-family: 'Noto Serif Thai', serif;
}

/* ============================================
   SCROLLBAR
============================================ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: rgba(200,168,75,0.05);
}
::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

/* ============================================
   TOP STRIP / TICKER
============================================ */
.strip {
  background: #0a0805;
  border-bottom: 1px solid var(--border-gold);
  overflow: hidden;
  white-space: nowrap;
  padding: 8px 0;
  position: relative;
}
.strip-track {
  display: inline-block;
  animation: scrollStrip 22s linear infinite;
}
.strip-item {
  display: inline-block;
  color: var(--gold-light);
  font-size: 14px;
  margin: 0 20px;
  font-weight: 500;
  letter-spacing: 0.03em;
}
.strip-item i {
  margin-right: 6px;
  font-size: 9px;
  vertical-align: middle;
  color: var(--gold);
}
@keyframes scrollStrip {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.strip:hover .strip-track {
  animation-play-state: paused;
}

/* ปรับปรุง navbar สำหรับมือถือ */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    padding: 0.8rem 1rem;
    gap: 0.8rem;
  }
  
  .nav-logo {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .nav-logo img {
    height: 60px !important;
    max-width: 100%;
    object-fit: contain;
  }
  
  .nav-cats {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .nav-cats::-webkit-scrollbar {
    display: none;
  }
  
  .nav-cats {
    display: flex;
    gap: 0.5rem;
    padding: 0.2rem 0;
  }
  
  .nav-cat {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    flex-shrink: 0;
  }
  
  .nav-search-wrap {
    width: 100%;
  }
}
.nav-cat {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
}
.nav-cat:hover {
  color: var(--gold-light);
  background: rgba(200,168,75,0.1);
}
.nav-cat.active {
  background: var(--gold);
  color: #1a1205;
}
.nav-search-wrap {
  position: relative;
  min-width: 220px;
}
.nav-search {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-gold);
  border-radius: 30px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  color: var(--text-light);
  font-size: 0.85rem;
  transition: all 0.2s;
}
.nav-search:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255,255,255,0.08);
}
.nav-search::placeholder {
  color: var(--text-dark);
}
.nav-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dark);
  font-size: 0.85rem;
  pointer-events: none;
}

/* Province badges - แสดงจำนวนพระ */
.prov-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin: 0.15rem 0;
    border-radius: 12px;
    color: #d4c5a0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prov-link i {
    width: 20px;
    color: var(--gold, #c8a84b);
    font-size: 0.85rem;
}

.prov-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 400;
}

.prov-badge-stock {
    background: rgba(200, 168, 75, 0.2);
    color: var(--gold, #c8a84b);
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 32px;
    text-align: center;
}

.prov-badge-total {
    background: rgba(100, 100, 100, 0.3);
    color: #9e8e6e;
    padding: 0.15rem 0.4rem;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 500;
    min-width: 28px;
    text-align: center;
}

.prov-link:hover {
    background: rgba(200, 168, 75, 0.1);
}

.prov-link.active {
    background: rgba(200, 168, 75, 0.2);
    border-left: 3px solid var(--gold, #c8a84b);
}

/* Region header */
.sb-heading.sub {
    font-size: 0.75rem;
    color: #7a6a4a;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
    padding: 0.25rem 1rem;
    letter-spacing: 0.5px;
}

/* Province list wrapper */
.prov-link-wrapper {
    display: block;
}

/* ============================================
   HERO SECTION
============================================ */
.hero {
    background: #1a0000;
}

.hero-banner {
    width: 100% !important;
    height: 250px;
    object-fit: cover;
}

.carousel-inner {
    border: 2px solid rgba(255, 215, 0, 0.2);
}

.carousel-control-prev,
.carousel-control-next {
    width: 8%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: rgba(0,0,0,0.5);
    border-radius: 50%;
    padding: 20px;
}

.carousel-indicators [data-bs-target] {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: gold;
}

@media (max-width: 991px) {
    .hero-banner {
        height: auto;
    }
}

/* ============================================
   SIDEBAR
============================================ */
.sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 0.5rem 0;
}
.sb-heading {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  margin-bottom: 0.25rem;
  border-left: 3px solid var(--gold);
}
.sb-link, .prov-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.sb-link:hover, .prov-link:hover {
  color: var(--gold-light);
  background: rgba(200,168,75,0.07);
  border-left-color: var(--gold);
}
.sb-link.active, .prov-link.active {
  color: var(--gold-light);
  background: rgba(200,168,75,0.16);
  border-left-color: var(--gold);
  font-weight: 600;
}
.sb-link i, .prov-link i {
  font-size: 0.7rem;
  width: 16px;
  opacity: 0.6;
}
.sb-search-wrap {
  padding: 0.5rem 1rem;
  position: relative;
}
.sb-search {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 0.5rem 0.5rem 0.5rem 2rem;
  color: var(--text-light);
  font-size: 0.75rem;
}
.sb-search:focus {
  outline: none;
  border-color: var(--gold);
}
.sb-search-icon {
  position: absolute;
  left: 1.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: rgba(200,168,75,0.35);
}
.sb-divider {
  height: 1px;
  background: var(--border-gold);
  margin: 0.75rem 1rem;
}

/* ============================================
   PRODUCT CARDS
============================================ */
.pcard {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.25s ease;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
}
.pcard.visible {
  opacity: 1;
  transform: translateY(0);
}
.pcard:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--border-gold-light);
}
.card-img-wrap {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #120f0a;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.pcard:hover .card-img-wrap img {
  transform: scale(1.06);
}
.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 60%);
  pointer-events: none;
}
.card-quick {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
  background: rgba(0,0,0,0.5);
}
.pcard:hover .card-quick {
  opacity: 1;
}
.btn-quick {
  background: var(--gold);
  color: #1a1205;
  border: none;
  border-radius: 30px;
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-quick:hover {
  background: var(--gold-light);
  transform: scale(1.05);
}
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gold);
  color: #1a1205;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
}
.card-body-inner {
  padding: 0.8rem;
}
.card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}
.card-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
}
.card-price small {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.btn-interest {
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--gold);
  border-radius: 30px;
  padding: 0.3rem 0.8rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-interest:hover {
  background: var(--gold);
  color: #1a1205;
}

/* ============================================
   PROVINCE BADGE
============================================ */
.province-badge {
  background: rgba(200,168,75,0.1);
  border: 1px solid var(--border-gold-light);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.province-badge span {
  font-size: 0.8rem;
  color: var(--gold-light);
}
.province-badge strong {
  color: var(--gold);
}

/* ============================================
   PAGINATION
============================================ */
.page-btn {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1205;
}
.page-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1205;
  font-weight: 700;
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ============================================
   MODAL
============================================ */
.modal-content {
  background: var(--bg-modal);
  border: 1px solid var(--border-gold);
  border-radius: 24px;
}
.modal-header {
  border-bottom: 1px solid var(--border-gold);
  padding: 1rem 1.5rem;
}
.modal-header span {
  font-family: 'Noto Serif Thai', serif;
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
}
.modal-close-btn {
  background: rgba(200,168,75,0.1);
  border: 1px solid var(--border-gold);
  color: var(--gold);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close-btn:hover {
  background: var(--gold);
  color: #1a1205;
}
.modal-title-h {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}
.modal-price-h {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1rem;
}
.modal-price-h small {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.modal-desc-p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.modal-hr {
  border-color: var(--border-gold);
  margin: 1rem 0;
}
.modal-body-left {
  background: #0d0b08;
  border-radius: 20px;
}
.image-thumb-grid {
  display: grid;
  gap: 6px;
}
.image-thumb-grid a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
}
.image-thumb-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.image-thumb-grid img:hover {
  transform: scale(1.03);
}

/* ============================================
   LINE COPY BOX
============================================ */
.line-box {
  background: rgba(0,185,0,0.07);
  border: 1px solid rgba(0,185,0,0.25);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
}
.line-id-big {
  font-size: 1.3rem;
  font-weight: 700;
  color: #00B900;
  letter-spacing: 0.04em;
  margin: 0.5rem 0;
}
.btn-copy-line {
  background: rgba(0,185,0,0.12);
  border: 1px solid rgba(0,185,0,0.4);
  color: #00B900;
  border-radius: 30px;
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-copy-line:hover {
  background: #00B900;
  color: #fff;
}

/* ============================================
   FOOTER
============================================ */
footer {
  background: #0a0805;
  border-top: 1px solid var(--border-gold);
  margin-top: 3rem;
  padding: 2rem 1rem 1rem;
}
.footer-inner {
  max-width: 1300px;
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 1rem;
}
.footer-logo em {
  font-style: normal;
  color: var(--gold-light);
}
.footer-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}
.footer-social {
  display: flex;
  gap: 0.8rem;
}
.social-a {
  background: rgba(200,168,75,0.1);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--gold);
  transition: all 0.2s;
}
.social-a:hover {
  background: var(--gold);
  color: #1a1205;
}
.footer-col h6 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 1rem;
}
.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-col li {
  margin-bottom: 0.5rem;
}
.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: var(--gold-light);
}
.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-gold);
  font-size: 0.7rem;
  color: var(--text-dark);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ============================================
   SKELETON LOADER
============================================ */
.skeleton {
  background: linear-gradient(90deg, #2a2010 25%, #3a3018 50%, #2a2010 75%);
  background-size: 200%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200%; }
  100% { background-position: -200%; }
}

/* ============================================
   UTILITIES & OVERRIDES
============================================ */
.results-count {
  font-size: 0.75rem;
  color: var(--text-dark);
}
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-dark);
}
.empty-state i {
  font-size: 3rem;
  opacity: 0.3;
  margin-bottom: 1rem;
}
.fab-sb {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1040;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1205;
  border: none;
  box-shadow: 0 4px 15px rgba(200,168,75,0.4);
  cursor: pointer;
  transition: transform 0.2s;
}
.fab-sb:hover {
  transform: scale(1.07);
}
@media (max-width: 991px) {
  .fab-sb {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
.offcanvas {
  background: #130f08 !important;
  border-right: 1px solid var(--border-gold) !important;
}
.offcanvas-header {
  border-bottom: 1px solid var(--border-gold);
}
.offcanvas .nav-logo {
  font-size: 1.2rem;
}