/* =========================================================
   Refinements — RTL direction, responsive header, WooCommerce stars
   Loaded last so these always win.
   ========================================================= */

/* ---------------------------------------------------------
   1. Select caret — deterministic SVG instead of gradients
   --------------------------------------------------------- */
select, .cc-select,
.cc-toolbar select,
.woocommerce select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7' fill='none' stroke='%238b95a5' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1.2 1.4 4.3 4.2 4.3-4.2'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 14px center !important;
  background-size: 11px 7px !important;
  padding-inline-start: 36px;
}
:root[data-theme="light"] select,
:root[data-theme="light"] .cc-select,
:root[data-theme="light"] .woocommerce select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7' fill='none' stroke='%2355616f' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1.2 1.4 4.3 4.2 4.3-4.2'/%3E%3C/svg%3E") !important;
}

/* ---------------------------------------------------------
   2. Directional icons must follow the reading direction
   --------------------------------------------------------- */
[dir="rtl"] .cc-section-link .cc-icon,
[dir="rtl"] .cc-icon--dir,
[dir="rtl"] .cc-account-nav__item a > .cc-icon.cc-icon--dir {
  transform: scaleX(-1);
}
[dir="rtl"] .cc-section-link:hover .cc-icon { transform: scaleX(-1) translateX(3px); }

/* Menu parent caret: right + bottom edges rotated = caret pointing down */
.cc-menu > li.menu-item-has-children > a::after {
  border-inline-end: 0;
  border-block-end: 1.6px solid currentColor;
  border-inline-start: 1.6px solid currentColor;
}

/* Pagination arrows */
.cc-pagination .prev, .cc-pagination .next { font-weight: 600; }

/* ---------------------------------------------------------
   3. Header search: never two search fields on screen at once
   --------------------------------------------------------- */
.cc-header__search.is-hidden { display: none !important; }
.cc-header__search.is-revealed { animation: cc-fade 220ms var(--cc-ease) both; }

/* ---------------------------------------------------------
   4. Header at tablet / phone — one compact row
   --------------------------------------------------------- */
