/*
Theme Name: Coinbazzar
Theme URI: https://coinbazzar.in
Author: Coinbazzar
Description: WooCommerce theme rebuilding the look of the store's Shopify "Refresh" theme. Colours, fonts, radii and spacing are taken from the live coinbazzar.in CSS, not approximated.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: coinbazzar
*/

/* ============================================================= fonts ==== */
/* Self-hosted: faster from India and no visitor IPs sent to a font CDN. */

@font-face {
  font-family: 'Questrial';
  src: url('assets/fonts/questrial-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Archivo';
  src: url('assets/fonts/archivo-var.woff2') format('woff2-variations'),
       url('assets/fonts/archivo-var.woff2') format('woff2');
  font-weight: 100 900;   /* variable font - one file covers every weight */
  font-style: normal;
  font-display: swap;
}

/* ============================================================ tokens ==== */
/*
  Read off the live Shopify theme:
    --page-width: 120rem          (Dawn uses a 10px root, so 1200px)
    --buttons-radius: 40px        pill buttons
    --inputs-radius: 26px
    --media-radius: 20px          heavily rounded product images
    --grid-desktop-*-spacing: 28px
    --font-body-scale: 1.05
    --font-heading-weight: 700
*/

:root {
  /* Shopify colour schemes, verbatim */
  --navy:       #0E1B4D;   /* scheme-3 background, scheme-1/2 foreground */
  --blue:       #4770DB;   /* scheme-4 background, scheme-1 button */
  --red:        #E32402;   /* scheme-5 background - sale accent */
  --grey:       #EFF0F5;   /* scheme-1 background */
  --white:      #FFFFFF;   /* scheme-2 background */
  --muted:      #A1A6C4;   /* scheme-1 contrast */
  --navy-deep:  #122363;
  --navy-mid:   #1B3988;

  --page-width: 1200px;
  --gutter:     20px;
  --grid-gap:   28px;

  --radius-button: 40px;
  --radius-input:  26px;
  --radius-media:  20px;
  --radius-card:   20px;

  --font-body:    'Questrial', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --weight-heading: 700;

  --fs-base: 16.8px;        /* 16 * --font-body-scale 1.05 */
  --fs-sm:   14px;
  --fs-xs:   12.5px;
  --fs-card-title: 15px;    /* product card title + price - Refresh keeps these small */
  --fs-h1:   clamp(30px, 4.4vw, 48px);
  --fs-h2:   clamp(24px, 3vw, 34px);
  --fs-h3:   20px;

  --shadow-card: 0 4px 18px rgba(14, 27, 77, 0.08);
  --shadow-lift: 0 10px 28px rgba(14, 27, 77, 0.14);

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ============================================================= reset ==== */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

button { font: inherit; cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.cbz-wrap {
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: var(--white);
  padding: 12px 20px; z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }

/* =========================================================== buttons ==== */

.cbz-btn,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce a.button.alt,
.woocommerce button.button.alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 400;
  line-height: 1;
  padding: 14px 26px;
  border: 1px solid var(--navy);
  border-radius: var(--radius-button);
  background: var(--navy);
  color: var(--white);
  text-align: center;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
  text-decoration: none;
}

.cbz-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  text-decoration: none;
}

.cbz-btn--outline {
  background: transparent;
  color: var(--navy);
}
.cbz-btn--outline:hover { background: var(--navy); color: var(--white); }

.cbz-btn--onnavy {
  background: var(--white);
  border-color: var(--white);
  color: var(--navy);
}
.cbz-btn--onnavy:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* ==================================================== announcement ==== */
/* scheme-4 on the live site: blue ground, white text */

.cbz-announce {
  background: var(--blue);
  color: var(--white);
  text-align: center;
  font-size: var(--fs-sm);
  padding: 9px var(--gutter);
  letter-spacing: 0.02em;
}

/* ============================================================ header ==== */
/* scheme-3: navy ground, white text */

.cbz-header {
  background: var(--navy);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}

.cbz-header__inner {
  max-width: var(--page-width);
  margin-inline: auto;
  padding: 14px var(--gutter);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
}

.cbz-header__logo img { max-height: 46px; width: auto; }
.cbz-header__logo a { display: inline-block; }
.cbz-header__logo a:hover { text-decoration: none; }

.cbz-brand-text {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 24px;
  color: var(--white);
}

.cbz-nav { justify-self: center; }
.cbz-nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}
.cbz-nav a {
  font-size: var(--fs-sm);
  color: var(--white);
  padding: 6px 0;
  position: relative;
  display: inline-block;
}
.cbz-nav a:hover { text-decoration: none; }
.cbz-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--white);
  transition: width .2s var(--ease);
}
.cbz-nav a:hover::after,
.cbz-nav .current-menu-item > a::after { width: 100%; }

