/*
Theme Name: Aangan Bazaar
Description: Custom WooCommerce theme for Aangan Bazaar — traditional Pakistani home decor, handmade jewelry, and street art. Design adapted from the Aangan Bazaar brand concept (terracotta/ochre palette, Playfair Display + Plus Jakarta Sans).
Author: Aangan Bazaar
Version: 1.0.0
Text Domain: aangan-bazaar
Requires PHP: 8.1
*/

:root {
  --color-terracotta-50: #fef7f2;
  --color-terracotta-100: #fdeee2;
  --color-terracotta-200: #fad5b8;
  --color-terracotta-300: #f5b183;
  --color-terracotta-400: #f0854d;
  --color-terracotta-500: #e55a23;
  --color-terracotta-600: #cb4319;
  --color-terracotta-700: #aa3114;
  --color-terracotta-800: #882713;
  --color-terracotta-900: #6f2212;
  --color-terracotta-950: #3c0e08;

  --color-ochre-50: #fdfaf3;
  --color-ochre-100: #fbf5e2;
  --color-ochre-200: #f4e7c0;
  --color-ochre-300: #ebd090;
  --color-ochre-400: #e0b45d;
  --color-ochre-500: #d19434;
  --color-ochre-600: #b57426;
  --color-ochre-700: #935420;
  --color-ochre-800: #76421d;
  --color-ochre-900: #61361b;
  --color-ochre-950: #371b0b;

  --color-indigo-clay: #1b263b;
  --color-sand: #fbf8f3;
  --color-warm-gray-900: #1c1c18;

  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-warm-gray-900);
  background: var(--color-sand);
  margin: 0;
  line-height: 1.55;
}
h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--color-ochre-900);
  margin: 0 0 0.5em;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-sand); }