@media (max-width: 960px) {
  .cc-header__inner {
    gap: 8px;
    row-gap: 8px;
    padding-block: 10px;
    min-height: 0;
  }
  .cc-brand { flex: 1 1 auto; min-width: 0; }
  .cc-brand__text { min-width: 0; }
  .cc-brand__name { font-size: 14px; }
  .cc-brand__mark { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
  .cc-header__actions { gap: 2px; margin-inline-start: 0; flex: none; }
  .cc-iconbtn { width: 38px; height: 38px; }
  .cc-mode-toggle__track { width: 52px; height: 28px; }
  .cc-mode-toggle__thumb { width: 22px; }
  :root[data-theme="light"] .cc-mode-toggle__thumb { transform: translateX(-24px); }
  .cc-mode-toggle__ico { width: 22px; }
  .cc-header__search { order: 3; flex: 1 0 100%; margin-block-end: 2px; }
  .cc-searchbox input { padding-inline: 42px 50px; min-height: 44px; font-size: 13.5px; }
  .cc-searchbox > .cc-icon { inset-inline-start: 13px; width: 17px; height: 17px; }
  .cc-searchbox__submit { width: 32px; height: 32px; inset-inline-end: 6px; }
}

@media (max-width: 480px) {
  .cc-brand__mark { width: 34px; height: 34px; }
  .cc-brand__name { font-size: 13.5px; }
  .cc-iconbtn { width: 34px; height: 34px; }
  .cc-iconbtn .cc-icon { width: 18px; height: 18px; }
  .cc-mode-toggle__track { width: 46px; height: 26px; }
  .cc-mode-toggle__thumb { width: 20px; }
  :root[data-theme="light"] .cc-mode-toggle__thumb { transform: translateX(-20px); }
  .cc-mode-toggle__ico { width: 19px; }
  .cc-mode-toggle__ico .cc-icon { width: 13px; height: 13px; }
}

/* ---------------------------------------------------------
   5. Hero on small screens
   --------------------------------------------------------- */
@media (max-width: 760px) {
  .cc-hero { padding-block: 28px 22px; }
  .cc-hero__inner { gap: 18px; }
  .cc-hero h1 { font-size: clamp(24px, 7.4vw, 34px); max-width: none; }
  .cc-hero__sub { font-size: 14px; }
  .cc-hero__search .cc-searchbox input {
    min-height: 52px;
    padding-inline: 46px 58px;
    font-size: 14px;
  }
  .cc-hero__search .cc-searchbox > .cc-icon { inset-inline-start: 16px; width: 18px; height: 18px; }
  .cc-hero__search .cc-searchbox__submit { width: 40px; height: 40px; inset-inline-end: 6px; }

  /* Quick searches: one scrollable row instead of three stacked ones */
  .cc-hero__quick {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    width: 100%;
    padding-block-end: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to left, #000 88%, transparent);
    mask-image: linear-gradient(to left, #000 88%, transparent);
  }
  .cc-hero__quick::-webkit-scrollbar { display: none; }
  .cc-hero__quick > * { flex: none; }
  .cc-hero__quick span { position: sticky; inset-inline-start: 0; }

  .cc-hero__stats { gap: 14px 26px; }
  .cc-hero__stat b { font-size: 20px; }
}

/* ---------------------------------------------------------
   6. Results toolbar — two tidy rows on phones
   --------------------------------------------------------- */
@media (max-width: 760px) {
  .cc-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
  }
  .cc-toolbar__summary { grid-column: 1 / -1; font-size: 13px; }
  .cc-toolbar__spacer { display: none; }
  .cc-toolbar__label { display: none; }
  .cc-toolbar__group { min-width: 0; }
  .cc-toolbar__group--perpage { display: none; }
  .cc-toolbar select { width: 100%; min-width: 0; min-height: 40px; }
  .cc-viewswitch { justify-self: end; }
  .cc-applied { gap: 6px; }
}

/* ---------------------------------------------------------
   7. Product tabs — no stray vertical scrollbar
   --------------------------------------------------------- */
.woocommerce-tabs .wc-tabs,
.cc-tabs {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.woocommerce-tabs .wc-tabs::-webkit-scrollbar,
.cc-tabs::-webkit-scrollbar { display: none; }
.woocommerce-tabs .wc-tabs li { flex: none; list-style: none; }
.woocommerce-tabs .panel { overflow: visible; }
.cc-product__tabs { overflow: visible; }

/* ---------------------------------------------------------
   8. WooCommerce star ratings (the WC icon font is not loaded)
   --------------------------------------------------------- */
.star-rating {
  position: relative;
  width: 74px;
  height: 13px;
  overflow: hidden;
  direction: ltr;
  font-size: 0;
  line-height: 1;
  flex: none;
  background: var(--cc-border-strong);
  -webkit-mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='74' height='13' viewBox='0 0 74 13'%3E%3Cg fill='black'%3E%3Cpath d='M6.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5L0 4.7l4.5-.6z'/%3E%3Cpath d='M21.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5-3.3-3.2 4.5-.6z'/%3E%3Cpath d='M36.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5-3.3-3.2 4.5-.6z'/%3E%3Cpath d='M51.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5-3.3-3.2 4.5-.6z'/%3E%3Cpath d='M66.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5-3.3-3.2 4.5-.6z'/%3E%3C/g%3E%3C/svg%3E") no-repeat;
  mask: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='74' height='13' viewBox='0 0 74 13'%3E%3Cg fill='black'%3E%3Cpath d='M6.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5L0 4.7l4.5-.6z'/%3E%3Cpath d='M21.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5-3.3-3.2 4.5-.6z'/%3E%3Cpath d='M36.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5-3.3-3.2 4.5-.6z'/%3E%3Cpath d='M51.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5-3.3-3.2 4.5-.6z'/%3E%3Cpath d='M66.5 0l2 4.1 4.5.6-3.3 3.2.8 4.5-4-2.1-4 2.1.8-4.5-3.3-3.2 4.5-.6z'/%3E%3C/g%3E%3C/svg%3E") no-repeat;
}
.star-rating > span {
  position: absolute;
  inset-block: 0;
  left: 0;
  right: auto;
  background: var(--cc-amber);
  overflow: hidden;
  text-indent: -9999px;
  display: block;
}
.star-rating > span::before { content: none; }
.star-rating strong, .star-rating .rating { position: absolute; left: -9999px; }

.woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--cc-text-2);
}
.woocommerce-review-link { color: var(--cc-text-2); }
.woocommerce-review-link:hover { color: var(--cc-accent); }

/* ---------------------------------------------------------
   9. Review form
   --------------------------------------------------------- */
#reviews { display: grid; gap: 22px; }
#comments > h2 { font-size: 17px; margin-bottom: 6px; }
.woocommerce-Reviews-title { font-size: 17px; }
.woocommerce-noreviews {
  margin: 0;
  padding: 16px 18px;
  border: 1px dashed var(--cc-border-strong);
  border-radius: var(--cc-r);
  background: var(--cc-surface);
  color: var(--cc-text-2);
  font-size: 13.5px;
}
.commentlist .comment-text { flex: 1; min-width: 0; }
.commentlist .meta { font-size: 12px; color: var(--cc-text-3); margin: 0 0 6px; }
.commentlist .meta strong { color: var(--cc-text); font-size: 13.5px; }
.commentlist .description { font-size: 13.5px; color: var(--cc-text-2); line-height: 1.9; }

