/* ===================================================
   CRAZEON DIGI SOLUTION — Responsive Styles (Mobile-First)
   =================================================== */

/* ——————————————————————————————
   BASE = MOBILE (≤ 480px default)
   All styles below are the default mobile styles.
   We then SCALE UP with min-width queries.
—————————————————————————————— */

/* — Mobile Base Overrides — */
:root {
  --section-pad: 56px 0;
}

.container {
  padding: 0 18px;
}

.navbar {
  padding: 14px 0;
}

.navbar .container {
  gap: 10px;
}

.nav-logo {
  min-width: 0;
}

.nav-logo .logo-main {
  font-size: 1.25rem;
  letter-spacing: 1.2px;
}

.nav-logo .logo-sub {
  font-size: 0.58rem;
  letter-spacing: 1.8px;
}

/* — Loader — */
.loader-logo {
  font-size: 1.6rem;
  letter-spacing: 3px;
  margin-bottom: 20px;
}
.loader-bar {
  width: 140px;
}

/* — Navbar Mobile — */
.hamburger {
  display: flex;
  z-index: 1020;
  position: relative;
}

body.mobile-bottom-nav-only .hamburger {
  display: none;
}

body.mobile-bottom-nav-only .nav-links {
  display: none;
}

body.mobile-bottom-nav-only .nav-overlay {
  display: none !important;
  pointer-events: none !important;
}

/* Keep menu links above overlay in mobile stacking context */
.navbar .container {
  position: relative;
  z-index: 1022;
}

.nav-cta {
  display: none;
}

.nav-links {
  position: fixed;
  inset: 0;
  left: 0;
  width: 100vw;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(5, 8, 20, 0.98), rgba(2, 4, 12, 0.995)),
    radial-gradient(circle at top right, rgba(0, 229, 255, 0.08), transparent 34%);
  border-right: none;
  padding: calc(92px + env(safe-area-inset-top, 0px)) 24px calc(120px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 14px;
  overflow-y: auto;
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1021;
  pointer-events: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-links.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateX(0) !important;
}

.nav-links li {
  margin: 0;
  width: 100%;
  max-width: 340px;
  align-self: center;
  pointer-events: auto;
}

.nav-links a {
  display: block;
  font-size: 1.2rem;
  padding: 14px 18px;
  border-radius: 16px;
  transition: all 0.3s;
  color: var(--heading);
  pointer-events: auto;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(0, 229, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.24);
  color: var(--cyan);
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1005;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.nav-overlay.show {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  background: rgba(0, 0, 0, 0.72) !important;
}

body.no-scroll {
  overflow: hidden;
  touch-action: none;
}

body.no-scroll .mobile-bottom-nav,
body.no-scroll .whatsapp-float,
body.no-scroll .back-to-top,
body.no-scroll .cookie-banner {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* — Mobile Bottom Nav (visible by default on mobile) — */
.mobile-bottom-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-content: unset;
  align-items: center;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 70px;
  height: auto;
  background: rgba(3, 5, 15, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border);
  z-index: 1003;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 12px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

/* When JS adds a 5th item (Account/Dashboard), switch to 5-col */
.mobile-bottom-nav:has(:nth-child(5)) {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mobile-bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 500;
  transition: color 0.3s ease, transform 0.1s ease;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 8px 2px;
  border-radius: 8px;
  position: relative;
  z-index: 1001;
  justify-self: center;
  text-align: center;
}

.mobile-bottom-nav .nav-item:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.05);
}

.mobile-bottom-nav .nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease, fill 0.3s ease;
  pointer-events: none;
  flex-shrink: 0;
}

