﻿/**
 * Products / Pricing / Order frontend styles - Zamanpour Excoin Core
 *
 * Dark is the default palette (matches theme :root tokens).
 * Light mode handled via [data-theme="light"] and system preference.
 */

/* -- Semantic aliases (dark-first) -- */
:root {
  --zxec-card-bg: var(--zpex-surface-elevated, #1A1A22);
  --zxec-surface: var(--zpex-surface, #131318);
  --zxec-bg: var(--zpex-primary, #0A0A0F);
  --zxec-heading: var(--zpex-text, #EDEDEF);
  --zxec-text: var(--zpex-text-secondary, rgba(237, 237, 239, 0.65));
  --zxec-text-strong: var(--zpex-text, #EDEDEF);
  --zxec-muted: var(--zpex-text-muted, rgba(237, 237, 239, 0.48));
  --zxec-border: var(--zpex-border, rgba(201, 168, 76, 0.12));
  --zxec-border-strong: var(--zpex-border-strong, rgba(201, 168, 76, 0.2));
  --zxec-accent: var(--zpex-accent, #C9A84C);
  --zxec-accent-muted: var(--zpex-accent-muted, rgba(201, 168, 76, 0.12));
  --zxec-on-accent: var(--zpex-text-inverse, #0A0A0F);
  --zxec-success: #4ADE80;
  --zxec-danger: #F87171;
  --zxec-input-bg: var(--zpex-surface-elevated, #1A1A22);
  --zxec-tile-bg: var(--zpex-surface, #131318);
}

[data-theme="light"] {
  --zxec-card-bg: var(--zpex-surface-elevated, #FFFFFF);
  --zxec-surface: var(--zpex-surface, #F0EDE8);
  --zxec-bg: var(--zpex-primary, #FAF9F6);
  --zxec-heading: var(--zpex-text, #1A1A1E);
  --zxec-text: var(--zpex-text-secondary, rgba(26, 26, 30, 0.65));
  --zxec-text-strong: var(--zpex-text, #1A1A1E);
  --zxec-muted: var(--zpex-text-muted, rgba(26, 26, 30, 0.48));
  --zxec-border: var(--zpex-border, rgba(154, 123, 47, 0.15));
  --zxec-border-strong: var(--zpex-border-strong, rgba(154, 123, 47, 0.25));
  --zxec-accent: var(--zpex-accent, #9A7B2F);
  --zxec-accent-muted: var(--zpex-accent-muted, rgba(154, 123, 47, 0.1));
  --zxec-on-accent: var(--zpex-text-inverse, #FAF9F6);
  --zxec-success: #15803D;
  --zxec-danger: #B91C1C;
  --zxec-input-bg: var(--zpex-surface-elevated, #FFFFFF);
  --zxec-tile-bg: var(--zpex-surface, #F0EDE8);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    --zxec-card-bg: var(--zpex-surface-elevated, #FFFFFF);
    --zxec-surface: var(--zpex-surface, #F0EDE8);
    --zxec-bg: var(--zpex-primary, #FAF9F6);
    --zxec-heading: var(--zpex-text, #1A1A1E);
    --zxec-text: var(--zpex-text-secondary, rgba(26, 26, 30, 0.65));
    --zxec-text-strong: var(--zpex-text, #1A1A1E);
    --zxec-muted: var(--zpex-text-muted, rgba(26, 26, 30, 0.48));
    --zxec-border: var(--zpex-border, rgba(154, 123, 47, 0.15));
    --zxec-border-strong: var(--zpex-border-strong, rgba(154, 123, 47, 0.25));
    --zxec-accent: var(--zpex-accent, #9A7B2F);
    --zxec-accent-muted: var(--zpex-accent-muted, rgba(154, 123, 47, 0.1));
    --zxec-on-accent: var(--zpex-text-inverse, #FAF9F6);
    --zxec-success: #15803D;
    --zxec-danger: #B91C1C;
    --zxec-input-bg: var(--zpex-surface-elevated, #FFFFFF);
    --zxec-tile-bg: var(--zpex-surface, #F0EDE8);
  }
}

/* -- Layout -- */
.zxec-products-page,
.zxec-product-detail,
.zxec-order-page {
  background: var(--zxec-bg);
  color: var(--zxec-text-strong);
  padding-block: 48px;
}
.zxec-container { max-width: 1280px; margin-inline: auto; padding-inline: 20px; }

.zxec-section-head { text-align: center; margin-bottom: 40px; }
.zxec-section-head h1 {
  font-size: 2rem; font-weight: 700; color: var(--zxec-heading); margin: 0 0 12px;
}
.zxec-section-head p { color: var(--zxec-text); font-size: 1.05rem; max-width: 640px; margin: 0 auto; }

/* -- Filter pills + search -- */
.zxec-filter-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.zxec-filter-pill {
  padding: 8px 20px; border-radius: 24px; cursor: pointer; text-decoration: none;
  font-size: 0.9rem; line-height: 1.4; border: 1px solid var(--zxec-border);
  background: var(--zxec-card-bg); color: var(--zxec-text);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.zxec-filter-pill:hover { border-color: var(--zxec-border-strong); color: var(--zxec-heading); }
.zxec-filter-pill.is-active { background: var(--zxec-accent); border-color: var(--zxec-accent); color: var(--zxec-on-accent); font-weight: 600; }

.zxec-search-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }
.zxec-search-input {
  padding: 10px 18px; border-radius: 24px; width: 300px; max-width: 100%;
  border: 1px solid var(--zxec-border); font-size: 0.95rem;
  background: var(--zxec-input-bg); color: var(--zxec-text-strong);
}
.zxec-search-input:focus { outline: 2px solid var(--zxec-accent); border-color: transparent; }
.zxec-search-input::placeholder { color: var(--zxec-muted); }

.zxec-btn {
  display: inline-block; text-align: center; text-decoration: none; cursor: pointer;
  padding: 10px 22px; border-radius: 24px; font-size: 0.95rem; font-weight: 600; border: none;
  background: var(--zxec-accent); color: var(--zxec-on-accent);
  transition: filter 0.2s;
}
.zxec-btn:hover { filter: brightness(1.08); text-decoration: none; }

/* -- Product grid / cards -- */
.zxec-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.zxec-product-card {
  display: block; overflow: hidden; text-decoration: none; color: var(--zxec-text-strong);
  background: var(--zxec-card-bg); border: 1px solid var(--zxec-border); border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.zxec-product-card:hover { transform: translateY(-4px); border-color: var(--zxec-border-strong); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
[data-theme="light"] .zxec-product-card:hover { box-shadow: 0 8px 24px rgba(26, 26, 30, 0.1); }
.zxec-product-card:focus-visible { outline: 2px solid var(--zxec-accent); outline-offset: 2px; }
.zxec-product-card__media { height: 180px; overflow: hidden; background: var(--zxec-surface); }
.zxec-product-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zxec-product-card__body { padding: 20px; }
.zxec-product-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.zxec-product-card__name { font-size: 1.1rem; font-weight: 600; margin: 0; color: var(--zxec-heading); }
.zxec-product-card__cat {
  font-size: 0.75rem; padding: 4px 10px; border-radius: 12px; white-space: nowrap;
  background: var(--zxec-accent-muted); color: var(--zxec-accent); font-weight: 600;
}
.zxec-product-card__desc {
  font-size: 0.9rem; color: var(--zxec-text); margin: 8px 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.zxec-product-card__prices {
  display: flex; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--zxec-border);
}
.zxec-price-col { flex: 1; text-align: center; }
.zxec-price-col__label { font-size: 0.75rem; color: var(--zxec-muted); margin-bottom: 4px; }
.zxec-price-col__value { font-weight: 700; font-size: 1rem; }
.zxec-is-buy { color: var(--zxec-success); }
.zxec-is-sell { color: var(--zxec-danger); }
.zxec-product-card__cta { margin-top: 14px; text-align: center; }

/* -- Empty state -- */
.zxec-empty { text-align: center; padding: 60px 20px; color: var(--zxec-text); font-size: 1.05rem; }

/* -- Breadcrumb -- */
.zxec-breadcrumb { margin-bottom: 24px; font-size: 0.9rem; color: var(--zxec-text); }
.zxec-breadcrumb a { color: var(--zxec-accent); text-decoration: none; }
.zxec-breadcrumb a:hover { text-decoration: underline; }
.zxec-breadcrumb .sep { margin-inline: 8px; color: var(--zxec-muted); }

/* -- Single product -- */
.zxec-detail__head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.zxec-detail__media { border-radius: 12px; overflow: hidden; background: var(--zxec-surface); border: 1px solid var(--zxec-border); align-self: start; }
.zxec-detail__media img { width: 100%; height: auto; display: block; }
.zxec-detail__cat {
  display: inline-block; font-size: 0.8rem; padding: 4px 12px; border-radius: 16px; margin-bottom: 12px;
  background: var(--zxec-accent-muted); color: var(--zxec-accent); font-weight: 600;
}
.zxec-detail__title { font-size: 1.8rem; font-weight: 700; color: var(--zxec-heading); margin: 0 0 16px; }
.zxec-detail__desc { color: var(--zxec-text); line-height: 1.8; margin: 0 0 24px; }

.zxec-pricebox {
  background: var(--zxec-surface); border: 1px solid var(--zxec-border);
  border-radius: 12px; padding: 24px; margin-bottom: 20px;
}
.zxec-pricebox__title { margin: 0 0 16px; font-size: 1.05rem; color: var(--zxec-heading); }
.zxec-pricebox__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.zxec-pricebox__tile {
  text-align: center; padding: 16px; border-radius: 10px;
  background: var(--zxec-tile-bg); border: 1px solid var(--zxec-border);
}
.zxec-pricebox__tile .t { font-size: 0.85rem; color: var(--zxec-muted); margin-bottom: 8px; }
.zxec-pricebox__tile .v { font-size: 1.35rem; font-weight: 700; }
.zxec-pricebox__tile .v small { font-size: 0.75rem; font-weight: 400; color: var(--zxec-muted); }
.zxec-pricebox__v-buy { color: var(--zxec-success); }
.zxec-pricebox__v-sell { color: var(--zxec-danger); }
.zxec-pricebox__updated { text-align: center; margin-top: 14px; font-size: 0.8rem; color: var(--zxec-muted); }
.zxec-no-price { padding: 20px; text-align: center; color: var(--zxec-text); background: var(--zxec-surface); border: 1px dashed var(--zxec-border); border-radius: 10px; }

.zxec-order-actions { display: flex; gap: 12px; margin-top: 8px; }
.zxec-order-btn {
  flex: 1; text-align: center; padding: 14px; border-radius: 10px; text-decoration: none;
  font-weight: 600; font-size: 1rem; color: #fff; transition: filter 0.2s;
}
.zxec-order-btn:hover { filter: brightness(1.1); text-decoration: none; color: #fff; }
.zxec-order-btn--buy { background: #16A34A; }
.zxec-order-btn--sell { background: #DC2626; }
.zxec-order-btn:focus-visible { outline: 2px solid var(--zxec-accent); outline-offset: 2px; }

.zxec-history { margin-top: 48px; }
.zxec-history__title { font-size: 1.25rem; font-weight: 600; color: var(--zxec-heading); margin: 0 0 18px; }
.zxec-chart-wrap {
  background: var(--zxec-card-bg); border: 1px solid var(--zxec-border);
  border-radius: 12px; padding: 20px;
  position: relative;
  height: 380px;
  max-height: 50vh;
}
.zxec-chart-loading { text-align: center; color: var(--zxec-muted); padding: 48px 0; margin: 0; }

.zxec-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; color: var(--zxec-text); }
.zxec-table th {
  padding: 12px; text-align: start; font-weight: 600; color: var(--zxec-heading);
  border-bottom: 2px solid var(--zxec-border);
}
.zxec-table td { padding: 12px; border-bottom: 1px solid var(--zxec-border); }
.zxec-table-wrap { overflow-x: auto; }
.zxec-table-buy { color: var(--zxec-success); font-weight: 600; }
.zxec-table-sell { color: var(--zxec-danger); font-weight: 600; }
.zxec-table-note { color: var(--zxec-muted); }

/* -- Order form -- */
.zxec-order-card {
  background: var(--zxec-card-bg); border: 1px solid var(--zxec-border);
  border-radius: 14px; padding: 32px;
}
.zxec-order-head { text-align: center; margin-bottom: 28px; }
.zxec-order-head h1 { font-size: 1.8rem; font-weight: 700; color: var(--zxec-heading); margin: 0 0 8px; }
.zxec-order-head p { color: var(--zxec-text); margin: 0; }
.zxec-field { margin-bottom: 18px; }
.zxec-field > label { display: block; font-weight: 600; color: var(--zxec-heading); margin-bottom: 6px; }
.zxec-req { color: var(--zxec-danger); }
.zxec-input,
.zxec-select,
.zxec-textarea {
  width: 100%; padding: 10px 14px; border-radius: 10px; font-size: 0.95rem;
  border: 1px solid var(--zxec-border-strong); background: var(--zxec-input-bg); color: var(--zxec-text-strong);
}
.zxec-input:focus, .zxec-select:focus, .zxec-textarea:focus { outline: 2px solid var(--zxec-accent); border-color: transparent; }
.zxec-input::placeholder, .zxec-textarea::placeholder { color: var(--zxec-muted); }
.zxec-textarea { resize: vertical; min-height: 96px; }
.zxec-input--ltr { direction: ltr; text-align: left; }

.zxec-type-row { display: flex; gap: 12px; }
.zxec-type-opt {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px;
  border-radius: 10px; cursor: pointer; font-weight: 600;
  border: 2px solid var(--zxec-border); background: var(--zxec-tile-bg); color: var(--zxec-text);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.zxec-type-opt input { accent-color: currentColor; }
.zxec-type-opt--buy.is-checked { border-color: var(--zxec-success); color: var(--zxec-success); background: rgba(22, 163, 74, 0.08); }
.zxec-type-opt--sell.is-checked { border-color: var(--zxec-danger); color: var(--zxec-danger); background: rgba(220, 38, 38, 0.08); }

.zxec-submit {
  width: 100%; padding: 14px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--zxec-accent); color: var(--zxec-on-accent);
  font-size: 1.1rem; font-weight: 700; transition: filter 0.2s;
}
.zxec-submit:hover { filter: brightness(1.08); }
.zxec-submit:focus-visible { outline: 2px solid var(--zxec-text-strong); outline-offset: 2px; }

.zxec-alert {
  padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; text-align: center;
  background: var(--zxec-accent-muted); border: 1px solid currentColor; color: var(--zxec-danger);
}

/* -- Responsive -- */
@media (max-width: 768px) {
  .zxec-detail__head { grid-template-columns: 1fr; }
  .zxec-order-actions { flex-direction: column; }
  .zxec-type-row { flex-direction: column; }
  .zxec-section-head h1 { font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  .zxec-product-card, .zxec-filter-pill, .zxec-order-btn, .zxec-submit { transition: none; }
  .zxec-product-card:hover { transform: none; }
}
