/* ==========================================================================
   ETECHEDGE SOLUTIONS - CENTRALIZED RESPONSIVE STYLESHEET (media.css)
   Clean, modern responsive rules across all screen sizes and devices.
   Desktop base styling remains in style.css; overrides live here.
   ========================================================================== */

/* ==========================================================================
   1. GLOBAL RESPONSIVE FIXES & UTILITIES
   ========================================================================== */
img, svg, video, canvas, audio, iframe {
  max-width: 100%;
  height: auto;
}

/* Ensure no element inadvertently overflows viewport */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Base responsive typography safety */
@media (max-width: 991px) {
  .section {
    padding: 65px 0;
  }
  .section-title {
    margin-bottom: 36px;
  }
  .section-title h2 {
    font-size: 2rem;
  }
  .section-title p {
    font-size: 0.98rem;
  }
}

@media (max-width: 767px) {
  .section {
    padding: 50px 0;
  }
  .section-title {
    margin-bottom: 30px;
  }
  .section-title h2 {
    font-size: 1.65rem;
    line-height: 1.25;
  }
  .section-title p {
    font-size: 0.92rem;
  }
  .section-label {
    font-size: 11.5px;
    letter-spacing: 1.8px;
    margin-bottom: 10px;
  }
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 400px) {
  .section {
    padding: 42px 0;
  }
  .section-title h2 {
    font-size: 1.45rem;
  }
}

/* ==========================================================================
   2. HEADER & NAVIGATION (MOBILE / TABLET DRAWER)
   ========================================================================== */
@media (max-width: 991.98px) {
  .navbar {
    height: 74px !important;
    padding-top: 10px;
    padding-bottom: 10px;
    background: rgba(7, 12, 24, 0.95) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-glass);
  }

  .navbar-brand .img-logo {
    max-height: 40px;
    width: auto;
  }

  .navbar-toggler {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-white);
    padding: 7px 11px;
    font-size: 22px;
    border-radius: var(--radius-sm);
    outline: none !important;
    cursor: pointer;
  }

  .navbar-toggler:focus {
    box-shadow: 0 0 0 2px var(--primary-blue);
  }

  .navbar-collapse {
    background: #0b1325;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 12px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.55);
    max-height: 80vh;
    overflow-y: auto;
  }

  .navbar-nav {
    gap: 2px;
  }

  .nav-link {
    padding: 11px 14px !important;
    font-size: 15px;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  }

  .nav-link:hover,
  .nav-link:focus {
    background: rgba(8, 104, 247, 0.12);
  }

  .nav-link.active::after {
    bottom: 6px;
    left: 14px;
    right: 14px;
  }

  .navbar .btn-primary-custom {
    margin-top: 14px;
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .nav-mobile-cta {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border-glass);
  }
  .nav-mobile-cta .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .theme-switch-wrapper {
    margin-left: 0;
    padding: 2px 4px;
  }
  .theme-btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  .theme-btn span {
    font-size: 11px;
  }
}

