:root {
  --cc-espresso: #180b06;
  --cc-brown: #3a1c12;
  --cc-cream: #fff7e8;
  --cc-gold: #ffc233;
  --cc-mango: #ff9f1c;
  --cc-cherry: #d7263d;
  --cc-teal: #00a7a5;
  --cc-berry: #8a1c5a;
  --cc-white: #ffffff;
  --cc-muted: #6f5a4e;
  --cc-border: rgba(24, 11, 6, .14);
  --cc-shadow: 0 18px 50px rgba(24, 11, 6, .12);
  --cc-radius: 24px;
  --cc-head: 'Fraunces', Georgia, serif;
  --cc-body: 'Source Sans 3', Arial, sans-serif;
  --cc-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
body.coffee-chemist-theme {
  margin: 0;
  font-family: var(--cc-body);
  background: var(--cc-cream);
  color: var(--cc-espresso);
  font-size: 17px;
  line-height: 1.6;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
.cc-container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.cc-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(255, 247, 232, .96);
  border-bottom: 1px solid var(--cc-border);
  backdrop-filter: blur(14px);
}
.cc-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  gap: 34px;
}
.cc-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 300px;
  max-width: none;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.cc-brand-main {
  font-family: var(--cc-head);
  font-size: clamp(1.65rem, 3vw, 2.3rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
}
.cc-brand-tag {
  margin-top: 5px;
  font-family: var(--cc-mono);
  font-size: .68rem;
  color: var(--cc-berry);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.custom-logo-link img { max-height: 74px; width: auto; }
.cc-nav { flex: 1; }
.cc-menu {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 22px;
  margin: 0;
  padding: 0;
}
.cc-menu a {
  text-decoration: none;
  font-weight: 800;
  color: var(--cc-espresso);
}
.cc-menu a:hover { color: var(--cc-cherry); }
.cc-menu .menu-item-has-children { position: relative; }
.cc-menu .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  padding: 12px;
  background: var(--cc-white);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  box-shadow: var(--cc-shadow);
  list-style: none;
}
.cc-menu .menu-item-has-children:hover > .sub-menu { display: block; }
.cc-menu .sub-menu a { display: block; padding: 8px 10px; }
.cc-menu-toggle {
  display: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--cc-espresso);
  color: var(--cc-cream);
  font-weight: 800;
}

.cc-page-header {
  padding: 70px 0 35px;
  text-align: center;
}
.cc-page-header h1, .cc-single h1, .woocommerce-products-header__title.page-title {
  margin: 0 auto 14px;
  max-width: 920px;
  font-family: var(--cc-head);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: .94;
  letter-spacing: -.06em;
}
.cc-eyebrow {
  font-family: var(--cc-mono);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cc-cherry);
  font-weight: 800;
  margin: 0 0 10px;
}
.cc-post-meta { color: var(--cc-muted); font-weight: 700; }

.cc-post-grid, .products.columns-4, ul.products {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding: 0;
}
.cc-post-card, .woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  background: var(--cc-white);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius);
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(24, 11, 6, .08);
}
.cc-post-thumb {
  display: grid;
  place-items: center;
  min-height: 230px;
  background: linear-gradient(135deg, var(--cc-brown), var(--cc-berry));
  color: var(--cc-gold);
  font-family: var(--cc-mono);
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 800;
}
.cc-post-thumb img { width: 100%; height: 260px; object-fit: cover; display: block; }
.cc-post-body { padding: 24px; }
.cc-post-body h2 { margin: 0 0 10px; font-family: var(--cc-head); font-size: 1.8rem; line-height: 1; }
.cc-post-body h2 a { text-decoration: none; }
.cc-text-link { color: var(--cc-cherry); font-weight: 900; text-decoration: none; }
.cc-text-link:hover { text-decoration: underline; }

.cc-single { max-width: 900px; }
.cc-single-image img { width: 100%; border-radius: var(--cc-radius); box-shadow: var(--cc-shadow); }
.cc-content { background: var(--cc-white); margin: 32px 0 70px; padding: clamp(26px, 5vw, 60px); border-radius: var(--cc-radius); border: 1px solid var(--cc-border); }
.cc-content h2, .cc-content h3 { font-family: var(--cc-head); line-height: 1; }

