/* ==========================================================================
   A Nice One Pte Ltd -- Buyer Website
   Design tokens + base styles
   Fonts: Sora (display/headings) + Inter (body/data) -- loaded via Google Fonts
   ========================================================================== */

:root {
  /* Color */
  --color-primary: #b2001a;      /* deep fresh green -- trust, grocery/export */
  --color-primary-dark: #ef9928;
  --color-primary-light: #EAF5EE;
  --color-accent: #f9af0e;       /* warm gold -- premium sourcing, used sparingly */
  --color-accent-dark: #B8841C;
  --color-ink: #14211A;          /* headings */
  --color-body: #4B5563;         /* body text */
  --color-muted: #7C8B82;
  --color-border: #E3E7E2;
  --color-bg: #F7F8F5;           /* page background */
  --color-surface: #FFFFFF;
  --color-danger: #C0392B;

  /* Type */
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Layout */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(20, 33, 26, 0.06), 0 4px 16px rgba(20, 33, 26, 0.05);
  --shadow-card-hover: 0 8px 24px rgba(20, 33, 26, 0.12);
  --container-max: 1280px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-body);
  background: var(--color-bg);
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6,
.font-display {
  font-family: var(--font-display);
  color: var(--color-ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.container-xl { max-width: var(--container-max); margin: 0 auto; padding: 0 1rem; }

/* ---------- Buttons ---------- */
.btn-brand {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  transition: background .15s ease, transform .15s ease;
}
.btn-brand:hover, .btn-brand:focus {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}
.btn-outline-brand {
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: transparent;
}
.btn-outline-brand:hover {
  background: var(--color-primary);
  color: #fff;
}
.btn-accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-ink);
  font-weight: 700;
  border-radius: var(--radius-sm);
}
.btn-accent:hover { background: var(--color-accent-dark); color: var(--color-ink); }

/* ---------- Section rhythm ---------- */
.section { padding: 20px 0; }
.section-sm { padding: 2rem 0; }
.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.section-eyebrow::before {
  content: "";
  width: 18px; height: 2px;
  background: var(--color-accent);
  display: inline-block;
}
.section-title { margin: .35rem 0 0; font-size: 1.75rem; }
.section-sub { color: var(--color-muted); margin: .25rem 0 0; }

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,.85);
  font-size: .82rem;
}
.topbar a { color: #fff; }
.topbar select.currency-select {
  background: transparent;
  color: #fff;
  border: none;
  font-size: .82rem;
}
.topbar select.currency-select option { color: #14211A; }

/* ---------- Header ---------- */
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.site-logo { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--color-ink); display: flex; align-items: center; gap: .5rem; }
.site-logo .logo-mark {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--color-primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.1rem;
}
.site-logo small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .62rem; color: var(--color-muted); letter-spacing: .06em; text-transform: uppercase; }

.header-search { position: relative; }
.header-search input {
  border-radius: 999px;
  padding: .65rem 1rem .65rem 2.6rem;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
}
.header-search input:focus { border-color: var(--color-primary); background: #fff; box-shadow: none; }
.header-search .bi-search { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--color-muted); }

.header-action {
  display: flex; flex-direction: column; align-items: center;
  color: var(--color-ink); font-size: .78rem; font-weight: 600; position: relative;
}
.header-action i { font-size: 1.35rem; color: var(--color-primary); }
.header-action .badge-count {
  position: absolute; top: -4px; right: -8px;
  background: var(--color-accent); color: var(--color-ink);
  font-size: .62rem; font-weight: 800; border-radius: 999px;
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
}