.cbz-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cbz-actions a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--white);
  position: relative;
  transition: background .18s var(--ease);
}
.cbz-actions a:hover { background: rgba(255,255,255,0.14); text-decoration: none; }
.cbz-actions svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; }

.cbz-cart-count {
  position: absolute;
  top: 3px; right: 3px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--red);
  color: var(--white);
  font-size: 10.5px;
  line-height: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cbz-burger {
  display: none;
  background: none;
  border: 0;
  color: var(--white);
  width: 40px; height: 40px;
  place-items: center;
}
.cbz-burger svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.7; fill: none; }

/* ============================================================== hero ==== */

.cbz-hero {
  position: relative;
  background: var(--navy);
  color: var(--white);
  overflow: hidden;
}

.cbz-hero__media {
  position: absolute;
  inset: 0;
}
.cbz-hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.cbz-hero__inner {
  position: relative;
  max-width: var(--page-width);
  margin-inline: auto;
  padding: clamp(72px, 12vw, 150px) var(--gutter);
  text-align: center;
}

.cbz-hero__title {
  font-size: var(--fs-h1);
  margin: 0 0 10px;
  color: var(--white);
}
.cbz-hero__text {
  font-size: clamp(16px, 2vw, 20px);
  margin: 0 0 26px;
  opacity: 0.94;
}

/* =========================================================== section ==== */

.cbz-section { padding: clamp(38px, 5vw, 60px) 0; }
.cbz-section--grey { background: var(--grey); }

.cbz-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.cbz-section__title { margin: 0; }
.cbz-section__link {
  font-size: var(--fs-sm);
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.cbz-section__link:hover { text-decoration: none; color: var(--blue); }

/* ============================================== product grid + cards ==== */

.cbz-grid,
.woocommerce ul.products {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--grid-gap);
}