.woocommerce .cc-shop-wrap { padding: 45px 0 80px; }
.woocommerce-result-count, .woocommerce-ordering { margin-bottom: 25px; }
.woocommerce ul.products li.product a img { width: 100%; height: 280px; object-fit: cover; margin: 0; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--cc-head);
  font-size: 1.55rem;
  line-height: 1;
  padding: 18px 20px 6px;
  color: var(--cc-espresso);
}
.woocommerce ul.products li.product .price { padding: 0 20px 14px; color: var(--cc-cherry); font-weight: 900; font-size: 1.1rem; }
.woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .woocommerce #respond input#submit, .button, .wp-block-button__link {
  border-radius: 999px !important;
  background: var(--cc-gold) !important;
  color: var(--cc-espresso) !important;
  font-weight: 900 !important;
  border: 0 !important;
  padding: 13px 20px !important;
  text-decoration: none !important;
}
.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover { background: var(--cc-mango) !important; }
.woocommerce ul.products li.product .button { margin: 0 20px 22px; }
.cc-product-badges { position: absolute; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; }
.woocommerce ul.products li.product { position: relative; }
.cc-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--cc-teal);
  color: white;
  font-family: var(--cc-mono);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}
.cc-badge-fair-trade-certified { background: var(--cc-cherry); }
.cc-badge-chemist-pick { background: var(--cc-berry); }
.cc-brew-formula {
  margin: 40px auto 70px;
  padding: clamp(24px, 5vw, 48px);
  background: var(--cc-espresso);
  color: var(--cc-cream);
  border-radius: var(--cc-radius);
}
.cc-brew-formula h2 { font-family: var(--cc-head); font-size: clamp(2rem, 5vw, 3.8rem); margin: 0 0 8px; line-height: .95; }
.cc-brew-formula .cc-text-link { color: var(--cc-gold); }
.woocommerce div.product .product_title { font-family: var(--cc-head); font-size: clamp(2.2rem, 5vw, 4rem); line-height: .95; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--cc-cherry); font-weight: 900; font-size: 1.5rem; }
.woocommerce .quantity .qty { padding: 11px; border: 1px solid var(--cc-border); border-radius: 10px; }
.woocommerce table.shop_table { border-radius: var(--cc-radius); overflow: hidden; background: white; }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select {
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  padding: 12px 14px;
}

.cc-footer { background: var(--cc-espresso); color: var(--cc-cream); padding: 58px 0 24px; }
.cc-footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.cc-footer h2, .cc-footer h3 { margin-top: 0; font-family: var(--cc-head); }
.cc-footer a { display: block; color: var(--cc-cream); text-decoration: none; margin: 8px 0; opacity: .9; }
.cc-footer a:hover { color: var(--cc-gold); }
.cc-footer-bottom { border-top: 1px solid rgba(255,255,255,.18); margin-top: 36px; padding-top: 20px; color: rgba(255,247,232,.78); }

@media (max-width: 900px) {
  .cc-header-inner { flex-wrap: wrap; gap: 16px; padding: 14px 0; }
  .cc-brand { min-width: 260px; }
  .cc-menu-toggle { display: inline-flex; margin-left: auto; }
  .cc-nav { display: none; width: 100%; }
  .cc-nav.is-open { display: block; }
  .cc-menu { flex-direction: column; align-items: flex-start; gap: 10px; padding: 15px 0; }
  .cc-menu .sub-menu { position: static; display: block; box-shadow: none; border: 0; background: transparent; padding: 4px 0 0 14px; }
  .cc-post-grid, .products.columns-4, ul.products { grid-template-columns: 1fr 1fr; }
  .cc-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .cc-container { width: min(100% - 28px, 1180px); }
  .cc-brand { min-width: 220px; }
  .cc-brand-main { font-size: 1.65rem; }
  .cc-brand-tag { white-space: normal; max-width: 230px; }
  .cc-post-grid, .products.columns-4, ul.products { grid-template-columns: 1fr; }
  .cc-footer-grid { grid-template-columns: 1fr; }
}


