/*
Theme Name: Haizum Uloomul Store
Theme URI: https://haizum.agency
Author: Haizum Agency
Author URI: https://haizum.agency
Description: Premium custom WooCommerce theme for Uloomul Akhirah Islamic Book Store. Pure PHP, HTML5, CSS3, vanilla JavaScript. No page builders. Built for the Uloomul Akhirah ecosystem (Store + Academy).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
Text Domain: haizum-uloomul-store
Tags: e-commerce, woocommerce, islamic, education, custom

This is the master stylesheet (loaded first). It defines the design
token system (the "Mihrab" design language) used across every other
stylesheet in /assets/css/. Component and page stylesheets are enqueued
separately from functions.php for caching and editing convenience.
*/

/* ==========================================================================
   1. DESIGN TOKENS — "Mihrab" design language
   Primary: Deep Emerald | Accent: Warm Gold | Background: Warm White
   Signature element: the Mihrab Arch (used on hero media, category tiles,
   author portraits, certificates) + a fine 8-point star line pattern used
   sparingly (4-6% opacity) as ambient texture, never as decoration on top
   of text.
   ========================================================================== */

:root {
  /* Color */
  --c-emerald: #0E3F33;
  --c-emerald-dark: #0A2E26;
  --c-emerald-light: #1E5C4B;
  --c-emerald-tint: #E7EFEC;
  --c-gold: #C7A03C;
  --c-gold-light: #E4C97A;
  --c-gold-tint: #F8F1DE;
  --c-cream: #FBF6EC;
  --c-white: #FFFFFF;
  --c-charcoal: #2A2823;
  --c-muted: #75706A;
  --c-border: #E7E0D2;
  --c-success: #3F8F5C;
  --c-error: #B0473D;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-arabic: 'Amiri', 'Times New Roman', serif;

  --fs-h1: clamp(2.25rem, 4vw, 3.25rem);
  --fs-h2: clamp(1.75rem, 3vw, 2.25rem);
  --fs-h3: 1.375rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.8125rem;

  --lh-heading: 1.2;
  --lh-body: 1.7;

  /* Spacing (8px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 48px;
  --sp-7: 64px;
  --sp-8: 96px;

  /* Layout */
  --container-max: 1280px;
  --container-pad: var(--sp-4);
  --radius-card: 12px;
  --radius-pill: 999px;
  --radius-arch: 50% 50% 0 0 / 28% 28% 0 0;

  /* Shadow */
  --shadow-card: 0 1px 2px rgba(14, 63, 51, 0.04), 0 8px 24px rgba(14, 63, 51, 0.06);
  --shadow-card-hover: 0 4px 8px rgba(14, 63, 51, 0.06), 0 16px 32px rgba(14, 63, 51, 0.10);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 180ms;

  /* Header heights (used for sticky offset calculations) */
  --switcher-height: 36px;
  --header-height: 80px;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--c-charcoal);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--c-emerald); text-decoration: none; }
a:hover { color: var(--c-emerald-light); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-heading);
  color: var(--c-emerald-dark);
  margin: 0 0 var(--sp-3);
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin: 0 0 var(--sp-3); }

ul, ol { padding-left: 1.25em; }