/* Category strip */
.category-strip { background: var(--color-primary); }
.category-strip .nav-link {
  color: rgba(255,255,255,.9);
  font-size: .86rem; font-weight: 600;
  padding: .7rem .9rem;
}
.category-strip .nav-link:hover, .category-strip .nav-link.active { color: #fff; background: rgba(255,255,255,.12); border-radius: var(--radius-sm); }
.category-strip .dropdown-menu { border-radius: var(--radius-md); border: 1px solid var(--color-border); box-shadow: var(--shadow-card-hover); }

/* ---------- Cascading category flyout (Tier1 -> hover -> Tier2 -> click -> Tier3) ----------
   Three columns side by side in one dropdown-menu. Column 1 (Tier1) is
   always visible once the menu opens. Columns 2 and 3 start empty/hidden
   and are populated by JS -- see the category tree + rendering logic in
   partials.js/main.js -- rather than pre-rendering every Tier1/Tier2
   combination as static HTML, which would be an enormous amount of markup
   for a 4-tier category structure. */
.explore-categories-menu {
  padding: 0; border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--color-border); box-shadow: var(--shadow-card-hover);
  align-items: stretch;
}
/* Bootstrap's own .dropdown-menu default is display:none, switching to
   display:block via its .show class when the button is clicked open. This
   menu needs flex (not block) for its 3 columns, but that display value
   must ONLY apply while .show is present too -- otherwise it overrides
   Bootstrap's display:none and the panel stays permanently visible,
   regardless of whether the button is clicked open or closed. */
.explore-categories-menu.show {
  display: flex;
}
.ecm-col {
  min-width: 220px; max-width: 240px;
  max-height: 420px; overflow-y: auto;
  padding: .6rem;
}
.ecm-col + .ecm-col { border-left: 1px solid var(--color-border); }
.ecm-col-2, .ecm-col-3 { display: none; }
.ecm-col-2.show, .ecm-col-3.show { display: block; }

.ecm-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .6rem; border-radius: var(--radius-sm);
  color: var(--color-ink); font-weight: 600; font-size: .84rem;
  cursor: pointer; width: 100%; text-align: left; background: none; border: none;
}
.ecm-item:hover, .ecm-item.ecm-active { background: var(--color-primary-light); color: var(--color-primary); }
.ecm-item .ecm-icon {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.ecm-item.ecm-active .ecm-icon { background: var(--color-primary); color: #fff; }
.ecm-item .ecm-caret { margin-left: auto; font-size: .68rem; color: var(--color-muted); }
.ecm-item.ecm-active .ecm-caret { color: var(--color-primary); }
.ecm-col-2 .ecm-item, .ecm-col-3 .ecm-item { padding-left: .5rem; }

/* ---------- "Explore All Categories" button (category strip, before the category links) ----------
   Deliberately a dark ink + gold-accent pill rather than the site's red/orange
   palette used elsewhere in the strip -- it needs to visually pop as a
   distinct "browse everything" entry point, not blend in as just another
   category link. Ink+gold is used because gold (--color-accent) is already
   an established accent color on this site, so this stays on-brand instead
   of introducing an unrelated color pairing. */
.explore-categories-btn {
  display: inline-flex; align-items: center; gap: .55rem;
  background: #ef9928;
  color: #fff;
  border: none; border-radius: 999px;
  padding: .55rem 1.1rem; margin: .5rem .75rem .5rem 0;
  font-size: .86rem; font-weight: 700;
  transition: background .15s ease;
}
.explore-categories-btn:hover, .explore-categories-btn:focus { background: #2a2a1f; color: var(--color-accent); }
.explore-categories-btn i { font-size: 1rem; }
.explore-categories-btn .bi-chevron-down { font-size: .7rem; transition: transform .15s ease; }
.explore-categories-btn[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }

/* ---------- Hero ---------- */
.hero-slide {
  background-size: cover; background-position: center;
  border-radius: var(--radius-lg);
  min-height: 420px;
  display: flex; align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(18,79,48,.82) 0%, rgba(18,79,48,.35) 55%, rgba(18,79,48,0) 85%);
}
.hero-slide .hero-content { position: relative; z-index: 2; color: #fff; max-width: 480px; padding: 2.5rem; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .3rem .75rem; border-radius: 999px; margin-bottom: 1rem;
}
.hero-content h1 { color: #fff; font-size: 2.4rem; line-height: 1.15; }
.hero-content p { color: rgba(255,255,255,.88); margin: .9rem 0 1.5rem; }

/* ---------- Category tiles ---------- */
.cat-tile {
  text-align: center; padding: 1.25rem .5rem;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  height: 100%;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); border-color: var(--color-primary); }
.cat-tile .cat-icon {
  width: 56px; height: 56px; margin: 0 auto .75rem;
  border-radius: 50%; background: var(--color-primary-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-primary); font-size: 1.5rem;
  overflow: hidden;
}
.cat-tile .cat-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cat-tile .cat-name { font-weight: 700; font-size: .86rem; color: var(--color-ink); }
.cat-tile .cat-count { font-size: .72rem; color: var(--color-muted); }

/* ---------- Product card ---------- */
.product-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 100%;
  display: flex; flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
  position: relative;
}
.product-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }
.product-card .product-media {
  aspect-ratio: 1 / 1;
  background: var(--color-bg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}
.product-card .product-media img { width: 100%; height: 100%; object-fit: contain; }
.product-badge {
  position: absolute; top: .6rem; left: .6rem;
  background: var(--color-accent); color: var(--color-ink);
  font-size: .66rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  padding: .25rem .55rem; border-radius: 999px; z-index: 2;
}
.product-badge.badge-origin {
  left: auto; right: .6rem;
  background: rgba(20,33,26,.75); color: #fff; font-weight: 600;
}
.wishlist-toggle {
  position: absolute; top: .6rem; right: .6rem; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-muted); font-size: .95rem;
}
.product-badge.badge-origin ~ .wishlist-toggle { display: none; }
.product-card .product-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.product-brand { font-size: .72rem; color: var(--color-muted); letter-spacing: .05em; font-weight: 700; }
.product-name { font-size: .92rem; font-weight: 700; color: var(--color-ink); margin: .25rem 0 .5rem; line-height: 1.35; }
.product-name.product-name-sm { font-size: .84rem; }
.product-name a { color: inherit; }
.product-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.product-meta .pill {
  font-size: .68rem; font-weight: 600; color: var(--color-primary);
  background: var(--color-primary-light); border-radius: 999px; padding: .18rem .55rem;
}
.product-card .product-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.moq-tag { font-size: .74rem; color: var(--color-body); }
.moq-tag strong { color: var(--color-ink); }