/* --- PHP SITE HEADER MATCH OVERRIDES --- */
body.coffee-chemist-theme { background: var(--cc-cream); }
.skip-link { position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 18px; top: 18px; width: auto; height: auto; z-index: 9999; background: var(--cc-gold); color: var(--cc-espresso); padding: 10px 14px; border-radius: 999px; font-weight: 900; }
.topbar { background: var(--cc-espresso); color: var(--cc-cream); text-align: center; padding: 8px 16px; font-family: var(--cc-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
.site-header.cc-header { position: sticky; top: 0; z-index: 999; background: rgba(255, 247, 232, .94); backdrop-filter: blur(12px); border-bottom: 2px solid rgba(24, 11, 6, .08); }
.header-inner.cc-header-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand.cc-brand { display: flex; flex-direction: row; align-items: center; gap: 12px; font-weight: 800; min-width: 320px; white-space: nowrap; flex-shrink: 0; text-decoration: none; }
.brand-mark { width: 48px; min-width: 48px; height: 48px; border-radius: 15px; background: var(--cc-espresso); color: var(--cc-cream); display: grid; place-items: center; font-family: var(--cc-mono); font-size: .68rem; font-weight: 800; line-height: 1; box-shadow: inset 0 -5px 0 rgba(255, 194, 51, .18); text-align: center; }
.brand-mark sub { font-size: .58em; line-height: 0; }
.brand-name { font-family: var(--cc-head); font-size: 1.48rem; line-height: 1; letter-spacing: -.03em; white-space: nowrap; color: var(--cc-espresso); }
.primary-nav.cc-nav { display: flex; align-items: center; justify-content: flex-end; gap: 18px; font-weight: 800; font-size: .98rem; flex: 1; }
.primary-nav a { padding: 8px 2px; opacity: .88; text-decoration: none; color: var(--cc-espresso); }
.primary-nav a:hover, .primary-nav .active { color: var(--cc-cherry); opacity: 1; }
.nav-dropdown { position: relative; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--cc-white); padding: 12px; border-radius: 18px; box-shadow: var(--cc-shadow); border: 1px solid var(--cc-border); z-index: 1000; }
.nav-dropdown:hover .dropdown-menu, .nav-dropdown:focus-within .dropdown-menu { display: grid; gap: 4px; }
.dropdown-menu a { display: block; padding: 8px 10px; border-radius: 10px; }
.dropdown-menu a:hover { background: rgba(255, 194, 51, .18); }
.btn.btn-small { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--cc-gold); color: var(--cc-espresso) !important; padding: 9px 16px !important; font-weight: 900; opacity: 1; box-shadow: 0 8px 18px rgba(255, 159, 28, .25); }
.nav-toggle.cc-menu-toggle { display: none; background: var(--cc-espresso); color: var(--cc-cream); border: 0; border-radius: 999px; padding: 9px 14px; font-weight: 800; }

@media (max-width: 1120px) {
  .brand.cc-brand { min-width: 280px; }
  .primary-nav.cc-nav { gap: 12px; font-size: .92rem; }
  .brand-name { font-size: 1.36rem; }
}
@media (max-width: 940px) {
  .header-inner.cc-header-inner { min-height: 78px; padding: 0; }
  .nav-toggle.cc-menu-toggle { display: inline-flex; margin-left: auto; }
  .primary-nav.cc-nav { display: none; position: absolute; left: 20px; right: 20px; top: 118px; background: var(--cc-white); border-radius: 22px; padding: 18px; box-shadow: var(--cc-shadow); flex-direction: column; align-items: stretch; z-index: 1000; }
  .primary-nav.cc-nav.open, .primary-nav.cc-nav.is-open { display: flex; }
  .dropdown-menu { position: static; display: grid; box-shadow: none; border: 0; padding: 4px 0 0 16px; background: transparent; }
  .btn.btn-small { width: fit-content; }
}
@media (max-width: 640px) {
  .topbar { font-size: .62rem; letter-spacing: .08em; }
  .brand.cc-brand { min-width: 230px; gap: 9px; }
  .brand-mark { width: 42px; min-width: 42px; height: 42px; border-radius: 13px; font-size: .6rem; }
  .brand-name { font-size: 1.22rem; }
}


/* --- FINAL MATCH PATCH: no-wrap molecule mark, footer alignment, blog spacing --- */
.brand.cc-brand,
.cc-brand {
  min-width: 380px;
  width: auto;
  white-space: nowrap !important;
  flex-wrap: nowrap !important;
  overflow: visible;
}
.brand-mark {
  width: auto !important;
  min-width: 82px !important;
  height: 48px !important;
  padding: 0 12px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap !important;
  line-height: 1 !important;
  letter-spacing: .02em;
}
.brand-mark sub {
  position: relative;
  bottom: -.15em;
  font-size: .62em;
}
.brand-name {
  display: inline-block;
  white-space: nowrap !important;
  min-width: max-content;
}
.cc-header-inner {
  overflow: visible;
}
.cc-archive,
.blog .site-main,
.archive .site-main,
.category .site-main,
.search .site-main {
  padding-bottom: 96px !important;
}
.cc-post-grid {
  margin-bottom: 48px;
}
.cc-pagination {
  margin: 36px 0 0;
}
.cc-footer {
  margin-top: 0;
  padding: 64px 0 28px;
  background: linear-gradient(135deg, var(--cc-espresso), #241008 55%, var(--cc-brown));
}
.cc-footer-grid {
  align-items: start;
}
.cc-footer h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: .95;
  letter-spacing: -.04em;
  margin-bottom: 14px;
}
.cc-footer h3 {
  font-size: 1.25rem;
  color: var(--cc-gold);
  margin-bottom: 14px;
}
.cc-footer p {
  max-width: 420px;
  color: rgba(255,247,232,.86);
}
.cc-footer a {
  line-height: 1.35;
  margin: 10px 0;
}
.cc-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
@media (max-width: 1180px) {
  .brand.cc-brand, .cc-brand { min-width: 335px; }
  .brand-mark { min-width: 74px !important; padding: 0 10px; }
  .primary-nav.cc-nav { gap: 10px; font-size: .88rem; }
}
@media (max-width: 940px) {
  .brand.cc-brand, .cc-brand { min-width: 315px; }
  .primary-nav.cc-nav { top: 118px; }
  .cc-archive, .blog .site-main, .archive .site-main, .category .site-main, .search .site-main { padding-bottom: 78px !important; }
}
@media (max-width: 640px) {
  .brand.cc-brand, .cc-brand { min-width: 272px; max-width: calc(100% - 86px); }
  .brand-mark { min-width: 66px !important; height: 42px !important; font-size: .58rem; padding: 0 8px; }
  .brand-name { font-size: 1.14rem; }
  .cc-footer-bottom { display: block; }
}

