/* ============================================================
   BRAND 2 MEDIA — COMPREHENSIVE RESPONSIVE STYLES
   Validated for: 320px, 375px, 390px, 414px, 480px, 768px, 834px, 1024px, 1280px, 1440px, 1920px
   ============================================================ */

/* ------------------------------------------------------------
   GLOBAL RESET & OVERFLOW DEFENSE
   ------------------------------------------------------------ */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  position: relative;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* Prevent image / media blowouts */
img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Fluid Typography */
h1, .hero-title, .page-hero-title {
  font-size: clamp(2rem, 5.5vw, 4.4rem);
  line-height: 1.12;
  word-break: break-word;
  overflow-wrap: break-word;
}

h2, .section-title {
  font-size: clamp(1.75rem, 3.8vw, 3rem);
  line-height: 1.18;
  word-break: break-word;
  overflow-wrap: break-word;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
  word-break: break-word;
}

h4 {
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  word-break: break-word;
}

.hero-desc, .page-hero-sub {
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  line-height: 1.65;
}

.section-sub {
  font-size: clamp(0.92rem, 1.5vw, 1.1rem);
  line-height: 1.65;
}

/* Touch Targets: Accessible 44px minimum for primary action controls */
.btn-primary-custom, .btn-outline-custom, .filter-btn, .nav-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-social a, .footer-social, .team-social-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* iOS Safari Zoom Prevention on Inputs */
input, select, textarea {
  font-size: 16px !important;
}

/* Grid item overflow defense */
.features-grid > *,
.services-grid > *,
.portfolio-grid > *,
.process-grid > *,
.pricing-grid > *,
.team-grid > *,
.news-grid > * {
  min-width: 0;
  max-width: 100%;
}

/* ------------------------------------------------------------
   LOGO & BRANDING RESPONSIVENESS
   ------------------------------------------------------------ */
.navbar-logo-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 100%;
}

.brand-logo-img {
  height: 44px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.footer-logo-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  margin-bottom: 18px;
}

.footer-logo-img {
  height: 48px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  display: block;
}

.loader-brand-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  margin-bottom: 8px;
  max-width: 85vw;
}

.loader-logo-img {
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

/* ------------------------------------------------------------
   MOBILE NAVIGATION DRAWER & TOGGLER ANIMATION
   ------------------------------------------------------------ */
.navbar-toggler {
  padding: 8px 10px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.navbar-toggler-icon {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.navbar-toggler-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  transform-origin: center;
}

.navbar-toggler:not(.collapsed) .navbar-toggler-icon span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.navbar-toggler:not(.collapsed) .navbar-toggler-icon span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar-toggler:not(.collapsed) .navbar-toggler-icon span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ------------------------------------------------------------
   LARGE DESKTOP (1440px – 1920px+)
   ------------------------------------------------------------ */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
  .hero-content {
    padding: 170px 0 120px;
  }
  .section-pad {
    padding: 120px 0;
  }
}

/* ------------------------------------------------------------
   DESKTOP / LAPTOP (1024px – 1399px)
   ------------------------------------------------------------ */
@media (min-width: 1024px) and (max-width: 1399.98px) {
  .hero-stats {
    gap: 20px;
  }
  .hero-stat-num {
    font-size: 2.2rem;
  }
  .hero-float-card-1 {
    right: 0 !important;
  }
  .hero-float-card-2 {
    left: 0 !important;
  }
}

/* ------------------------------------------------------------
   TABLET (768px – 1023px)
   ------------------------------------------------------------ */
@media (max-width: 1023.98px) {
  #topbar {
    font-size: 0.82rem;
  }

  .section-pad {
    padding: 75px 0;
  }

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

  .hero-content {
    padding: 120px 0 70px;
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 36px;
  }

  .features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .process-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
    gap: 24px;
  }

  .pricing-card.featured {
    transform: none !important;
  }

  .team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Tablet Drawer Menu */
  .navbar-collapse {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-top: 14px;
    box-shadow: var(--shadow-lg);
    max-height: 80vh;
    overflow-y: auto;
  }

  .navbar-nav .nav-link {
    padding: 10px 16px !important;
    font-size: 1rem;
    border-radius: 8px;
  }

  .navbar-nav .nav-link:hover,
  .navbar-nav .nav-link.active,
  .navbar-nav .nav-link.active-route {
    background: var(--accent-light);
  }

  .about-small-img {
    display: none;
  }

  .about-exp-badge {
    bottom: -16px;
    right: 0;
  }
}

