/*
Theme Name: Asal Bano Bazaar
Description: قالب فروشگاه عسل بانو با کاشی‌کاری اصفهان. سبک، راست‌چین و هماهنگ با موبایل، تبلت و کامپیوتر.
Version: 2.5.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: asalbano-bazaar
Tags: rtl-language-support, e-commerce, custom-menu
License: GNU General Public License v2 or later
*/

/* ---------- Fonts: bundled so the site does not depend on Google Fonts ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- Colors and sizes ---------- */
:root {
  --teal: #0f4a55;
  --teal-dark: #0a333c;
  --gold: #e5a823;
  --gold-soft: #f6d27a;
  --gold-line: #c9a24a;
  --gold-grad: linear-gradient(180deg, #f8d778, #e5a823);
  --paper: #f8f0dc;
  --paper-light: #fffaf0;
  --ink: #2a2115;
  --muted: #66583f;
  --danger: #a12c12;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.9;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal); }
h1, h2, h3 { font-weight: 800; line-height: 1.45; margin: 0 0 .5em; color: var(--teal-dark); }
:focus-visible { outline: 3px solid var(--danger); outline-offset: 2px; }
.wrap { width: min(1320px, 100%); margin-inline: auto; padding-inline: clamp(14px, 2.5vw, 32px); }
.skip-link { position: absolute; right: -9999px; }
.skip-link:focus { right: 12px; top: 12px; z-index: 60; background: #fff; padding: 8px 14px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- Header: positions below are percentages of the header image ---------- */
.site-header { position: relative; z-index: 20; }
.hd { position: relative; aspect-ratio: 1536 / 194; background: url("assets/img/header.webp") center / 100% 100% no-repeat; }
.search { position: absolute; top: 18.6%; right: 8.85%; width: 23.45%; height: 26.8%; display: flex; }
.search input[type="search"] { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0 1em; font: inherit; font-size: clamp(12px, 1.02vw, 17px); color: var(--ink); }
.search input::placeholder { color: var(--muted); }
/* The magnifier is part of the image, so the button only needs to be clickable. */
.search button { flex: none; width: 13%; border: 0; background: transparent; color: transparent; cursor: pointer; }
.band-actions { position: absolute; top: 18.6%; left: 8.9%; width: 23.3%; height: 26.8%; display: flex; align-items: center; justify-content: space-evenly; }
.pill { display: inline-flex; align-items: center; gap: .5em; color: #fff; font-weight: 500; font-size: clamp(12px, 1.02vw, 17px); text-decoration: none; white-space: nowrap; transition: color .2s; }
.pill:hover { color: var(--gold-soft); }
.pill svg { width: 1.35em; height: 1.35em; }
.cart-count { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--gold-grad); color: var(--ink); font-size: .92em; font-weight: 800; }
.logo { position: absolute; z-index: 3; top: 4%; left: 50%; translate: -50% 0; width: 13.2%; height: 96%; text-decoration: none; }
.logo-m { display: none; }
/* Name on the ribbon: dark engraved lettering on the gold. */
.logo-name { position: absolute; top: 89%; left: 50%; translate: -50% -50%; white-space: nowrap; color: #2c1d07; font-size: 2.05vw; font-weight: 900; line-height: 1; text-shadow: 0 1px 0 rgba(255, 240, 190, .85); }
.ribbon-drop { position: absolute; z-index: 2; top: 100%; left: 50%; translate: -50% 0; width: 18.55%; height: auto; pointer-events: none; -webkit-mask-image: radial-gradient(ellipse 42% 100% at 50% 0, #000 70%, transparent 100%); mask-image: radial-gradient(ellipse 42% 100% at 50% 0, #000 70%, transparent 100%); }
.nav-toggle { display: none; }
.main-nav ul { position: absolute; top: 62.4%; height: 35%; display: flex; align-items: center; justify-content: center; gap: 1.6vw; margin: 0; padding: 0; list-style: none; }
.nav-start { right: 8.2%; width: 31.2%; }
.nav-end { left: 8.5%; width: 30.6%; }
.main-nav a { position: relative; display: block; padding: .25em .35em; color: var(--ink); font-weight: 500; font-size: clamp(12px, 1.12vw, 19px); text-decoration: none; white-space: nowrap; }
.main-nav a::after { content: ""; position: absolute; inset-inline: .35em; bottom: 0; height: 2px; background: var(--gold); scale: 0 1; transition: scale .22s; }
.main-nav a:hover::after, .main-nav .is-current a::after { scale: 1 1; }
.main-nav .is-current a { color: var(--teal); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button,
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce #respond input#submit, .nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 24px;
  background: var(--gold-grad);
  color: var(--ink);
  border: 1px solid #b98a1e;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: translate .18s, box-shadow .18s;
}
.btn:hover, .woocommerce a.button:hover, .woocommerce button.button:hover,
.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover {
  background: var(--gold-grad);
  color: var(--ink);
  translate: 0 -2px;
  box-shadow: 0 8px 18px rgba(150, 105, 15, .35);
}
.nav-toggle { display: none; }
.btn-ghost { background: transparent; color: var(--teal); border-color: var(--teal); }

/* ---------- Hero: the brand text sits inside the image's empty panel ---------- */
.hero { position: relative; }
.hero img { display: block; width: 100%; }
.hero-brand { position: absolute; top: 25%; left: 62.6%; width: 36%; height: 42%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; }
/* Gold foil lettering. */
.hero-brand strong {
  font-size: 6vw;
  font-weight: 900;
  line-height: 1.25;
  background: linear-gradient(180deg, #fff3bf 10%, #f6cf5f 45%, #d9981c 70%, #ffe7a0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 .12vw .1vw rgba(0, 0, 0, .55));
}
/* Thin gold rule with a diamond in the middle. */
.hero-rule { position: relative; width: 58%; height: 2px; margin-block: .5vw; background: linear-gradient(90deg, transparent, var(--gold-soft), transparent); }
.hero-rule::after { content: ""; position: absolute; top: 50%; left: 50%; width: .7vw; height: .7vw; translate: -50% -50%; rotate: 45deg; background: var(--gold-soft); }
.hero-brand p { margin: 0; font-size: 1.6vw; font-weight: 500; line-height: 1.65; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }

/* ---------- Product section ---------- */
.section { position: relative; padding-block: clamp(26px, 4vw, 48px); }
.title-pill { white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 14px; margin: 0 0 clamp(16px, 2.5vw, 28px); font-weight: 800; font-size: clamp(28px, 3.2vw, 46px); color: var(--teal-dark); }
.title-pill::before, .title-pill::after { content: ""; flex: 0 1 150px; height: 2px; background: linear-gradient(90deg, var(--gold-line), transparent); }
.title-pill::after { scale: -1 1; }

.p-grid, .woocommerce ul.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2.4vw, 40px); margin: 0; padding: 0; list-style: none; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product { float: none; width: auto; margin: 0; padding: 0; }
.p-card { display: flex; flex-direction: column; height: 100%; padding: clamp(10px, 1.2vw, 18px); background: var(--paper-light); border: 1px solid var(--gold-line); border-radius: 22px; box-shadow: 0 10px 30px rgba(15, 74, 85, .1); transition: translate .25s, box-shadow .25s; }
.p-card:hover { translate: 0 -6px; box-shadow: 0 18px 40px rgba(15, 74, 85, .18); }
.p-photo { position: relative; display: block; aspect-ratio: 23 / 30; overflow: hidden; }
.woocommerce ul.products li.product a img, .p-photo img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; clip-path: polygon(0 97%, 3% 100%, 97% 100%, 100% 97%, 100% 20%, 92% 12%, 78% 7%, 64% 4%, 50% 0, 36% 4%, 22% 7%, 8% 12%, 0 20%); }
/* Light sweep across the arch on hover. */
.p-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .4) 50%, transparent 62%); translate: 110% 0; pointer-events: none; }
.p-card:hover .p-photo::after { translate: -110% 0; transition: translate .8s; }
.p-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 12px 6px 2px; text-align: center; }
.p-name { color: var(--teal-dark); font-weight: 800; font-size: clamp(16px, 1.7vw, 24px); line-height: 1.5; text-decoration: none; }
.p-price { margin-top: auto; font-weight: 800; font-size: clamp(16px, 1.45vw, 21px); color: var(--teal); line-height: 1.6; }
.p-price small { font-size: .7em; font-weight: 500; color: var(--muted); }
.woocommerce .p-add, .p-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: clamp(44px, 3.6vw, 54px);
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-weight: 500;
  font-size: clamp(14px, 1.15vw, 17px);
  text-decoration: none;
  transition: background-color .18s;
}
.p-add:hover { background: var(--teal-dark); color: #fff; }
.p-add.loading { opacity: .6; pointer-events: none; }
.p-add.added { background: #17806f; }
.p-card .added_to_cart { display: none; }
.p-soldout { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 4px; border-radius: 10px; background: #e6dcc4; color: #5c4f38; font-weight: 500; font-size: 14px; }
.notice-soon { border: 1px dashed var(--gold-line); border-radius: 12px; padding: 24px; text-align: center; font-weight: 700; }

.benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding-bottom: clamp(28px, 4vw, 50px); }
.benefits div { background: var(--paper-light); border: 1px solid var(--gold-line); border-radius: 14px; padding: clamp(12px, 1.4vw, 22px); }
.benefits b { display: block; color: var(--teal-dark); font-size: clamp(16px, 1.3vw, 19px); }
.benefits span { font-size: clamp(14px, 1.05vw, 16px); color: var(--muted); }

/* ---------- Inner pages ---------- */
.content { padding-block: clamp(30px, 6vw, 64px); }
.entry { background: var(--paper-light); border: 1px solid var(--gold-line); border-radius: 14px; padding: clamp(16px, 3vw, 30px); margin-bottom: 20px; }
.entry-title, .woocommerce-products-header__title, .product_title { font-weight: 800; color: var(--teal-dark); }
.woocommerce-account:not(.logged-in) .entry { background: none; border: 0; padding: 0; }
.woocommerce-account:not(.logged-in) .entry-title { display: none; }
.single-product .content div.product { background: var(--paper-light); border: 1px solid var(--gold-line); border-radius: 14px; padding: clamp(16px, 3vw, 30px); }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea { min-height: 46px; padding: 8px 12px; font-size: 16px; border: 1px solid var(--gold-line); border-radius: 10px; background: #fff; }
.woocommerce .woocommerce-ordering select { min-height: 44px; border: 1px solid var(--gold-line); border-radius: 8px; padding: 4px 10px; background: var(--paper-light); font: inherit; font-size: 14px; }
.woocommerce table.shop_table { background: #fff; border-color: var(--gold-line); border-radius: 12px; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--teal); font-weight: 800; }
.woocommerce span.onsale { background: var(--danger); color: #fff; }
.woocommerce-info, .woocommerce-message { border-top-color: var(--gold); background: #fff4d4; color: var(--ink); }
.woocommerce-info::before, .woocommerce-message::before { color: var(--teal); }
.ab-hidden-field { display: none !important; }
.ab-address-note, .ab-checkout-login { font-weight: 700; color: var(--teal); }

/* ---------- Mobile login card ---------- */
.ab-login { max-width: 440px; margin-inline: auto; background: var(--paper-light); border: 1px solid var(--gold-line); border-radius: 16px; padding: clamp(18px, 4vw, 30px); }
.ab-login h2 { text-align: center; }
.ab-login label { display: block; font-weight: 700; margin-bottom: 4px; }
.ab-login input { width: 100%; min-height: 48px; padding: 8px 14px; font: inherit; font-size: 16px; border: 1px solid var(--gold-line); border-radius: 10px; background: #fff; }
.ab-login form .btn { width: 100%; }
.ab-otp-message { min-height: 1.9em; margin: 4px 0; font-weight: 700; color: var(--teal); }
.ab-otp-message.is-error { color: var(--danger); }
.ab-login-guest { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--gold-line); text-align: center; }
.ab-login-guest p { margin: 0 0 8px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--teal-dark); color: #fff; }
.band-thin { height: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 24px; }
.footer-brand { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; }
.footer-brand img { grid-row: span 2; width: 120px; height: auto; }
/* Same lettering as the logo: gold with a dark outline. */
.footer-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--gold-soft); }

/* Phone-only bottom bar, like a shopping app. */
.dock { display: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1100px) {
  .p-grid, .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pill span:not(.cart-count) { display: none; }
  .band-actions { justify-content: center; gap: 28px; }
  .main-nav ul { gap: 2px; }
}

/* ---------- Phone: the wide images are replaced by a stacked layout ---------- */
@media (max-width: 760px) {
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .hd { aspect-ratio: auto; display: grid; gap: 8px; padding: 8px 14px 10px; background: var(--teal-dark) url("assets/img/tile-band.webp") center top / auto 100% repeat-x; }
  .logo { position: relative; top: auto; left: auto; translate: none; justify-self: center; width: 172px; height: auto; }
  .logo-m { display: block; width: 100%; height: auto; }
  .logo-name { top: 77%; font-size: 20px; }
  .ribbon-drop, .band-actions { display: none; }
  .search { position: static; order: 2; width: 100%; height: 46px; background: var(--paper-light); border: 2px solid var(--gold-line); border-radius: 999px; overflow: hidden; }
  .search input[type="search"] { font-size: 16px; }
  .search button { width: 46px; color: var(--teal); }
  .nav-toggle { order: 3; display: flex; width: 100%; min-height: 42px; background: var(--paper-light); box-shadow: none; }
  .main-nav { order: 4; display: none; background: var(--paper-light); border-radius: 10px; padding: 6px 12px; }
  .main-nav.open { display: block; }
  .main-nav ul { position: static; display: block; width: auto; height: auto; }
  .main-nav a { padding: 10px 4px; font-size: 16px; }
  .hero-brand { position: static; width: auto; height: auto; padding: 18px 16px 20px; background: var(--teal-dark); border-block: 2px solid var(--gold-line); }
  .hero-brand strong { font-size: 54px; filter: none; }
  .hero-rule { margin-block: 10px; }
  .hero-rule::after { width: 8px; height: 8px; }
  .hero-brand p { font-size: 16px; }
  /* Phone: two even columns, compact cards, readable sizes. */
  body { font-size: 16px; }
  .section { padding-block: 26px 18px; }
  .title-pill { font-size: 26px; gap: 10px; }
  .title-pill::before, .title-pill::after { flex-basis: 60px; }
  .p-grid, .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .p-card { padding: 8px; border-radius: 16px; }
  .p-body { gap: 2px; padding: 8px 2px 0; }
  .p-name { font-size: 15px; }
  .p-price { font-size: 15px; }
  .p-add, .woocommerce .p-add { min-height: 44px; font-size: 14px; }
  .benefits { grid-template-columns: 1fr 1fr; gap: 10px; }
  .benefits div { padding: 10px 12px; }
  .footer-inner { flex-direction: column; align-items: center; text-align: center; }
  .footer-brand { grid-template-columns: 1fr; justify-items: center; row-gap: 6px; }
  .footer-brand img { grid-row: auto; width: 110px; }
  .dock {
    position: fixed;
    z-index: 50;
    inset-inline: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--teal-dark);
    border-top: 2px solid var(--gold-line);
  }
  .dock a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 58px; color: #fff; font-size: 12px; font-weight: 500; text-decoration: none; }
  .dock .cart-count { min-width: 20px; height: 20px; font-size: 11px; }
}

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