/*
Theme Name: ای‌سورس کودک
Template: esource
Description: قالب فرزند ای‌سورس برای تغییرهای اختصاصی بدون دست زدن به قالب اصلی.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: esource-child
*/

/* Product purchase panel */
.single-product form.es-buy.cart {
  display: grid;
  grid-template-columns: auto minmax(5.5rem, 7rem) minmax(10rem, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--es-line);
  border-radius: calc(var(--es-radius) + 4px);
  background: var(--es-surface);
  box-shadow: 0 10px 30px rgb(20 18 14 / 6%);
}

.single-product form.es-buy.cart label[for="es-qty"] {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--es-ink-soft);
}

.single-product form.es-buy.cart .es-qty {
  width: 100%;
  min-height: 48px;
  padding-inline: 0.75rem;
  border: 1px solid var(--es-line);
  border-radius: var(--es-radius);
  background: var(--es-paper);
  color: var(--es-ink);
  font: inherit;
  font-weight: 700;
  text-align: center;
}

.single-product form.es-buy.cart .es-qty:focus {
  outline: 2px solid rgb(226 161 0 / 28%);
  outline-offset: 2px;
  border-color: var(--es-amber);
}

.single-product form.es-buy.cart .es-btn {
  min-height: 48px;
  padding-inline: 1.25rem;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.single-product form.es-buy.cart .es-btn[type="submit"] {
  box-shadow: 0 8px 18px rgb(226 161 0 / 22%);
}

.single-product form.es-buy.cart .es-btn:hover {
  transform: translateY(-1px);
}

.single-product form.es-buy.cart .es-btn-ghost {
  background: var(--es-paper);
  border-color: var(--es-line);
}

.single-product form.es-buy.cart .es-btn-ghost:hover {
  border-color: var(--es-ink);
  background: var(--es-surface);
}

@media (max-width: 640px) {
  .single-product form.es-buy.cart {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.875rem;
  }

  .single-product form.es-buy.cart .es-btn {
    grid-column: 1 / -1;
    width: 100%;
  }
}
/* Post comment form */
.es-comments #respond {
  margin-top: 2rem;
  padding: clamp(1rem, 3vw, 1.75rem);
  border: 1px solid var(--es-line);
  border-radius: calc(var(--es-radius) + 4px);
  background: var(--es-surface);
  box-shadow: 0 12px 36px rgb(20 18 14 / 6%);
}

.es-comments #reply-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  color: var(--es-ink);
}

.es-comments #reply-title::before {
  content: "";
  width: 0.3rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--es-amber);
}

.es-comments #cancel-comment-reply-link {
  margin-inline-start: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--es-amber-deep);
}

.es-comments .comment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.es-commments .comment-form > p {
  margin: 0;
}

.es-comments .comment-notes,
.es-comments .logged-in-as,
.es-comments .comment-form-comment,
.es-comments .comment-form-url,
.es-comments .comment-form-cookies-consent,
.es-comments .form-submit {
  grid-column: 1 / -1;
}

.es-comments .comment-notes,
.es-comments .logged-in-as {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--es-line);
  color: var(--es-muted);
  font-size: 0.875rem;
  line-height: 1.9;
}

.es-comments .logged-in-as a,
.es-comments .comment-notes a {
  color: var(--es-amber-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2rem;
}

.es-comments .comment-form label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--es-ink-soft);
  font-size: 0.875rem;
  font-weight: 700;
}

.es-comments .required {
  color: #b33a2b;
}

.es-comments .comment-form textarea,
.es-comments .comment-form input[type="text"],
.es-comments .comment-form input[type="email"],
.es-comments .comment-form input[type="url"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--es-line);
  border-radius: var(--es-radius);
  background: var(--es-paper);
  color: var(--es-ink);
  padding: 0.75rem 0.9rem;
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.es-comments .comment-form textarea {
  min-height: 10rem;
  resize: vertical;
  line-height: 1.9;
}