#review_form_wrapper {
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-r-lg);
  background: var(--cc-surface);
}
#respond .comment-reply-title { display: block; font-size: 16px; font-weight: 700; margin-bottom: 6px; }
#respond .comment-notes, #respond .comment-form-cookies-consent label {
  font-size: 12.5px;
  color: var(--cc-text-3);
}
.comment-form { display: grid; gap: 16px; }
.comment-form label { font-size: 13px; font-weight: 600; color: var(--cc-text-2); }
.comment-form .comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; }
.comment-form .comment-form-cookies-consent input { margin: 0; }

.comment-form-rating { display: grid; gap: 8px; }
.comment-form-rating label { margin: 0; }
p.stars { margin: 0; }
p.stars > span { display: inline-flex; gap: 4px; direction: ltr; }
p.stars a {
  position: relative;
  display: inline-block;
  width: 26px;
  height: 26px;
  text-indent: -9999px;
  overflow: hidden;
  outline: none;
}
p.stars a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cc-border-strong);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 3.4 2.7 5.5 6 .9-4.3 4.2 1 6-5.4-2.8-5.4 2.8 1-6L3.3 9.8l6-.9z'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='m12 3.4 2.7 5.5 6 .9-4.3 4.2 1 6-5.4-2.8-5.4 2.8 1-6L3.3 9.8l6-.9z'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
  transition: background var(--cc-fast), transform var(--cc-fast);
}
p.stars:hover a::before { background: var(--cc-amber); }
p.stars a:hover ~ a::before { background: var(--cc-border-strong); }
p.stars a:hover::before { transform: scale(1.12); }
p.stars.selected a.active::before { background: var(--cc-amber); }
p.stars.selected a.active ~ a::before { background: var(--cc-border-strong); }
p.stars.selected a:not(.active)::before { background: var(--cc-amber); }

.comment-form p.form-submit { margin: 0; }
.comment-form p.form-submit input[type="submit"],
#respond input#submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 30px;
  width: auto;
  border: 0;
  border-radius: var(--cc-r-sm);
  background: linear-gradient(180deg, var(--cc-accent), var(--cc-accent-strong));
  color: var(--cc-accent-ink);
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: 0 10px 26px -14px var(--cc-accent-glow);
  transition: transform var(--cc-fast), box-shadow var(--cc-fast);
}
.comment-form p.form-submit input[type="submit"]:hover,
#respond input#submit:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -14px var(--cc-accent-glow); }

/* ---------------------------------------------------------
   10. WooCommerce attributes table (Additional information)
   --------------------------------------------------------- */
.cc-attributes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cc-attribute {
  display: grid;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-r-sm);
  background: var(--cc-surface-2);
}
.cc-attribute__label { font-size: 11.5px; color: var(--cc-text-3); }
.cc-attribute__value { font-size: 13.5px; font-weight: 600; color: var(--cc-text); line-height: 1.7; }
.cc-attribute__value a { color: var(--cc-accent); }
.cc-attribute__value a:hover { text-decoration: underline; }

/* ---------------------------------------------------------
   11. Price reads "۳۵٬۰۰۰ تومان" — keep the symbol off the digits
   --------------------------------------------------------- */
.woocommerce-Price-currencySymbol { padding-inline-start: 4px; font-weight: 600; font-size: 0.82em; opacity: 0.85; }

/* ---------------------------------------------------------
   12. Product cards on narrow screens
   --------------------------------------------------------- */
