/* ============================================================
   WebKMT — Offers section (homepage) + Template Gallery page
   Loaded after the main bundles so these rules win on ties.
   RTL-safe: uses logical properties where direction matters.
   ============================================================ */

/* ---------- Shared buttons ---------- */
.offer-btn,
.tpl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}
.offer-btn--primary,
.tpl-btn--primary {
  background: #1faa55;
  color: #fff;
  box-shadow: 0 6px 18px rgba(31, 170, 85, 0.35);
}
.offer-btn--primary:hover,
.tpl-btn--primary:hover {
  background: #178a44;
  transform: translateY(-2px);
}
.offer-btn--ghost,
.tpl-btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.offer-btn--ghost:hover,
.tpl-btn--ghost:hover {
  background: rgba(var(--color-primary-rgb, 10, 172, 184), 0.1);
  transform: translateY(-2px);
}

/* ---------- Homepage offers ---------- */
.offer-card__front {
  gap: 0.85rem;
  padding: 1.5rem 1.4rem;
}
.offer-card__badge {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  background: var(--color-accent, #f59e0b);
  color: #1a1206;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  z-index: 2;
}
.offer-card__icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--color-primary-rgb, 10, 172, 184), 0.12);
  color: var(--color-primary);
  flex: none;
}
.offer-card__title {
  font-size: 1.3rem;
  line-height: 1.3;
}
.offer-card__desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
.offer-card__price {
  border-top: 1px dashed var(--glass-border, rgba(127, 140, 160, 0.3));
  border-bottom: 1px dashed var(--glass-border, rgba(127, 140, 160, 0.3));
  padding: 0.7rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.offer-card__setup {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-primary);
}
.offer-card__care {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-primary);
}
.offer-card__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.offer-card__features li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.45;
}
.offer-card__features svg {
  color: var(--color-primary);
  flex: none;
  margin-top: 2px;
}
.offer-card__actions {
  margin-top: auto;
  padding-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.offer-card--featured .service-card__front {
  border: 1px solid var(--color-primary);
  box-shadow: 0 14px 44px rgba(var(--color-primary-rgb, 10, 172, 184), 0.2);
}
.care-strip {
  margin-top: 2.2rem;
  padding: 1.6rem 1.8rem;
  border-radius: var(--radius-xl, 20px);
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb, 10, 172, 184), 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(var(--color-primary-rgb, 10, 172, 184), 0.28);
  text-align: center;
}
.care-strip h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.care-strip p {
  color: var(--text-secondary);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.65;
}
.offers-custom-note {
  text-align: center;
  margin-top: 1.3rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.offers-custom-note a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.offers-custom-note a:hover {
  text-decoration: underline;
}

/* ---------- Template Gallery page ---------- */
.nav-link-enhanced.is-active {
  color: var(--color-primary);
}
.tpl-hero {
  padding: 8.5rem 0 0.5rem;
  text-align: center;
}
.tpl-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.2;
}
.tpl-hero__sub {
  max-width: 730px;
  margin: 1.1rem auto 0;
  color: var(--text-secondary);
  font-size: 1.08rem;
  line-height: 1.7;
}
.tpl-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2.4rem auto 0;
  max-width: 1020px;
  text-align: start;
}
.tpl-step {
  padding: 1.25rem 1.35rem;
  border-radius: 16px;
  background: var(--color-surface);
  border: 1px solid var(--glass-border, rgba(127, 140, 160, 0.18));
}
.tpl-step h3 {
  color: var(--color-primary);
  font-size: 1rem;
  margin-bottom: 0.45rem;
}
.tpl-step p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}
.tpl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin: 2.4rem 0 1.7rem;
}
.tpl-filter-btn {
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--glass-border, rgba(127, 140, 160, 0.3));
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
}
.tpl-filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.tpl-filter-btn.is-active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.6rem;
  padding-bottom: 0.5rem;
}
.tpl-card {
  border-radius: 20px;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--glass-border, rgba(127, 140, 160, 0.18));
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.tpl-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.2);
}
.tpl-preview {
  position: relative;
  height: 192px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.tpl-preview__bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.9rem;
  background: rgba(0, 0, 0, 0.18);
}
.tpl-preview__dots {
  display: flex;
  gap: 5px;
}
.tpl-preview__dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
}
.tpl-preview__url {
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.18);
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  direction: ltr;
  unicode-bidi: embed;
}
.tpl-preview__icon {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.tpl-preview__lines {
  position: absolute;
  bottom: 16px;
  inset-inline-start: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tpl-preview__lines i {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
}
.tpl-preview__lines i:nth-child(1) { width: 112px; }
.tpl-preview__lines i:nth-child(2) { width: 78px; }
.tpl-preview__lines i:nth-child(3) { width: 54px; }
.tpl-card__body {
  padding: 1.3rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
}
.tpl-card__name {
  font-size: 1.25rem;
  line-height: 1.3;
}
.tpl-card__tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
.tpl-card__features {
  list-style: none;
  padding: 0;
  margin: 0.1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.tpl-card__features li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.45;
}
.tpl-card__features svg {
  color: var(--color-primary);
  flex: none;
  margin-top: 2px;
}
.tpl-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-top: 1px dashed var(--glass-border, rgba(127, 140, 160, 0.3));
  padding-top: 0.85rem;
  margin-top: auto;
}
.tpl-card__meta strong {
  color: var(--text-primary);
}
.tpl-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.tpl-how {
  padding: 3.2rem 0 0.5rem;
}
.tpl-cta-band {
  margin: 3rem 0 4.5rem;
  text-align: center;
  padding: 2.6rem 1.6rem;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb, 10, 172, 184), 0.14), rgba(99, 102, 241, 0.14));
  border: 1px solid rgba(var(--color-primary-rgb, 10, 172, 184), 0.3);
}
.tpl-cta-band h2 {
  margin-bottom: 0.6rem;
}
.tpl-cta-band p {
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 1.4rem;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .tpl-hero { padding-top: 7rem; }
  .tpl-grid { grid-template-columns: 1fr; }
  .offer-btn, .tpl-btn { white-space: normal; text-align: center; }
}
