/* ═══════════════════════════════════════════════════════════
   RESPONSIVE FINAL POLISH — Complete UI/UX Enhancement
   Fixes spacing, logo responsiveness, box layouts
   ═══════════════════════════════════════════════════════════ */

:root {
  --spacing-xs: clamp(8px, 1.5vw, 12px);
  --spacing-sm: clamp(12px, 2vw, 16px);
  --spacing-md: clamp(16px, 2.5vw, 24px);
  --spacing-lg: clamp(24px, 3.5vw, 36px);
  --spacing-xl: clamp(32px, 4.5vw, 48px);
  --card-gap: clamp(16px, 2.5vw, 24px);
  --grid-gap: clamp(20px, 3vw, 32px);
}

/* ─── Container & Section Spacing ─── */
.container {
  width: min(var(--container), calc(100% - clamp(24px, 4vw, 64px)));
  padding-inline: var(--spacing-sm);
}

.section {
  padding-block: var(--spacing-xl);
}

/* ─── Logo Responsiveness (All Devices) ─── */
.site-logo-shell {
  flex-shrink: 0;
  overflow: hidden;
  border-radius: clamp(12px, 2vw, 18px);
}

.brand-logo-shell {
  width: clamp(36px, 5vw, 48px);
  height: clamp(36px, 5vw, 48px);
}

.footer-logo-shell {
  width: clamp(48px, 6vw, 64px);
  height: clamp(48px, 6vw, 64px);
}

.site-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.5vw, 14px);
  flex-shrink: 0;
  max-width: min(100%, 420px);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}

.brand-copy strong {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-copy small {
  font-size: clamp(0.75rem, 1.2vw, 0.85rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

/* ─── Navigation Shell ─── */
.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-md);
  flex-wrap: nowrap;
  padding-block: var(--spacing-sm);
}

/* ─── Grid Layouts with Proper Spacing ─── */
.home-hero-shell,
.product-hero-grid,
.detail-overview-grid,
.contact-main-grid,
.two-col {
  display: grid;
  gap: var(--grid-gap);
  align-items: start;
}

.home-proof-grid,
.plans-grid,
.cards-grid,
.pricing-grid,
.feature-grid,
.hero-value-strip,
.use-cases-grid,
.launch-steps,
.contact-support-grid,
.location-grid,
.footer-grid {
  display: grid;
  gap: var(--card-gap);
}

/* ─── Card Spacing & Padding ─── */
.pricing-card,
.plan-card,
.feature-card,
.testimonial,
.domain-card,
.contact-support-card,
.panel,
.side-card,
.form-card,
.home-proof-card,
.hero-value-card,
.launch-step-card,
.enhanced-use-case-card,
.dashboard-card,
.payment-card,
.ticket-message,
.stat-card,
.empty-state {
  padding: clamp(18px, 2.5vw, 28px);
  border-radius: clamp(16px, 2.5vw, 24px);
  min-width: 0;
}

/* ─── Home Hero Responsive Layout ─── */
.home-hero {
  padding-block: var(--spacing-xl);
}

.home-hero-shell {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: center;
}

.home-hero-copy h1 {
  font-size: clamp(1.8rem, 3vw + 1rem, 3.5rem);
  line-height: 1.3;
  margin-bottom: var(--spacing-md);
}

.home-hero-copy .lead {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  line-height: 1.7;
  margin-bottom: var(--spacing-md);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-bottom: var(--spacing-lg);
}

.home-proof-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  margin-top: var(--spacing-lg);
}

.home-proof-card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

/* ─── Hero Visual Stage ─── */
.hero-logo-stage {
  position: relative;
  min-height: clamp(400px, 40vw, 540px);
  padding: clamp(24px, 3vw, 48px);
  border-radius: clamp(28px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-md);
}

.hero-logo-core {
  width: clamp(140px, 18vw, 240px);
  height: clamp(140px, 18vw, 240px);
  flex-shrink: 0;
}

.hero-floating-card {
  padding: clamp(12px, 2vw, 18px);
  min-width: clamp(140px, 20vw, 180px);
}

.hero-curved-panel {
  width: 100%;
  max-width: clamp(280px, 35vw, 340px);
  padding: clamp(16px, 2.5vw, 24px);
}

/* ─── Pricing & Plan Cards ─── */
.pricing-grid,
.featured-home-plans {
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
}