/* Visually-hidden helper for accessibility labels */
.screen-reader-text {
  position: absolute !important;
  left: -9999px;
  top: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Visible keyboard focus ring everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--c-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* Ecosystem switcher cross-site navigation: brief fade-out before the
   browser follows the link to the Academy site (see main.js). */
html {
  opacity: 1;
  transition: opacity 200ms var(--ease);
}
html.haizum-page-leaving {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  html.haizum-page-leaving { opacity: 1; }
}

/* ==========================================================================
   3. LAYOUT HELPERS
   ========================================================================== */

.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.section {
  padding: var(--sp-7) 0;
}

@media (max-width: 768px) {
  .section { padding: var(--sp-6) 0; }
}

.section-head {
  max-width: 640px;
  margin: 0 auto var(--sp-5);
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: var(--sp-2);
}

.section-head p {
  color: var(--c-muted);
}

.section--tint {
  background: var(--c-emerald-tint);
}

.section--emerald {
  background: var(--c-emerald);
  color: var(--c-white);
}
.section--emerald h2,
.section--emerald h3 { color: var(--c-white); }
.section--emerald .section-head p { color: rgba(255,255,255,0.78); }

/* Geometric pattern texture — used as ambient background only.
   Defined once here so any section can opt in via .pattern-bg */
.pattern-bg {
  position: relative;
}
.pattern-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('assets/images/pattern-geometric.svg');
  background-repeat: repeat;
  background-size: 220px 220px;
  opacity: 0.05;
  pointer-events: none;
}
.section--emerald.pattern-bg::before { opacity: 0.08; filter: invert(1); }
.pattern-bg > .container { position: relative; z-index: 1; }

/* ==========================================================================
   4. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-body);
  line-height: 1;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--c-emerald);
  color: var(--c-white);
}
.btn--primary:hover { background: var(--c-emerald-light); color: var(--c-white); }

.btn--secondary {
  background: transparent;
  color: var(--c-emerald);
  border-color: var(--c-emerald);
}
.btn--secondary:hover { background: var(--c-emerald); color: var(--c-white); }

.btn--gold {
  background: var(--c-gold);
  color: var(--c-emerald-dark);
}
.btn--gold:hover { background: var(--c-gold-light); }

.btn--ghost {
  background: transparent;
  color: var(--c-emerald);
  padding: 8px 4px;
  min-height: auto;
}
.btn--ghost:hover { color: var(--c-gold); text-decoration: underline; }

.btn--block { width: 100%; }
.btn--sm { padding: 8px 18px; font-size: var(--fs-small); min-height: 36px; }

/* ==========================================================================
   5. CARDS (shared shape vocabulary for product / course / author cards)
   ========================================================================== */

.card {
  background: var(--c-white);
  border-radius: var(--radius-card);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* The Mihrab Arch — signature framing shape for media */
.arch-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-arch);
  background: var(--c-emerald-tint);
}
.arch-frame img { width: 100%; height: 100%; object-fit: cover; }
.arch-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-arch);
  border: 2px solid var(--c-gold);
  pointer-events: none;
}

/* ==========================================================================
   6. UTILITIES
   ========================================================================== */

.visually-balanced { text-wrap: balance; }
.text-muted { color: var(--c-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-small);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--c-gold-tint);
  color: var(--c-emerald-dark);
  letter-spacing: 0.02em;
}
.badge--sale { background: var(--c-emerald); color: var(--c-white); }
.badge--category,
.badge--tag {
  text-decoration: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.badge--category:hover,
.badge--tag:hover {
  background: var(--c-emerald);
  color: var(--c-white);
}
.badge--tag {
  background: var(--c-emerald-tint);
  color: var(--c-emerald-dark);
  font-weight: 600;
}

/* ==========================================================================
   7. QUICK VIEW MODAL (global — used by product cards on any page)
   ========================================================================== */

.quick-view-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.quick-view-modal[hidden] { display: none; }

.quick-view-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 46, 38, 0.55);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.quick-view-modal.is-open .quick-view-modal__backdrop { opacity: 1; }

.quick-view-modal__panel {
  position: relative;
  background: var(--c-white);
  border-radius: var(--radius-card);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--sp-5);
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.quick-view-modal.is-open .quick-view-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.quick-view-modal__close {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--c-emerald-tint);
  color: var(--c-emerald-dark);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.quick-view__loading {
  text-align: center;
  padding: var(--sp-7) 0;
  color: var(--c-muted);
}