@media (max-width: 620px) {
  .cc-grid { gap: 12px; }
  .cc-grid--grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

  .cc-card-product__body { padding: 12px 12px 13px; gap: 7px; }
  .cc-card-product__title { font-size: 13px; line-height: 1.55; min-height: 2.7em; }
  .cc-card-product__cat { font-size: 10.5px; }
  .cc-card-product__meta { font-size: 10.5px; gap: 7px; }

  /* Footer stacks so the buy button is never clipped */
  .cc-card-product__foot {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
  }
  .cc-card-product__foot .cc-btn { width: 100%; }
  .cc-price-tag { text-align: center; }
  .cc-price-tag .amount, .cc-price-tag ins { font-size: 14px; }

  /* Format pills stay on one line inside the thumbnail */
  .cc-card-product__formats { inset-inline-start: 8px; inset-block-end: 8px; max-width: calc(100% - 16px); }
  .cc-card-product__formats .cc-format-row { flex-wrap: nowrap; gap: 4px; }
  .cc-card-product__formats .cc-format { padding: 2px 6px; font-size: 9.5px; }

  .cc-card-product__tools { opacity: 1; transform: none; inset-block-start: 8px; inset-inline-end: 8px; }
  .cc-fav--icon, .cc-quickview { width: 32px; height: 32px; }
  .cc-fav--icon .cc-icon, .cc-quickview .cc-icon { width: 16px; height: 16px; }
  .cc-card-product__badges { inset-block-start: 8px; inset-inline-start: 8px; }

  /* Two category tiles per row instead of one tall column */
  .cc-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cc-cat-tile { min-height: 108px; padding: 13px; }
  .cc-cat-tile__name { font-size: 13px; }
  .cc-cat-tile__count { font-size: 11px; }

  .cc-features { gap: 10px; }
  .cc-feature { padding: 16px; }
  .cc-rail__track { grid-auto-columns: minmax(180px, 1fr); gap: 12px; }
}

/* The "frequent searches" caption must not float over the chips */
.cc-hero__quick span { position: static; }

/* ---------------------------------------------------------
   13. Filters FAB only while the catalog is on screen
   --------------------------------------------------------- */
.cc-filters-fab {
  opacity: 0;
  visibility: hidden;
  transform: translateX(50%) translateY(12px);
  transition: opacity var(--cc-mid), transform var(--cc-mid), visibility var(--cc-mid);
}
.cc-filters-fab.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(50%) translateY(0);
}

/* ---------------------------------------------------------
   14. Single product on phones
   --------------------------------------------------------- */
@media (max-width: 620px) {
  .cc-product__title { font-size: clamp(19px, 5.6vw, 24px); }
  .cc-buybox { padding: 16px; }
  .cc-specs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cc-spec { padding: 11px 12px; }
  .cc-spec__value { font-size: 13px; }
  .cc-attributes { grid-template-columns: 1fr; }
  .cc-buybox__row { flex-wrap: wrap; }
  .cc-buybox__row > * { flex: 1 1 140px; }
  .cc-gallery__thumb { width: 62px; height: 50px; }
  .woocommerce-tabs .wc-tabs li a { padding: 11px 14px; font-size: 13px; }
}

/* Mobile card chrome: drop the "+N" pill, lay the tools out horizontally */
@media (max-width: 620px) {
  .cc-card-product__formats .cc-format--more { display: none; }
  .cc-card-product__tools { flex-direction: row; gap: 6px; }
}

/* ---------------------------------------------------------
   15. Review form polish
   --------------------------------------------------------- */
.comment-form-comment textarea,
#respond textarea {
  min-height: 130px;
  height: 130px;
  max-height: 320px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  border-color: var(--cc-border-strong);
}
.comment-form .comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  flex-direction: row;
}
.comment-form .comment-form-cookies-consent input[type="checkbox"] {
  flex: none;
  margin-top: 3px;
  width: 16px;
  height: 16px;
}
.comment-form .comment-form-cookies-consent label {
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.8;
}
.comment-form p.form-submit {
  display: flex;
  justify-content: flex-start;
}

/* ---------------------------------------------------------
   16. Gallery zoom button needs contrast over artwork
   --------------------------------------------------------- */
.cc-gallery__zoom {
  background: var(--cc-surface-glass) !important;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-color: var(--cc-border-strong) !important;
  box-shadow: var(--cc-shadow-sm);
}