/* ---------- Horizontal product card (Featured Products, per client reference) ----------
   Image left, content right -- distinct from the standard .product-card used
   everywhere else on the site (category grid, related products, cart, etc).
   Adapted for B2B: MOQ takes the visual slot a retail price would occupy in
   the reference, "Add to cart" -> "Add to Container", no pricing shown, per
   the earlier decision that cost/pricing isn't shown on public catalog pages. */
.product-card-h {
  display: flex; gap: .9rem;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 1rem; height: 100%;
  transition: box-shadow .15s ease, transform .15s ease;
}
.product-card-h:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.product-card-h .ph-media {
  width: 92px; height: 92px; flex-shrink: 0; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--color-bg); position: relative;
}
.product-card-h .ph-media img { width: 100%; height: 100%; object-fit: contain; }
.product-card-h .ph-origin-badge {
  position: absolute; top: 4px; left: 4px;
  background: rgba(20,33,26,.75); color: #fff; font-size: .6rem; font-weight: 700;
  padding: .1rem .35rem; border-radius: 4px; line-height: 1.4;
}
.product-card-h .ph-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product-card-h .ph-top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.product-card-h .ph-moq { font-family: var(--font-display); font-weight: 800; color: var(--color-ink); font-size: .92rem; line-height: 1.2; }
.product-card-h .ph-moq small { font-family: var(--font-body); font-weight: 600; font-size: .64rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: .03em; display: block; }
.product-card-h .ph-wishlist { color: var(--color-primary); background: none; border: none; font-size: 1.1rem; padding: 0; flex-shrink: 0; line-height: 1; }
.product-card-h .ph-wishlist:hover { color: var(--color-primary-dark); }
.product-card-h .ph-name {
  font-size: .84rem; font-weight: 600; color: var(--color-ink); margin: .4rem 0 .35rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35;
}
.product-card-h .ph-name a { color: inherit; }
.product-card-h .ph-meta { font-size: .72rem; color: var(--color-muted); margin-bottom: auto; }
.product-card-h .ph-add-row { display: flex; justify-content: flex-end; margin-top: .5rem; }
.product-card-h .ph-add {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700;
  color: var(--color-primary); border: none; background: none; padding: 0;
}
.product-card-h .ph-add:hover { color: var(--color-primary-dark); }
.cta-banner {
  border-radius: var(--radius-lg);
  background-size: cover; background-position: center;
  min-height: 220px; display: flex; align-items: flex-end;
  position: relative; overflow: hidden;
}
.cta-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(20,33,26,.78) 0%, rgba(20,33,26,.05) 65%); }
.cta-banner .cta-body { position: relative; z-index: 2; color: #fff; padding: 1.5rem; }
.cta-banner h3 { color: #fff; font-size: 1.15rem; margin-bottom: .35rem; }
.cta-banner p { color: rgba(255,255,255,.85); font-size: .85rem; margin-bottom: .75rem; }

/* ---------- Trust strip ---------- */
.trust-item { display: flex; gap: .85rem; align-items: flex-start; }
.trust-item .trust-icon {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
}
.trust-item h4 { font-size: .92rem; margin-bottom: .15rem; }
.trust-item p { font-size: .8rem; color: var(--color-muted); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-primary-dark); color: rgba(255,255,255,.78); }
.site-footer h5 { color: #fff; font-size: .92rem; font-weight: 700; margin-bottom: 1rem; }
.site-footer a { color: rgba(255,255,255,.78); }
.site-footer a:hover { color: #fff; }
.site-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,.14); font-size: .82rem; }
.social-circle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .9rem;
}
.social-circle:hover { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-ink); }

