/*
Theme Name: Bazaar
Description: Multi-category marketplace theme for WooCommerce with seller dashboard, wishlist, blog and buying guides.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: bazaar
*/

:root {
  --bg: #fbf7f0;
  --paper: #ffffff;
  --ink: #1a1511;
  --muted: #6f6458;
  --line: #e8dece;
  --sand: #f3eadb;
  --deep: #2a1f17;
  --star: #f2a21b;
  --good: #17884f;
  --sale: #d23b2a;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", "Hind", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1280px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); }
h3 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.ic { flex: none; }

.btn, button.button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button, .single_add_to_cart_button, .checkout-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  background: var(--ink); color: #fff !important; border: 1px solid var(--ink); border-radius: 10px;
  padding: 12px 22px; font: 600 15px/1 var(--sans); text-decoration: none;
}
.btn:hover, .woocommerce a.button:hover, .woocommerce button.button:hover { background: #000; text-decoration: none; }
.woocommerce a.button.alt, .woocommerce button.button.alt { background: var(--ink); }
.btn.ghost, .button.ghost { background: transparent; color: var(--ink) !important; }

.announce { background: var(--deep); color: #f5e9d6; text-align: center; font-size: 13px; padding: 7px 12px; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(251, 247, 240, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; gap: 22px; min-height: 68px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.primary-nav .menu { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; font-size: 14.5px; font-weight: 500; }
.search { flex: 1; display: flex; align-items: center; gap: 10px; max-width: 520px; margin-left: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; }
.search input[type="search"] { flex: 1; border: 0; background: none; padding: 11px 0; font: inherit; font-size: 14px; outline: none; min-width: 0; }
.actions { display: flex; gap: 4px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--sand); text-decoration: none; }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--sale); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.menu-toggle { display: none; }

.drawer { position: fixed; inset: 0; z-index: 90; background: rgba(26, 21, 17, .5); }
.drawer[hidden] { display: none; }
.drawer-panel { width: min(320px, 86vw); height: 100%; background: var(--bg); padding: 16px 22px; overflow: auto; }
.drawer-panel ul { list-style: none; margin: 8px 0 0; padding: 0; }
.drawer-panel li a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-weight: 600; }