/* ------------------------------------------------------------
   MOBILE LANDSCAPE / LARGE PHONES (480px – 767px)
   ------------------------------------------------------------ */
@media (max-width: 767.98px) {
  .section-pad {
    padding: 55px 0;
  }

  .page-hero {
    padding: 110px 0 50px;
  }

  .hero-content {
    padding: 100px 0 50px;
  }

  .hero-float-card {
    display: none !important;
  }

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

  .feature-item {
    padding: 24px 20px;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }

  .feature-item:last-child {
    border-bottom: none;
  }

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

  .service-card {
    padding: 26px 22px;
  }

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

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

  .team-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }

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

  .portfolio-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 auto 30px;
    text-align: center;
  }

  .filter-btn {
    padding: 8px 14px;
    font-size: 0.84rem;
  }

  .contact-info-card,
  .contact-form-card {
    padding: 22px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .about-exp-badge {
    bottom: 12px;
    right: 12px;
    padding: 14px 18px;
  }

  .about-exp-num {
    font-size: 2rem;
  }

  .about-exp-label {
    font-size: 0.76rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
}

/* ------------------------------------------------------------
   STANDARD MOBILE (375px – 479px)
   ------------------------------------------------------------ */
@media (max-width: 479.98px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-logo-img {
    height: 32px;
    max-width: 135px;
  }

  .navbar-logo-badge {
    padding: 4px 8px;
    border-radius: 8px;
  }

  .footer-logo-img {
    height: 38px;
    max-width: 150px;
  }

  .loader-logo-img {
    height: 48px;
  }

  .hero-content {
    padding: 95px 0 45px;
  }

  .hero-badge {
    font-size: 0.70rem;
    padding: 5px 10px;
    letter-spacing: 0.08em;
  }

  .btn-primary-custom,
  .btn-outline-custom {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .hero-stat-num {
    font-size: 1.8rem;
  }

  .hero-stat-label {
    font-size: 0.72rem;
  }

  .pricing-amount {
    font-size: 2.6rem;
  }

  .modal-dialog {
    margin: 10px;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* ------------------------------------------------------------
   SMALL MOBILE (320px – 374px)
   ------------------------------------------------------------ */
@media (max-width: 374.98px) {
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .brand-logo-img {
    height: 28px;
    max-width: 115px;
  }

  .navbar-logo-badge {
    padding: 3px 6px;
    border-radius: 6px;
  }

  .footer-logo-img {
    height: 34px;
    max-width: 130px;
  }

  .theme-icon {
    font-size: 0.95rem;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .page-hero-title {
    font-size: 1.75rem;
  }

  .service-card,
  .process-card,
  .pricing-card {
    padding: 20px 14px;
    border-radius: 14px;
  }

  .counter-num {
    font-size: 1.8rem;
  }

  .counter-item {
    padding: 16px 8px;
  }

  .counter-label {
    font-size: 0.75rem;
  }

  .about-exp-badge {
    padding: 10px 14px;
  }

  .about-exp-num {
    font-size: 1.6rem;
  }

  .contact-info-card,
  .contact-form-card {
    padding: 16px;
  }

  .pricing-card {
    padding: 24px 16px;
  }

  .pricing-plan {
    font-size: 1.15rem;
  }

  .pricing-amount {
    font-size: 2.2rem;
  }

  .pricing-features li {
    font-size: 0.84rem;
  }
}

/* ------------------------------------------------------------
   ACCESSIBILITY: PREFERS REDUCED MOTION
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