.quick-view {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--sp-5);
}
.quick-view__media {
  aspect-ratio: 5 / 7;
}
.quick-view__author {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
  margin: 0;
}
.quick-view__title { margin: var(--sp-1) 0 var(--sp-2); }
.quick-view__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-emerald);
  margin: 0 0 var(--sp-2);
}
.quick-view__meta {
  font-size: var(--fs-small);
  color: var(--c-muted);
  margin: 0 0 var(--sp-1);
}
.quick-view__excerpt {
  font-size: var(--fs-small);
  color: var(--c-charcoal);
  margin: var(--sp-2) 0 var(--sp-4);
}
.quick-view__excerpt p:last-child { margin-bottom: 0; }
.quick-view__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

@media (max-width: 640px) {
  .quick-view { grid-template-columns: 1fr; }
  .quick-view__media { max-width: 220px; margin: 0 auto; }
}

/* ==========================================================================
   8. SHARED COMPONENTS — product cards & blog cards
   Used across the homepage, category/shop pages and search results.
   ========================================================================== */

/* --------------------------------------------------------------------
   PRODUCT GRID + CARD (used on homepage, category, search)
   -------------------------------------------------------------------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
}

.product-grid--scroll {
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 1fr);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.product-grid--scroll .product-card { scroll-snap-align: start; }

.product-card { display: flex; flex-direction: column; overflow: hidden; }

.product-card__media {
  position: relative;
  aspect-ratio: 5 / 7;
}

.product-card__badge {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 2;
}

.product-card__wishlist {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--c-emerald-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.product-card__wishlist:hover { transform: scale(1.08); }
.product-card__wishlist.is-active {
  color: var(--c-error);
}
.product-card__wishlist.is-active svg { fill: currentColor; }

.product-card__quickview {
  position: absolute;
  left: var(--sp-2);
  right: var(--sp-2);
  bottom: var(--sp-2);
  z-index: 2;
  background: rgba(255,255,255,0.94);
  border-color: transparent;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.product-card:hover .product-card__quickview,
.product-card:focus-within .product-card__quickview {
  opacity: 1;
  transform: translateY(0);
}

.product-card__body {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  flex: 1;
}
.product-card__author {
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
.product-card__title {
  font-size: 1.0625rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.product-card__title a { color: var(--c-emerald-dark); }
.product-card__title a:hover { color: var(--c-emerald); }

.product-card__price {
  font-weight: 700;
  color: var(--c-emerald);
  margin: var(--sp-1) 0 var(--sp-2);
}
.product-card__price del {
  color: var(--c-muted);
  font-weight: 400;
  margin-right: var(--sp-1);
  text-decoration-color: var(--c-error);
}
.product-card__price ins {
  text-decoration: none;
}

.product-card__add-to-cart {
  margin-top: auto;
  width: 100%;
}
.product-card__add-to-cart.loading {
  opacity: 0.7;
  pointer-events: none;
}


/* --------------------------------------------------------------------
   Blog card grid (homepage Learning Resources + product Related Articles)
   -------------------------------------------------------------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-4);
}
.blog-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--c-charcoal);
  overflow: hidden;
}
.blog-card__media {
  aspect-ratio: 3 / 2;
}
.blog-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-emerald-light);
}
.blog-card__body {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.blog-card__date {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-gold);
  font-weight: 700;
}
.blog-card__title { font-size: 1.1875rem; margin: 0; }
.blog-card__excerpt { color: var(--c-muted); font-size: var(--fs-small); margin: 0; }
.blog-card__readmore {
  font-weight: 700;
  font-size: var(--fs-small);
  color: var(--c-emerald);
  margin-top: var(--sp-2);
}

/* --------------------------------------------------------------------
   Breadcrumb (single product, category, author/publisher archives)
   -------------------------------------------------------------------- */
.breadcrumb {
  font-size: var(--fs-small);
  color: var(--c-muted);
  padding: var(--sp-3) 0;
}
.breadcrumb a { color: var(--c-muted); }
.breadcrumb a:hover { color: var(--c-emerald); }
.breadcrumb .breadcrumb__sep { margin: 0 var(--sp-1); color: var(--c-border); }

