/*
  Hypermart theme stylesheet

  IMPORTANT:
  - Must be scoped to [data-theme="hypermart"] to avoid leaking styles to other themes.
  - This file is intentionally minimal at first; we'll port exact CSS from the template in the next steps.
*/

[data-theme="hypermart"] {
  /* Brand: store theme overrides via --primary-color / --secondary-color / --attention-color */
  --hm-primary: var(--primary-color, #f01436);
  --hm-link: var(--attention-color, #0274be);
  --hm-teal: var(--secondary-color, #00a9ac);
  --hm-secondary: var(--hm-teal);
  --hm-text: #111827;
  --hm-muted: #6b7280;
  --hm-bg: #f7f8fb;
  --hm-surface: #ffffff;
  --hm-border: #e5e7eb;
  --hm-radius-sm: 0.5rem;
  --hm-radius-md: 0.75rem;
  --hm-radius-lg: 1rem;
  --hm-radius-xl: 1.5rem;
  --hm-shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.06);
  --hm-shadow-card: 0 6px 18px rgba(0, 0, 0, 0.08);
  --hm-spacing-section: 2rem;
  --hm-motion-fast: 150ms;
  --hm-motion-normal: 200ms;
}

/* Font: IRANSans (copied from template assets) */
[data-theme="hypermart"] body {
  direction: rtl;
  text-align: right;
  font-family: "IRANSans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

[data-theme="hypermart"] a {
  font-family: "IRANSans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

[data-theme="hypermart"] h1,
[data-theme="hypermart"] h2,
[data-theme="hypermart"] h3,
[data-theme="hypermart"] h4,
[data-theme="hypermart"] h5,
[data-theme="hypermart"] h6,
[data-theme="hypermart"] span,
[data-theme="hypermart"] div {
  font-family: "IRANSans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

@font-face {
  font-family: "IRANSans";
  font-style: normal;
  font-weight: 900;
  src: url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_Black.eot");
  src:
    url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_Black.eot?#iefix") format("embedded-opentype"),
    url("/themes/hypermart/fonts/IRANSans/woff2/IRANSansWeb_Black.woff2") format("woff2"),
    url("/themes/hypermart/fonts/IRANSans/woff/IRANSansWeb_Black.woff") format("woff"),
    url("/themes/hypermart/fonts/IRANSans/ttf/IRANSansWeb_Black.ttf") format("truetype");
}

@font-face {
  font-family: "IRANSans";
  font-style: normal;
  font-weight: 700;
  src: url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_Bold.eot");
  src:
    url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_Bold.eot?#iefix") format("embedded-opentype"),
    url("/themes/hypermart/fonts/IRANSans/woff2/IRANSansWeb_Bold.woff2") format("woff2"),
    url("/themes/hypermart/fonts/IRANSans/woff/IRANSansWeb_Bold.woff") format("woff"),
    url("/themes/hypermart/fonts/IRANSans/ttf/IRANSansWeb_Bold.ttf") format("truetype");
}

@font-face {
  font-family: "IRANSans";
  font-style: normal;
  font-weight: 500;
  src: url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_Medium.eot");
  src:
    url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_Medium.eot?#iefix") format("embedded-opentype"),
    url("/themes/hypermart/fonts/IRANSans/woff2/IRANSansWeb_Medium.woff2") format("woff2"),
    url("/themes/hypermart/fonts/IRANSans/woff/IRANSansWeb_Medium.woff") format("woff"),
    url("/themes/hypermart/fonts/IRANSans/ttf/IRANSansWeb_Medium.ttf") format("truetype");
}

@font-face {
  font-family: "IRANSans";
  font-style: normal;
  font-weight: 300;
  src: url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_Light.eot");
  src:
    url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_Light.eot?#iefix") format("embedded-opentype"),
    url("/themes/hypermart/fonts/IRANSans/woff2/IRANSansWeb_Light.woff2") format("woff2"),
    url("/themes/hypermart/fonts/IRANSans/woff/IRANSansWeb_Light.woff") format("woff"),
    url("/themes/hypermart/fonts/IRANSans/ttf/IRANSansWeb_Light.ttf") format("truetype");
}

@font-face {
  font-family: "IRANSans";
  font-style: normal;
  font-weight: 200;
  src: url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_UltraLight.eot");
  src:
    url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb_UltraLight.eot?#iefix") format("embedded-opentype"),
    url("/themes/hypermart/fonts/IRANSans/woff2/IRANSansWeb_UltraLight.woff2") format("woff2"),
    url("/themes/hypermart/fonts/IRANSans/woff/IRANSansWeb_UltraLight.woff") format("woff"),
    url("/themes/hypermart/fonts/IRANSans/ttf/IRANSansWeb_UltraLight.ttf") format("truetype");
}

@font-face {
  font-family: "IRANSans";
  font-style: normal;
  font-weight: 400;
  src: url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb.eot");
  src:
    url("/themes/hypermart/fonts/IRANSans/eot/IRANSansWeb.eot?#iefix") format("embedded-opentype"),
    url("/themes/hypermart/fonts/IRANSans/woff2/IRANSansWeb.woff2") format("woff2"),
    url("/themes/hypermart/fonts/IRANSans/woff/IRANSansWeb.woff") format("woff"),
    url("/themes/hypermart/fonts/IRANSans/ttf/IRANSansWeb.ttf") format("truetype");
}

[data-theme="hypermart"] body {
  color: var(--hm-text);
  background: #f7f8fb;
  overflow-x: hidden;
}

/* Container: match template max widths (main-container: 1440px). */
[data-theme="hypermart"] .container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

[data-theme="hypermart"] .main-container {
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

[data-theme="hypermart"] a {
  text-decoration: none;
}

/* Links hover color from template */
[data-theme="hypermart"] a:hover {
  text-decoration: none;
}

/* =========================
   Template Port (Curated)
   - Source: themes/hypermart/assets/css/main.css + responsive.css
   - Only the selectors we actually use in Hypermart widgets.
   ========================= */

/* Search overlay (used by header search result UX in template; kept for future parity) */
[data-theme="hypermart"] .overlay-search-box {
  position: fixed;
  top: 80px;
  inset-inline-start: 0;
  width: 100%;
  height: 1500px;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease-in-out;
}

/* Offcanvas (mini cart) - planned parity (we use drawer now, but keep styles scoped) */
[data-theme="hypermart"] .offcanvas-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 60;
  display: none;
}

[data-theme="hypermart"] .offcanvas-overlay.active {
  display: block;
}

/* Product box look (template search grid) */
[data-theme="hypermart"] .hm-product-box {
  width: 100%;
  height: auto;
  padding: 25px 0;
  border-radius: 5px;
  background: #fff;
  position: relative;
  transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="hypermart"] .hm-product-box:hover {
  box-shadow: 0 2px 17px 0 rgba(0, 0, 0, 0.09);
  z-index: 10;
}

[data-theme="hypermart"] .hm-product-box-image {
  text-align: center;
  display: block;
}

[data-theme="hypermart"] .hm-product-box-image img {
  max-width: 70%;
}

[data-theme="hypermart"] .hm-product-box-discount {
  margin: auto;
  background: var(--hm-primary);
  color: #fff;
  display: inline-block;
  font-size: 14px;
  border-radius: 50px 50px 0 50px;
  padding: 5px 10px;
  line-height: 1.2;
  font-weight: 400;
  text-align: center;
  position: absolute;
  left: 10px;
  width: 50px;
  top: 10px;
}

[data-theme="hypermart"] .hm-product-box-title {
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
  font-weight: 400;
  overflow: hidden;
  max-width: 100%;
  line-height: 2;
}

[data-theme="hypermart"] .hm-product-box-price {
  height: auto;
  font-size: 20px;
  text-align: center;
}

[data-theme="hypermart"] .hm-product-box-price del {
  color: #bdbdbd;
  letter-spacing: 0.5px;
  font-size: 1rem;
  display: block;
  margin-left: 10px;
}

[data-theme="hypermart"] .hm-product-box-price ins {
  width: 100%;
  color: #fb4b63;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
}

[data-theme="hypermart"] .hm-add-to-cart {
  color: #fff;
  border: none;
  background-color: var(--hm-primary);
  border-radius: 50px;
  padding: 0.3rem 0.75rem;
  box-shadow: none;
  font-size: 14px;
}

/* Sidebar widget (search filters) */
[data-theme="hypermart"] .hm-widget {
  width: 100%;
  height: auto;
  padding: 15px;
  position: relative;
  border-radius: 5px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0px 2px 4px rgba(126, 142, 177, 0.12);
  border: 1px solid #eee;
}

[data-theme="hypermart"] .hm-widget-title-btn {
  font-size: 16px;
  background: transparent;
  box-shadow: none;
  margin-top: 10px;
  font-weight: 500;
  padding: 0;
  width: 100%;
  text-align: right;
}

[data-theme="hypermart"] .hm-widget-title-btn .hm-widget-chevron {
  float: left;
  transition: 0.2s;
}

[data-theme="hypermart"] .hm-widget-title-btn[aria-expanded="true"] .hm-widget-chevron {
  transform: rotate(180deg);
}

[data-theme="hypermart"] .hm-filter-input {
  background-color: #fafafa;
  border: none;
  border-radius: 50px;
  padding: 1.1rem 3.25rem 1.1rem 1rem;
  font-size: 14px;
  color: #616161;
  box-shadow: none;
  width: 100%;
}

[data-theme="hypermart"] .hm-filter-input::placeholder {
  color: rgb(184, 184, 184);
  font-size: 12px;
}

[data-theme="hypermart"] .hm-filter-search-btn {
  width: 45px;
  height: 45px;
  position: absolute;
  top: 0;
  right: 4px;
  border-radius: 0 50px 50px 0;
  padding: 0;
  text-align: center;
  background-color: transparent;
  border: none;
  box-shadow: none;
}

[data-theme="hypermart"] .hm-filter-search-btn img {
  width: 50px;
  height: 100%;
}

[data-theme="hypermart"] .hm-filter-link {
  color: #545454;
  text-decoration: none;
  padding-right: 20px;
  padding-top: 5px;
  display: block;
  margin-bottom: 5px;
}

[data-theme="hypermart"] .hm-filter-link.active {
  color: #333;
  font-size: 14px;
}

[data-theme="hypermart"] .hm-read-more {
  color: var(--hm-primary);
  display: block;
  text-align: center;
  font-size: 14px;
  padding: 10px 15px 5px;
  margin-top: 15px;
}

/* Range slider styles (noUiSlider) */
[data-theme="hypermart"] .range-slider {
  padding-top: 0.5rem;
}

[data-theme="hypermart"] .noUi-target {
  border: 0;
  border-radius: 0;
  background-color: #e7e7e7;
  box-shadow: none;
}

[data-theme="hypermart"] .noUi-horizontal {
  height: 5px;
  margin-right: 10px;
}

[data-theme="hypermart"] .noUi-horizontal .noUi-handle {
  top: -8px;
  left: -0.375rem;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
}

[data-theme="hypermart"] .noUi-handle:before,
[data-theme="hypermart"] .noUi-handle:after {
  display: none;
}

[data-theme="hypermart"] .noUi-horizontal .noUi-handle.noUi-handle-lower,
[data-theme="hypermart"] .noUi-horizontal .noUi-handle.noUi-handle-upper {
  background-color: #fff;
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2);
  border: 1px solid #d4d4d4;
}

[data-theme="hypermart"] .noUi-connect {
  background: var(--hm-primary);
}

[data-theme="hypermart"] .filter-range {
  font-size: 13px;
  text-align: right;
  color: #9e9e9e;
}

[data-theme="hypermart"] .filter-range .example-val {
  color: var(--hm-primary);
  font-size: 20px;
  font-weight: 700;
}

[data-theme="hypermart"] .btn-range {
  color: #fff;
  border: none;
  background-image: linear-gradient(to right, #ee4a63 0%, var(--hm-primary) 100%);
  background-repeat: repeat-x;
  font-size: 14px;
  transition: all 300ms ease-out;
  border-radius: 0;
  padding: 10px 15px;
  width: 100%;
  margin-top: 10px;
  box-shadow: none;
}

[data-theme="hypermart"] .btn-range:hover {
  opacity: 0.7;
  transition: all 300ms ease-out;
  color: #fff;
}

/* Profile (template port - curated) */
[data-theme="hypermart"] .hm-profile-sidebar {
  width: 100%;
  height: auto;
  margin-top: 20px;
}

[data-theme="hypermart"] .hm-profile-box {
  box-shadow: 0 1px 4px 2px rgba(0, 0, 0, 0.12);
  position: relative;
  display: block;
  background-color: #fff;
  border-radius: 0.3rem;
  width: 100%;
  margin-bottom: 25px;
  padding: 7px 5px;
  overflow: hidden;
}

[data-theme="hypermart"] .hm-profile-box-inner {
  padding: 1.25rem;
}

[data-theme="hypermart"] .hm-profile-phone {
  font-size: 14px;
}

[data-theme="hypermart"] .hm-profile-wallet-row {
  display: block;
  font-size: 14px;
  color: #212121;
  float: right;
  width: 100%;
  margin-bottom: 5px;
  padding-bottom: 10px;
}

[data-theme="hypermart"] .hm-profile-wallet-title {
  float: right;
  margin-top: 10px;
  color: #bdbdbd;
  font-weight: 500;
}

[data-theme="hypermart"] .hm-profile-wallet-price {
  float: left;
  text-align: left;
  margin-top: 10px;
  color: #bdbdbd;
  font-weight: 500;
}

[data-theme="hypermart"] .hm-profile-signout {
  color: #fb4b63;
  margin-top: 20px;
  border-color: #fff;
  background-color: #fff;
  border-radius: 50px;
  font-weight: 700;
  padding: 0.6rem 3.75rem;
}

[data-theme="hypermart"] .hm-profile-signout:hover {
  background-color: #fb4b63;
  color: #fff;
}

[data-theme="hypermart"] .hm-profile-menu a {
  display: block;
  padding: 0.7rem;
  transition: all 400ms ease;
  width: 100%;
  color: #616161;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 100px;
}

[data-theme="hypermart"] .hm-profile-menu a:hover {
  background-color: #eee;
}

[data-theme="hypermart"] .hm-profile-menu a[data-active="true"] {
  color: #06b57c;
  background-color: rgba(6, 181, 84, 0.1);
}

[data-theme="hypermart"] .hm-profile-content {
  width: 100%;
  margin-top: 20px;
}

[data-theme="hypermart"] .hm-profile-card {
  box-shadow: 0 1px 4px 2px rgba(0, 0, 0, 0.12);
  background-color: #fafafa;
  border-radius: 0.3rem;
  width: 100%;
  margin-bottom: 25px;
  padding: 7px 5px;
}

[data-theme="hypermart"] .hm-profile-card-header {
  position: relative;
  background-color: transparent;
  border: none;
  padding-right: 35px;
  margin-top: -7px;
}

[data-theme="hypermart"] .hm-profile-card-header::before {
  content: "";
  position: absolute;
  right: 10px;
  top: 0px;
  width: 4px;
  background: var(--hm-primary);
  height: 4rem;
}

[data-theme="hypermart"] .hm-profile-card-title {
  font-size: 1.5rem;
  font-weight: 500;
  display: inline-block;
}

[data-theme="hypermart"] .hm-profile-form-label {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--hm-primary);
}

[data-theme="hypermart"] .hm-profile-form-control {
  display: block;
  width: 100%;
  height: 3rem;
  padding: 0.5rem 1rem;
  font-size: 14px;
  line-height: 2;
  color: #616161;
  background-color: #fff;
  border: 1px solid #bdbdbd;
  border-radius: 3.75rem;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

[data-theme="hypermart"] .hm-profile-btn-edit {
  color: #fb4b63;
  border-color: #fb4b63;
  padding: 0.6rem 2rem;
  background-color: #fff;
  border-radius: 3.75rem;
  box-shadow: none;
}

[data-theme="hypermart"] .hm-profile-btn-edit:hover {
  background-color: #fb4b63;
  color: #fff;
}

[data-theme="hypermart"] .hm-address-box {
  display: block;
  border: 1px dashed var(--hm-primary);
  border-radius: 20px;
  margin-bottom: 25px;
}

[data-theme="hypermart"] .hm-address-item {
  padding: 1.25rem;
  text-align: right;
  display: block;
}

[data-theme="hypermart"] .hm-address-info-item {
  display: block;
  margin-bottom: 20px;
}

[data-theme="hypermart"] .hm-address-info-item .hm-title {
  color: var(--hm-primary);
}

[data-theme="hypermart"] .hm-address-info-item .hm-value {
  color: #424242;
}

[data-theme="hypermart"] .hm-action-row button {
  padding: 5px 10px;
  font-size: 14px;
  border-radius: 50px;
  box-shadow: none;
}

[data-theme="hypermart"] .hm-btn-remove {
  color: #fb4b63;
  border: 1px solid #fb4b63;
  background-color: #fff;
}

[data-theme="hypermart"] .hm-btn-remove:hover {
  color: #fff;
  background-color: #fb4b63;
}

[data-theme="hypermart"] .hm-bank-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

[data-theme="hypermart"] .hm-bank-digit {
  width: 100%;
  height: 3rem;
  border-radius: 18px;
  border: 1px solid #d1d5db;
  text-align: center;
  font-size: 1rem;
  background: #fff;
}

[data-theme="hypermart"] .hm-bank-sidebar {
  border: 1px dashed #f3c0c8;
  border-radius: 20px;
  padding: 1rem;
  background: #fff;
}

[data-theme="hypermart"] .hm-wallet-actions button {
  margin-top: 10px;
  border-radius: 50px;
  padding: 0.6rem 2rem;
}

[data-theme="hypermart"] .hm-wallet-btn-primary {
  color: #f01436;
  border: 1px solid #f01436;
  background-color: #fff;
}

[data-theme="hypermart"] .hm-wallet-btn-primary:hover {
  color: #fff;
  background-color: #f01436;
}

[data-theme="hypermart"] .hm-wallet-btn-secondary {
  color: #fb4b63;
  border: 1px solid #fb4b63;
  background-color: #fff;
}

[data-theme="hypermart"] .hm-wallet-btn-secondary:hover {
  color: #fff;
  background-color: #fb4b63;
}

[data-theme="hypermart"] .hm-wallet-submit {
  color: #fff;
  border: 1px solid #fb4b63;
  background-color: #fb4b63;
  border-radius: 50px;
  padding: 0.6rem 1rem;
}

@media (max-width: 991px) {
  [data-theme="hypermart"] .search .search-box .input-search {
    border-radius: 0.75rem;
    font-size: 12px;
  }
}

/* Accessibility & motion */
@media (prefers-reduced-motion: reduce) {
  [data-theme="hypermart"] *,
  [data-theme="hypermart"] *::before,
  [data-theme="hypermart"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

[data-theme="hypermart"] .hm-add-to-cart:focus-visible,
[data-theme="hypermart"] .hm-profile-btn-edit:focus-visible,
[data-theme="hypermart"] .hm-wallet-btn-primary:focus-visible,
[data-theme="hypermart"] .hm-wallet-btn-secondary:focus-visible,
[data-theme="hypermart"] .hm-wallet-submit:focus-visible,
[data-theme="hypermart"] .btn-range:focus-visible {
  outline: 2px solid var(--hm-primary);
  outline-offset: 2px;
}

[data-theme="hypermart"] .hm-product-box--compact .hm-product-box-price {
  text-align: start;
}

[data-theme="hypermart"] .hm-product-box--featured {
  box-shadow: var(--hm-shadow-card);
}