/* Denser grid on tablets, where the sidebar is off-canvas */
@media (min-width: 621px) and (max-width: 1024px) {
  .cc-grid--grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .cc-cats { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* Keep the nav pill on the same line as the menu */
@media (min-width: 961px) {
  .cc-nav__inner { flex-wrap: nowrap; }
  .cc-nav .cc-menu { flex: 0 1 auto; min-width: 0; }
  .cc-nav__spacer { flex: 1 1 auto; }
}

/* Clearer active state on the grid/list switch */
.cc-viewswitch button.is-active {
  background: var(--cc-accent-soft);
  color: var(--cc-accent);
  box-shadow: inset 0 0 0 1px var(--cc-accent-line);
}
:root[data-theme="light"] .cc-viewswitch button.is-active { background: var(--cc-accent-soft); }

/* =========================================================
   17. Never crop artwork — letterbox it instead
   ========================================================= */
.cc-card-product__media {
  background: var(--cc-surface-3);
  isolation: isolate;
}
.cc-card-product__media::before {
  content: "";
  position: absolute;
  inset: -12%;
  background-image: var(--cc-thumb);
  background-size: cover;
  background-position: center;
  filter: blur(22px) saturate(120%) brightness(0.62);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}
:root[data-theme="light"] .cc-card-product__media::before { filter: blur(22px) saturate(115%) brightness(1.06); opacity: 0.4; }
.cc-card-product__media img {
  position: relative;
  z-index: 1;
  object-fit: contain !important;
  width: 100%;
  height: 100%;
}
.cc-card-product:hover .cc-card-product__media img { transform: scale(1.03); }
.cc-card-product__scrim { z-index: 1; }
.cc-card-product__badges, .cc-card-product__formats, .cc-card-product__tools { z-index: 3; }

/* Quick view, library rows, collection covers, block grid */
.cc-quickview-panel__media img,
.cc-library-row__thumb img,
.cc-collection-card__cover img,
.wc-block-grid__product-image img {
  object-fit: contain !important;
  background: var(--cc-surface-3);
}
.cc-quickview-panel__media { background: var(--cc-surface-3); }

/* Product gallery: the whole image, at its own ratio */
.cc-gallery__stage {
  aspect-ratio: auto;
  display: grid;
  place-items: center;
  background: var(--cc-surface-3);
  min-height: 240px;
  padding: 10px;
}
.cc-gallery__stage img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 760px);
  object-fit: contain;
  border-radius: var(--cc-r-sm);
}
.cc-gallery__thumb img { object-fit: contain; background: var(--cc-surface-3); }
.cc-lightbox__img { max-height: 88vh; width: auto; object-fit: contain; }

/* =========================================================
   18. Ratings fill right-to-left, and stop the hover flicker
   ========================================================= */
.cc-rating__stars { direction: rtl; }
.cc-rating__fill { inset: 0 0 0 auto; }

.star-rating { direction: rtl; }
.star-rating > span { left: auto; right: 0; }

p.stars > span { direction: rtl; }
p.stars a::before { transition: background var(--cc-fast); }
p.stars a:hover::before { transform: none; }
p.stars a { margin: 0; }

/* =========================================================
   19. Filter checkbox — a real tick, correctly oriented
   ========================================================= */
.cc-check__box::after {
  content: "";
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  transform: scale(0.55);
  opacity: 0;
  background: var(--cc-accent-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.6 4.6L19 7.2'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.6 4.6L19 7.2'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
  transition: opacity var(--cc-fast), transform var(--cc-fast);
}
.cc-check input:checked ~ .cc-check__box::after { opacity: 1; transform: scale(1); }
.cc-chip-set .cc-chip:has(input:checked) { border-color: var(--cc-accent); }

/* =========================================================
   20. Hero stats stay on one line
   ========================================================= */
@media (max-width: 620px) {
  .cc-hero__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .cc-hero__stat b { font-size: 17px; }
  .cc-hero__stat span { font-size: 10px; line-height: 1.5; }
}

/* =========================================================
   21. Classic cart + one-step checkout
   ========================================================= */
.cc-checkout__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  gap: clamp(18px, 2.4vw, 30px);
  align-items: start;
}
.cc-checkout__step { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.cc-checkout__step h2 { margin: 0 0 2px; font-size: 19px; }
.cc-checkout__step p { margin: 0; font-size: 13px; }
.cc-checkout__step-no {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--cc-accent); color: var(--cc-accent-ink);
  font-weight: 800; font-size: 13px;
}

.cc-order-review {
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-r-lg);
  background: var(--cc-surface);
  overflow: hidden;
}
.cc-order-items { list-style: none; margin: 0; padding: 0; }
.cc-order-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--cc-border-soft);
}
.cc-order-item:last-child { border-bottom: 0; }
.cc-order-item__thumb {
  width: 62px; height: 52px;
  border-radius: var(--cc-r-xs);
  overflow: hidden;
  background: var(--cc-surface-3);
  position: relative;
}
.cc-order-item__thumb img { width: 100%; height: 100%; object-fit: contain; }
.cc-order-item__body { display: grid; gap: 5px; min-width: 0; }
.cc-order-item__title { font-size: 14px; font-weight: 700; color: var(--cc-text); }
.cc-order-item__title:hover { color: var(--cc-accent); }
.cc-order-item__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--cc-text-3); }
.cc-order-item__price { font-size: 14px; font-weight: 800; white-space: nowrap; }
.cc-order-item__remove {
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; color: var(--cc-text-3);
  border: 1px solid transparent;
  transition: all var(--cc-fast);
}
.cc-order-item__remove:hover { color: var(--cc-danger); border-color: color-mix(in srgb, var(--cc-danger) 35%, transparent); }
.cc-order-item__remove .cc-icon { width: 15px; height: 15px; }

