/* ==========================================================================
   NHỰA ĐƯỜNG QUỐC LÂM ANH – THEME PALETTE & WORDPRESS EXTRAS
   ========================================================================== */

:root {
  --font-sans: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --navy-950: #0B1220;
  --navy-800: #162238;
  --blue-600: #1D4ED8;
  --magenta-700: #D97706;
  --magenta-900: #92400E;
  --pink-100: #FEF3C7;
  --blue-50: #F1F5F9;
  --decor-pink: #F59E0B;
  --hero-gradient: linear-gradient(120deg, #0B1220 0%, #162238 55%, #78350F 100%);
  --section-bar-gradient: linear-gradient(90deg, #1D4ED8 0%, #D97706 100%);
  --placeholder-gradient: linear-gradient(135deg, #0B1220 0%, #162238 55%, #78350F 100%);
}

html,
body {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.category-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 20px;
}

.category-directory__card {
  display: flex;
  min-height: 190px;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--slate-900);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.category-directory__card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-600);
  box-shadow: var(--shadow-md);
}

.category-directory__count {
  color: var(--blue-600);
  font-size: 0.82rem;
  font-weight: 700;
}

.category-directory__card h2 {
  margin: 12px 0 8px;
  font-size: 1.2rem;
  line-height: 1.35;
}

.category-directory__card p {
  margin: 0 0 18px;
  color: var(--slate-600);
  line-height: 1.55;
}

.category-directory__link {
  margin-top: auto;
  color: var(--blue-600);
  font-weight: 700;
}

.category-directory__all {
  margin: 28px 0 0;
  text-align: center;
}

.section--pink {
  background-color: #FFFBEB;
}

.wp-page-hero {
  background: var(--hero-gradient);
  color: var(--white);
  padding: 56px 0 48px;
  position: relative;
}

.wp-page-hero__title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-top: 10px;
}

.wp-page-hero__desc {
  color: var(--slate-200);
  margin-top: 10px;
  max-width: 720px;
  font-size: 1rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--slate-300);
}

.breadcrumbs a {
  color: var(--white);
  text-decoration: none;
  opacity: 0.88;
}

.breadcrumbs a:hover {
  opacity: 1;
  text-decoration: underline;
}

.breadcrumbs__sep {
  opacity: 0.55;
}

.single-product-wrap {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 40px;
  align-items: start;
}

.single-product__gallery {
  background: var(--slate-100);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.single-product__img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
  object-fit: cover;
}

.single-product__meta-box {
  background: var(--blue-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 20px 0;
}

.single-product__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.single-product__price-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--magenta-700);
}

.single-product__content {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.single-product__content h2,
.single-product__content h3,
.entry-content h2,
.entry-content h3 {
  color: var(--navy-950);
  margin: 24px 0 12px;
  font-weight: 700;
}

.single-product__content p,
.entry-content p {
  margin-bottom: 16px;
  color: var(--ink);
}

.single-product__content ul,
.entry-content ul,
.single-product__content ol,
.entry-content ol {
  margin: 0 0 18px 22px;
}

.single-product__content li,
.entry-content li {
  margin-bottom: 8px;
}

.single-post-container {
  max-width: 860px;
  margin: 0 auto;
}

.single-post__thumb {
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.single-post__thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.single-post__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--slate-200);
  margin-top: 14px;
}

.wp-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.wp-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--navy-950);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}

.wp-pagination .page-numbers:hover,
.wp-pagination .page-numbers.current {
  background: var(--blue-600);
  color: var(--white);
  border-color: var(--blue-600);
}

.btn.is-loading {
  opacity: 0.72;
  pointer-events: none;
}

/* Submenu trigger on "Sản phẩm" nav link */
.nav-link--has-sub {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-link--has-sub svg {
  transition: transform var(--transition);
}

.nav-item--mega:hover .nav-link--has-sub svg,
.nav-item--mega.is-open .nav-link--has-sub svg {
  transform: rotate(180deg);
}

.nav-item--mega .mega-menu {
  left: -220px;
  max-width: calc(100vw - 32px);
}

@media (min-width: 1080px) {
  .main-nav {
    margin-left: auto;
    margin-right: 12px;
  }

  .nav-list {
    gap: 6px;
  }
}

/* Logo size adjustment */
.brand__logo-wrap {
  width: 78px;
  height: 68px;
}

.footer__logo-box img {
  width: 64px;
  height: 54px;
}

/* Mobile horizontal scroll for homepage categories & products */
@media (max-width: 767px) {
  .home .category-grid,
  .home .product-showcase {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding-bottom: 12px;
    margin-inline: -4px;
    padding-inline: 4px;
    scrollbar-width: thin;
  }

  .home .category-grid > .category-card,
  .home .product-showcase > .product-card {
    flex: 0 0 82%;
    max-width: 320px;
    scroll-snap-align: start;
  }

  .home .product-showcase > .product-card.is-hidden {
    display: none;
  }
}

/* Mobile Hero: show image before text */
@media (max-width: 991px) {
  .hero__visual {
    order: -1;
  }
}

/* Mobile Header: place logo & menu button above topbar */
@media (max-width: 1079px) {
  body {
    display: flex;
    flex-direction: column;
  }

  #site-header {
    order: 1;
  }

  .topbar {
    order: 2;
  }

  #noi-dung-chinh {
    order: 3;
  }

  .site-footer {
    order: 4;
  }
}

@media (max-width: 900px) {
  .single-product-wrap {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