.es-comments .comment-form textarea:focus,
.es-comments .comment-form input[type="text"]:focus,
.es-comments .comment-form input[type="email"]:focus,
.es-comments .comment-form input[type="url"]:focus {
  outline: none;
  border-color: var(--es-amber);
  background: var(--es-surface);
  box-shadow: 0 0 0 3px rgb(226 161 0 / 16%);
}

.es-comments .comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: var(--es-muted);
  font-size: 0.85rem;
  line-height: 1.8;
}

.es-comments .comment-form-cookies-consent input {
  flex: none;
  margin-top: 0.4rem;
  accent-color: var(--es-amber);
}

.es-comments .comment-form-cookies-consent label {
  margin: 0;
  color: inherit;
  font-weight: 400;
}

.es-comments #submit {
  min-height: 48px;
  padding-inline: 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--es-radius);
  background: var(--es-amber);
  color: var(--es-ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgb(226 161 0 / 22%);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.es-comments #submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgb(226 161 0 / 28%);
}

@media (max-width: 640px) {
  .es-comments .comment-form {
    grid-template-columns: 1fr;
  }

  .es-comments .comment-form > p {
    grid-column: 1;
  }

  .es-comments #submit {
    width: 100%;
  }
}
/* Site footer redesign */
.es-site-footer {
  position: relative;
  margin-top: 4rem;
  overflow: hidden;
  border-top: 0;
  background: var(--es-header);
  color: var(--es-paper);
}

.es-site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--es-amber) 24%, var(--es-amber) 76%, transparent);
}

.es-site-footer::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 12% 15%, rgb(226 161 0 / 10%), transparent 32%);
}

.es-site-footer .es-foot-grid,
.es-site-footer .es-foot-bar {
  position: relative;
  z-index: 1;
}

.es-site-footer .es-foot-grid {
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.es-site-footer .es-foot-grid > div:first-child {
  padding-inline-end: clamp(0rem, 3vw, 2rem);
}

.es-site-footer .es-foot-brand {
  margin: 0;
  color: var(--es-paper);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.3;
}

.es-site-footer .es-foot-en {
  margin: 0.3rem 0 1.25rem;
  color: var(--es-amber);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-align: right;
}

.es-site-footer .es-foot-note,
.es-site-footer .es-foot-grid li,
.es-site-footer .es-foot-grid p {
  color: rgb(243 239 230 / 72%);
  font-size: 0.875rem;
  line-height: 2;
}

.es-site-footer .es-foot-note {
  max-width: 30rem;
  margin: 0;
}

.es-site-footer .es-foot-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1rem;
  color: var(--es-paper);
  font-size: 0.95rem;
  font-weight: 800;
}

.es-site-footer .es-foot-title::before {
  content: "";
  width: 0.3rem;
  height: 1.1rem;
  border-radius: 999px;
  background: var(--es-amber);
}