.mobile-bottom-nav .nav-item span {
  display: block;
  max-width: 100%;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:hover {
  color: var(--cyan);
}

.mobile-bottom-nav .nav-item.active svg {
  transform: translateY(-2px);
  fill: rgba(0, 229, 255, 0.15);
}

/* — Body padding for mobile nav — */
body {
  padding-bottom: calc(82px + env(safe-area-inset-bottom, 10px));
  padding-left: max(12px, env(safe-area-inset-left, 0));
  padding-right: max(12px, env(safe-area-inset-right, 0));
}

/* — Hero Mobile — */
.hero {
  min-height: 100dvh;
  padding: 120px 0 104px;
}

.hero h1 {
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  line-height: 1.08;
}

.hero-sub {
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 28px;
}

.hero-btns {
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.hero-btns .btn {
  width: 100%;
  justify-content: center;
  min-height: 48px;
}

.hero-shapes .shape {
  opacity: 0.22;
}
.hero-shapes .shape:nth-child(1) { width: 40px; height: 40px; }
.hero-shapes .shape:nth-child(2) { width: 60px; height: 60px; }
.hero-shapes .shape:nth-child(3) { width: 30px; height: 30px; }
.hero-shapes .shape:nth-child(4) { width: 45px; height: 45px; }

/* — Social Proof — */
.social-proof {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 24px;
}

.proof-item {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.proof-item .number {
  font-size: 1.15rem;
}

.proof-item .label {
  font-size: 0.72rem;
}

/* — Grids — */
.services-grid,
.steps-row,
.testimonials-grid,
.portfolio-grid,
.stats-grid,
.why-us-grid,
.footer-grid,
.pricing-row,
.contact-grid,
.service-detail-grid,
.blog-grid {
  grid-template-columns: 1fr;
}

.stats-grid {
  gap: 16px;
}

.stat-number {
  font-size: clamp(2.4rem, 10vw, 3.5rem);
}

/* — Glass Card — */
.glass-card {
  padding: 20px 16px;
}

/* — Step Number — */
.step-number {
  font-size: 2.8rem;
}

/* — Footer — */
.footer-grid {
  gap: 28px;
}

.footer-brand p {
  max-width: 100%;
}

/* — CTA — */
.cta-card {
  padding: 30px 18px;
}

.cta-btns {
  flex-direction: column;
  gap: 14px;
}

.cta-btns .btn {
  width: 100%;
  justify-content: center;
  min-height: 48px;
}

/* — Contact — */
.form-row {
  grid-template-columns: 1fr;
}

/* — Page Hero — */
.page-hero {
  padding: 104px 0 44px;
}

/* — Service Detail — */
.service-detail {
  padding: 42px 0;
}

.service-detail-header {
  flex-direction: column;
}

/* — Cursor only on devices with hover/mouse — */
@media (hover: hover) and (pointer: fine) {
  .cursor-dot { display: block; }
}

/* — Cursor hidden on touch devices — */
@media (hover: none) {
  .cursor-dot { display: none; }
  body { cursor: auto; }
}

.btn { cursor: pointer; touch-action: manipulation; }
.faq-question { cursor: pointer; }
.filter-btn { cursor: pointer; touch-action: manipulation; }
a { cursor: pointer; touch-action: manipulation; }
.nav-item { cursor: pointer; touch-action: manipulation; }

/* — Fix iOS zoom on input focus — */
@supports (-webkit-touch-callout: none) {
  /* iOS-specific: prevent zoom on input focus */
  input[type='text'],
  input[type='email'],
  input[type='number'],
  input[type='tel'],
  textarea {
    font-size: 16px;
  }
}

/* Standard: ensure inputs are readable size */
.form-group input,
.form-group select,
.form-group textarea {
  font-size: 1rem;
}

/* — Mobile bottom nav safe positioning — */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  height: auto;
  min-height: 70px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.contact-form,
.auth-card form {
  padding-bottom: 20px;
}

/* — Filter — */
.filter-tabs {
  gap: 8px;
}

.filter-btn {
  font-size: 0.78rem;
  padding: 8px 16px;
}

/* — Pricing — */
.pricing-row {
  max-width: 100%;
}

.pricing-card {
  padding: 26px 18px;
}

.pricing-card .price-val {
  font-size: 1.5rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.service-card p,
.testimonial-card p,
.detail-block ul li,
.pricing-card ul li,
.contact-info-card p,
.section-desc {
  font-size: 0.9rem;
}

.faq-question,
.faq-answer-inner {
  padding-left: 16px;
  padding-right: 16px;
}

.trusted-by {
  padding: 32px 0;
}

.trusted-logos {
  gap: 14px;
}

.logo-item {
  font-size: 0.78rem;
  letter-spacing: 1px;
}

/* — h tags — */
h1 {
  font-size: clamp(1.6rem, 7vw, 2.2rem);
}

h2 {
  font-size: clamp(1.4rem, 5vw, 1.8rem);
}

/* — Global mobile text safety — */
p, li {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* ===================================================
   ULTRA-SMALL SCREENS (≤ 320px)
   =================================================== */
@media (max-width: 320px) {
  .container {
    padding: 0 12px;
  }

  .hero h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .hero-sub {
    font-size: 0.88rem;
  }

  .btn {
    font-size: 0.85rem;
    padding: 10px 20px;
  }

  .nav-logo .logo-main {
    font-size: 1.1rem;
  }

  .glass-card {
    padding: 16px 12px;
  }

  .pricing-card .price-val {
    font-size: 1.3rem;
  }

  .social-proof {
    grid-template-columns: 1fr;
  }

  .proof-item .number {
    font-size: 1rem;
  }

  .mobile-bottom-nav .nav-item {
    font-size: 0.58rem;
  }

  .mobile-bottom-nav .nav-item svg {
    width: 18px;
    height: 18px;
  }
}


/* ===================================================
   TABLET (≥ 481px)
   =================================================== */
@media (min-width: 481px) {
  :root {
    --section-pad: 64px 0;
  }

  .container {
    padding: 0 24px;
  }

  /* Remove body bottom padding on tablet */
  body {
    /* Keep bottom spacing because mobile bottom nav remains visible until 769px */
    padding-bottom: calc(82px + env(safe-area-inset-bottom, 10px));
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  .nav-logo .logo-main {
    font-size: 1.45rem;
  }

  .nav-logo .logo-sub {
    font-size: 0.62rem;
    letter-spacing: 2.4px;
  }

  h1 {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
  }

  h2 {
    font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  }

  .glass-card {
    padding: 32px;
  }

  .step-number {
    font-size: 3.2rem;
  }

  .social-proof {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 24px;
  }

  .proof-item {
    flex-direction: column;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .hero {
    padding: 140px 0 80px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
  }

  .hero-sub {
    font-size: 1rem;
  }

  .hero-btns {
    margin-bottom: 40px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .page-hero {
    padding: 120px 0 60px;
  }

  .service-detail {
    padding: 60px 0;
  }

  .cta-card {
    padding: 40px 24px;
  }

  .hero-shapes .shape {
    opacity: 0.7;
  }
}


/* ===================================================
   TABLET LANDSCAPE (≥ 769px)
   =================================================== */
@media (min-width: 769px) {
  :root {
    --section-pad: 80px 0;
  }

  .navbar .container {
    position: static;
    z-index: auto;
    gap: 0;
  }

  /* Hide mobile bottom nav on larger screens */
  .mobile-bottom-nav {
    display: none;
  }

  /* Remove mobile bottom padding on desktop */
  body {
    padding-bottom: 0;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  /* Show desktop nav, hide hamburger */
  .hamburger {
    display: none;
  }

  .nav-cta {
    display: inline-flex;
  }

  .nav-links {
    position: static;
    inset: auto;
    left: auto;
    width: auto;
    height: auto;
    min-height: auto;
    max-height: none;
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 36px;
    overflow: visible;
    transform: none;
    opacity: 1;
    visibility: visible;
    transition: none;
    z-index: auto;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: auto;
  }

  .nav-links li {
    margin: 0;
    width: auto;
    max-width: none;
    align-self: auto;
    flex: 0 0 auto;
  }

  .nav-links a {
    display: inline;
    font-size: 0.92rem;
    padding: 0;
    padding-bottom: 4px;
    border-radius: 0;
    text-align: left;
    white-space: nowrap;
    background: transparent;
    box-shadow: none;
    word-break: normal;
    overflow-wrap: normal;
    color: var(--text);
  }

  .nav-links a:hover {
    background: transparent;
    color: var(--heading);
  }

  .nav-links a.active {
    background: transparent;
    color: var(--cyan);
  }

  .nav-overlay {
    display: none !important;
  }

  /* Two-column grids */
  .services-grid,
  .testimonials-grid,
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  .service-detail-grid,
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .why-us-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .pricing-row {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
  }

  .hero {
    min-height: auto;
    padding: 140px 0 80px;
  }

  .hero-btns {
    flex-direction: row;
  }

  .hero-btns .btn {
    width: auto;
  }

  .cta-btns {
    flex-direction: row;
  }

  .cta-btns .btn {
    width: auto;
  }

  .cta-card {
    padding: 48px 32px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  .service-detail-header {
    flex-direction: row;
  }

  /* Restore cursor on desktop */
  .cursor-dot { display: block; }

  .hero-shapes .shape {
    opacity: 1;
  }
  .hero-shapes .shape:nth-child(1) { width: 80px; height: 80px; }
  .hero-shapes .shape:nth-child(2) { width: 120px; height: 120px; }
  .hero-shapes .shape:nth-child(3) { width: 50px; height: 50px; }
  .hero-shapes .shape:nth-child(4) { width: 90px; height: 90px; }
}


/* ===================================================
   DESKTOP (≥ 1025px)
   =================================================== */
@media (min-width: 1025px) {
  :root {
    --section-pad: 120px 0;
  }

  h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
  }

  h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
  }

  /* Three-column grids */
  .services-grid,
  .testimonials-grid,
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
  }

  .why-us-grid {
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pricing-row {
    grid-template-columns: repeat(3, 1fr);
    max-width: none;
  }

  .contact-grid {
    grid-template-columns: 1.2fr 0.8fr;
  }

  .hero {
    min-height: 100vh;
    padding-top: 100px;
  }

  .cta-card {
    padding: 64px;
  }
}


/* ===================================================
   PREFERS REDUCED MOTION
   =================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .fade-up {
    opacity: 1;
    transform: none;
  }

  .hero h1 .word {
    opacity: 1;
    transform: none;
  }
}