::-webkit-scrollbar-thumb { background: var(--color-ochre-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-terracotta-600); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background: var(--color-terracotta-500);
  color: #fff;
  box-shadow: 0 4px 14px rgba(229, 90, 35, 0.25);
}
.btn-primary:hover { background: var(--color-terracotta-600); }
.btn-outline {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,0.2); }
.btn-dark {
  background: var(--color-ochre-400);
  color: var(--color-warm-gray-900);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.btn-dark:hover { background: var(--color-ochre-600); }

/* ---------- Pre-launch banner ---------- */
.prelaunch-banner {
  background: var(--color-indigo-clay);
  color: var(--color-ochre-200);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.65rem 1rem;
}

/* ---------- Site Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(252, 249, 243, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(235, 208, 144, 0.3);
}
.site-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.site-logo { display: flex; align-items: center; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--color-terracotta-600); flex-shrink: 0; }
.site-logo a { display: inline-flex; align-items: center; }
.site-logo img,
.site-logo .custom-logo {
  height: 3.5rem !important;
  width: auto !important;
  max-width: 220px !important;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: contrast(1.06) brightness(1.03);
}
.primary-nav { display: flex; gap: 2rem; }
.primary-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-ochre-800);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease;
}
.primary-nav a:hover, .primary-nav a.current-menu-item, .primary-nav .current-menu-item a {
  color: var(--color-terracotta-600);
  border-bottom-color: var(--color-terracotta-600);
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
.header-actions a, .header-actions button {
  position: relative;
  display: inline-flex;
  color: var(--color-ochre-800);
  padding: 0.5rem;
  border-radius: 999px;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}
.header-actions a:hover, .header-actions button:hover { color: var(--color-terracotta-600); background: rgba(244, 231, 192, 0.3); }

.header-search {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-sand);
  border-bottom: 1px solid rgba(235, 208, 144, 0.3);
  padding: 1rem 1.5rem;
}
.header-search.is-open { display: block; }
.header-search form { max-width: 1280px; margin: 0 auto; display: flex; gap: 0.5rem; }
.header-search input[type=search] {
  flex: 1; padding: 0.65rem 1rem; border: 1px solid rgba(235, 208, 144, 0.8); border-radius: 0.5rem; font-size: 0.9rem;
}
.header-search button {
  background: var(--color-terracotta-500); color: #fff; border: none; border-radius: 0.5rem; padding: 0.65rem 1.25rem; font-weight: 600; cursor: pointer;
}
.header-search button:hover { background: var(--color-terracotta-600); }
.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--color-terracotta-600);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mobile-nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--color-ochre-800); }

@media (max-width: 900px) {
  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-sand);
    border-bottom: 1px solid rgba(235, 208, 144, 0.3);
    padding: 0.5rem 1.5rem 1rem;
  }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: 0.75rem 0; border-bottom: 1px solid rgba(235, 208, 144, 0.2); }
  .mobile-nav-toggle { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 580px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-warm-gray-900);
  text-align: center;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; }
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.4) 60%, transparent);
}
.hero__content { position: relative; z-index: 1; max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }
.hero__eyebrow {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  color: var(--color-ochre-300); text-transform: uppercase; letter-spacing: 0.15em;
  font-size: 0.75rem; font-weight: 700; margin-bottom: 1.25rem;
}
.hero__title { font-size: clamp(2.25rem, 5vw, 3.75rem); color: #fff; line-height: 1.1; margin-bottom: 1rem; }
.hero__subtitle { font-size: clamp(1rem, 2vw, 1.25rem); color: rgba(251, 248, 243, 0.9); font-weight: 300; max-width: 42rem; margin: 0 auto 2rem; }
.hero__actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ---------- Section shared ---------- */
.section { max-width: 1280px; margin: 0 auto; padding: 5rem 1.5rem; }
.section-heading { text-align: center; margin-bottom: 2.5rem; }
.section-heading .eyebrow {
  display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.15em; color: var(--color-terracotta-600); margin-bottom: 0.5rem;
}
.section-heading .rule { width: 3rem; height: 4px; background: var(--color-ochre-500); border-radius: 999px; margin: 0.75rem auto 0; }

/* ---------- Shop by craft grid ---------- */
.craft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.craft-tile {
  position: relative; overflow: hidden; border-radius: 1rem; height: 20rem;
  background: #f5f5f4; border: 1px solid rgba(235, 208, 144, 0.2); box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.craft-tile.span-2 { grid-column: span 2; }
.craft-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s ease; }
.craft-tile:hover img { transform: scale(1.05); }
.craft-tile__overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1));
}
.craft-tile__text { position: absolute; left: 1.5rem; right: 1.5rem; bottom: 1.5rem; color: #fff; }
.craft-tile__eyebrow { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--color-ochre-300); font-family: var(--font-sans); }
.craft-tile__title { font-size: 1.5rem; margin: 0.25rem 0; color: #fff; }
.craft-tile__tagline { font-size: 0.8rem; color: #d4d4d4; font-weight: 300; }
@media (max-width: 900px) {
  .craft-grid { grid-template-columns: 1fr 1fr; }
  .craft-tile.span-2 { grid-column: span 2; }
}
@media (max-width: 640px) {
  .craft-grid { grid-template-columns: 1fr; }
  .craft-tile.span-2 { grid-column: span 1; }
}

/* ---------- Trust row ---------- */
.trust-row { background: rgba(244, 231, 192, 0.3); border-top: 1px solid rgba(235,208,144,0.35); border-bottom: 1px solid rgba(235,208,144,0.35); padding: 3rem 0; }
.trust-row .container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.trust-item { display: flex; align-items: flex-start; gap: 1rem; }
.trust-item__icon { padding: 0.75rem; background: rgba(229, 90, 35, 0.1); color: var(--color-terracotta-600); border-radius: 0.5rem; font-size: 1.375rem; flex-shrink: 0; }
.trust-item h4 { font-size: 1rem; margin-bottom: 0.25rem; }
.trust-item p { font-size: 0.8rem; color: #57534e; margin: 0; }
@media (max-width: 900px) { .trust-row .container { grid-template-columns: 1fr; } }

/* ---------- Artisan story ---------- */
.artisan-story { background: var(--color-indigo-clay); border-radius: 1.5rem; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,0.2); border: 1px solid #334155; display: grid; grid-template-columns: 7fr 5fr; }
.artisan-story__text { padding: 4rem; color: #fff; display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; }
.artisan-story__label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--color-ochre-300); font-family: monospace; }
.artisan-story__quote { font-family: var(--font-serif); font-size: 1.75rem; font-style: italic; color: #f1f5f9; line-height: 1.35; margin: 0; }
.artisan-story__author { display: flex; align-items: center; gap: 0.5rem; color: var(--color-ochre-400); font-size: 0.9rem; font-weight: 600; }
.artisan-story__author-line { width: 1.5rem; height: 2px; background: var(--color-ochre-400); }
.artisan-story__body { font-size: 0.875rem; color: #cbd5e1; font-weight: 300; line-height: 1.6; }
.artisan-story__image { position: relative; min-height: 340px; }
.artisan-story__image img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
@media (max-width: 900px) { .artisan-story { grid-template-columns: 1fr; } .artisan-story__text { padding: 2.5rem; } .artisan-story__image { height: 280px; } }

/* ---------- Newsletter ---------- */
.newsletter { max-width: 56rem; margin: 0 auto; padding: 2rem 1.5rem 5rem; text-align: center; }
.newsletter__box { background: rgba(244,231,192,0.3); border-radius: 1rem; padding: 3rem 2rem; border: 1px solid rgba(235,208,144,0.4); }
.newsletter__label { font-size: 0.65rem; font-family: monospace; text-transform: uppercase; letter-spacing: 0.15em; color: var(--color-ochre-500); display: block; margin-bottom: 0.5rem; }
.newsletter__desc { font-size: 0.85rem; color: #57534e; max-width: 32rem; margin: 0.5rem auto 1.5rem; }
.newsletter__form { display: flex; gap: 0.5rem; max-width: 28rem; margin: 0 auto; flex-wrap: wrap; }
.newsletter__form input[type=email] {
  flex: 1; min-width: 200px; background: #fff; border: 1px solid rgba(235,208,144,0.8); border-radius: 0.5rem;
  padding: 0.85rem 1rem; font-size: 0.8rem;
}
.newsletter__form button { border-radius: 0.5rem; }

/* ---------- Product grid / cards (also used by WooCommerce archive) ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .product-grid { grid-template-columns: 1fr; } }

ul.products { display: grid !important; grid-template-columns: repeat(4, 1fr) !important; gap: 1.5rem !important; list-style: none !important; margin: 0 !important; padding: 0 !important; clear: none !important; }
@media (max-width: 1100px) { ul.products { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 560px) { ul.products { grid-template-columns: 1fr !important; } }

/* WooCommerce's own stylesheet (.woocommerce ul.products li.product) has higher specificity
   than a plain `ul.products li.product` selector and sets float/width/margin for its legacy
   float-based grid — these !important overrides are required so our CSS grid actually wins. */
ul.products li.product, .product-card {
  background: #fff; border-radius: 0.75rem; overflow: hidden; border: 1px solid rgba(235,208,144,0.3);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04); transition: box-shadow 0.2s ease, transform 0.2s ease;
  padding: 0 !important;
  width: auto !important;
  float: none !important;
  margin: 0 !important;
  clear: none !important;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Homepage "Trending Now" cards render WooCommerce's [add_to_cart] shortcode directly, which
   injects a sibling "View cart" link + toggles the button to an "added" state via AJAX/JS —
   without these rules that extra content overflows and breaks alignment between cards. */
.product-card { padding-bottom: 1.25rem !important; }
.product-card > a:first-child { display: block; }
.product-card .price { margin-top: auto; }
.product-card .button,
.product-card a.button {
  display: block !important;
  width: calc(100% - 2rem) !important;
  margin: 0 1rem !important;
  text-align: center;
  box-sizing: border-box;
}
.product-card .added_to_cart {
  display: block;
  text-align: center;
  margin: 0.5rem 1rem 0 !important;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-terracotta-600);
}
ul.products li.product:hover { box-shadow: 0 12px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
ul.products li.product a { display: block; }
ul.products li.product img { aspect-ratio: 1; object-fit: cover; width: 100%; border-radius: 0 !important; }
ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-serif); font-size: 1rem; color: var(--color-ochre-900); padding: 1rem 1rem 0.25rem; margin: 0;
}
ul.products li.product .price { padding: 0 1rem 1rem; font-size: 0.9rem; color: var(--color-terracotta-600); font-weight: 600; }
ul.products li.product .price del { color: #a8a29e; font-weight: 400; margin-right: 0.4rem; }
ul.products li.product .button {
  margin: 0 1rem 1.25rem; background: var(--color-terracotta-500); color: #fff; border-radius: 0.5rem;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.65rem 1rem;
  width: calc(100% - 2rem);
}
ul.products li.product .button:hover { background: var(--color-terracotta-600); }
.onsale {
  background: var(--color-terracotta-600) !important; color: #fff !important; font-family: var(--font-sans) !important;
  font-size: 0.65rem !important; font-weight: 700 !important; text-transform: uppercase; letter-spacing: 0.05em;
  min-height: auto !important; min-width: auto !important; padding: 0.3rem 0.6rem !important; border-radius: 0.3rem !important;
  top: 0.75rem !important; left: 0.75rem !important; right: auto !important;
}

/* ---------- Single product ---------- */
.woocommerce div.product .woocommerce-product-gallery { border-radius: 0.75rem; overflow: hidden; }
.woocommerce div.product .product_title { font-family: var(--font-serif); color: var(--color-ochre-900); }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--color-terracotta-600); font-weight: 700; }
.woocommerce div.product form.cart .button, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button {
  background: var(--color-terracotta-500); color: #fff; border-radius: 0.5rem; font-weight: 600; padding: 0.85rem 1.75rem; border: none;
}
.woocommerce div.product form.cart .button:hover, .woocommerce a.button:hover, .woocommerce button.button:hover { background: var(--color-terracotta-600); }
.woocommerce span.onsale { background: var(--color-terracotta-600); }
.woocommerce ul.tabs li.active { border-bottom: 2px solid var(--color-terracotta-600); }

/* ---------- WooCommerce Cart/Checkout blocks (React-rendered; ship with WooCommerce's
   own default accent color unless the theme's palette / these overrides win) ---------- */
.wc-block-cart__submit-container .wc-block-components-button .wc-block-components-button__text,
.wc-block-components-checkout-place-order-button,
.wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button,
.wc-block-components-checkout-return-to-cart-button {
  --wc-primary: var(--color-terracotta-500) !important;
}
.wc-block-components-checkout-place-order-button,
.wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button.wp-element-button {
  background-color: var(--color-terracotta-500) !important;
  border-color: var(--color-terracotta-500) !important;
}
.wc-block-components-checkout-place-order-button:hover,
.wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button.wp-element-button:hover {
  background-color: var(--color-terracotta-600) !important;
}

/* ---------- WooCommerce misc ---------- */
.woocommerce-message, .woocommerce-info { border-top-color: var(--color-terracotta-500) !important; }
.woocommerce-message::before, .woocommerce-info::before { color: var(--color-terracotta-500) !important; }
.woocommerce a.added_to_cart { color: var(--color-terracotta-600); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-indigo-clay); color: #cbd5e1; padding: 4rem 0 2rem; margin-top: 4rem; }
.site-footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; }
.site-footer h5 { color: var(--color-ochre-300); font-family: var(--font-sans); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; }
.site-footer p { font-size: 0.85rem; line-height: 1.6; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { margin-bottom: 0.6rem; font-size: 0.85rem; }
.site-footer ul li a:hover { color: var(--color-ochre-300); }
.site-footer .copyright { max-width: 1280px; margin: 3rem auto 0; padding: 1.5rem 1.5rem 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.75rem; color: #94a3b8; text-align: center; }
@media (max-width: 900px) { .site-footer .container { grid-template-columns: 1fr; } }

/* ---------- Coming soon override note ---------- */
.woocommerce-coming-soon-banner { font-family: var(--font-serif); }
