/* ═══════════════════════════════════════════════════════════
   RESPONSIVE ENHANCED — Final UI/UX Polish for hostrade.ir
   Fixes overlapping, cramped elements, mobile optimization
   ═══════════════════════════════════════════════════════════ */

/* ─── Override and enhance existing responsive rules ─── */

/* Container with better breathing room */
.container {
  width: min(var(--container, 1180px), calc(100% - clamp(32px, 5vw, 80px))) !important;
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 24px);
}

/* Section spacing - more generous */
.section {
  padding-block: clamp(40px, 6vw, 80px) !important;
}

.home-hero {
  padding-block: clamp(40px, 6vw, 70px) !important;
}

/* ─── Home Hero Layout - Fix Overlapping ─── */
.home-hero-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(32px, 5vw, 48px) !important;
  align-items: start;
}

@media (min-width: 1025px) {
  .home-hero-shell {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
  }
}

.home-hero-copy {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 24px);
}

.home-hero-copy h1 {
  font-size: clamp(1.75rem, 4vw, 3.2rem) !important;
  line-height: 1.35 !important;
  margin: 0 0 clamp(12px, 2vw, 20px) 0 !important;
  word-wrap: break-word;
}

.home-hero-copy .lead {
  font-size: clamp(1rem, 1.8vw, 1.15rem) !important;
  line-height: 1.75 !important;
  margin: 0 0 clamp(16px, 3vw, 24px) 0 !important;
  max-width: 65ch;
}

/* Hero Actions - Better spacing */
.hero-actions {
  display: flex;
  gap: clamp(12px, 2vw, 16px) !important;
  flex-wrap: wrap;
  margin-bottom: clamp(20px, 3vw, 32px) !important;
}

.hero-actions .btn {
  padding: clamp(12px, 1.5vw, 16px) clamp(24px, 3vw, 36px) !important;
  font-size: clamp(0.95rem, 1.5vw, 1.05rem) !important;
  white-space: nowrap;
  min-height: 48px;
}

/* ─── Home Proof Grid - Fix Cramped Boxes ─── */
.home-proof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: clamp(20px, 3vw, 28px) !important;
  margin-top: clamp(24px, 4vw, 36px) !important;
}

.home-proof-card {
  padding: clamp(20px, 3vw, 28px) !important;
  border-radius: clamp(18px, 2.5vw, 24px) !important;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.5vw, 14px) !important;
  min-height: 120px;
  justify-content: center;
}

.home-proof-card strong {
  font-size: clamp(1rem, 1.8vw, 1.15rem) !important;
  line-height: 1.4;
  margin: 0;
}

.home-proof-card span {
  font-size: clamp(0.9rem, 1.5vw, 0.95rem) !important;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

/* ─── Pill List - Better spacing ─── */
.pill-list {
  display: flex;
  gap: clamp(10px, 1.5vw, 14px) !important;
  flex-wrap: wrap;
  margin-top: clamp(16px, 2.5vw, 24px);
}

.pill {
  padding: clamp(8px, 1.2vw, 12px) clamp(14px, 2vw, 20px) !important;
  font-size: clamp(0.85rem, 1.3vw, 0.92rem) !important;
  white-space: nowrap;
}

/* ─── Home Link Row - Better spacing ─── */
.home-link-row {
  display: flex;
  gap: clamp(10px, 1.5vw, 14px) !important;
  flex-wrap: wrap;
  margin-top: clamp(18px, 2.5vw, 24px) !important;
}

.home-link-row a {
  padding: clamp(10px, 1.5vw, 14px) clamp(16px, 2.5vw, 22px) !important;
  font-size: clamp(0.9rem, 1.4vw, 0.98rem) !important;
  white-space: nowrap;
  border-radius: 999px;
}

/* ─── Hero Visual Stage - Better mobile layout ─── */
.hero-logo-stage {
  position: relative;
  min-height: auto !important;
  padding: clamp(28px, 4vw, 48px) !important;
  border-radius: clamp(24px, 3vw, 44px) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 32px);
}

.hero-logo-core {
  position: relative !important;
  inset: auto !important;
  width: clamp(140px, 20vw, 220px) !important;
  height: clamp(140px, 20vw, 220px) !important;
  flex-shrink: 0;
  margin: 0 auto;
}

.hero-floating-card {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  padding: clamp(16px, 2.5vw, 22px) !important;
  margin: 0 !important;
}

.hero-floating-card span {
  font-size: clamp(0.85rem, 1.3vw, 0.92rem) !important;
}

.hero-floating-card strong {
  font-size: clamp(1rem, 1.6vw, 1.1rem) !important;
}

.hero-curved-panel {
  position: static !important;
  width: 100% !important;
  max-width: 100% !important;
  padding: clamp(18px, 2.5vw, 24px) !important;
  margin: 0 !important;
  inset: auto !important;
}

.hero-curved-head {
  margin-bottom: clamp(12px, 2vw, 16px);
}

.hero-curved-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100px, 100%), 1fr));
  gap: clamp(12px, 2vw, 16px) !important;
  margin-bottom: clamp(14px, 2vw, 18px);
}

.hero-curved-grid > div {
  padding: clamp(10px, 1.5vw, 14px);
}

/* Hide orbits on all devices for cleaner look */
.orbit-one,
.orbit-two {
  display: none !important;
}

/* ─── Featured Plans - Better spacing ─── */
.featured-home-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(24px, 3.5vw, 36px) !important;
  margin-top: clamp(24px, 4vw, 40px);
}

.plan-card {
  padding: clamp(22px, 3vw, 32px) !important;
  border-radius: clamp(18px, 2.5vw, 26px) !important;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.5vw, 22px) !important;
}

