/* TrendWatch theme tokens + feature compatibility.
   Layout and component geometry intentionally remain in the legacy stylesheets
   from TrendWatch_after. This file changes colors only, plus paint-only transitions. */

:root {
  --tw-ui-radius-sm: 12px;
  --tw-ui-radius: 18px;
  --tw-ui-radius-lg: 22px;
  --tw-ui-ease: cubic-bezier(.2, .7, .2, 1);
}

html[data-theme="classic"] {
  color-scheme: dark;
  --tw-ui-bg: #090b0f;
  --tw-ui-bg-soft: #0d1016;
  --tw-ui-surface: #13161d;
  --tw-ui-surface-2: #11141b;
  --tw-ui-surface-3: #171b24;
  --tw-ui-input: #10131a;
  --tw-ui-text: #f4f1e9;
  --tw-ui-text-2: #d9dbe1;
  --tw-ui-muted: #9296a1;
  --tw-ui-muted-2: #a6a9b2;
  --tw-ui-line: rgba(216, 189, 128, .18);
  --tw-ui-line-strong: rgba(216, 189, 128, .32);
  --tw-ui-accent: #d8bd80;
  --tw-ui-accent-strong: #f0d79b;
  --tw-ui-accent-soft: rgba(216, 189, 128, .13);
  --tw-ui-gold: #d8bd80;
  --tw-ui-gold-soft: #f0dfb5;
  --tw-ui-danger: #e58b83;
  --tw-ui-success: #d8bd80;
  --tw-ui-warning: #e1b66e;
  --tw-ui-shadow: 0 22px 60px rgba(0, 0, 0, .34);
  --tw-ui-shadow-soft: 0 12px 32px rgba(0, 0, 0, .22);
  --tw-ui-header: rgba(9, 11, 15, .92);
  --tw-ui-footer: #10131a;
  --green-theme: #d8bd80;
  --green-ink: #f0dfb5;
  --emerald-900: #171717;
  --emerald-800: #202020;
  --emerald-700: #34312a;
  --emerald-600: #8b7b58;
  --emerald-500: #b69a61;
  --emerald-200: #d8bd80;
  --emerald-100: #30291b;
  --green: #d8bd80;
  --acc-success: #d8bd80;
  --tw-ref-success: #d8bd80;
  --adm-success: #d8bd80;
  --tw404-accent: #d8bd80;
  --tw404-accent-2: #f0d79b;
}

html[data-theme="emerald"] {
  color-scheme: light;
  --tw-ui-bg: #f3f6f2;
  --tw-ui-bg-soft: #eaf0eb;
  --tw-ui-surface: #ffffff;
  --tw-ui-surface-2: #f8faf8;
  --tw-ui-surface-3: #edf3ee;
  --tw-ui-input: #ffffff;
  --tw-ui-text: #19251e;
  --tw-ui-text-2: #314239;
  --tw-ui-muted: #66756c;
  --tw-ui-muted-2: #87958d;
  --tw-ui-line: rgba(38, 91, 65, .15);
  --tw-ui-line-strong: rgba(38, 91, 65, .27);
  --tw-ui-accent: #246b4b;
  --tw-ui-accent-strong: #1b5b3d;
  --tw-ui-accent-soft: rgba(36, 107, 75, .09);
  --tw-ui-gold: #246b4b;
  --tw-ui-gold-soft: #1b5b3d;
  --tw-ui-danger: #b84e4e;
  --tw-ui-success: #28754e;
  --tw-ui-warning: #9b6a32;
  --tw-ui-shadow: 0 20px 54px rgba(30, 65, 46, .09);
  --tw-ui-shadow-soft: 0 10px 30px rgba(30, 65, 46, .06);
  --tw-ui-header: rgba(255, 255, 255, .92);
  --tw-ui-footer: #e9efea;
  --green-theme: #176b4b;
  --green-ink: #124936;
  --green: #176b4b;
  --acc-success: #28754e;
}

/* Retain the original floating login headers and group the theme control beside the return link. */
body.customer-login-page .customer-topbar,
body.admin-login-page .admin-topbar {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

body.customer-login-page .customer-topbar-actions,
body.admin-login-page .admin-topbar-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

body.customer-login-page .customer-topbar .theme-toggle,
body.admin-login-page .admin-topbar .theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 11px;
  line-height: 1;
  flex: 0 0 42px;
  background: #11141b;
  border-color: rgba(216, 181, 107, .20);
}

body.admin-login-page .admin-topbar .store-link {
  margin: 0 !important;
  white-space: nowrap;
}