.pricing-card,
.plan-card {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: var(--spacing-sm);
}

/* ─── Feature & Testimonial Cards ─── */
.cards-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.feature-card,
.testimonial {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* ─── Footer Responsive ─── */
.footer-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.footer-branding {
  display: flex;
  align-items: start;
  gap: var(--spacing-md);
}

/* ─── Tablet Breakpoint (max-width: 1024px) ─── */
@media (max-width: 1024px) {
  .home-hero-shell {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

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

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

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

  .hero-logo-stage {
    min-height: auto;
  }

  .orbit-one,
  .orbit-two {
    display: none;
  }

  .hero-floating-card,
  .hero-curved-panel {
    position: static;
    width: 100%;
    max-width: 100%;
  }

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

/* ─── Mobile Breakpoint (max-width: 768px) ─── */
@media (max-width: 768px) {
  .container {
    width: calc(100% - clamp(16px, 3vw, 32px));
  }

  .home-proof-grid,
  .pricing-grid,
  .featured-home-plans,
  .cards-grid,
  .feature-grid,
  .contact-support-grid,
  .footer-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

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

  .brand-logo-shell {
    width: 40px;
    height: 40px;
  }

  .brand-copy strong {
    font-size: 0.95rem;
  }

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

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

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

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

  .card-cta,
  .comparison-note,
  .cta-actions,
  .section-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .card-cta .btn,
  .comparison-note .btn,
  .cta-actions .btn,
  .section-actions .btn {
    width: 100%;
  }
}

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

  .brand {
    max-width: calc(100% - 60px);
    gap: 8px;
  }

  .brand-logo-shell {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-copy strong {
    font-size: 0.9rem;
  }

  .pricing-card,
  .plan-card,
  .feature-card,
  .panel,
  .dashboard-card {
    padding: 16px;
    border-radius: 16px;
  }

  .home-hero-copy h1 {
    font-size: 1.5rem;
  }

  .hero-logo-stage {
    padding: 20px 16px;
    border-radius: 24px;
  }

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

/* ─── Extra Small Mobile (max-width: 360px) ─── */
@media (max-width: 360px) {
  .brand {
    max-width: calc(100% - 50px);
  }

  .brand-logo-shell {
    width: 32px;
    height: 32px;
  }

  .brand-copy strong {
    font-size: 0.85rem;
    max-width: 10ch;
  }
}

/* ─── Fix Overlapping & Cramped Elements ─── */
.nav-shell > .nav-actions {
  margin-inline-start: auto;
}

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

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

/* ─── Dashboard Responsive ─── */
.dashboard-quick-grid,
.dashboard-summary-grid {
  display: grid;
  gap: var(--card-gap);
}

@media (max-width: 768px) {
  .dashboard-quick-grid,
  .dashboard-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-head {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-head .btn {
    width: 100%;
  }
}

/* ─── Form Responsive ─── */
.field-row {
  display: grid;
  gap: var(--spacing-md);
}

@media (min-width: 769px) {
  .field-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Button Responsive ─── */
.btn {
  padding: clamp(10px, 1.5vw, 14px) clamp(18px, 2.5vw, 28px);
  font-size: clamp(0.9rem, 1.5vw, 1rem);
  border-radius: clamp(10px, 1.5vw, 14px);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .btn {
    padding: 12px 20px;
    font-size: 0.95rem;
  }
}

/* ─── Table Responsive ─── */
.table-wrap,
.dashboard-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .table-wrap,
  .dashboard-table-wrap {
    margin-inline: calc(var(--spacing-sm) * -1);
    padding-inline: var(--spacing-sm);
  }
}

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

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

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

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

/* ─── Fix Site Banner Responsiveness ─── */
.site-banner-inner {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-wrap: nowrap;
}

.site-banner-copy {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  flex: 1;
  min-width: 0;
}

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

@media (max-width: 480px) {
  .site-banner-text {
    font-size: 0.8rem;
  }
}

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

h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.3;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.35;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  line-height: 1.4;
}

p {
  max-width: 75ch;
}

/* ─── Accessibility Improvements ─── */
:focus-visible {
  outline: 2px solid var(--primary);
  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;
  }
}

/* ─── Print Styles ─── */
@media print {
  .site-header,
  .site-footer,
  .nav-toggle,
  .site-banner,
  .back-to-top,
  .hostiny-chat-widget {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .container {
    width: 100%;
  }
}
