/* Shared components. Page-specific layout lives in the per-template stylesheets. */

.p136-icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }

/* Buttons ---------------------------------------------------------------- */
.p136-btn,
.wp-element-button,
.woocommerce .button,
.woocommerce button.button,
.woocommerce a.button,
.woocommerce input.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 22px;
  border: 1px solid transparent;
  border-radius: var(--p136-r-pill);
  background: var(--p136-accent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--p136-t-fast) var(--p136-ease), color var(--p136-t-fast) var(--p136-ease), transform var(--p136-t-fast) var(--p136-ease), box-shadow var(--p136-t-fast) var(--p136-ease);
}
.p136-btn:hover, .woocommerce .button:hover { background: var(--p136-accent-hover); color: #fff; text-decoration: none; }
.p136-btn:active, .woocommerce .button:active { transform: scale(0.97); }
.p136-btn[disabled], .p136-btn[aria-disabled="true"], .woocommerce .button.disabled, .woocommerce .button:disabled {
  background: var(--p136-line);
  color: var(--p136-faint);
  cursor: not-allowed;
  transform: none;
  pointer-events: none;
}
.p136-btn--secondary { background: var(--p136-surface); color: var(--p136-ink); }
.p136-btn--secondary:hover { background: var(--p136-line-soft); color: var(--p136-ink); }
.p136-btn--ghost { background: transparent; color: var(--p136-accent); border-color: var(--p136-accent); }
.p136-btn--ghost:hover { background: var(--p136-accent); color: #fff; }
.p136-btn--dark { background: var(--p136-ink); color: #fff; }
.p136-btn--dark:hover { background: #000; color: #fff; }
.p136-btn--light { background: #fff; color: var(--p136-ink); }
.p136-btn--light:hover { background: var(--p136-surface); color: var(--p136-ink); }
.p136-btn--lg { min-height: 46px; padding: 10px 28px; font-size: 1rem; }
.p136-btn--sm { min-height: 32px; padding: 4px 16px; font-size: 0.8125rem; }
.p136-btn--block { display: flex; width: 100%; }

/* "Learn more ›" text link with chevron (RTL: chevron points left). */
.p136-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--p136-accent);
}
.p136-link::after { content: "‹"; font-size: 1.25em; line-height: 1; transition: transform var(--p136-t-fast) var(--p136-ease); }
.p136-link:hover { text-decoration: none; }
.p136-link:hover::after { transform: translateX(-3px); }
.p136-on-dark .p136-link, .p136-section--dark .p136-link { color: #ff8a5c; }
.p136-actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.p136-actions--center { justify-content: center; }

/* Icon button (header, dialogs) */
.p136-iconbtn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  transition: background-color var(--p136-t-fast) var(--p136-ease);
}
.p136-iconbtn:hover { background: rgba(0, 0, 0, 0.06); }

/* Badges & chips ----------------------------------------------------------- */
.p136-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--p136-r-pill);
  background: var(--p136-surface);
  color: var(--p136-ink-2);
  font-size: var(--p136-fs-tiny);
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
}
.p136-badge--new { background: var(--p136-accent-tint); color: var(--p136-accent); }
.p136-badge--ok { background: var(--p136-ok-tint); color: var(--p136-ok); }
.p136-badge--warn { background: var(--p136-warn-tint); color: var(--p136-warn); }
.p136-badge--out { background: var(--p136-surface); color: var(--p136-faint); }
.p136-badge--demo { background: #eef2ff; color: #3b4cca; }

.p136-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 2px 14px;
  border: 1px solid var(--p136-line);
  border-radius: var(--p136-r-pill);
  background: #fff;
  color: var(--p136-ink);
  font-size: var(--p136-fs-small);
  white-space: nowrap;
  transition: border-color var(--p136-t-fast) var(--p136-ease), background-color var(--p136-t-fast) var(--p136-ease);
}
a.p136-chip:hover { border-color: var(--p136-ink); text-decoration: none; }
.p136-chip[aria-current="page"], .p136-chip.is-active { background: var(--p136-ink); color: #fff; border-color: var(--p136-ink); }

/* Glass surface (header, sticky bars, flyouts) */
.p136-glass {
  background: var(--p136-glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
}

/* Cards & tiles ------------------------------------------------------------ */
.p136-card {
  background: var(--p136-surface);
  border-radius: var(--p136-r-lg);
  overflow: clip;
}
.p136-card--white { background: #fff; border: 1px solid var(--p136-line-soft); }
.p136-card--dark { background: var(--p136-dark-2); color: var(--p136-on-dark); }
.p136-card--pad { padding: var(--p136-s6); }

/* Swatches (colour dots) -------------------------------------------------- */
.p136-swatches { display: inline-flex; align-items: center; gap: 6px; }
.p136-swatch {
  --swatch: #d2d2d7;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  flex: none;
}
.p136-swatch--lg { width: 40px; height: 40px; }
.p136-swatch-more { font-size: var(--p136-fs-tiny); color: var(--p136-muted); }

/* Choice cards: real radios styled as Apple's selectable option tiles ------- */
.p136-choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.p136-choice { position: relative; display: block; }
.p136-choice > input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.p136-choice__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
  padding: 12px 16px;
  border: 1px solid var(--p136-line);
  border-radius: var(--p136-r-sm);
  background: #fff;
  transition: border-color var(--p136-t-fast) var(--p136-ease), box-shadow var(--p136-t-fast) var(--p136-ease), background-color var(--p136-t-fast) var(--p136-ease);
}
.p136-choice:hover .p136-choice__body { border-color: var(--p136-faint); }
.p136-choice > input:checked + .p136-choice__body {
  border-color: var(--p136-accent);
  box-shadow: 0 0 0 1px var(--p136-accent);
  background: #fff;
}
.p136-choice > input:focus-visible + .p136-choice__body { outline: 3px solid var(--p136-focus); outline-offset: 3px; }
.p136-choice > input:disabled + .p136-choice__body { background: var(--p136-surface); color: var(--p136-faint); border-style: dashed; }
.p136-choice > input:disabled { cursor: not-allowed; }
.p136-choice__title { font-weight: 700; font-size: 0.9375rem; }
.p136-choice__sub { font-size: var(--p136-fs-small); color: var(--p136-muted); }
.p136-choice__price { font-size: var(--p136-fs-small); color: var(--p136-ink-2); font-weight: 500; }

/* Sheets (dialogs used for help, bag confirmation, search) ------------------ */
dialog.p136-sheet {
  width: min(680px, 100% - 24px);
  max-height: min(86vh, 900px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--p136-r-lg);
  background: #fff;
  color: var(--p136-ink);
  box-shadow: var(--p136-shadow-lg);
  overflow: auto;
}
dialog.p136-sheet::backdrop { background: rgba(0, 0, 0, 0.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.p136-sheet[open] { animation: p136-sheet-in var(--p136-t-med) var(--p136-ease-out); }
@keyframes p136-sheet-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
.p136-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.p136-sheet__head h2 { font-size: var(--p136-fs-h3); }
.p136-sheet__body { padding: 16px 24px 28px; }
@media (max-width: 734px) {
  dialog.p136-sheet { width: 100%; max-height: 92vh; margin-block-end: 0; border-end-start-radius: 0; border-end-end-radius: 0; }
}

/* Accordion (details/summary) ---------------------------------------------- */
.p136-accordion { border-top: 1px solid var(--p136-line); }
.p136-accordion details { border-bottom: 1px solid var(--p136-line); }
.p136-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.p136-accordion summary::-webkit-details-marker { display: none; }
.p136-accordion summary::after {
  content: "+";
  flex: none;
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1;
  transition: transform var(--p136-t-med) var(--p136-ease);
}
.p136-accordion details[open] summary::after { transform: rotate(45deg); }
.p136-accordion .p136-accordion__body { padding: 0 4px 24px; color: var(--p136-ink-2); }

/* Help disclosure "به راهنمایی نیاز دارید؟ (+)" */
.p136-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--p136-r-sm);
  background: var(--p136-surface);
  text-align: start;
  font-weight: 600;
  font-size: 0.875rem;
}
.p136-help small { display: block; font-weight: 400; color: var(--p136-muted); font-size: var(--p136-fs-small); }
.p136-help::after { content: "+"; font-size: 1.25rem; font-weight: 300; }

/* Timeline (reservation status, order tracking) ---------------------------- */
.p136-timeline { position: relative; display: grid; gap: 0; }
.p136-timeline__step { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding-block-end: 22px; }
.p136-timeline__step::before {
  content: "";
  position: absolute;
  inset-inline-start: 13px;
  inset-block: 28px 0;
  width: 2px;
  background: var(--p136-line);
}
.p136-timeline__step:last-child { padding-block-end: 0; }
.p136-timeline__step:last-child::before { display: none; }
.p136-timeline__dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--p136-line);
  background: #fff;
  color: #fff;
  font-size: 0.8rem;
}
.p136-timeline__step[data-state="done"] .p136-timeline__dot { background: var(--p136-ok); border-color: var(--p136-ok); }
.p136-timeline__step[data-state="done"]::before { background: var(--p136-ok); }
.p136-timeline__step[data-state="current"] .p136-timeline__dot { border-color: var(--p136-accent); box-shadow: 0 0 0 5px var(--p136-accent-tint); }
.p136-timeline__step[data-state="attention"] .p136-timeline__dot { background: var(--p136-danger); border-color: var(--p136-danger); }
.p136-timeline__title { font-weight: 700; }
.p136-timeline__step[data-state="upcoming"] .p136-timeline__title { color: var(--p136-faint); font-weight: 600; }
.p136-timeline__detail { color: var(--p136-muted); font-size: var(--p136-fs-small); }

/* Progress steps for checkout */
.p136-progress { display: flex; gap: 8px; }
.p136-progress > * { flex: 1; height: 4px; border-radius: 4px; background: var(--p136-line-soft); }
.p136-progress > .is-done { background: var(--p136-accent); }

/* Price ------------------------------------------------------------------- */
.p136-price { font-weight: 700; }
.p136-price-unit { font-size: 0.85em; font-weight: 500; color: var(--p136-muted); }
.p136-price-stamp { font-size: var(--p136-fs-tiny); color: var(--p136-muted); }
.p136-price-stamp::before { content: "●"; margin-inline-end: 6px; color: var(--p136-ok); font-size: 0.7em; vertical-align: 1px; }
.p136-price-stamp[data-state="indicative"]::before { color: var(--p136-warn); }
.p136-price-stamp[data-state="stale"]::before, .p136-price-stamp[data-state="missing"]::before { color: var(--p136-danger); }

/* Forms --------------------------------------------------------------------- */
.p136-field, .woocommerce form .form-row { margin-block-end: 16px; }
.p136-field label, .woocommerce form .form-row label { display: block; margin-block-end: 6px; font-size: var(--p136-fs-small); font-weight: 600; color: var(--p136-ink-2); }
.woocommerce form .form-row label .required { color: var(--p136-danger); text-decoration: none; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="url"], input[type="date"],
select, textarea, .woocommerce .input-text {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--p136-line);
  border-radius: var(--p136-r-sm);
  background: #fff;
  color: var(--p136-ink);
  transition: border-color var(--p136-t-fast) var(--p136-ease), box-shadow var(--p136-t-fast) var(--p136-ease);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--p136-accent); box-shadow: 0 0 0 3px rgba(201, 67, 27, 0.18); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--p136-accent); }
