@import url('styles-base.css');
@import url('operations.css');
@import url('theme-backgrounds.css');

body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    Tahoma,
    sans-serif;
}

/* All readable text surfaces use one consistent 10% transparency level. */
.product-card,
.product-gallery img,
.cart-item,
.auth-panel,
.education a,
.home-intro p,
.page-head p,
.site-footer,
.research-request {
  background: var(--surface-90);
}
.theme-switch {
  background-image: url('assets/Switch To Light.png');
  background-position: center;
  background-size: 100% 100%;
}
.light .theme-switch {
  background-image: url('assets/Switch To Dark.png');
  background-position: center;
}
.language-switch {
  height: 32px;
  white-space: nowrap;
  line-height: 1;
  min-width: 40px;
  padding: 0 9px;
  border: 1px solid rgba(230, 154, 26, 0.55);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-weight: 800;
  font-size: 12px;
}
.language-switch:hover {
  border-color: var(--amber);
  background: rgba(230, 154, 26, 0.11);
}
.compact {
  padding: 3px 8px;
  margin-inline-start: 8px;
}
.upload-zone.busy {
  opacity: 0.65;
  pointer-events: none;
}
.upload-zone.busy::after {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid rgba(230, 154, 26, 0.3);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: makeone-spin 0.8s linear infinite;
  position: absolute;
}
@keyframes makeone-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Language changes text, never the direction of grid/flex containers. */
html,
body {
  direction: ltr;
  text-align: left;
}

.catalog-page {
  max-width: 1500px;
}
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}
.product-card {
  display: block;
  min-width: 0;
  background: var(--charcoal-2);
  border: 1px solid rgba(230, 154, 26, 0.28);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition:
    transform 0.16s,
    border-color 0.16s;
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--amber);
}
.product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: var(--charcoal-3);
}
.product-card-body {
  padding: 13px;
}
.product-card h2 {
  font-size: 16px;
  margin: 0 0 8px;
  line-height: 1.35;
}
.product-price {
  font-size: 14px;
  color: var(--amber);
  font-weight: 800;
}
.catalog-empty {
  grid-column: 1/-1;
}
.pagination {
  display: flex;
  gap: 7px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}
.pagination .btn {
  min-width: 42px;
}
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 24px;
}
.product-gallery {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  scroll-snap-type: x mandatory;
  border-radius: var(--radius);
  scrollbar-color: var(--amber) transparent;
}
.product-gallery img {
  flex: 0 0 100%;
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  background: var(--charcoal-2);
  border: 1px solid rgba(230, 154, 26, 0.28);
  border-radius: var(--radius);
  scroll-snap-align: start;
}
.product-info {
  padding: 12px 0;
}
.product-info h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  margin: 8px 0 16px;
}
.product-description {
  white-space: normal;
  color: var(--muted);
  line-height: 1.85;
}
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 10px;
}
.cart-item h3 {
  margin: 5px 0;
}
.cart-item-actions {
  text-align: end;
}
.auth-panel {
  max-width: 620px;
}