.es-site-footer .es-foot-grid ul {
  display: grid;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.es-site-footer .es-foot-grid li {
  margin: 0;
}

.es-site-footer .es-foot-grid a:not(.es-foot-cta) {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: rgb(243 239 230 / 72%);
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.es-site-footer .es-foot-grid a:not(.es-foot-cta)::before {
  content: "";
  width: 0;
  height: 1px;
  margin-inline-end: 0;
  background: var(--es-amber);
  transition: width 160ms ease, margin 160ms ease;
}

.es-site-footer .es-foot-grid a:not(.es-foot-cta):hover {
  color: var(--es-paper);
  transform: translateX(-2px);
}

.es-site-footer .es-foot-grid a:not(.es-foot-cta):hover::before {
  width: 0.8rem;
  margin-inline-end: 0.4rem;
}

.es-site-footer .es-foot-grid > div:last-child > p {
  margin: 0 0 0.35rem;
}

.es-site-footer .es-foot-grid > div:last-child > p[dir="ltr"] {
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
}

.es-site-footer .es-foot-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 0.75rem;
  padding-inline: 1.15rem;
  border: 1px solid var(--es-amber);
  border-radius: var(--es-radius);
  background: var(--es-amber);
  color: var(--es-ink);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgb(226 161 0 / 16%);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.es-site-footer .es-foot-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgb(226 161 0 / 24%);
}

.es-site-footer .es-foot-bar {
  border-top: 1px solid rgb(243 239 230 / 12%);
  background: rgb(0 0 0 / 18%);
  color: rgb(243 239 230 / 60%);
}

.es-site-footer .es-foot-bar-inner {
  min-height: 64px;
  align-items: center;
  padding-block: 0.75rem;
}

.es-site-footer .es-foot-bar p {
  margin: 0;
  color: inherit;
  font-size: 0.75rem;
}

@media (max-width: 980px) {
  .es-site-footer .es-foot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .es-site-footer .es-foot-grid > div:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .es-site-footer .es-foot-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .es-site-footer .es-foot-grid > div:first-child {
    grid-column: auto;
  }

  .es-site-footer .es-foot-bar-inner {
    display: grid;
    justify-content: stretch;
    text-align: center;
  }

  .es-site-footer .es-foot-cta {
    width: 100%;
  }
}
/* Dynamic brand directory */
.page-id-32 .es-prose-page > h1 {
  margin-bottom: 0.5rem;
}

.page-id-32 .es-prose > p:empty {
  display: none;
}

.es-brand-directory {
  margin-top: 1.25rem;
}

.es-brand-directory-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--es-line);
  border-radius: calc(var(--es-radius) + 4px);
  background: linear-gradient(135deg, var(--es-surface), var(--es-paper));
}

.es-brand-kicker {
  color: var(--es-amber-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.es-brand-directory-head h2 {
  margin: 0.3rem 0 0.45rem;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}

.es-brand-directory-head p {
  margin: 0;
  color: var(--es-muted);
  font-size: 0.9rem;
}

.es-brand-total {
  flex: none;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgb(226 161 0 / 35%);
  border-radius: 999px;
  background: rgb(226 161 0 / 10%);
  color: var(--es-amber-deep);
  font-size: 0.8rem;
  font-weight: 800;
}

.es-brand-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.es-brand-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--es-line);
  border-radius: calc(var(--es-radius) + 4px);
  background: var(--es-surface);
  box-shadow: 0 8px 24px rgb(20 18 14 / 4%);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.es-brand-card:hover {
  transform: translateY(-3px);
  border-color: rgb(226 161 0 / 55%);
  box-shadow: 0 14px 32px rgb(20 18 14 / 9%);
}

.es-brand-card-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.es-brand-card-media {
  display: grid;
  min-height: 9rem;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--es-line);
  background: var(--es-paper);
}

.es-brand-card-media img {
  width: 100%;
  height: 9rem;
  object-fit: contain;
  padding: 1.5rem;
  transition: transform 180ms ease;
}

.es-brand-card:hover .es-brand-card-media img {
  transform: scale(1.04);
}

.es-brand-monogram {
  display: grid;
  width: 4.5rem;
  height: 4.5rem;
  place-items: center;
  border: 1px solid rgb(226 161 0 / 35%);
  border-radius: 50%;
  background: rgb(226 161 0 / 10%);
  color: var(--es-amber-deep);
  font-size: 1.7rem;
  font-weight: 800;
}

.es-brand-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem;
}

.es-brand-card-content strong {
  color: var(--es-ink);
  font-size: 1.05rem;
}

.es-brand-card-content > span {
  margin-top: 0.4rem;
  color: var(--es-muted);
  font-size: 0.82rem;
  line-height: 1.85;
}

.es-brand-card-content small {
  margin-top: auto;
  padding-top: 0.85rem;
  color: var(--es-amber-deep);
  font-size: 0.75rem;
  font-weight: 800;
}

.es-brand-sheet {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-top: 1px solid var(--es-line);
  background: var(--es-paper);
  color: var(--es-ink);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}

.es-brand-sheet:hover {
  background: var(--es-amber);
}