/* ─── Pricing Grid - Better spacing ─── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
  gap: clamp(24px, 3.5vw, 36px) !important;
}

.pricing-card {
  padding: clamp(22px, 3vw, 32px) !important;
  border-radius: clamp(18px, 2.5vw, 26px) !important;
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.5vw, 22px) !important;
}

/* ─── Feature Cards - Better spacing ─── */
.cards-grid,
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(24px, 3.5vw, 36px) !important;
}

.feature-card {
  padding: clamp(22px, 3vw, 30px) !important;
  border-radius: clamp(18px, 2.5vw, 24px) !important;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2vw, 18px) !important;
}

/* ─── Resource Grid - Better spacing ─── */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: clamp(14px, 2vw, 18px) !important;
}

.resource-item {
  padding: clamp(14px, 2vw, 18px) !important;
}

/* ─── Tablet Responsive (max-width: 1024px) ─── */
@media (max-width: 1024px) {
  .container {
    width: calc(100% - clamp(24px, 4vw, 48px)) !important;
  }

  .home-hero-shell {
    grid-template-columns: 1fr !important;
    gap: clamp(28px, 4vw, 40px) !important;
  }

  .home-hero-copy {
    text-align: center;
    align-items: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .home-link-row {
    justify-content: center;
  }

  .home-proof-grid {
    grid-template-columns: 1fr !important;
    max-width: 600px;
    margin-inline: auto;
  }

  .brand-copy small {
    display: none !important;
  }
}

/* ─── Mobile Responsive (max-width: 768px) ─── */
@media (max-width: 768px) {
  .container {
    width: calc(100% - 24px) !important;
    padding-inline: 12px;
  }

  .section {
    padding-block: clamp(32px, 5vw, 48px) !important;
  }

  .home-hero {
    padding-block: clamp(32px, 5vw, 48px) !important;
  }

  .home-hero-copy h1 {
    font-size: clamp(1.6rem, 6vw, 2.2rem) !important;
  }

  .home-hero-copy .lead {
    font-size: 1rem !important;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px !important;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .home-proof-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .home-proof-card {
    padding: 18px !important;
    min-height: auto;
  }

  .pill-list {
    justify-content: center;
  }

  .home-link-row {
    justify-content: center;
    gap: 8px !important;
  }

  .home-link-row a {
    padding: 10px 16px !important;
    font-size: 0.9rem !important;
  }

  .hero-logo-stage {
    padding: 24px 16px !important;
  }

  .hero-logo-core {
    width: 140px !important;
    height: 140px !important;
  }

  .featured-home-plans,
  .pricing-grid,
  .cards-grid,
  .feature-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .resource-grid {
    grid-template-columns: 1fr !important;
  }

  /* Footer responsive */
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .footer-branding {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ─── Small Mobile (max-width: 480px) ─── */
@media (max-width: 480px) {
  .container {
    width: calc(100% - 16px) !important;
    padding-inline: 8px;
  }

  .home-hero-copy h1 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
  }

  .home-hero-copy .lead {
    font-size: 0.95rem !important;
  }

  .hero-actions .btn {
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
  }

  .home-proof-card {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  .home-proof-card strong {
    font-size: 0.98rem !important;
  }

  .home-proof-card span {
    font-size: 0.88rem !important;
  }

  .pill {
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
  }

  .home-link-row a {
    padding: 8px 14px !important;
    font-size: 0.88rem !important;
  }

  .hero-logo-stage {
    padding: 20px 12px !important;
    border-radius: 20px !important;
  }

  .hero-logo-core {
    width: 120px !important;
    height: 120px !important;
  }

  .hero-floating-card,
  .hero-curved-panel {
    padding: 16px !important;
    border-radius: 16px !important;
  }

  .plan-card,
  .pricing-card,
  .feature-card {
    padding: 18px !important;
    border-radius: 16px !important;
  }
}

/* ─── Extra Small Mobile (max-width: 360px) ─── */
@media (max-width: 360px) {
  .home-hero-copy h1 {
    font-size: 1.35rem !important;
  }

  .home-hero-copy .lead {
    font-size: 0.9rem !important;
  }

  .home-proof-card {
    padding: 14px !important;
  }

  .hero-logo-core {
    width: 100px !important;
    height: 100px !important;
  }
}

/* ─── Fix Navigation Overlapping ─── */
.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 20px);
  flex-wrap: nowrap;
  padding-block: clamp(12px, 2vw, 16px);
}

.brand {
  flex-shrink: 0;
  max-width: min(100%, 400px);
}

@media (max-width: 980px) {
  .nav-shell > .nav-actions {
    display: none !important;
  }

  .nav-toggle {
    margin-inline-start: auto;
    flex-shrink: 0;
  }

  .brand {
    max-width: calc(100% - 80px);
  }
}

@media (max-width: 480px) {
  .brand {
    max-width: calc(100% - 60px);
  }
}

/* ─── Fix Site Banner ─── */
.site-banner-inner {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 16px);
  flex-wrap: nowrap;
  padding-block: clamp(8px, 1.5vw, 12px);
}

.site-banner-copy {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 12px);
  flex: 1;
  min-width: 0;
}

.site-banner-text {
  font-size: clamp(0.85rem, 1.5vw, 0.95rem) !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Prevent Horizontal Overflow ─── */
html,
body {
  max-width: 100%;
  overflow-x: hidden !important;
}

* {
  box-sizing: border-box;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* ─── Improve Touch Targets ─── */
@media (max-width: 768px) {
  a,
  button {
    min-height: 44px;
    min-width: 44px;
  }

  .btn {
    min-height: 48px;
  }
}

/* ─── Typography Improvements ─── */
body {
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

p {
  max-width: 75ch;
  word-wrap: break-word;
}

/* ─── Accessibility ─── */
:focus-visible {
  outline: 2px solid var(--primary, #5ea3ff);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
