:root {
  --front-bg: #f7f5ef;
  --front-text: #1f2937;
  --front-muted: #4b5563;
  --front-card: rgba(255, 255, 255, 0.88);
  --front-accent: #de5b22;
  --front-accent-deep: #b84314;
  --front-accent-soft: #ffe1c8;
  --front-border: rgba(31, 41, 55, 0.09);
  --front-shadow: 0 16px 40px rgba(28, 31, 35, 0.12);
}

body.frontend {
  font-family: "Noto Sans Thai", sans-serif;
  color: var(--front-text);
  background:
    radial-gradient(circle at 12% 12%, #fff4e6 0%, transparent 38%),
    radial-gradient(circle at 82% 2%, #d5f7f7 0%, transparent 30%),
    linear-gradient(140deg, #f9f6ed 0%, #eef9fb 100%);
  min-height: 100vh;
}

body.frontend::before,
body.frontend::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(3px);
}

body.frontend::before {
  width: 240px;
  height: 240px;
  top: 20%;
  right: -80px;
  background: rgba(255, 212, 179, 0.55);
}

body.frontend::after {
  width: 200px;
  height: 200px;
  left: -80px;
  bottom: 12%;
  background: rgba(162, 228, 230, 0.5);
}

.frontend-main {
  max-width: 1220px;
}

.site-nav {
  background: rgba(20, 28, 38, 0.88) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav .brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffba70, var(--front-accent));
  color: #fff;
}

.site-nav .brand-text {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #fff;
}

.site-nav .nav-link {
  color: rgba(255, 255, 255, 0.82) !important;
  font-weight: 500;
}

.site-nav .nav-link.active,
.site-nav .nav-link:hover {
  color: #fff !important;
}

.site-nav .nav-search .form-control {
  min-width: 240px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.97);
}

.site-nav .btn {
  border-radius: 999px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--front-accent), #f07b43);
  border: 0;
}

.front-hero {
  border: 1px solid var(--front-border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 95% 14%, rgba(255, 225, 200, 0.85), transparent 32%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(240, 250, 255, 0.95));
  box-shadow: var(--front-shadow);
  padding: 1.4rem 1.5rem;
  animation: fadeInRise 0.65s ease both;
}

.front-hero__eyebrow {
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--front-accent-deep);
  margin-bottom: 0.35rem;
}

.front-hero h1 {
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: clamp(1.45rem, 3.2vw, 2.5rem);
  margin-bottom: 0.35rem;
}

.front-hero p {
  color: var(--front-muted);
  margin-bottom: 0;
}

.product-grid .col-6,
.product-grid .col-md-4,
.product-grid .col-lg-3 {
  animation: fadeInRise 0.45s ease both;
}

.product-grid > div:nth-child(2n) { animation-delay: 0.04s; }
.product-grid > div:nth-child(3n) { animation-delay: 0.07s; }
.product-grid > div:nth-child(4n) { animation-delay: 0.1s; }

.frontend .card {
  background: var(--front-card);
  border: 1px solid var(--front-border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.frontend .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 34px rgba(31, 41, 55, 0.14);
}

.frontend .card-header {
  border-bottom: 0;
  background: linear-gradient(130deg, rgba(255, 250, 243, 0.92), rgba(239, 251, 254, 0.9));
}

.frontend .card-title a,
.frontend .card-title {
  color: #18212d;
  text-decoration: none;
}

.product-image img,
.frontend .card-img-top {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
}

.frontend .card-footer {
  background: rgba(255, 255, 255, 0.82) !important;
  border-top: 1px solid var(--front-border);
}

.frontend .btn {
  border-radius: 10px;
  font-weight: 600;
}

.frontend .btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--front-accent), #f07b43);
}

.frontend .btn-primary:hover {
  background: linear-gradient(135deg, var(--front-accent-deep), #dd5e24);
}

.frontend .btn-outline-warning {
  color: #8b3a16;
  border-color: #f5b186;
  background: #fff4ea;
}

.frontend .btn-outline-warning:hover {
  color: #fff;
  background: #d7662f;
  border-color: #d7662f;
}

.site-footer {
  border: 1px solid var(--front-border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, 0.64);
  margin-bottom: 1.2rem;
}

.footer-divider {
  border-top: 1px dashed rgba(31, 41, 55, 0.18);
}

.footer-links a {
  text-decoration: none;
}

#ppda-popup {
  border-top: 1px solid var(--front-border);
  background: rgba(255, 255, 255, 0.96) !important;
  backdrop-filter: blur(10px);
}

#ppda-popup .btn-primary {
  background: linear-gradient(135deg, var(--front-accent), #f07b43);
  border: 0;
  border-radius: 10px;
}

.pagination {
  gap: 0.25rem;
}

.pagination .page-link {
  border: 0;
  border-radius: 10px;
  color: #2d3847;
  background: rgba(255, 255, 255, 0.78);
}

.pagination .active .page-link,
.pagination .page-link:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--front-accent), #f07b43);
}

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

@media (max-width: 991.98px) {
  .site-nav .nav-search {
    width: 100%;
    margin-top: 0.8rem;
  }

  .site-nav .nav-search .form-control {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .frontend-main {
    padding-top: 1.2rem !important;
  }

  .front-hero {
    border-radius: 18px;
    padding: 1.1rem;
  }

  .site-footer {
    padding: 0.8rem 0.9rem;
  }

  .frontend .card-title {
    font-size: 0.92rem;
  }

  .frontend .card-footer {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .frontend .card-footer a:last-child {
    grid-column: span 2;
  }
}