.cc-order-totals { padding: 16px 18px; border-top: 1px solid var(--cc-border); background: var(--cc-surface-2); display: grid; gap: 10px; }
.cc-order-total-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--cc-text-2); }
.cc-order-total-row--accent { color: var(--cc-accent); }
.cc-order-total-row--grand {
  padding-top: 12px;
  border-top: 1px dashed var(--cc-border-strong);
  font-size: 16px;
  font-weight: 800;
  color: var(--cc-text);
}
.cc-order-total-row--grand .amount { font-size: 19px; }

.cc-coupon { border-top: 1px solid var(--cc-border); padding: 14px 18px; }
.cc-coupon summary {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--cc-text-2);
  list-style: none;
}
.cc-coupon summary::-webkit-details-marker { display: none; }
.cc-coupon summary .cc-icon { width: 16px; height: 16px; color: var(--cc-accent); }
.cc-coupon__row { display: flex; gap: 8px; margin-top: 12px; }
.cc-coupon__row input { flex: 1; }

.cc-checkout__pay { padding: 18px; border-top: 1px solid var(--cc-border); }
.cc-checkout__pay .woocommerce-checkout-payment { background: none; border: 0; padding: 0; }
.cc-checkout__pay ul.payment_methods { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; border: 0; }
.cc-checkout__pay ul.payment_methods li {
  padding: 14px 16px;
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-r-sm);
  background: var(--cc-surface-2);
  transition: border-color var(--cc-fast), background var(--cc-fast);
}
.cc-checkout__pay ul.payment_methods li:has(input:checked) { border-color: var(--cc-accent-line); background: var(--cc-accent-soft); }
.cc-checkout__pay ul.payment_methods li label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.cc-checkout__pay ul.payment_methods li img { max-height: 26px; width: auto; }
.cc-checkout__pay .payment_box {
  margin-top: 10px; padding: 12px 14px;
  border-radius: var(--cc-r-xs);
  background: var(--cc-surface-3);
  font-size: 12.5px; color: var(--cc-text-2);
}
.cc-checkout__pay .payment_box p:last-child { margin: 0; }
.cc-checkout__pay .place-order { margin: 0; padding: 0; }
.cc-checkout__pay #place_order { width: 100%; min-height: 54px; font-size: 15.5px; }
.cc-checkout__pay .woocommerce-terms-and-conditions-wrapper { margin-bottom: 12px; font-size: 12.5px; }

.cc-checkout__aside { display: grid; gap: 14px; position: sticky; inset-block-start: calc(var(--cc-header-h) + 16px); }
.cc-checkout__identity { display: grid; gap: 12px; }
.cc-checkout__identity-row { display: flex; align-items: center; gap: 12px; }
.cc-checkout__identity-row img { width: 44px; height: 44px; border-radius: 50%; }
.cc-checkout__identity-row strong { font-size: 14.5px; }
.cc-checkout__trust { display: grid; gap: 12px; }

.cc-checkout-gate {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-r-lg);
  background:
    radial-gradient(80% 130% at 100% 0%, var(--cc-accent-soft), transparent 62%),
    var(--cc-surface);
}
.cc-checkout-gate__intro h2 { margin: 12px 0 8px; font-size: clamp(20px, 2.6vw, 26px); }
.cc-checkout-gate__form {
  padding: clamp(16px, 2vw, 22px);
  border: 1px solid var(--cc-border);
  border-radius: var(--cc-r);
  background: var(--cc-surface-2);
}
.cc-checkout-gate__form .woocommerce-form-login { border: 0; padding: 0; background: none; }

/* Classic cart table → readable rows */
.woocommerce-cart-form table.shop_table { background: var(--cc-surface); border-color: var(--cc-border); }
.woocommerce-cart-form .product-thumbnail img { width: 62px; height: 52px; object-fit: contain; background: var(--cc-surface-3); border-radius: var(--cc-r-xs); }
.woocommerce-cart-form .product-name a { color: var(--cc-text); font-weight: 700; }
.woocommerce-cart-form .product-name a:hover { color: var(--cc-accent); }
.woocommerce-cart-form .product-remove a.remove {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  color: var(--cc-text-3); font-size: 18px; line-height: 1; text-decoration: none;
}
.woocommerce-cart-form .product-remove a.remove:hover { color: var(--cc-danger); background: color-mix(in srgb, var(--cc-danger) 12%, transparent); }
.woocommerce-cart-form .quantity { display: none; }
.woocommerce-cart-form .actions .coupon { display: flex; gap: 8px; flex-wrap: wrap; }
.woocommerce-cart-form .actions { padding: 14px !important; }
.cart_totals h2 { font-size: 16px; margin-top: 0; }
.cart_totals table.shop_table { border: 0; }
.cart_totals table.shop_table th, .cart_totals table.shop_table td { border-color: var(--cc-border-soft); }
.wc-proceed-to-checkout { margin-top: 14px; }
.wc-proceed-to-checkout .checkout-button { width: 100%; }

