/* ==========================================================
   TopGSM — Home Page Design System 2026 
   Stack: Bootstrap 5.3 RTL + Swiper + Yekan font
   Palette: Navy #102c57 · Coral #ff5e57 · Surface #fafafa
   ========================================================== */

/* Prevent horizontal page overflow caused by swipers */
body {
  overflow-x: hidden;
}

/* ── Section Scaffolding ─────────────────────────────────── */
.tg-section {
  padding: 2.75rem 0;
}
.tg-section--alt {
  background: #f1f5f9;
}
.tg-section--dark {
  background: var(--primary-color);
  color: #fff;
}

.tg-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
}
.tg-section-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--primary-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  letter-spacing: -0.01em;
}
.tg-section-title::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 1.4rem;
  background: var(--secondary-color);
  border-radius: 3px;
  flex-shrink: 0;
}
.tg-section--dark .tg-section-title {
  color: #fff;
}
.tg-section--dark .tg-section-title::before {
  background: var(--secondary-color);
}

.tg-view-all {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  border: 1.5px solid rgba(16, 44, 87, 0.25);
  padding: 0.3rem 1rem;
  border-radius: 100px;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
  white-space: nowrap;
}
.tg-view-all:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* ── Hero Section ───────────────────────────────────────── */
.tg-hero {
  padding: 1rem 0 0;
}

.tg-carousel-frame {
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(16, 44, 87, 0.1);
  height: 100%;
  min-height: 240px;
}

.tg-carousel-frame .carousel,
.tg-carousel-frame .carousel-inner,
.tg-carousel-frame .carousel-item {
  height: 100%;
}

.tg-carousel-frame .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* pill-style indicators */
.tg-carousel-frame .carousel-indicators {
  margin-bottom: 0.6rem;
}
.tg-carousel-frame .carousel-indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.55);
  transition:
    width 0.3s,
    opacity 0.3s;
  opacity: 1;
}
.tg-carousel-frame .carousel-indicators .active {
  width: 22px;
  border-radius: 4px;
  background: #fff;
}

/* side banners */
.tg-side-ads {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
}
.tg-side-ads a {
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  flex: 1;
  box-shadow: 0 4px 16px rgba(16, 44, 87, 0.07);
  transition: transform 0.3s;
}
.tg-side-ads a:hover {
  transform: translateY(-2px);
}
.tg-side-ads img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Header Stories (Digikala-style circles) ─────────────── */
.tg-stories {
  margin-top: 0.5rem;
  padding: 0.5rem 0.5rem;
  background: #fff;
}

.tg-stories-wrap {
  position: relative;
}

.tg-stories-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2.5rem;
  padding: 0.2rem 0 0.15rem;
}

.tg-stories-scroll::-webkit-scrollbar {
  display: none;
}

.tg-stories-track {
  display: flex;
  align-items: flex-start;
  gap: 1.35rem;
  min-width: max-content;
  margin: 0;
  padding: 0 0.25rem;
  list-style: none;
}

.tg-stories-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.tg-story {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: 5.25rem;
  text-decoration: none;
  color: #3f4064;
}

.tg-story:active .tg-story-ring {
  transform: scale(0.97);
}