/* ---------- Misc ---------- */
.breadcrumb-bar { background: var(--color-surface); border-bottom: 1px solid var(--color-border); }
.breadcrumb-bar .breadcrumb { margin: 0; font-size: .82rem; }

/* ---------- CMS pages without a hero photo (Module 14: page_image is optional) ---------- */
.cms-header-plain {
  background: var(--color-primary-dark);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  color: #fff;
}
.cms-header-plain h1 { color: #fff; font-size: 1.85rem; margin-bottom: .35rem; }
.cms-header-plain p { color: rgba(255,255,255,.75); margin: 0; font-size: .86rem; }

/* Sticky "on this page" jump-nav for long legal documents */
.toc-nav { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.25rem; position: sticky; top: 1.5rem; }
.toc-nav h6 { text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; color: var(--color-muted); font-weight: 700; margin-bottom: .85rem; }
.toc-nav a { display: block; padding: .35rem 0; font-size: .85rem; color: var(--color-body); border-left: 2px solid transparent; padding-left: .75rem; margin-left: -1px; }
.toc-nav a:hover, .toc-nav a.active { color: var(--color-primary); border-left-color: var(--color-primary); font-weight: 600; }

/* ---------- Contact page ---------- */
.contact-info-card {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 1.1rem; margin-bottom: .85rem;
}
.contact-info-card .icon {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.contact-info-card h6 { font-size: .86rem; margin-bottom: .2rem; }
.contact-info-card p { font-size: .82rem; color: var(--color-muted); margin: 0; }
.contact-map { border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--color-border); }
.contact-map iframe { width: 100%; height: 280px; border: 0; display: block; }

/* ---------- Category card (All Categories page) ----------
   Distinct from .cat-tile (Home's small circular teaser icons) -- this is
   a larger, photo-forward card for the dedicated "browse everything" page. */
.category-card {
  display: block; text-decoration: none;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
  overflow: hidden; height: 100%;
  transition: box-shadow .15s ease, transform .15s ease;
}
.category-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }
.category-card .cc-media { aspect-ratio: 4 / 3; background: var(--color-bg); overflow: hidden; }
.category-card .cc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.category-card:hover .cc-media img { transform: scale(1.05); }
.category-card .cc-body { padding: 1rem; }
.category-card .cc-name { font-size: 1.05rem; color: var(--color-ink); margin-bottom: .2rem; }
.category-card .cc-count { font-size: .8rem; color: var(--color-muted); }

/* ---------- Fact/info sidebar card (used on About Us + How Sourcing Works) ---------- */
.fact-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.25rem; }
.fact-row { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px dashed var(--color-border); font-size: .86rem; }
.fact-row:last-child { border-bottom: none; }
.fact-row strong { color: var(--color-ink); }

@media (max-width: 767.98px) {
  .hero-content h1 { font-size: 1.7rem; }
  .section { padding: 2.25rem 0; }
}

.qty1{
    border-radius: 5px;
    border: 1px #6c757d solid;
    padding: 5px 5px;
        width: 100px;
}