@media (max-width: 900px) {
  .cc-checkout__grid { grid-template-columns: 1fr; }
  .cc-checkout__aside { position: static; }
  .cc-checkout-gate { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .cc-order-item { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; padding: 12px 14px; }
  .cc-order-item__thumb { width: 52px; height: 44px; }
  .cc-order-item__remove { grid-column: 3; grid-row: 1; align-self: start; }
  .cc-order-item__price { grid-column: 2 / -1; justify-self: start; font-size: 13.5px; }
  .cc-order-totals, .cc-coupon, .cc-checkout__pay { padding: 14px; }

  .woocommerce-cart-form table.shop_table thead { display: none; }
  .woocommerce-cart-form table.shop_table tr.cart_item {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--cc-border-soft);
  }
  .woocommerce-cart-form table.shop_table tr.cart_item td { border: 0; padding: 0; }
  .woocommerce-cart-form td.product-remove { grid-column: 3; }
  .woocommerce-cart-form td.product-subtotal { grid-column: 2 / -1; font-weight: 800; }
  .woocommerce-cart-form td.product-price { display: none; }
}

/* Inputs inside WooCommerce blocks must never fall back to a white box */
.wc-block-components-text-input input,
.wc-block-components-form input,
.woocommerce input[type="text"],
.woocommerce input[type="email"],
.woocommerce input[type="tel"],
.woocommerce input[type="password"],
.woocommerce textarea,
.woocommerce select {
  background: var(--cc-surface-2) !important;
  border: 1px solid var(--cc-border) !important;
  color: var(--cc-text) !important;
  border-radius: var(--cc-r-sm) !important;
  box-shadow: none !important;
}
.woocommerce input::placeholder, .woocommerce textarea::placeholder { color: var(--cc-text-3) !important; }

/* Login form inside the checkout gate */
.woocommerce-form-login { display: grid; gap: 14px; }
.woocommerce-form-login .woocommerce-form-row { display: grid; gap: 7px; }
.woocommerce-form-login .form-row:has(.woocommerce-form-login__rememberme),
.woocommerce-form-login p:has(button[name="login"]) { margin: 0; }
.woocommerce-form-login .woocommerce-form-login__rememberme {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--cc-text-2);
  cursor: pointer;
  margin: 0;
}
.woocommerce-form-login .woocommerce-form-login__rememberme input { margin: 0; }
.woocommerce-form-login button[name="login"],
.woocommerce-form-login .woocommerce-form-login__submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: var(--cc-r-sm);
  background: linear-gradient(180deg, var(--cc-accent), var(--cc-accent-strong));
  color: var(--cc-accent-ink);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.woocommerce-form-login .lost_password { margin: 0; font-size: 13px; }
.woocommerce-form-login .lost_password a { color: var(--cc-accent); }
.woocommerce-form-login .show-password-input { display: none; }
.woocommerce-LostPassword { text-align: start; }

/* =========================================================
   22. Classic cart layout
   ========================================================= */
.woocommerce-cart .cc-woo-page > .woocommerce {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: clamp(16px, 2vw, 26px);
  align-items: start;
}
.woocommerce-cart .cc-woo-page > .woocommerce > .woocommerce-notices-wrapper { grid-column: 1 / -1; }
.woocommerce-cart .cc-woo-page > .woocommerce > .cart-empty,
.woocommerce-cart .cc-woo-page > .woocommerce > .cc-empty,
.woocommerce-cart .cc-woo-page > .woocommerce > .return-to-shop { grid-column: 1 / -1; }
.woocommerce-cart .woocommerce-cart-form { margin: 0; }
.woocommerce-cart .cart-collaterals { display: block; width: 100%; }
.woocommerce-cart .cart-collaterals .cart_totals { width: 100%; position: sticky; inset-block-start: calc(var(--cc-header-h) + 16px); }

/* One quantity, one price: drop the redundant columns */
.woocommerce-cart-form th.product-quantity,
.woocommerce-cart-form td.product-quantity,
.woocommerce-cart-form th.product-subtotal,
.woocommerce-cart-form td.product-subtotal { display: none; }

.woocommerce-cart-form td.product-thumbnail { width: 78px; }
.woocommerce-cart-form td.product-name { font-size: 14px; }