.tg-story-ring {
  --tg-story-ring: var(--secondary-color, #ff5e57);
  box-sizing: border-box;
  flex-shrink: 0;
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  padding: 2px;
  background: var(--tg-story-ring);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tg-story.is-seen .tg-story-ring {
  --tg-story-ring: #c0c2c5;
}

.tg-story-thumb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  padding: 2px;
  background: #fff;
  overflow: hidden;
  box-sizing: border-box;
}

.tg-story-thumb img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.tg-story-label {
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  max-width: 5.25rem;
  min-height: 2.05em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tg-stories-nav {
  position: absolute;
  inset-inline-end: 0;
  top: 1.35rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid #e0e0e2;
  background: #fff;
  color: #81858b;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s;
}

.tg-stories-nav:hover {
  color: #424750;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
}

.tg-stories-nav:active {
  transform: scale(0.96);
}

.tg-stories-nav[hidden] {
  display: none;
}

.tg-stories-wrap.is-scrollable .tg-stories-scroll {
  padding-inline-end: 2.5rem;
}

.tg-stories-wrap.is-scrollable::before {
  content: "";
  position: absolute;
  inset-inline-end: 0;
  top: 0;
  width: 3.25rem;
  height: 5.5rem;
  background: linear-gradient(to right, #fff 35%, rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: 2;
}

header.header-mob .tg-stories {
  margin-top: 0.25rem;
  padding-top: 0.55rem;
  border-top: 1px solid #f0f0f1;
}

@media (max-width: 767.98px) {
  .tg-stories-track {
    gap: 1.1rem;
  }

  .tg-story {
    width: 4.75rem;
  }

  .tg-story-ring {
    width: 4.5rem;
    height: 4.5rem;
  }

  .tg-story-label {
    max-width: 4.75rem;
    font-size: 0.65rem;
  }
}

/* ── Quick Grid (4-box) ──────────────────────────────────── */
.tg-quick-grid {
  padding: 1.25rem 0 0.5rem;
}
.tg-quick-item {
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(16, 44, 87, 0.05);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  display: block;
}
.tg-quick-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 22px rgba(16, 44, 87, 0.11);
}
.tg-quick-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Hot Offers ──────────────────────────────────────────── */
.tg-swiper-clip {
  overflow: hidden;
  /* give enough lateral padding so the nav buttons are visible */
  padding: 0 2rem;
  margin: 0 -2rem;
}
.tg-offers-swiper {
  padding-bottom: 2.25rem !important;
}

.tg-offer-card {
  display: block;
  background: #fff;
  border-radius: 0.875rem;
  padding: 0.65rem;
  text-decoration: none;
  color: var(--primary-color);
  border: 1.5px solid rgba(16, 44, 87, 0.06);
  box-shadow: 0 2px 10px rgba(16, 44, 87, 0.05);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.tg-offer-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 28px rgba(16, 44, 87, 0.1);
  color: var(--primary-color);
}
.tg-offer-img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 0.55rem;
  display: block;
  margin: 0 auto 0.55rem;
}
.tg-offer-name {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.tg-offer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 44, 87, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.28s;
  border-radius: 0.9rem;
}
.tg-offer-card:hover .tg-offer-overlay {
  opacity: 1;
}
.tg-offer-overlay p {
  color: #fff;
  font-size: 0.775rem;
  line-height: 1.6;
  margin: 0;
}

/* Swiper nav buttons — global tint */
.tg-offers-swiper .swiper-button-next,
.tg-offers-swiper .swiper-button-prev,
.tg-experts-swiper .swiper-button-next,
.tg-experts-swiper .swiper-button-prev {
  color: var(--primary-color);
  background: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(16, 44, 87, 0.12);
  top: 50%;
}
.tg-offers-swiper .swiper-button-next::after,
.tg-offers-swiper .swiper-button-prev::after,
.tg-experts-swiper .swiper-button-next::after,
.tg-experts-swiper .swiper-button-prev::after {
  font-size: 0.85rem;
  font-weight: 900;
}

/* ── Experts ─────────────────────────────────────────────── */
.tg-experts {
  padding: 1.75rem 0;
}
.tg-experts .tg-section-head {
  margin-bottom: 1rem;
}
.tg-experts .tg-section-title {
  font-size: 1.15rem;
}
.tg-experts .tg-section-title::before {
  height: 1.15rem;
}

.tg-experts-swiper {
  padding-bottom: 1.5rem !important;
}
.tg-experts-swiper .swiper-button-next,
.tg-experts-swiper .swiper-button-prev {
  width: 30px;
  height: 30px;
}
.tg-experts-swiper .swiper-button-next::after,
.tg-experts-swiper .swiper-button-prev::after {
  font-size: 0.72rem;
}

.tg-expert-card {
  background: #fff;
  border-radius: 0.9rem;
  padding: 0.85rem 0.65rem 0.7rem;
  text-align: center;
  border: 1px solid rgba(16, 44, 87, 0.06);
  box-shadow: 0 1px 8px rgba(16, 44, 87, 0.04);
  transition:
    transform 0.3s,
    box-shadow 0.3s;
}
.tg-expert-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 44, 87, 0.08);
}
.tg-expert-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(16, 44, 87, 0.09);
  display: block;
  margin: 0 auto 0.4rem;
}
.tg-expert-stars {
  color: #f59e0b;
  font-size: 0.62rem;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.2rem;
}
.tg-expert-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.2rem;
  line-height: 1.35;
}
.tg-expert-badge {
  display: inline-block;
  font-size: 0.62rem;
  background: rgba(16, 44, 87, 0.07);
  color: var(--primary-color);
  padding: 0.12rem 0.5rem;
  border-radius: 100px;
  margin-bottom: 0.3rem;
  font-weight: 600;
}
.tg-expert-phone {
  font-size: 0.68rem;
  color: #64748b;
  direction: ltr;
  display: block;
}