/*
  Column counts apply to the wrapping grids ONLY. The `:not()` matters: the
  scroll variant needs `grid-template-columns: none` so its auto-flow columns
  size themselves, and without this exclusion the responsive rules further down
  re-assert a column count and collapse the first cards to 0px wide.
*/
.cbz-grid:not(.cbz-grid--scroll),
.woocommerce ul.products {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* horizontal scroller for the homepage collection rows, like Refresh */
.cbz-grid--scroll {
  grid-auto-flow: column;
  grid-auto-columns: minmax(240px, 1fr);
  grid-template-columns: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 10px;
  scrollbar-width: thin;
}
.cbz-grid--scroll > li { scroll-snap-align: start; }

/*
  Card styles must work in TWO places:
    - .woocommerce ul.products   shop, category and search pages
    - .cbz-grid                  the homepage collection rows
  The homepage has no `woocommerce` body class, so anything scoped only to
  `.woocommerce ...` silently does nothing there - which is how the loop titles
  ended up rendering at full <h2> size. Every card rule below lists both.
*/

.woocommerce ul.products li.product,
.cbz-grid li.product {
  width: auto !important;
  margin: 0 !important;
  float: none !important;
  background: var(--grey);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.woocommerce ul.products li.product:hover,
.cbz-grid li.product:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

/*
  WooCommerce wraps media + title + price in one anchor and leaves the button
  outside it. Make that anchor a flex column so the card stacks correctly.
  (`display: contents` would also work but is still shaky for assistive tech on
  interactive elements, so it is avoided here.)
*/
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link,
.cbz-grid li.product > a.woocommerce-LoopProduct-link {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link:hover,
.cbz-grid li.product > a.woocommerce-LoopProduct-link:hover { text-decoration: none; }

.cbz-card__media {
  position: relative;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--white);
  aspect-ratio: 1 / 1;
  flex: none;
}
.cbz-card__media img,
.woocommerce ul.products li.product img,
.cbz-grid li.product img {
  width: 100%;
  height: 100%;
  object-fit: contain;      /* coins and books must not be cropped */
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  transition: transform .35s var(--ease);
}
.cbz-card__media:hover img { transform: scale(1.04); }

/* ---- title ---- */
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.cbz-grid li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.cbz-grid li.product h2 {
  font-family: var(--font-body);
  font-size: var(--fs-card-title);
  font-weight: 400;
  line-height: 1.42;
  letter-spacing: 0;
  color: var(--navy);
  padding: 0;
  margin: 0;
  text-wrap: pretty;
}

/* ---- price ---- */
.woocommerce ul.products li.product .price,
.cbz-grid li.product .price,
.woocommerce div.product p.price,
.woocommerce div.product span.price {
  color: var(--navy);
  font-size: var(--fs-card-title);
  font-weight: 400;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  line-height: 1.4;
}
.woocommerce ul.products li.product .price del,
.cbz-grid li.product .price del,
.woocommerce div.product p.price del {
  opacity: 1;
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.92em;
}
.woocommerce ul.products li.product .price ins,
.cbz-grid li.product .price ins,
.woocommerce div.product p.price ins {
  background: none;
  text-decoration: none;
  color: var(--red);
  font-weight: 400;
}

/* ---- add to cart / read more ---- */
.woocommerce ul.products li.product .button,
.cbz-grid li.product .button,
.cbz-grid li.product a.button {
  margin-top: auto;
  width: 100%;
  padding: 11px 18px;
  font-size: var(--fs-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--navy);
  border-radius: var(--radius-button);
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-body);
  line-height: 1;
  text-decoration: none;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.woocommerce ul.products li.product .button:hover,
.cbz-grid li.product .button:hover,
.cbz-grid li.product a.button:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  text-decoration: none;
}
.woocommerce ul.products li.product .added_to_cart,
.cbz-grid li.product .added_to_cart {
  font-size: var(--fs-xs);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* badges over the image */
.cbz-badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: 30px;
  background: var(--navy);
  color: var(--white);
}
.cbz-badge--sale      { background: var(--red); }
.cbz-badge--soldout   { background: var(--muted); color: var(--navy); }
.cbz-badge--backorder { background: var(--blue); }

/* WooCommerce's own sale flash, hidden - we render our own */
.woocommerce span.onsale { display: none; }

/* ==================================================== single product ==== */

.woocommerce div.product { margin-top: 26px; }

.woocommerce div.product div.images { border-radius: var(--radius-media); overflow: hidden; }
.woocommerce div.product div.images img { border-radius: var(--radius-media); }

.woocommerce div.product .product_title {
  font-size: clamp(22px, 2.6vw, 32px);
  margin-bottom: 12px;
}

.woocommerce div.product p.price,
.woocommerce div.product span.price {
  font-size: 22px;
  margin-bottom: 18px;
}

.woocommerce div.product form.cart { margin-top: 22px; }
.woocommerce div.product form.cart div.quantity { margin-right: 10px; }
.woocommerce .quantity input.qty,
.woocommerce input[type="text"],
.woocommerce input[type="email"],
.woocommerce input[type="tel"],
.woocommerce input[type="number"],
.woocommerce input[type="password"],
.woocommerce textarea,
.woocommerce select {
  border: 1px solid var(--muted);
  border-radius: var(--radius-input);
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--navy);
  background: var(--white);
}
.woocommerce .quantity input.qty { text-align: center; width: 84px; }