/* --- SHOP ARCHIVE TITLE + BRANDED EMPTY PRODUCT STATE --- */
.woocommerce-products-header {
  text-align: center;
  padding: 64px 0 28px;
}
.woocommerce-products-header__title.page-title,
.woocommerce .cc-shop-wrap > h1.page-title,
.woocommerce .cc-shop-wrap .page-title {
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}
.woocommerce-products-header .term-description,
.woocommerce-products-header .page-description {
  max-width: 760px;
  margin: 0 auto 20px;
  color: var(--cc-muted);
  font-weight: 600;
}
.woocommerce .woocommerce-info,
.woocommerce-page .woocommerce-info {
  border-top-color: var(--cc-gold);
  background: var(--cc-white);
  color: var(--cc-espresso);
  border-radius: 20px;
  box-shadow: 0 12px 35px rgba(24, 11, 6, .08);
}
.woocommerce .woocommerce-info::before,
.woocommerce-page .woocommerce-info::before {
  color: var(--cc-cherry);
}
.cc-empty-products {
  width: min(860px, 100%);
  margin: 24px auto 72px;
  padding: clamp(30px, 6vw, 58px);
  text-align: center;
  background:
    radial-gradient(circle at top left, rgba(255, 194, 51, .24), transparent 34%),
    radial-gradient(circle at bottom right, rgba(215, 38, 61, .12), transparent 32%),
    var(--cc-white);
  border: 1px solid var(--cc-border);
  border-radius: 30px;
  box-shadow: var(--cc-shadow);
}
.cc-empty-products__mark {
  width: fit-content;
  margin: 0 auto 18px;
  padding: 12px 18px;
  border-radius: 18px;
  background: var(--cc-espresso);
  color: var(--cc-cream);
  font-family: var(--cc-mono);
  font-size: .9rem;
  font-weight: 900;
  letter-spacing: .06em;
  box-shadow: inset 0 -6px 0 rgba(255, 194, 51, .2);
}
.cc-empty-products__mark sub {
  position: relative;
  bottom: -.12em;
  font-size: .65em;
}
.cc-empty-products h2 {
  margin: 0 auto 12px;
  max-width: 720px;
  font-family: var(--cc-head);
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: .95;
  letter-spacing: -.055em;
}
.cc-empty-products > p:not(.cc-eyebrow) {
  max-width: 660px;
  margin: 0 auto;
  color: var(--cc-muted);
  font-size: 1.08rem;
  font-weight: 600;
}
.cc-empty-products__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}
.cc-empty-products__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--cc-gold);
  color: var(--cc-espresso) !important;
  padding: 13px 22px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(255, 159, 28, .25);
}
.cc-empty-products__button:hover {
  background: var(--cc-mango);
}
.cc-empty-products__link {
  color: var(--cc-cherry);
  font-weight: 900;
  text-decoration: none;
}
.cc-empty-products__link:hover {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .woocommerce-products-header { padding: 48px 0 22px; }
  .cc-empty-products { margin-bottom: 54px; }
  .cc-empty-products__actions { align-items: stretch; flex-direction: column; }
}


/* --- LINK FIX PATCH + STRONGER EMPTY SHOP FALLBACK --- */
.tax-product_cat .woocommerce-products-header,
.post-type-archive-product .woocommerce-products-header,
.woocommerce-shop .woocommerce-products-header {
  text-align: center !important;
}
.tax-product_cat .woocommerce-products-header__title.page-title,
.post-type-archive-product .woocommerce-products-header__title.page-title,
.woocommerce-shop .woocommerce-products-header__title.page-title {
  width: 100%;
  text-align: center !important;
}
.woocommerce .woocommerce-info::before,
.woocommerce-page .woocommerce-info::before {
  color: var(--cc-cherry) !important;
}
.woocommerce .cc-empty-products + .woocommerce-info,
.woocommerce-page .cc-empty-products + .woocommerce-info {
  display: none !important;
}