/* ── Why TopGSM ──────────────────────────────────────────── */
.tg-why {
  position: relative;
  overflow: hidden;
}
.tg-why::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  pointer-events: none;
}
.tg-why::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: rgba(255, 94, 87, 0.05);
  pointer-events: none;
}
.tg-why-image-wrap {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.tg-why-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tg-why-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}
.tg-why-list li {
  padding: 0.55rem 0;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.65;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.tg-why-list li:last-child {
  border-bottom: none;
}
.tg-why-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--secondary-color);
  margin-top: 3px;
  flex-shrink: 0;
}
.tg-why-check svg {
  display: block;
}
.tg-why-slogan {
  margin-top: 1.5rem;
  padding: 0.9rem 1.25rem;
  border: 1.5px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.6;
}

/* ── Latest Products ─────────────────────────────────────── */
.tg-product-wrap {
  background: #fff;
  border-radius: 1rem;
  border: 1.5px solid rgba(16, 44, 87, 0.07);
  overflow: hidden;
}
.tg-product-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1.1rem;
  text-decoration: none;
  color: var(--primary-color);
  transition: background 0.2s;
}
.tg-product-item:hover {
  background: rgba(16, 44, 87, 0.03);
  color: var(--primary-color);
}
.tg-product-thumb {
  width: 44px;
  height: 44px;
  border-radius: 0.6rem;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(16, 44, 87, 0.08);
}
.tg-product-name {
  font-size: 0.85rem;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tg-product-date {
  font-size: 0.73rem;
  color: #94a3b8;
  flex-shrink: 0;
  direction: ltr;
}
.tg-product-divider {
  height: 1px;
  background: rgba(16, 44, 87, 0.05);
  margin: 0 1.1rem;
}

/* ── Scroll-reveal animation ─────────────────────────────── */
@keyframes tgFadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.tg-reveal {
  animation: tgFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.tg-reveal-d1 {
  animation-delay: 0.05s;
}
.tg-reveal-d2 {
  animation-delay: 0.12s;
}
.tg-reveal-d3 {
  animation-delay: 0.19s;
}
.tg-reveal-d4 {
  animation-delay: 0.26s;
}
.tg-reveal-d5 {
  animation-delay: 0.33s;
}

/* ── Swiper pagination dots ──────────────────────────────── */
.swiper-pagination-bullet {
  background: var(--primary-color);
  opacity: 0.35;
}
.swiper-pagination-bullet-active {
  opacity: 1;
  background: var(--secondary-color);
}

/* ── Mobile overrides ────────────────────────────────────── */
@media (max-width: 767.98px) {
  .tg-section {
    padding: 2rem 0;
  }
  .tg-experts {
    padding: 1.35rem 0;
  }
  .tg-carousel-frame {
    min-height: 200px;
  }
  .tg-side-ads {
    flex-direction: row;
    height: auto;
  }
  .tg-side-ads a {
    flex: 1;
    min-height: 110px;
  }
  .tg-why-image-wrap {
    max-height: 240px;
  }
}