.woocommerce div.product .woocommerce-tabs ul.tabs {
  padding: 0;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.woocommerce div.product .woocommerce-tabs ul.tabs::before { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li::before,
.woocommerce div.product .woocommerce-tabs ul.tabs li::after { display: none; }
.woocommerce div.product .woocommerce-tabs ul.tabs li a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 12px 18px;
  display: block;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li.active a {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.woocommerce .stock { font-size: var(--fs-sm); }
.woocommerce .stock.in-stock { color: #1F6B4A; }
.woocommerce .stock.out-of-stock { color: var(--red); }
.woocommerce .stock.available-on-backorder { color: var(--blue); }

/* ==================================================== breadcrumb etc ==== */

.cbz-breadcrumb {
  font-size: var(--fs-sm);
  color: var(--muted);
  padding: 18px 0 0;
}
.cbz-breadcrumb a { color: var(--muted); }
.cbz-breadcrumb a:hover { color: var(--navy); }
.cbz-crumb-sep { padding: 0 8px; }

.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering { font-size: var(--fs-sm); }
.woocommerce .woocommerce-ordering select {
  padding: 10px 16px;
  border-radius: var(--radius-input);
}

.woocommerce nav.woocommerce-pagination ul { border: 0; gap: 6px; display: flex; justify-content: center; }
.woocommerce nav.woocommerce-pagination ul li { border: 0; }
.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
  border-radius: 50%;
  min-width: 40px; height: 40px;
  line-height: 40px;
  padding: 0;
  font-size: var(--fs-sm);
}
.woocommerce nav.woocommerce-pagination ul li span.current {
  background: var(--navy);
  color: var(--white);
}

.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  border-top-color: var(--blue);
  border-radius: 12px;
  background: var(--grey);
  font-size: var(--fs-sm);
}
.woocommerce-message::before,
.woocommerce-info::before { color: var(--blue); }

/* ======================================================== newsletter ==== */
/* scheme-1 on the live site: grey ground, navy text */

.cbz-newsletter {
  background: var(--grey);
  text-align: center;
  padding: clamp(44px, 6vw, 72px) var(--gutter);
}
.cbz-newsletter h2 { margin-bottom: 8px; }
.cbz-newsletter p { margin: 0 auto 22px; max-width: 46ch; }

.cbz-newsletter__form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin-inline: auto;
  flex-wrap: wrap;
  justify-content: center;
}
.cbz-newsletter__form input[type="email"] {
  flex: 1 1 240px;
  border: 1px solid var(--muted);
  border-radius: var(--radius-input);
  padding: 13px 20px;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  background: var(--white);
  color: var(--navy);
}

/* ============================================================ footer ==== */
/* scheme-3: navy ground, white text */

.cbz-footer {
  background: var(--navy);
  color: var(--white);
  padding: clamp(40px, 5vw, 62px) 0 26px;
}
.cbz-footer a { color: var(--white); }

.cbz-footer__cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
  margin-bottom: 34px;
}
.cbz-footer h3 {
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
  color: var(--white);
}
.cbz-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.cbz-footer li a { font-size: var(--fs-sm); opacity: 0.88; }
.cbz-footer li a:hover { opacity: 1; }
.cbz-footer p { font-size: var(--fs-sm); opacity: 0.88; margin: 0 0 12px; }

.cbz-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.18);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  opacity: 0.82;
}

/* ======================================================== responsive ==== */

@media (max-width: 1024px) {
  .cbz-grid:not(.cbz-grid--scroll),
  .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cbz-footer__cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 749px) {
  :root { --grid-gap: 16px; }

  .cbz-header__inner { grid-template-columns: auto 1fr auto; gap: 10px; }
  .cbz-burger { display: grid; }

  .cbz-nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    background: var(--navy);
    padding: 12px var(--gutter) 20px;
    border-top: 1px solid rgba(255,255,255,0.16);
  }
  .cbz-nav.is-open { display: block; }
  .cbz-nav ul { flex-direction: column; gap: 4px; }
  .cbz-nav a { display: block; padding: 11px 0; }

  .cbz-grid:not(.cbz-grid--scroll),
  .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cbz-grid--scroll { grid-auto-columns: minmax(180px, 62%); }

  .cbz-footer__cols { grid-template-columns: 1fr; }

  .woocommerce div.product div.images,
  .woocommerce div.product div.summary { float: none; width: 100%; margin: 0 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