@media (max-width:560px) {

  body.customer-login-page .customer-topbar,
  body.admin-login-page .admin-topbar {
    gap: 10px;
  }

  body.customer-login-page .customer-topbar-actions,
  body.admin-login-page .admin-topbar-actions {
    gap: 8px;
  }

  body.customer-login-page .customer-topbar .theme-toggle,
  body.admin-login-page .admin-topbar .theme-toggle {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex-basis: 36px;
  }

  body.admin-login-page .admin-topbar .store-link {
    padding: 8px 9px;
    font-size: 11px;
  }
}

/* Operations center: use the same legacy surface and type colors without changing its layout. */
body.admin-operations-page {
  color: var(--tw-ui-text);
}

body.admin-operations-page .ops-topbar {
  color: var(--tw-ui-text);
  background: var(--tw-ui-header);
  border-color: var(--tw-ui-line);
}

body.admin-operations-page .ops-hero {
  color: var(--tw-ui-text);
  background: linear-gradient(112deg, color-mix(in srgb, var(--tw-ui-accent) 13%, var(--tw-ui-surface)), var(--tw-ui-surface) 76%);
  border-color: var(--tw-ui-line);
}

body.admin-operations-page :is(.ops-stat-card, .ops-card, .ops-output, .ops-result-item, .ops-cart-row, .ops-table-wrap) {
  background: var(--tw-ui-surface);
  color: var(--tw-ui-text);
  border-color: var(--tw-ui-line);
  box-shadow: var(--tw-ui-shadow-soft);
}

body.admin-operations-page .ops-card :is(h3, strong) {
  color: var(--tw-ui-text);
}

body.admin-operations-page .ops-card pre {
  color: var(--tw-ui-text);
  background: var(--tw-ui-bg-soft);
}

body.admin-operations-page .ops-footer {
  color: var(--tw-ui-muted);
  border-color: var(--tw-ui-line);
}

body.admin-operations-page .ops-footer a {
  color: var(--tw-ui-accent-strong);
}

body :is(.admin-table, .ops-table, .orders-table) {
  color: var(--tw-ui-text);
}

body :is(.admin-table th, .ops-table th, .orders-table th) {
  color: var(--tw-ui-accent-strong);
  background: var(--tw-ui-surface-3);
}

body :is(.admin-table td, .ops-table td, .orders-table td) {
  color: var(--tw-ui-text-2);
  border-color: var(--tw-ui-line);
}

body :is(.admin-table tbody tr:hover, .ops-table tbody tr:hover, .orders-table tbody tr:hover) {
  background: var(--tw-ui-accent-soft);
}

/* New pricing, address, coupon, review and compare features use the selected theme accent. */
html[data-theme="classic"] body :is(.tw-price-increase-card, .tw-price-increase-preview) {
  border-color: rgba(216, 189, 128, .34) !important;
  background: linear-gradient(135deg, rgba(216, 189, 128, .09), rgba(255, 255, 255, .015)) !important;
}