/* mVerve theme adjustments for mobile navbar */
@media (max-width: 991.98px) {
  [data-theme="mverve"] .navbar {
    background: rgba(252, 251, 249, 0.96) !important;
    border-bottom-color: var(--border-glass) !important;
  }

  [data-theme="mverve"] .navbar-collapse {
    background: #f7f4ed !important;
    border: 1px solid var(--border-glass) !important;
    box-shadow: 0 8px 24px rgba(23, 19, 29, 0.06) !important;
  }

  [data-theme="mverve"] .nav-link {
    border-bottom-color: #ede8dc !important;
    color: #241e2c !important;
  }

  [data-theme="mverve"] .nav-link:hover,
  [data-theme="mverve"] .nav-link:focus {
    background: rgba(3, 74, 208, 0.08) !important;
    color: var(--accent-primary, #034ad0) !important;
  }

  [data-theme="mverve"] .nav-mobile-cta {
    border-top-color: #ede8dc !important;
  }
}

@media (max-width: 575px) {
  .navbar {
    height: 68px !important;
  }

  .navbar-brand .img-logo {
    max-height: 34px;
  }

  .navbar-collapse {
    padding: 16px 14px;
    margin-top: 10px;
  }

  .nav-link {
    padding: 9px 12px !important;
    font-size: 14.5px;
  }

  .theme-btn {
    padding: 3px 6px;
    font-size: 10.5px;
  }
}

/* ==========================================================================
   3. HERO SECTIONS (HOME HERO & INNER PAGES HERO)
   ========================================================================== */
/* Home Hero Responsive Adjustments */
@media (max-width: 991px) {
  .home-hero {
    min-height: auto;
    padding: 115px 0 60px;
    text-align: center;
  }

  .hero-badge {
    margin: 0 auto 20px auto;
  }

  .hero-title {
    font-size: 2.35rem;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem;
    max-width: 90%;
  }

  .hero-actions {
    justify-content: center;
    margin-bottom: 35px;
  }

  .consult-card {
    max-width: 560px;
    margin: 0 auto;
    text-align: left;
  }

  .hero-controls {
    justify-content: center;
    margin-top: 24px;
  }
}

@media (max-width: 767px) {
  .home-hero {
    padding: 100px 0 50px;
  }

  .hero-title {
    font-size: 1.95rem;
    line-height: 1.2;
    margin-bottom: 16px;
  }

  .hero-description {
    font-size: 0.94rem;
    line-height: 1.6;
    margin-bottom: 24px;
  }

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

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

  .consult-card {
    padding: 24px 20px;
    border-radius: var(--radius-md);
  }

  .consult-card h3 {
    font-size: 1.25rem;
  }

  .consult-card p {
    font-size: 13px;
    margin-bottom: 18px;
  }
}

@media (max-width: 400px) {
  .home-hero {
    padding: 92px 0 42px;
  }

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

  .hero-badge {
    font-size: 12px;
    padding: 6px 14px;
  }
}

/* Inner Page Hero (About, Services, Products, Tech, Careers, Blog, Contact, Case Studies) */
.inner-hero {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

@media (max-width: 991px) {
  .inner-hero {
    padding: 120px 0 55px;
    text-align: center;
  }

  .breadcrumb-custom {
    justify-content: center;
  }

  .inner-hero h1 {
    font-size: 2.2rem;
    margin-left: auto;
    margin-right: auto;
  }

  .inner-hero p {
    font-size: 1rem;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 767px) {
  .inner-hero {
    padding: 105px 0 45px;
    min-height: 240px;
    background-position: center center;
    background-size: cover;
  }

  .inner-hero h1 {
    font-size: 1.8rem;
    line-height: 1.22;
  }

  .inner-hero p {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .breadcrumb-custom {
    font-size: 12px;
    margin-bottom: 12px;
  }
}

@media (max-width: 400px) {
  .inner-hero {
    padding: 96px 0 38px;
  }

  .inner-hero h1 {
    font-size: 1.55rem;
  }
}

/* Services Immersive Hero Responsive */
@media (max-width: 991px) {
  .services-immersive-hero {
    padding: 110px 0 45px;
    text-align: center;
  }
  .services-hero-content {
    margin-bottom: 25px;
  }
  .services-hero-subtext {
    margin-left: auto;
    margin-right: auto;
  }
  .services-hero-actions {
    justify-content: center;
  }
  .services-hero-pillars-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    padding: 20px 24px;
    margin-top: 35px;
  }
}

@media (max-width: 767px) {
  .services-immersive-hero {
    padding: 95px 0 35px;
  }
  .services-hero-heading {
    font-size: 2.1rem;
    line-height: 1.18;
  }
  .services-hero-subtext {
    font-size: 1rem;
  }
  .services-hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 12px;
  }
  .services-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .services-hero-pillars-bar {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px 20px;
    margin-top: 25px;
    border-radius: 18px;
    text-align: left;
  }
  .pillar-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    width: 100%;
  }
  .pillar-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 19px;
  }
  .pillar-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .pillar-text strong {
    font-size: 14px;
    text-align: left;
  }
  .pillar-text span {
    font-size: 12px;
    text-align: left;
  }
}

/* Trust / Value Strip */
@media (max-width: 767px) {
  .trust-strip {
    padding: 16px 0;
  }
  .trust-item {
    font-size: 13px;
    gap: 8px;
  }
  .trust-item i {
    font-size: 19px;
  }
}

@media (max-width: 575px) {
  .trust-strip .row > div {
    margin-bottom: 8px;
  }
  .trust-strip .row > div:nth-last-child(-n+2) {
    margin-bottom: 0;
  }
}