.hero { padding: 28px 0 8px; }
.hero-grid { display: grid; grid-template-columns: 2.2fr 1fr; gap: 20px; }
.hero-copy { min-height: 400px; border-radius: 24px; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; background: linear-gradient(120deg, #f1dcc0 0%, #e8c9a2 55%, #d9b184 100%); position: relative; overflow: hidden; }
.hero.has-img .hero-copy { background: linear-gradient(90deg, rgba(251,247,240,.92) 0%, rgba(251,247,240,.55) 55%, rgba(251,247,240,0) 100%), var(--hero-img) center/cover; }
.hero-copy h1 { max-width: 11ch; font-size: clamp(2.4rem, 5.4vw, 4.6rem); }
.hero-copy p { max-width: 36ch; font-size: 1.1rem; margin: 0 0 24px; }
.promo-col { display: grid; gap: 14px; }
.promo { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 20px 22px; border-radius: 18px; min-height: 120px; }
.promo strong { font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; }
.promo span { font-size: 14px; color: var(--muted); }
.promo:hover { text-decoration: none; transform: translateY(-2px); transition: transform .15s; }
.p1 { background: #f6d9d3; }
.p2 { background: #d9ecdf; }
.p3 { background: #dfe3f3; }

.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.trust-strip div { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.trust-strip .ic { grid-row: span 2; color: var(--deep); }
.trust-strip strong { font-size: 14px; }
.trust-strip span { font-size: 12.5px; color: var(--muted); }

.block { margin-top: 44px; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: 4px 0 0; }
.sec-head > a { font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.festival { background: linear-gradient(180deg, #f6e6cc, rgba(246,230,204,0)); border-radius: 24px; padding: 28px 24px 8px; }

.cat-circles { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.cat-circles a { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; min-width: 84px; }
.circle { width: 84px; height: 84px; border-radius: 50%; background: var(--sand); display: grid; place-items: center; overflow: hidden; font-family: var(--serif); font-size: 1.8rem; border: 1px solid var(--line); }
.circle img { width: 100%; height: 100%; object-fit: cover; }

.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.cat-tile { display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 16px; }
.cat-tile:hover { text-decoration: none; border-color: var(--ink); }
.cat-tile .img { aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--sand); display: grid; place-items: center; margin-bottom: 8px; }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile .ph { font-family: var(--serif); font-size: 3rem; color: var(--muted); }
.cat-tile strong, .cat-tile .muted { padding: 0 6px; }

.woocommerce ul.products, ul.products { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
ul.products li.product { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 16px; display: flex; flex-direction: column; margin: 0 !important; width: auto !important; float: none !important; }
ul.products li.product a.woocommerce-LoopProduct-link { display: block; }
ul.products li.product img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--sand); width: 100%; margin: 0 0 10px; }
ul.products li.product .woocommerce-loop-product__title { font-family: var(--sans); font-size: 14.5px; font-weight: 600; padding: 0 4px; margin: 0 0 6px; }
ul.products li.product .price { display: block; padding: 0 4px; font-weight: 700; font-size: 1.05rem; }
ul.products li.product .price del { color: var(--muted); font-weight: 400; font-size: .85rem; margin-right: 6px; }
ul.products li.product .price ins { text-decoration: none; }
ul.products li.product .star-rating { margin: 6px 4px 0; }
ul.products li.product .button { margin: 12px 4px 0; padding: 10px 14px; font-size: 13.5px; }
.onsale { position: absolute; top: 16px; left: 16px; z-index: 2; background: var(--sale); color: #fff; border-radius: 6px; padding: 3px 8px; font-size: 12px; font-weight: 700; line-height: 1.3; }
.wl-btn { position: absolute; top: 14px; right: 14px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.wl-btn[aria-pressed="true"] { color: var(--sale); }
.wl-btn[aria-pressed="true"] svg { fill: currentColor; }
.star-rating { color: var(--star); }

.single-product div.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; margin-top: 28px; }
.single-product div.product .woocommerce-product-gallery { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 10px; }
.single-product div.product .summary { position: relative; }
.single-product .product_title { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.single-product .summary .price { font-size: 1.8rem; font-weight: 700; display: block; margin: 8px 0 14px; }
.single-product .summary .price del { color: var(--muted); font-size: 1.1rem; font-weight: 400; }
.single-product .summary .price ins { text-decoration: none; }
.single-product .stock.in-stock { color: var(--good); font-weight: 600; }
.single-product form.cart { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.single-product form.cart .quantity input { width: 72px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; text-align: center; background: var(--paper); }
.single_add_to_cart_button { flex: 1; min-width: 160px; }
.pdp-actions { display: flex; align-items: center; gap: 10px; float: right; }
.pdp-actions .wl-btn { position: static; border: 1px solid var(--line); }
.guide-link { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; }
.trust-row { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; }
.trust-row li { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; }
.trust-row span { color: var(--muted); }
.single-product .woocommerce-tabs, .single-product .related, .single-product .guides-box, .single-product .upsells { grid-column: 1 / -1; }
.woocommerce-tabs ul.tabs { display: flex; gap: 18px; list-style: none; padding: 0; margin: 28px 0 14px; border-bottom: 1px solid var(--line); }
.woocommerce-tabs ul.tabs li { padding: 10px 0; }
.woocommerce-tabs ul.tabs li.active { border-bottom: 2px solid var(--ink); font-weight: 700; }
.guides-box { margin-top: 30px; }

.post-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.post-card { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.post-card .thumb { aspect-ratio: 4 / 3; background: var(--sand); display: grid; place-items: center; color: var(--muted); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.post-card h3 { margin: 0; font-size: 1.05rem; }
.post-card p { margin: 0; font-size: 14px; }
.tag { display: inline-block; align-self: flex-start; background: var(--sand); border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.meta { font-size: 13px; color: var(--muted); }

.page-head { padding: 34px 0 18px; }
.pills { list-style: none; display: flex; gap: 8px; flex-wrap: wrap; padding: 0; margin: 14px 0 0; }
.pills a { display: inline-block; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 14px; }
.pills a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager { margin: 30px 0; text-align: center; }
.pager .page-numbers { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; margin: 0 2px; background: var(--paper); }
.pager .current { background: var(--ink); color: #fff; }
.page-wrap, .blog-wrap, .article-wrap, .woo-wrap { padding-bottom: 60px; }

.article-wrap { max-width: 820px; }
.article header { padding: 34px 0 10px; }
.article .lead img { width: 100%; border-radius: 18px; }
.entry { font-size: 1.08rem; line-height: 1.75; max-width: 70ch; }
.entry h2, .entry h3 { margin-top: 1.8em; scroll-margin-top: 90px; }
.entry img { border-radius: 12px; }
.entry a { text-decoration: underline; text-underline-offset: 3px; }
.entry table { width: 100%; border-collapse: collapse; }
.entry th, .entry td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.comments { margin-top: 50px; }

.why ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.why li { display: flex; flex-direction: column; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.why span { font-size: 13.5px; color: var(--muted); }

.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce form .form-row select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], textarea, select { font: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--paper); width: 100%; }
.woocommerce-message, .woocommerce-info, .woocommerce-error { list-style: none; border: 1px solid var(--line); background: var(--paper); border-left: 4px solid var(--ink); border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; }
table.shop_table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
table.shop_table th, table.shop_table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }

.site-footer { margin-top: 70px; background: var(--deep); color: #eadfcc; padding: 44px 0 24px; }
.site-footer .muted { color: #b9a98f; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.foot-grid h3 { font-family: var(--sans); font-size: 14px; font-weight: 700; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.copy { margin-top: 28px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; color: #b9a98f; }

.bottom-nav { display: none; }

.bz-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin-bottom: 22px; }
.bz-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.bz-tabs a { padding: 9px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 14px; font-weight: 600; }
.bz-tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.bz-form { display: grid; gap: 14px; max-width: 640px; }
.bz-form label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; }
.bz-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bz-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bz-table th, .bz-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.bz-table img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.bz-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--sand); }
.bz-status.publish { background: #d9ecdf; color: var(--good); }
.bz-notice { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; background: #d9ecdf; }
.bz-notice.err { background: #f6d9d3; }

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .promo-col { grid-template-columns: repeat(3, 1fr); }
  ul.products, .woocommerce ul.products, .post-grid { grid-template-columns: repeat(3, 1fr); }
  .primary-nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .search { margin-left: 0; }
}
@media (max-width: 720px) {
  body.has-bottom-nav { padding-bottom: 64px; }
  .bar { gap: 8px; min-height: 58px; flex-wrap: wrap; padding-bottom: 8px; }
  .brand { font-size: 1.25rem; margin-right: auto; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .actions .icon-btn:last-child { display: none; }
  .hero-copy { min-height: 300px; border-radius: 20px; }
  .promo-col { grid-template-columns: 1fr; }
  .promo { min-height: 0; }
  .trust-strip, .why ul, .trust-row { grid-template-columns: repeat(2, 1fr); }
  ul.products, .woocommerce ul.products, .post-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-tiles { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .single-product div.product { grid-template-columns: 1fr; gap: 20px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .bz-form .row2 { grid-template-columns: 1fr; }
  .bz-table { display: block; overflow-x: auto; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--paper); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
  .bottom-nav a.on { color: var(--ink); font-weight: 700; }
  .bottom-nav a:hover { text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