html[data-theme="classic"] body .tw-price-increase-mark {
  background: linear-gradient(145deg, #4b3c1d, #241d10) !important;
  color: #efd79c !important;
}

html[data-theme="classic"] body :is(.tw-price-increase-controls input:focus, .tw-price-increase-controls select:focus, .tw-price-increase-dialog input:focus, .tw-product-select, #selectAllActiveProducts) {
  accent-color: #d8bd80 !important;
  border-color: #d8bd80 !important;
}

html[data-theme="classic"] body :is(.tw-price-increase-controls input:focus, .tw-price-increase-controls select:focus, .tw-price-increase-dialog input:focus) {
  box-shadow: 0 0 0 3px rgba(216, 189, 128, .15) !important;
}

html[data-theme="classic"] body :is(.tw-postal-lookup-button, .tw-checkout-discount-row button, .ops-button-primary) {
  background: linear-gradient(135deg, #efd79c, #b99145) !important;
  color: #17130b !important;
  border-color: #d8bd80 !important;
}

html[data-theme="classic"] body :is(.product-stock-status>span, .ops-pill.is-success, .tw-address-default-badge, .tw-address-message.is-success, .tw-postal-lookup-status.is-success, .tw-checkout-discount p.is-success, .tw-discount-message.is-success, .tw-discount-status.is-active) {
  color: #e7d09a !important;
  border-color: rgba(216, 189, 128, .42) !important;
}

html[data-theme="classic"] body :is(.product-stock-status>span) {
  background: #d8bd80 !important;
  box-shadow: 0 0 0 .22rem rgba(216, 189, 128, .13) !important;
}

html[data-theme="classic"] body :is(.tw-address-default-badge, .tw-discount-status.is-active) {
  background: rgba(216, 189, 128, .11) !important;
}

html[data-theme="classic"] body :is(.status-success, .badge-success, .success-badge, .in-stock, .stock-available, .available, .text-success, .is-success, .alert-success, .form-message.success, .status-paid, .paid-status) {
  color: #e7d09a !important;
  border-color: rgba(216, 189, 128, .38) !important;
}

html[data-theme="classic"] body :is(.status-success, .badge-success, .success-badge, .in-stock, .stock-available, .available) {
  background-color: rgba(216, 189, 128, .12) !important;
}

html[data-theme="classic"] body :is(input[type="checkbox"], input[type="radio"], progress, meter) {
  accent-color: #d8bd80 !important;
}

html[data-theme="emerald"] body :is(.tw-price-increase-card, .tw-price-increase-preview) {
  border-color: rgba(36, 107, 75, .24) !important;
  background: linear-gradient(135deg, rgba(36, 107, 75, .08), rgba(255, 255, 255, .7)) !important;
}

html[data-theme="emerald"] body .tw-price-increase-mark {
  background: linear-gradient(145deg, #3ca97d, #246b4b) !important;
  color: #fff !important;
}

html[data-theme="emerald"] body :is(.tw-price-increase-controls input:focus, .tw-price-increase-controls select:focus, .tw-price-increase-dialog input:focus, .tw-product-select, #selectAllActiveProducts) {
  accent-color: #246b4b !important;
  border-color: #246b4b !important;
}

html[data-theme="emerald"] body :is(.tw-postal-lookup-button, .tw-checkout-discount-row button, .ops-button-primary) {
  margin: 10px 0px;
  background: linear-gradient(135deg, #3ca97d, #357c62) !important;
  color: #fff !important;
  border-color: #357c62 !important;
}

html[data-theme="emerald"] body :is(.ops-pill.is-success, .tw-address-default-badge, .tw-discount-status.is-active) {
  color: #246b4b !important;
  border-color: rgba(36, 107, 75, .24) !important;
  background: rgba(36, 107, 75, .09) !important;
}

/* Preserve the same geometry across modes: only paint properties transition. */
html.tw-theme-transition body,
html.tw-theme-transition body :is(header, footer, nav, main, section, article, aside, .card, .panel, .product-card, .checkout-card, .account-card, .admin-card, .ops-card, button, a, input, textarea, select, table, th, td) {
  transition-property: color, background-color, border-color, box-shadow, fill, stroke !important;
  transition-duration: 180ms !important;
  transition-timing-function: ease !important;
}

@media (prefers-reduced-motion:reduce) {
  html {
    scroll-behavior: auto;
  }

  body *,
  body *::before,
  body *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* Theme-specific finishing for newly added address, promotion, price and loyalty controls. */
html[data-theme="classic"] body :is(.tw-address-eyebrow, .tw-address-default-badge, .tw-checkout-discount>label, .tw-discount-code) {
  color: var(--tw-ui-gold) !important;
}

html[data-theme="classic"] body :is(.tw-address-book, .tw-checkout-discount, .tw-discount-form-card, .tw-discount-card, .tw-address-card) {
  border-color: var(--tw-ui-line) !important;
  background: var(--tw-ui-surface) !important;
  color: var(--tw-ui-text) !important;
}

html[data-theme="classic"] body :is(.tw-address-grid input, .tw-address-grid textarea, .tw-checkout-address-picker select, .tw-checkout-discount-row input, .tw-discount-grid input, .tw-discount-grid select) {
  border-color: var(--tw-ui-line-strong) !important;
  background: var(--tw-ui-input) !important;
  color: var(--tw-ui-text) !important;
}

html[data-theme="classic"] body :is(.tw-address-actions button, .tw-discount-actions button) {
  border-color: var(--tw-ui-line) !important;
  color: var(--tw-ui-text-2) !important;
  background: var(--tw-ui-surface-2) !important;
}

html[data-theme="classic"] body :is(.tw-address-default-badge, .tw-discount-status.is-active) {
  background: var(--tw-ui-accent-soft) !important;
}

html[data-theme="classic"] body .tw-address-message.is-success,
html[data-theme="classic"] body .tw-checkout-discount p.is-success,
html[data-theme="classic"] body .tw-discount-message.is-success {
  color: var(--tw-ui-gold) !important;
}

html[data-theme="emerald"] body :is(.tw-address-eyebrow, .tw-address-default-badge, .tw-checkout-discount>label, .tw-discount-code) {
  color: #176b4b !important;
}

html[data-theme="emerald"] body :is(.tw-address-book, .tw-checkout-discount, .tw-discount-form-card, .tw-discount-card, .tw-address-card) {
  border-color: var(--tw-ui-line) !important;
  background: var(--tw-ui-surface) !important;
  color: var(--tw-ui-text) !important;
}

html[data-theme="emerald"] body :is(.tw-address-grid input, .tw-address-grid textarea, .tw-checkout-address-picker select, .tw-checkout-discount-row input, .tw-discount-grid input, .tw-discount-grid select) {
  border-color: var(--tw-ui-line-strong) !important;
  background: var(--tw-ui-input) !important;
  color: var(--tw-ui-text) !important;
}

html[data-theme="emerald"] body :is(.tw-address-actions button, .tw-discount-actions button) {
  border-color: var(--tw-ui-line) !important;
  color: var(--tw-ui-text) !important;
  background: var(--tw-ui-surface-2) !important;
}

html[data-theme="emerald"] body :is(.tw-address-default-badge, .tw-discount-status.is-active) {
  color: #176b4b !important;
  border-color: var(--tw-ui-line-strong) !important;
  background: rgba(23, 107, 75, .08) !important;
}

html[data-theme="emerald"] body :is(.tw-address-message.is-success, .tw-checkout-discount p.is-success, .tw-discount-message.is-success) {
  color: #28754e !important;
}

/* Ensure the new operations data panels inherit the legacy card surfaces. */
body.admin-operations-page .ops-notice,
body.admin-operations-page .ops-empty,
body.admin-operations-page .ops-output pre {
  border-color: var(--tw-ui-line);
}

html[data-theme="classic"] body.admin-operations-page .ops-button-primary {
  background: linear-gradient(135deg, #efd79c, #b99145) !important;
  color: #17130b !important;
  border-color: #d8bd80 !important;
}

html[data-theme="emerald"] body.admin-operations-page .ops-button-primary {
  background: linear-gradient(135deg, #3ca97d, #357c62) !important;
  color: #fff !important;
  border-color: #357c62 !important;
}

html[data-theme="classic"] body.admin-operations-page .ops-notice.is-success .ops-notice-dot {
  background: #d8bd80 !important;
  box-shadow: 0 0 0 4px rgba(216, 189, 128, .15) !important;
}

html[data-theme="classic"] body.admin-operations-page .ops-pill.is-success {
  color: #e7d09a !important;
  border-color: rgba(216, 189, 128, .42) !important;
  background: rgba(216, 189, 128, .11) !important;
}

html[data-theme="emerald"] body.admin-operations-page .ops-notice.is-success .ops-notice-dot {
  background: #28754e !important;
  box-shadow: 0 0 0 4px rgba(40, 117, 78, .13) !important;
}

/* One canonical theme-toggle control across every storefront/admin page.
   Geometry intentionally matches the admin-login reference button. */
html body button[data-theme-toggle] {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-grid !important;
  place-items: center !important;
  box-sizing: border-box !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  flex: 0 0 42px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1px solid var(--tw-ui-line-strong) !important;
  border-radius: 11px !important;
  background: var(--tw-ui-surface-2) !important;
  color: var(--tw-ui-accent) !important;
  box-shadow: var(--tw-ui-shadow-soft) !important;
  text-align: center !important;
  line-height: 1 !important;
  cursor: pointer !important;
  vertical-align: middle !important;
  font-size: 125%;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}

html body button[data-theme-toggle]:hover {
  background: var(--tw-ui-accent-soft) !important;
  border-color: var(--tw-ui-accent) !important;
}

html body button[data-theme-toggle]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--tw-ui-accent) 36%, transparent) !important;
  outline-offset: 2px !important;
}

@media (max-width: 560px) {
  html body button[data-theme-toggle] {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    flex-basis: 36px !important;
  }
}

/* Shared spacing for the multi-image gallery manager in the admin form. */
.product-image-manager {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.product-image-choice {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--adm-line, var(--tw-ui-line));
  border-radius: 14px;
  background: var(--adm-surface-2, var(--tw-ui-surface));
  color: var(--adm-text, var(--tw-ui-text));
}

.product-image-choice.is-primary {
  border-color: var(--tw-ui-accent);
  box-shadow: 0 0 0 2px var(--tw-ui-accent-soft);
}

.product-image-choice img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: 9px;
  background: var(--tw-ui-surface-3);
}

.product-image-choice label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  cursor: pointer;
}

.product-image-choice input[type="radio"] {
  accent-color: var(--tw-ui-accent);
  flex: 0 0 auto;
}

.product-image-choice small {
  color: var(--tw-ui-muted);
  font-size: 9px;
  overflow-wrap: anywhere;
}

.product-image-manager-empty {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px dashed var(--tw-ui-line-strong);
  border-radius: 12px;
  color: var(--tw-ui-muted);
  font-size: 11px;
}


/* Persian brand wordmark tuning */
.logo-word, .info-brand, .customer-brand, .admin-brand {
  font-family: "Vazirmatn", sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.logo-word { direction: rtl; unicode-bidi: plaintext; }


html[data-theme="emerald"] body .tw-address-grid .tw-postal-lookup-button {
  margin: 12px 0 0;
}