@media (max-width: 720px) {
  .account-link,
  .cart-link {
    display: none;
  }
  .language-switch {
    height: 29px;
    min-width: 68px;
    padding: 0 7px;
  }
  .header-left {
    gap: 4px;
  }
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .product-card-body {
    padding: 9px;
  }
  .product-card h2 {
    font-size: 13px;
    margin-bottom: 5px;
  }
  .product-price {
    font-size: 12px;
  }
  .product-detail {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .product-gallery {
    margin-inline: -2px;
  }
  .product-gallery img {
    max-height: 440px;
  }
  .cart-item {
    flex-direction: column;
  }
  .cart-item-actions {
    text-align: start;
  }
  .card-content {
    left: 11px;
    right: 11px;
  }
}

/* One locally hosted variable font covers normal text and headings. */
@font-face {
  font-family: 'Vazirmatn';
  src: url('assets/fonts/Vazirmatn-Variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
body {
  font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
}
button,
input,
select,
textarea {
  font-family: inherit;
}

/* Apply bidi handling to text blocks, not their layout parents. */
h1,
h2,
h3,
p,
label,
input,
textarea,
option,
.card-title,
.card-kicker,
.card-desc,
.card-tag,
.eyebrow,
.product-price,
.price,
.notice,
.empty,
.preview-label {
  unicode-bidi: plaintext;
}
:is(h1, h2, h3, p, .card-title, .card-kicker, .card-desc, .eyebrow, label) {
  letter-spacing: normal;
  line-height: 1.65;
}
:is(.card-tag, .header-link, .field label) {
  letter-spacing: normal;
}
.home-intro h1 {
  line-height: 1.35;
}

/* Match the visible 18px end radius of the 36px-high header buttons. */
.home-main .service-card {
  border-radius: 18px;
}

/* These labels are painted over photographs in both themes. */
.service-card,
.light .service-card {
  color: #f3f0e8;
}
.service-card .card-title,
.light .service-card .card-title,
.service-card .card-tag,
.light .service-card .card-tag {
  color: #f3f0e8;
}
.service-card .card-kicker,
.light .service-card .card-kicker {
  color: #e69a1a;
}
.service-card .card-desc,
.light .service-card .card-desc {
  color: rgba(255, 255, 255, 0.9);
}

/* Fixed header slots keep every control in place when its caption changes. */
.site-header {
  grid-template-columns: minmax(371px, 1fr) 458px minmax(414px, 1fr);
}
.header-left {
  gap: 8px;
}
.header-left {
  grid-column: 1;
}
.header-right {
  grid-column: 3;
}
.header-center {
  display: grid;
  grid-template-columns: 82px 120px 116px 116px;
  gap: 8px;
}
.header-center .header-link {
  width: 100%;
  padding: 0 6px;
}
.header-link {
  letter-spacing: normal;
}
.account-link {
  width: 92px;
  padding: 0 6px;
  flex-shrink: 0;
}
.cart-link {
  width: 92px;
  padding: 0 6px;
  flex-shrink: 0;
}
.language-switch {
  width: 76px;
  min-width: 76px;
  flex-shrink: 0;
}

/* Both edited images are 1608x241. Show the full image inside an equally
   sized link: no cropping, offsets or theme-specific zoom. */
.home-button {
  display: block;
  width: auto;
  height: 62px;
  aspect-ratio: 1608 / 241;
  flex-shrink: 0;
}
.home-art {
  display: block;
  width: 100%;
  height: 100%;
}
.home-art .header-logo {
  position: static;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: contain;
  transform: none;
}

/* Both switch files are 420x190; the actual pill occupies ~370x134.
   Artwork and hit target are enlarged 40%, preserving the image proportions. */
.theme-switch,
.light .theme-switch {
  flex-shrink: 0;
  width: 86.8px;
  height: 44.8px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  border-radius: 0;
}
.theme-switch::before {
  content: '';
  position: absolute;
  width: 86.8px;
  height: 32.2px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background-image: url('assets/Switch To Light.png');
  background-repeat: no-repeat;
  background-size: 114.44% 142.86%;
  background-position: 50% 50%;
}
.light .theme-switch::before {
  background-image: url('assets/Switch To Dark.png');
}
.theme-switch:focus-visible,
.home-button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

@media (max-width: 1320px) and (min-width: 721px) {
  .site-header {
    grid-template-columns: 318px minmax(0, 1fr) 414px;
    padding: 0 10px;
  }
  .header-left {
    gap: 5px;
  }
  .account-link,
  .cart-link {
    width: 74px;
    font-size: 11px;
  }
  .language-switch {
    width: 68px;
    min-width: 68px;
  }
  .header-center {
    grid-template-columns: 56px 84px 82px 82px;
    gap: 4px;
  }
  .header-center .header-link {
    font-size: 11px;
    padding: 0 3px;
  }
}
@media (max-width: 1080px) and (min-width: 721px) {
  .header-center {
    display: none;
  }
}
@media (max-width: 720px) {
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .header-center {
    display: none;
  }
  .header-right {
    grid-column: 3;
  }
  .home-button {
    width: 180px;
    height: auto;
  }
  .language-switch {
    width: 68px;
    min-width: 68px;
  }
  .theme-switch,
  .light .theme-switch {
    width: 78.4px;
    height: 40.6px;
  }
  .theme-switch::before {
    width: 78.4px;
    height: 29.08px;
  }
}

/* Keep the enlarged language control clear of the logo on narrow phones. */
.phone-input {
  display: flex;
  align-items: center;
  gap: 10px;
  direction: ltr;
}
.phone-input > span {
  flex: 0 0 auto;
}
.phone-input > input {
  flex: 1;
  min-width: 0;
}
@media (max-width: 360px) {
  .home-button {
    width: calc(100vw - 180px);
  }
}