@media (max-width: 900px) {
  .es-brand-directory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .es-brand-directory-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .es-brand-directory-grid {
    grid-template-columns: 1fr;
  }
}
/* Responsive shop product grid: mobile 2, tablet 3, desktop 4 */
.es-shop-layout .woocommerce ul.products {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 640px) {
  .es-shop-layout .woocommerce ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

@media (min-width: 1024px) {
  .es-shop-layout .woocommerce ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 639px) {
  .es-shop-layout {
    gap: 1rem;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard-media .es-photo-labels {
    display: none;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard-body {
    gap: 0.4rem;
    padding: 0.65rem;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard-kicker {
    overflow: hidden;
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard h2,
  .es-shop-layout .woocommerce ul.products .es-pcard .woocommerce-loop-product__title {
    display: -webkit-box;
    overflow: hidden;
    min-height: 2.8em;
    font-size: 0.82rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard-sum {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard-stock {
    font-size: 0.68rem;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard-row {
    align-items: stretch;
    flex-direction: column;
    gap: 0.5rem;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard-price {
    min-height: 2.8em;
    font-size: 0.68rem;
    line-height: 1.45;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard-price .amount {
    display: block;
    overflow-wrap: anywhere;
    font-size: 0.74rem;
  }

  .es-shop-layout .woocommerce ul.products .es-pcard-compare {
    width: 100%;
    min-height: 38px;
    padding-inline: 0.45rem;
    font-size: 0.72rem;
  }
}
/* WooCommerce archive grid selector fix */
body.woocommerce.archive ul.products {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (min-width: 640px) {
  body.woocommerce.archive ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
}

@media (min-width: 1024px) {
  body.woocommerce.archive ul.products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 639px) {
  body.woocommerce.archive ul.products .es-photo-labels { display: none; }
  body.woocommerce.archive ul.products .es-pcard-body { gap: 0.4rem; padding: 0.65rem; }
  body.woocommerce.archive ul.products .es-pcard-kicker { overflow: hidden; font-size: 0.66rem; text-overflow: ellipsis; white-space: nowrap; }
  body.woocommerce.archive ul.products .woocommerce-loop-product__title { display: -webkit-box; overflow: hidden; min-height: 2.8em; font-size: 0.82rem; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  body.woocommerce.archive ul.products .es-pcard-sum { display: -webkit-box; overflow: hidden; font-size: 0.72rem; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  body.woocommerce.archive ul.products .es-pcard-stock { font-size: 0.68rem; }
  body.woocommerce.archive ul.products .es-pcard-row { align-items: stretch; flex-direction: column; gap: 0.5rem; }
  body.woocommerce.archive ul.products .es-pcard-price { min-height: 2.8em; font-size: 0.68rem; line-height: 1.45; }
  body.woocommerce.archive ul.products .es-pcard-price .amount { display: block; overflow-wrap: anywhere; font-size: 0.74rem; }
  body.woocommerce.archive ul.products .es-pcard-compare { width: 100%; min-height: 38px; padding-inline: 0.45rem; font-size: 0.72rem; }
}
/* Prevent legacy WooCommerce row classes from creating empty grid cells. */
body.woocommerce.archive ul.products > li.product,
body.woocommerce.archive ul.products > li.product.first,
body.woocommerce.archive ul.products > li.product.last {
  clear: none !important;
  margin-inline: 0 !important;
}
body.woocommerce.archive ul.products::before,
body.woocommerce.archive ul.products::after {
  display: none !important;
  content: none !important;
}
body.woocommerce.archive ul.products{grid-auto-flow:row dense}
body.woocommerce.archive ul.products>li.product:nth-of-type(2n+1){grid-column:1}
body.woocommerce.archive ul.products>li.product:nth-of-type(2n){grid-column:2}
@media(min-width:640px){body.woocommerce.archive ul.products>li.product:nth-of-type(n){grid-column:auto}body.woocommerce.archive ul.products>li.product:nth-of-type(3n+1){grid-column:1}body.woocommerce.archive ul.products>li.product:nth-of-type(3n+2){grid-column:2}body.woocommerce.archive ul.products>li.product:nth-of-type(3n){grid-column:3}}
@media(min-width:1024px){body.woocommerce.archive ul.products>li.product:nth-of-type(n){grid-column:auto}body.woocommerce.archive ul.products>li.product:nth-of-type(4n+1){grid-column:1}body.woocommerce.archive ul.products>li.product:nth-of-type(4n+2){grid-column:2}body.woocommerce.archive ul.products>li.product:nth-of-type(4n+3){grid-column:3}body.woocommerce.archive ul.products>li.product:nth-of-type(4n){grid-column:4}}
/* Product facts overlay remains visible while preserving the product image. */
body.woocommerce.archive ul.products .es-photo-labels,
.es-pcard-media .es-photo-labels {
  display: block !important;
  background: rgb(243 239 230 / 72%);
  border-color: rgb(216 208 194 / 70%);
  box-shadow: 0 6px 18px rgb(20 18 14 / 8%);
  -webkit-backdrop-filter: blur(6px) saturate(115%);
  backdrop-filter: blur(6px) saturate(115%);
}

body.woocommerce.archive ul.products .es-photo-labels dt,
.es-pcard-media .es-photo-labels dt {
  color: rgb(72 66 56 / 78%);
}

body.woocommerce.archive ul.products .es-photo-labels dd,
.es-pcard-media .es-photo-labels dd {
  color: var(--es-ink);
  text-shadow: 0 1px 0 rgb(255 255 255 / 45%);
}

@media (max-width: 639px) {
  body.woocommerce.archive ul.products .es-photo-labels,
  .es-pcard-media .es-photo-labels {
    inset-inline: 0.3rem;
    bottom: 0.3rem;
    padding: 0.3rem 0.35rem;
    background: rgb(243 239 230 / 66%);
    -webkit-backdrop-filter: blur(4px) saturate(110%);
    backdrop-filter: blur(4px) saturate(110%);
  }

  body.woocommerce.archive ul.products .es-photo-labels dl,
  .es-pcard-media .es-photo-labels dl {
    gap: 0.18rem 0.3rem;
  }

  body.woocommerce.archive ul.products .es-photo-labels dt,
  .es-pcard-media .es-photo-labels dt {
    font-size: 8px;
  }

  body.woocommerce.archive ul.products .es-photo-labels dd,
  .es-pcard-media .es-photo-labels dd {
    overflow: hidden;
    font-size: 9px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
/* List toggle: force one product per row regardless of archive grid rules. */
body.woocommerce.archive ul.products:has(> li.es-pcard.is-list) {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-auto-flow: row !important;
}

body.woocommerce.archive ul.products:has(> li.es-pcard.is-list) > li.product {
  grid-column: 1 !important;
  width: 100% !important;
}

@media (min-width: 701px) {
  body.woocommerce.archive ul.products > li.es-pcard.is-list .es-pcard-media {
    width: clamp(13rem, 30%, 18rem);
  }

  body.woocommerce.archive ul.products > li.es-pcard.is-list .es-pcard-body {
    padding: 1.25rem;
  }
}
/* Shop sorting select */
.es-archive-tools form:has(#es-sort) {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.es-archive-tools form:has(#es-sort)::after {
  content: "";
  position: absolute;
  inset-inline-end: 0.95rem;
  width: 0.45rem;
  height: 0.45rem;
  pointer-events: none;
  border-inline-end: 2px solid var(--es-ink-soft);
  border-bottom: 2px solid var(--es-ink-soft);
  transform: translateY(-25%) rotate(45deg);
}

#es-sort {
  width: auto;
  min-width: 9.5rem;
  min-height: 46px;
  appearance: none;
  -webkit-appearance: none;
  padding: 0.55rem 2.5rem 0.55rem 1rem;
  border: 1px solid var(--es-line);
  border-radius: calc(var(--es-radius) + 2px);
  background: linear-gradient(180deg, var(--es-surface), var(--es-paper));
  color: var(--es-ink);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px rgb(20 18 14 / 5%);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

#es-sort:hover {
  border-color: rgb(226 161 0 / 65%);
}

#es-sort:focus-visible {
  outline: none;
  border-color: var(--es-amber);
  box-shadow: 0 0 0 3px rgb(226 161 0 / 16%), 0 6px 16px rgb(20 18 14 / 6%);
}

#es-sort option {
  background: var(--es-surface);
  color: var(--es-ink);
}

@media (max-width: 639px) {
  .es-archive-tools form:has(#es-sort) {
    flex: 1 1 100%;
  }

  #es-sort {
    width: 100%;
  }
}
/* Compact archive product cards */
body.woocommerce.archive ul.products {
  column-gap: 0.7rem;
  row-gap: 0.85rem;
}

body.woocommerce.archive ul.products > li.es-pcard {
  align-self: stretch;
  border-radius: calc(var(--es-radius) + 2px);
  box-shadow: 0 5px 16px rgb(20 18 14 / 4%);
}

body.woocommerce.archive ul.products .es-pcard-img,
body.woocommerce.archive ul.products .es-pcard-media img {
  aspect-ratio: 4 / 3;
}

body.woocommerce.archive ul.products .es-pcard-body {
  gap: 0.45rem;
  padding: 0.75rem;
}

body.woocommerce.archive ul.products .es-pcard h2,
body.woocommerce.archive ul.products .woocommerce-loop-product__title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.7em;
  font-size: 0.92rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.woocommerce.archive ul.products .es-pcard-sum {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.woocommerce.archive ul.products .es-pcard-row {
  align-items: center;
  flex-direction: row;
  gap: 0.45rem;
}

body.woocommerce.archive ul.products .es-pcard-price {
  flex: 1;
  min-width: 0;
  min-height: 0;
  font-size: 0.76rem;
  line-height: 1.45;
}

body.woocommerce.archive ul.products .es-pcard-price .amount {
  display: inline;
  font-size: inherit;
  overflow-wrap: anywhere;
}

body.woocommerce.archive ul.products .es-pcard-compare {
  flex: none;
  width: auto;
  min-height: 38px;
  padding-inline: 0.65rem;
  font-size: 0.76rem;
}

@media (max-width: 639px) {
  body.woocommerce.archive ul.products {
    column-gap: 0.45rem;
    row-gap: 0.6rem;
  }

  body.woocommerce.archive ul.products .es-pcard-body {
    gap: 0.32rem;
    padding: 0.55rem;
  }

  body.woocommerce.archive ul.products .es-pcard-kicker {
    font-size: 0.62rem;
  }

  body.woocommerce.archive ul.products .es-pcard h2,
  body.woocommerce.archive ul.products .woocommerce-loop-product__title {
    min-height: 2.55em;
    font-size: 0.78rem;
  }

  body.woocommerce.archive ul.products .es-pcard-sum {
    font-size: 0.66rem;
    line-height: 1.5;
    -webkit-line-clamp: 1;
  }

  body.woocommerce.archive ul.products .es-pcard-stock {
    font-size: 0.62rem;
  }

  body.woocommerce.archive ul.products .es-pcard-price {
    font-size: 0.64rem;
  }

  body.woocommerce.archive ul.products .es-pcard-compare {
    min-height: 34px;
    padding-inline: 0.45rem;
    font-size: 0.65rem;
  }
}

.es-mega[hidden] {
  display: none !important;
}

form.es-ref {
  position: relative;
  display: grid;
  gap: 0.75rem;
  max-width: none;
  margin-block: 1.5rem;
  padding: clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--es-line);
  border-inline-start: 4px solid var(--es-amber);
  border-radius: calc(var(--es-radius) + 4px);
  background: var(--es-surface);
  box-shadow: 0 8px 24px rgb(20 18 14 / 5%);
}
form.es-ref > label {
  color: var(--es-ink);
  font-size: 0.95rem;
  font-weight: 800;
}
form.es-ref select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--es-line);
  border-radius: var(--es-radius);
  background: var(--es-paper);
  color: var(--es-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
form.es-ref select:hover { border-color: var(--es-amber); }
form.es-ref select:focus-visible {
  outline: 2px solid var(--es-amber);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgb(226 161 0 / 12%);
}
form.es-ref option,
form.es-ref optgroup {
  background: var(--es-surface);
  color: var(--es-ink);
}
@media (max-width: 639px) {
  form.es-ref { gap: 0.6rem; margin-block: 1rem; }
  form.es-ref select { font-size: 1rem; }
}

/* ESOURCE HIGH CONTRAST V5 */
.es-single-media{display:flex!important;flex-direction:column!important;background:#fff!important;border:1px solid #cbd5e1!important;}
.es-single-media .es-photo-labels{position:static!important;inset:auto!important;margin:0!important;padding:0.75rem 1rem!important;background:#fff!important;border:0!important;border-top:2px solid #e2a100!important;border-radius:0 0 8px 8px!important;}
body.woocommerce.archive ul.products .es-photo-labels,.es-pcard-media .es-photo-labels{top:0.4rem!important;bottom:auto!important;background:rgba(255,255,255,0.96)!important;border:1px solid #cbd5e1!important;box-shadow:0 4px 12px rgba(0,0,0,0.14)!important;backdrop-filter:none!important;}
.es-photo-labels dt{color:#334155!important;font-weight:700!important;}
.es-photo-labels dd{color:#0f172a!important;font-weight:800!important;text-shadow:none!important;}
.es-prose table th,.es-specs-table th,.es-board th{background:#1e293b!important;color:#fff!important;font-weight:700!important;}
.es-prose table td,.es-specs-table td,.es-specs td,.es-board td{background:#fff!important;color:#0f172a!important;}
.es-sales-box{background:#f8fafc!important;color:#0f172a!important;border:1px solid #cbd5e1!important;border-right:4px solid #d97706!important;}
.es-sales-box p,.es-sales-box strong{color:#0f172a!important;}
.es-btn-catalog,.es-catalog-box a{background:#e2a100!important;color:#14120e!important;font-weight:800!important;border:1px solid #b45309!important;}

/* === ESOURCE HIGH CONTRAST AAA OVERRIDES === */
:root {
  --es-muted: #334155 !important;
  --es-ink-soft: #1e293b !important;
  --es-amber-deep: #92400e !important;
}
.es-single-media,
.es-pcard-media {
  background: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
}
.es-single-img,
body.woocommerce.archive ul.products .es-pcard-img,
body.woocommerce.archive ul.products .es-pcard-media img,
.es-pcard-img,
.es-pcard-media img {
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
  background: #ffffff !important;
}
.es-single-media .es-photo-labels,
body.woocommerce.archive ul.products .es-photo-labels,
.es-pcard-media .es-photo-labels,
.es-photo-labels {
  position: static !important;
  inset: auto !important;
  margin: 0 !important;
  padding: 0.55rem 0.65rem !important;
  background: #f8fafc !important;
  border: 0 !important;
  border-top: 2px solid #cbd5e1 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto !important;
}
.es-photo-labels dt,
body.woocommerce.archive ul.products .es-photo-labels dt,
.es-pcard-media .es-photo-labels dt,
.es-search-keys dt {
  color: #334155 !important;
  font-weight: 700 !important;
  font-size: 11px !important;
}
.es-photo-labels dd,
body.woocommerce.archive ul.products .es-photo-labels dd,
.es-pcard-media .es-photo-labels dd,
.es-search-keys dd {
  color: #0f172a !important;
  font-weight: 800 !important;
  font-size: 12.5px !important;
  text-shadow: none !important;
}
.es-specs-table th,
.es-prose table thead th,
.es-prose table tr th {
  background-color: #1e293b !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  border-color: #334155 !important;
}
.es-specs-table td,
.es-prose table tbody td {
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  border-color: #cbd5e1 !important;
}
.es-specs th,
.es-board th,
.es-table th {
  background-color: #e2e8f0 !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  border-color: #cbd5e1 !important;
}
.es-specs td,
.es-board td,
.es-table td {
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-weight: 600 !important;
  border-color: #cbd5e1 !important;
}
.es-sales-box {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #cbd5e1 !important;
  border-right: 5px solid #d97706 !important;
}
.es-sales-box p, .es-sales-box strong, .es-sales-box span {
  color: #0f172a !important;
}
.es-sales-box a {
  color: #92400e !important;
  font-weight: 800 !important;
  text-decoration: underline !important;
}
.es-catalog-box {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border: 2px solid #cbd5e1 !important;
  border-right: 5px solid #1e293b !important;
}
.es-catalog-box a, a.es-btn-catalog {
  background-color: #1e293b !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}
.es-catalog-box a:hover, a.es-btn-catalog:hover {
  background-color: #0f172a !important;
  color: #fbbf24 !important;
}

/* isource mobile overflow fix 2026-11-13 */
@media (max-width: 1023.98px){
 .es-archive{grid-template-columns:minmax(0,1fr)}
 .es-archive > *{min-width:0}
 .es-archive ul.products,.es-related ul.products{grid-template-columns:repeat(2,minmax(0,1fr))}
 .es-archive ul.products > li{min-width:0}
 .woocommerce nav.woocommerce-pagination ul.page-numbers{display:flex;flex-wrap:wrap;justify-content:center;gap:4px;white-space:normal;max-width:100%;border:0}
 .woocommerce nav.woocommerce-pagination ul.page-numbers li{border:1px solid #cfc8bb}
}

/* ═══════════════════════════════════════════════
   ARCHIVE MOBILE RESPONSIVE — 2026-11-17
   ═══════════════════════════════════════════════ */

/* ── Archive head: عنوان و تعداد نتایج ── */
@media (max-width: 639px) {
	.es-archive-head { flex-direction: column; align-items: flex-start; gap: .5rem; }
	.es-archive-head h1 { font-size: 1.25rem; }
}

/* ── Archive tools: نوار فیلتر/مرتب/نمایش ── */
@media (max-width: 639px) {
	.es-archive-tools { gap: .4rem; }
	/* دکمه فیلتر + toggle نمایش کنار هم، sort تمام عرض زیر */
	.es-filter-open {
		flex: 1 1 auto;
		justify-content: center;
		font-size: 0.875rem;
		padding: 0 .6rem;
	}
	.es-view-toggle a { width: 40px; }
	/* chips فیلتر فعال */
	.es-chips { gap: .35rem; margin-top: .6rem; }
	.es-chips a { min-height: 38px; font-size: .82rem; padding: 0 .6rem; }
}

/* ── Pagination: بهبود موبایل ── */
@media (max-width: 639px) {
	.woocommerce-pagination { flex-wrap: wrap; gap: .35rem; }
	.woocommerce-pagination a,
	.woocommerce-pagination span { width: 38px; height: 38px; font-size: 0.875rem; }
}

/* ── محصولات آرشیو: کارت‌های فشرده‌تر روی موبایل ── */
@media (max-width: 480px) {
	/* شبکه: کمی فاصله کمتر */
	.es-archive ul.products,
	.es-related ul.products { gap: .5rem; }
	/* کارت محصول */
	body.woocommerce.archive ul.products { column-gap: .4rem; row-gap: .55rem; }
	body.woocommerce.archive ul.products .es-pcard-body { padding: .45rem; gap: .25rem; }
	body.woocommerce.archive ul.products .es-pcard h2,
	body.woocommerce.archive ul.products .woocommerce-loop-product__title {
		font-size: .75rem;
		min-height: 2.4em;
		-webkit-line-clamp: 2;
	}
	body.woocommerce.archive ul.products .es-pcard-sum { display: none; }
	body.woocommerce.archive ul.products .es-pcard-row { gap: .3rem; }
	body.woocommerce.archive ul.products .es-pcard-compare {
		min-height: 32px;
		padding-inline: .35rem;
		font-size: .62rem;
	}
}

/* ── صفحه محصول single: بهبود فرم خرید موبایل ── */
@media (max-width: 480px) {
	.single-product form.es-buy.cart { gap: .5rem; padding: .75rem; }
	.es-fact-grid { grid-template-columns: 1fr; gap: .4rem; }
}

/* ── فیلتر dialog: بهبود نمایش موبایل ── */
@media (max-width: 480px) {
	#es-filter-dialog { width: calc(100% - 1rem); }
}