/* ==========================================================================
   4. SERVICES & SERVICES CAROUSEL
   ========================================================================== */
@media (max-width: 991px) {
  .services-carousel-track .service-card {
    flex: 0 0 calc((100% - 20px) / 2);
  }
  .testimonials-carousel-track .testimonial-slide {
    flex: 0 0 calc((100% - 20px) / 2);
  }
}

@media (max-width: 767px) {
  .services-carousel-viewport {
    padding: 18px 6px 20px;
    margin-top: 10px;
  }
  .testimonials-carousel-viewport {
    padding: 8px 4px 18px;
  }
  .services-carousel-track,
  .testimonials-carousel-track {
    gap: 14px;
  }
  .services-carousel-track .service-card,
  .testimonials-carousel-track .testimonial-slide {
    flex: 0 0 100%;
    min-height: 280px;
  }
  .testimonials-carousel-track .testimonial-card-modern {
    padding: 24px 20px;
  }
  .carousel-arrows {
    margin-top: 14px;
  }
  .carousel-arrows button {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

/* Service Detail Cards (Services.html) */
@media (max-width: 991px) {
  .service-detail-card {
    padding: 30px 24px;
  }
}

@media (max-width: 767px) {
  .service-detail-card {
    padding: 24px 18px;
    margin-bottom: 22px;
  }
  .service-detail-card h3 {
    font-size: 1.3rem;
  }
  .service-detail-card .caps-list li {
    font-size: 13.5px;
    gap: 8px;
  }
}

/* ==========================================================================
   5. SPECIALIZED PRODUCTS SECTION & HORIZONTAL TABS
   ========================================================================== */
.product-nav-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(8, 104, 247, 0.4) transparent;
  padding: 8px 4px 16px;
  margin-bottom: 28px;
  max-width: 100%;
}

@media (min-width: 1200px) {
  .product-nav-tabs {
    justify-content: center;
  }
}

@media (max-width: 1199px) {
  .product-nav-tabs {
    justify-content: flex-start;
  }
}

@media (max-width: 991px) {
  .product-nav-tabs {
    gap: 4px;
    padding-bottom: 14px;
    margin-bottom: 20px;
    overflow: hidden;
  }
  .product-tab-btn {
    padding: 7px 4px;
    font-size: 11px;
  }
}

@media (max-width: 767px) {
  .product-nav-tabs {
    gap: 8px;
    padding: 4px 6px 14px;
    margin-bottom: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
    justify-content: flex-start;
  }
  .product-nav-tabs::-webkit-scrollbar {
    display: none;
  }
  .product-tab-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 12px;
    border-radius: var(--radius-full);
  }
  .product-tab-btn i {
    font-size: 13px;
    margin-right: 5px !important;
  }
  .product-pane {
    display: none;
  }
  .product-pane.active {
    display: block;
    animation: tabFadeMobile 0.4s ease-out forwards;
  }
  @keyframes tabFadeMobile {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .product-showcase-card {
    padding: 26px 20px;
    border-radius: var(--radius-md);
  }
  .product-showcase-card h2,
  .product-showcase-card h3 {
    font-size: 1.45rem;
  }
  .product-showcase-card .lead {
    font-size: 0.98rem !important;
  }
  .product-features-list {
    margin: 16px 0 22px;
  }
  .product-features-list li {
    font-size: 13.5px;
    gap: 10px;
  }
  .product-visual-preview {
    padding: 20px 16px;
    margin-top: 10px;
  }
}

@media (max-width: 575px) {
  .product-showcase-card .d-flex.gap-3 {
    flex-direction: column;
    gap: 10px !important;
  }
  .product-showcase-card .d-flex.gap-3 .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ==========================================================================
   6. TECHNOLOGY SECTION & FILTER BAR
   ========================================================================== */
@media (max-width: 991px) {
  .tech-grid {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: 14px;
  }
  .tech-filter-bar {
    gap: 8px;
    margin-bottom: 28px;
  }
  .tech-filter-btn {
    font-size: 12.5px;
    padding: 7px 15px;
  }
}

@media (max-width: 767px) {
  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .tech-item {
    padding: 16px 10px;
    gap: 8px;
  }
  .tech-item i {
    font-size: 28px;
  }
  .tech-item span {
    font-size: 12px;
  }
  .tech-item small {
    font-size: 10px;
    line-height: 1.25;
  }
}

@media (max-width: 480px) {
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tech-filter-bar {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .tech-filter-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ==========================================================================
   7. CASE STUDIES, BLOGS & CAREERS CARDS
   ========================================================================== */
/* Case Studies */
@media (max-width: 767px) {
  .case-card-modern {
    padding: 24px 18px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
  }
  .case-card-modern h3 {
    font-size: 1.35rem;
  }
  .case-metric-badge {
    padding: 10px 14px;
  }
  .case-metric-badge strong {
    font-size: 20px;
  }
  .case-metric-badge span {
    font-size: 10px;
  }
}

/* Blog Cards */
@media (max-width: 767px) {
  .blog-card-img {
    height: 140px;
    font-size: 32px;
  }
  .blog-card-body {
    padding: 18px 16px;
  }
  .blog-card-body h4 {
    font-size: 1.15rem;
  }
  .blog-card-body p {
    font-size: 13.5px;
  }
}

/* Careers Cards */
@media (max-width: 767px) {
  .career-card {
    padding: 22px 18px;
  }
  .career-card h4 {
    font-size: 1.2rem;
  }
  .career-card p {
    font-size: 13.5px;
  }
}

/* ==========================================================================
   8. FORMS & INPUTS (CONTACT & QUICK CONSULTATION)
   ========================================================================== */
input, select, textarea {
  max-width: 100%;
}

@media (max-width: 767px) {
  .contact-info-card {
    padding: 24px 20px;
    border-radius: var(--radius-md);
  }
  .contact-item-box {
    gap: 12px;
    margin-bottom: 18px;
  }
  .contact-item-box .icon {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .contact-item-box a,
  .contact-item-box span {
    font-size: 14px !important;
    word-break: break-word;
  }
  .consult-card {
    padding: 24px 18px;
  }
  .form-control,
  .form-select {
    font-size: 14px;
    padding: 10px 14px;
  }
}

/* ==========================================================================
   9. CTA & FOOTER
   ========================================================================== */
/* CTA Section */
@media (max-width: 767px) {
  .cta-sec {
    padding: 55px 0;
  }
  .cta-box h2 {
    font-size: 1.75rem;
    line-height: 1.25;
    margin-bottom: 14px;
  }
  .cta-box p {
    font-size: 0.95rem;
    margin-bottom: 24px;
  }
  .cta-box .btn-div {
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  .cta-box .btn-div .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Footer Section */
@media (max-width: 991px) {
  footer {
    padding: 60px 0 30px;
  }
  footer .row > div {
    margin-bottom: 30px;
  }
  footer .row > div:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 767px) {
  footer {
    padding: 45px 0 25px;
  }
  footer h4 {
    font-size: 1rem;
    margin-bottom: 16px;
  }
  footer a {
    font-size: 13.5px;
    margin-bottom: 9px;
  }
  .footer-contact-item {
    font-size: 13.5px;
    margin-bottom: 10px;
  }
  .footer-bottom {
    margin-top: 32px;
    padding-top: 20px;
    flex-direction: column;
    text-align: center;
    gap: 10px;
    font-size: 12px;
  }
}

/* ==========================================================================
   10. FLOATING ACTION BUTTONS (WHATSAPP & BACK TO TOP & THEME TOGGLE)
   ========================================================================== */
@media (max-width: 767px) {
  .floating-actions {
    bottom: 20px;
    right: 18px;
    gap: 10px;
  }
  .theme-single-toggle-btn {
    width: 38px;
    height: 38px;
    min-width: 38px;
  }
  .theme-single-toggle-btn .theme-icon-wrap {
    font-size: 15px;
  }
  .whatsapp-float {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }
  .back-top-btn {
    width: 42px;
    height: 42px;
    font-size: 17px;
  }
}

@media (max-width: 400px) {
  .floating-actions {
    bottom: 16px;
    right: 14px;
    gap: 8px;
  }
  .theme-single-toggle-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }
  .theme-single-toggle-btn .theme-icon-wrap {
    font-size: 14px;
  }
  .whatsapp-float {
    width: 44px;
    height: 44px;
    font-size: 22px;
  }
  .back-top-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }
}

/* ==========================================================================
   11. ACCESSIBILITY & MOTION PREFERENCES
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