/* Coupon + update row */
.woocommerce-cart-form .actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--cc-surface-2);
}
.woocommerce-cart-form .actions .coupon { display: flex; gap: 8px; flex: 1 1 260px; max-width: 420px; }
.woocommerce-cart-form .actions .coupon input { min-height: 42px; }
.woocommerce-cart-form .actions .coupon button,
.woocommerce-cart-form .actions button[name="update_cart"] {
  min-height: 42px;
  padding: 10px 18px;
  border-radius: var(--cc-r-sm);
  font: inherit;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
}
.woocommerce-cart-form .actions .coupon button {
  border: 1px solid var(--cc-accent-line);
  background: var(--cc-accent-soft);
  color: var(--cc-accent);
}
.woocommerce-cart-form .actions button[name="update_cart"] {
  border: 1px solid var(--cc-border);
  background: transparent;
  color: var(--cc-text-2);
}
.woocommerce-cart-form .actions button[name="update_cart"]:disabled { opacity: 0.45; }

.cart_totals { padding: 20px; }
.cart_totals table.shop_table td, .cart_totals table.shop_table th { padding: 10px 0; font-size: 13.5px; }
.cart_totals .order-total th, .cart_totals .order-total td { font-size: 16px; font-weight: 800; color: var(--cc-text); }
.wc-proceed-to-checkout .checkout-button {
  display: flex; align-items: center; justify-content: center;
  min-height: 50px; font-size: 15px;
}

@media (max-width: 860px) {
  .woocommerce-cart .cc-woo-page > .woocommerce { grid-template-columns: 1fr; }
  .woocommerce-cart .cart-collaterals .cart_totals { position: static; }
  .woocommerce-cart-form .actions { flex-direction: column; align-items: stretch; }
  .woocommerce-cart-form .actions .coupon { max-width: none; }
}

/* Cart action row: keep the coupon on one line and tone the buttons down */
.woocommerce-cart-form .actions .coupon input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}
.woocommerce-cart-form .actions .coupon button[name="apply_coupon"] {
  background: var(--cc-accent-soft) !important;
  color: var(--cc-accent) !important;
  border: 1px solid var(--cc-accent-line) !important;
  box-shadow: none !important;
  flex: none;
}
.woocommerce-cart-form .actions button[name="update_cart"] {
  background: transparent !important;
  color: var(--cc-text-2) !important;
  border: 1px solid var(--cc-border) !important;
  box-shadow: none !important;
  flex: none;
}
.woocommerce-cart-form .actions button[name="update_cart"]:hover:not(:disabled) {
  color: var(--cc-text) !important;
  border-color: var(--cc-border-strong) !important;
}

/* =========================================================
   23. Buttons must inherit the Persian UI font
   ========================================================= */
.cc-chip,
.cc-badge,
.cc-format,
.cc-filters__count,
.cc-count,
.cc-account-nav__badge,
button.cc-chip,
.cc-viewswitch button,
.cc-applied__label {
  font-family: inherit;
}
.cc-chip { font: inherit; font-size: 13px; font-weight: 500; }
.cc-chip--remove { font-size: 12.5px; }
.cc-filters__count { font-size: 11px; font-weight: 800; }
.cc-format { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* =========================================================
   24. Cart contents must read right-to-left
   ========================================================= */
.woocommerce table.shop_table,
.woocommerce-cart-form table.shop_table { direction: rtl; }
.woocommerce table.shop_table th,
.woocommerce table.shop_table td,
.woocommerce-cart-form table.shop_table th,
.woocommerce-cart-form table.shop_table td { text-align: right; }
.woocommerce-cart-form td.product-thumbnail,
.woocommerce-cart-form th.product-remove,
.woocommerce-cart-form td.product-remove { text-align: center; }
.woocommerce-cart-form td.product-price,
.woocommerce-cart-form th.product-price { text-align: left; }
.cart_totals table.shop_table th { text-align: right; }
.cart_totals table.shop_table td { text-align: left; }

/* Small product thumbs need a frame, otherwise white renders vanish */
.cc-order-item__thumb,
.woocommerce-cart-form .product-thumbnail img,
.cc-library-row__thumb {
  border: 1px solid var(--cc-border);
  background: var(--cc-surface-3);
  border-radius: var(--cc-r-xs);
}
.cc-order-item { grid-template-columns: 68px minmax(0, 1fr) auto auto; }
.cc-order-item__thumb { width: 68px; height: 56px; padding: 3px; }
.woocommerce-cart-form .product-thumbnail img { width: 68px; height: 56px; padding: 3px; }
@media (max-width: 620px) {
  .cc-order-item { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .cc-order-item__thumb { width: 56px; height: 48px; }
}
