/* Aniyab UI — Homepage (HomePage v1) */

.ay-home {
  position: relative;
  overflow: hidden;
  background: var(--ay-bg-light, #FAFAFA);
  font-family: var(--ay-font-family, dana, DanaFaNum, IRANSansfanum, Tahoma, sans-serif);
  color: var(--ay-text-main, #404040);
}

.ay-home .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ay-home__glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  z-index: 0;
}

.ay-home__glow--blue {
  width: min(520px, 60vw);
  height: min(520px, 60vw);
  top: 80px;
  inset-inline-end: -120px;
  background: rgba(57, 116, 205, 0.22);
}

.ay-home__glow--orange {
  width: min(420px, 50vw);
  height: min(420px, 50vw);
  top: 220px;
  inset-inline-start: -100px;
  background: rgba(255, 111, 28, 0.16);
}

.ay-home__inner {
  position: relative;
  z-index: 1;
  width: min(1222px, calc(100% - 32px));
  margin-inline: auto;
}

.ay-home__section {
  padding-block: 48px;
}

.ay-home__section-title {
  margin: 0 0 24px;
  font-weight: 500;
  font-size: var(--ay-type-display-md-size, 24px);
  line-height: var(--ay-type-display-md-line, 40px);
  color: var(--ay-text-title, #302E2E);
  text-align: center;
}

.ay-home__section-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  text-align: center;
}

.ay-home__section-desc {
  margin: 0;
  max-width: 640px;
  font-weight: 500;
  font-size: var(--ay-type-text-xl-size, 16px);
  line-height: var(--ay-type-text-xl-line, 28px);
  color: var(--ay-text-secondary, #737373);
}

/* ── Hero ── */
.ay-home-hero {
  display: grid;
  grid-template-columns: minmax(280px, 518px) minmax(280px, 1fr);
  gap: 40px;
  align-items: center;
  padding: 12px 0 0;
  min-height: 0;
}

/* Keep search section visible in the first viewport */
.ay-home-hero + .ay-home__section {
  padding-top: 12px;
}

.ay-home-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  text-align: start;
}

.ay-home-hero__text {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 518px;
}

.ay-home-hero__title {
  margin: 0;
  font-weight: 600;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.25;
  color: var(--ay-brand-primary-dark, #022251);
}

.ay-home-hero__desc {
  margin: 0;
  font-weight: 500;
  font-size: var(--ay-type-text-xl-size, 16px);
  line-height: var(--ay-type-text-xl-line, 28px);
  color: var(--ay-text-main, #404040);
}

.ay-home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
}

.ay-home-hero__visual {
  position: relative;
  width: min(380px, 100%);
  aspect-ratio: 1;
  margin-inline: auto;
}

.ay-home-hero__blur {
  position: absolute;
  width: 76%;
  height: 76%;
  left: 10%;
  top: 4%;
  border-radius: 40%;
  background: linear-gradient(135deg, rgba(57, 116, 205, 0.28), rgba(255, 111, 28, 0.22));
  filter: blur(32px);
  transform: rotate(-15deg);
  pointer-events: none;
}

.ay-home-hero__photo {
  position: absolute;
  width: 41.4%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 4px solid #fff;
  background: #fff;
  box-shadow: var(--ay-elevation-md, 0 4px 12px rgba(163, 163, 163, 0.25));
}

.ay-home-hero__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* right image — top-right rounded corner (design: 8px 56px 8px 8px) */
.ay-home-hero__photo--right {
  inset-inline-end: 7%;
  top: 9.7%;
  border-radius: 8px 56px 8px 8px;
}

[dir="rtl"] .ay-home-hero__photo--right {
  border-radius: 56px 8px 8px 8px;
}

/* left image — bottom-left rounded corner (design: 8px 8px 8px 56px) */
.ay-home-hero__photo--left {
  inset-inline-start: 16.8%;
  top: 45.4%;
  border-radius: 8px 8px 8px 56px;
}

[dir="rtl"] .ay-home-hero__photo--left {
  border-radius: 8px 8px 56px 8px;
}

/* Aniyab logo badge — centered between the two photos */
.ay-home-hero__logo {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: var(--ay-elevation-md, 0 4px 12px rgba(163, 163, 163, 0.25));
}

.ay-home-hero__logo img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.ay-home-hero__bubble {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  max-width: 184px;
  padding: 8px 12px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 8px rgba(163, 163, 163, 0.25);
  font-weight: 500;
  font-size: 14px;
  line-height: 28px;
  color: var(--ay-text-main, #404040);
  white-space: nowrap;
}

.ay-home-hero__bubble-emoji {
  flex: none;
  font-size: 14px;
  line-height: 1;
}

.ay-home-hero__bubble--top {
  top: 14%;
  inset-inline-start: 8%;
}

.ay-home-hero__bubble--bottom {
  top: 68%;
  inset-inline-end: 2%;
}

/* ── Search ── */
.ay-home-search {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 24px 48px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid var(--ay-surface-white, #fff);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  text-align: center;
}

.ay-home-search__title {
  margin: 0;
  font-weight: 500;
  font-size: var(--ay-type-display-md-size, 24px);
  line-height: var(--ay-type-display-md-line, 40px);
  color: var(--ay-text-title, #302E2E);
}

.ay-home-search__hint {
  margin: 0 0 16px;
  font-weight: 500;
  font-size: var(--ay-type-text-xl-size, 16px);
  line-height: var(--ay-type-text-xl-line, 28px);
  color: var(--ay-text-secondary, #737373);
}

.ay-home-search__bar {
  display: flex;
  align-items: stretch;
  width: min(726px, 100%);
  background: var(--ay-surface-white, #fff);
  border: 1px solid var(--ay-border-light, #E7E5E4);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--ay-elevation-sm);
}

.ay-home-search__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  color: var(--ay-text-tertiary, #A3A3A3);
}

.ay-home-search__icon svg {
  width: 22px;
  height: 22px;
}

.ay-home-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ay-text-main, #404040);
  font-family: inherit;
  font-size: 14px;
  line-height: 28px;
  outline: none;
}

.ay-home-search__input::placeholder {
  color: var(--ay-text-tertiary, #A3A3A3);
}

.ay-home-search__submit {
  flex: none;
  min-width: 94px;
  border-radius: 0 !important;
  height: 48px !important;
}

.ay-home-search__error {
  display: none;
  margin-top: 8px;
  color: var(--ay-error, #D92412);
  font-size: 14px;
  justify-content: center;
  text-align: center;
}

.ay-home-search__result {
  margin-top: 4px;
  min-height: 1.2em;
}

/* ── Service cards ── */
.ay-home-services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.ay-home-services--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
  margin-inline: auto;
}

.ay-home-service {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  min-height: 320px;
  padding: 40px 24px 48px;
  overflow: hidden;
  background: var(--ay-brand-primary-light, #0545A6);
  border-radius: 12px;
  color: var(--ay-text-contrast, #fff);
}

.ay-home-service__title {
  margin: 0 0 16px;
  font-weight: 500;
  font-size: var(--ay-type-display-md-size, 24px);
  line-height: var(--ay-type-display-md-line, 40px);
  color: inherit;
}

.ay-home-service__desc {
  margin: 0;
  font-weight: 500;
  font-size: var(--ay-type-text-xl-size, 16px);
  line-height: var(--ay-type-text-xl-line, 28px);
  color: rgba(255, 255, 255, 0.8);
}

.ay-home-service__art {
  position: absolute;
  width: 180px;
  height: 180px;
  inset-inline-end: -36px;
  bottom: -10px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  object-fit: contain;
  transform: scaleX(-1);
}

.ay-home-service .ay-btn {
  position: relative;
  z-index: 1;
  align-self: flex-start;
}

/* ── Stats banner ── */
.ay-home-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  padding: 28px 32px;
  margin-block: 16px;
  background: var(--ay-brand-primary, #002D71);
  border-radius: 16px;
  color: var(--ay-text-contrast, #fff);
}

.ay-home-stats__label {
  margin: 0;
  max-width: 640px;
  font-weight: 500;
  font-size: clamp(16px, 2.2vw, 24px);
  line-height: 1.5;
  text-align: start;
}

.ay-home-stats__brand {
  color: var(--ay-brand-secondary, #FF6F1C);
}

.ay-home-stats__digits {
  display: flex;
  flex-direction: row;
  gap: 6px;
  direction: ltr;
}

.ay-home-stats__digit {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(2px);
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  color: #fff;
}

.ay-home-stats__digit.is-sep {
  width: auto;
  min-width: 10px;
  background: transparent;
  backdrop-filter: none;
  font-size: 18px;
}

/* ── Products carousel ── */
.ay-home-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.ay-home-carousel__track {
  display: flex;
  flex: 1 1 auto;
  gap: 24px;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 4px 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ay-home-carousel__track::-webkit-scrollbar {
  display: none;
}

.ay-home-carousel__track > * {
  flex: 0 0 min(312px, 82vw);
  scroll-snap-align: start;
}

.ay-home-carousel__nav {
  flex: none;
  width: 44px;
  height: 48px;
  border: 1px solid var(--ay-text-tertiary, #A3A3A3);
  border-radius: 8px;
  background: var(--ay-surface-white, #fff);
  color: var(--ay-text-main, #404040);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ay-home-carousel__nav:hover {
  border-color: var(--ay-brand-primary, #002D71);
  color: var(--ay-brand-primary, #002D71);
}

.ay-home-carousel__nav:disabled {
  opacity: 0.4;
  cursor: default;
}

.ay-home-carousel__nav svg {
  width: 20px;
  height: 20px;
}

.ay-home__more {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.ay-home__more a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ay-brand-primary, #002D71);
  font-weight: 500;
  font-size: 14px;
  line-height: 28px;
  text-decoration: none;
}

.ay-home__more a:hover {
  color: var(--ay-brand-primary-light, #0545A6);
}

/* ── Testimonials ── */
.ay-home-story {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: 280px;
  padding: 24px;
  background: var(--ay-surface-white, #fff);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(163, 163, 163, 0.25);
}

.ay-home-story__quote {
  color: var(--ay-brand-secondary, #FF6F1C);
  width: 36px;
  height: 36px;
}

.ay-home-story__quote svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.ay-home-story__text {
  margin: 0;
  flex: 1;
  font-weight: 500;
  font-size: 14px;
  line-height: 28px;
  color: var(--ay-text-main, #404040);
  text-align: start;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ay-home-story__media {
  width: 100%;
  max-height: 180px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--ay-bg-dark, #F4F4F5);
}

.ay-home-story__author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ay-home-story__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ay-bg-dark, #F4F4F5);
}

.ay-home-story__name {
  margin: 0;
  font-weight: 700;
  font-size: 14px;
  line-height: 28px;
  color: var(--ay-text-title, #302E2E);
}

/* ── FAQ ── */
.ay-home-faq {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 48px;
  align-items: start;
}

.ay-home-faq__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ay-home-faq__support {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 276px;
  padding: 24px;
  background: var(--ay-surface-white, #fff);
  border: 1px solid var(--ay-border-light, #E7E5E4);
  border-radius: 12px;
  text-align: center;
}

.ay-home-faq__support-title {
  margin: 0 0 8px;
  font-weight: 500;
  font-size: 24px;
  line-height: 40px;
  color: var(--ay-text-title, #302E2E);
}

.ay-home-faq__support-desc {
  margin: 0;
  font-size: 16px;
  line-height: 28px;
  color: var(--ay-text-secondary, #737373);
}

.ay-home-faq__phone {
  display: block;
  margin: 8px 0 16px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ay-brand-primary, #002D71);
  text-decoration: none;
  direction: ltr;
}

/* ── Partners (carousel cards) ── */
.ay-home-carousel--partners .ay-home-carousel__track {
  gap: 16px;
}

.ay-home-carousel--partners .ay-home-carousel__track > * {
  flex: 0 0 min(140px, 42vw);
}

.ay-home-partner {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 96px;
  height: 96px;
  padding: 16px;
  background: var(--ay-surface-white, #fff);
  border: 1px solid var(--ay-border-light, #E7E5E4);
  border-radius: 12px;
  transition: box-shadow 0.2s ease;
  text-decoration: none;
}

.ay-home-partner:hover {
  box-shadow: var(--ay-elevation-sm);
}

.ay-home-partner img {
  max-width: 100%;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: grayscale(0.15);
}

/* ── Responsive ── */
@media (max-width: 991px) {
  .ay-home-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 28px;
    min-height: 0;
  }

  .ay-home-hero__content {
    align-items: stretch;
  }

  .ay-home-hero__visual {
    width: min(360px, 92%);
  }

  .ay-home-hero__actions {
    gap: 12px;
  }

  .ay-home-hero__actions .ay-btn {
    flex: 1 1 auto;
  }

  .ay-home-services {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ay-home-service {
    min-height: 0;
    padding: 28px 20px 32px;
  }

  .ay-home-faq {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ay-home-faq__support {
    order: 2;
    min-height: 0;
  }

  .ay-home-carousel__nav {
    display: none;
  }
}

@media (max-width: 767px) {
  .ay-home__inner {
    width: calc(100% - 24px);
  }

  .ay-home__section {
    padding-block: 32px;
  }

  .ay-home-search {
    padding: 24px 16px 32px;
  }

  .ay-home-search__bar {
    flex-direction: column;
    border: 0;
    background: transparent;
    box-shadow: none;
    gap: 12px;
  }

  .ay-home-search__icon {
    display: none;
  }

  .ay-home-search__input {
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--ay-border-light, #E7E5E4);
    border-radius: 12px;
    background: var(--ay-surface-white, #fff);
  }

  .ay-home-search__submit {
    width: 100%;
    border-radius: 8px !important;
  }

  .ay-home-stats {
    flex-direction: column;
    padding: 24px 16px;
  }

  .ay-home-stats__digits {
    flex-wrap: wrap;
    justify-content: center;
  }

  .ay-home-hero {
    padding: 24px 0 16px;
  }

  .ay-home-hero__title {
    font-size: clamp(24px, 7vw, 32px);
  }

  .ay-home-hero__logo {
    width: 72px;
    height: 72px;
  }

  .ay-home-hero__logo img {
    width: 44px;
    height: 44px;
  }

  .ay-home-hero__bubble {
    font-size: 12px;
    line-height: 22px;
    padding: 6px 10px;
    max-width: 150px;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ay-home-carousel__track {
    scroll-behavior: auto;
  }
}