input::placeholder, textarea::placeholder { color: var(--p136-faint); }
.woocommerce form .form-row.woocommerce-invalid .input-text { border-color: var(--p136-danger); }
.woocommerce form .form-row.woocommerce-validated .input-text { border-color: var(--p136-ok); }
select { appearance: none; padding-inline-end: 40px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23424245' stroke-width='2'%3E%3Cpath d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat left 16px center; }

/* Quantity stepper (progressive: plain number input works without JS) */
.p136-qty { display: inline-flex; align-items: center; border: 1px solid var(--p136-line); border-radius: var(--p136-r-pill); overflow: hidden; }
.p136-qty input { width: 48px; min-height: 40px; padding: 0; border: 0; text-align: center; background: transparent; box-shadow: none !important; -moz-appearance: textfield; }
.p136-qty input::-webkit-outer-spin-button, .p136-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.p136-qty button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 1.3rem; }
.p136-qty button:hover { background: var(--p136-surface); }

/* WooCommerce notices ---------------------------------------------------------- */
.woocommerce-notices-wrapper { width: min(var(--p136-page), 100% - 2 * var(--p136-gutter)); margin-inline: auto; }
.woocommerce-message, .woocommerce-info, .woocommerce-error {
  margin: 16px 0;
  padding: 14px 20px;
  border-radius: var(--p136-r-md);
  background: var(--p136-surface);
  border-inline-start: 4px solid var(--p136-ink);
  list-style: none;
}
.woocommerce-message { background: var(--p136-ok-tint); border-color: var(--p136-ok); }
.woocommerce-error { background: var(--p136-danger-tint); border-color: var(--p136-danger); }
.woocommerce-info { background: var(--p136-warn-tint); border-color: var(--p136-warn); }
.woocommerce-message .button, .woocommerce-info .button { float: inline-end; min-height: 34px; padding: 4px 16px; font-size: 0.9rem; }

/* Breadcrumb */
.p136-breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--p136-fs-small); color: var(--p136-muted); }
.p136-breadcrumb a { color: var(--p136-muted); }
.p136-breadcrumb li + li::before { content: "‹"; margin-inline-end: 6px; opacity: 0.6; }

/* Pagination */
.woocommerce-pagination ul.page-numbers, .p136-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-block: var(--p136-s7); }
.woocommerce-pagination .page-numbers li { list-style: none; }
.page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: var(--p136-r-pill); background: var(--p136-surface); color: var(--p136-ink); font-weight: 600; }
.page-numbers.current { background: var(--p136-ink); color: #fff; }
a.page-numbers:hover { background: var(--p136-line-soft); text-decoration: none; }

/* Autoplay video wrapper (media.js adds the pause control) */
.p136-video { position: relative; overflow: hidden; }
.p136-video video { width: 100%; height: 100%; object-fit: cover; }
.p136-video__toggle {
  position: absolute;
  inset-block-end: 16px;
  inset-inline-end: 16px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--p136-ink);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Demo labelling (honest, not shouty) */
.p136-demo-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--p136-r-pill); background: #eef2ff; color: #3b4cca; font-size: var(--p136-fs-tiny); font-weight: 600; }

/* Skeleton shimmer for async content */
.p136-skeleton { background: linear-gradient(90deg, var(--p136-surface) 25%, #ececf0 37%, var(--p136-surface) 63%); background-size: 400% 100%; animation: p136-shimmer 1.4s ease infinite; border-radius: var(--p136-r-sm); }
@keyframes p136-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Number pop when a price/bag count changes */
.p136-bump { animation: p136-bump 420ms var(--p136-ease-out); }
@keyframes p136-bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* Prices and figures. Vazirmatn's Persian digits are proportional (the zero is a small dot), which reads
   correctly by default. Never use tabular figures here: they force equal widths and open up ugly gaps
   ("۴۵ ۱٬۵۰۰٬۰۰۰"). Only a hair of tightening keeps long toman amounts compact. */
.p136-price-num,
.woocommerce-Price-amount bdi,
[data-bar-price],
[data-sum-total],
[data-sum-price],
[data-sum-deposit],
[data-sum-rest] {
  font-variant-numeric: normal;
  letter-spacing: -0.02em;
}
