/* ====== RESPONSIVE  ====== */

/* Prevent horizontal scroll */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  position: relative;
}

/* Flexible images and media */
img,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* ====== LARGE DESKTOP (1440px+) ====== */
@media (min-width: 1440px) {
  .hero h1 {
    font-size: 4.5rem;
  }

  .section-title h2 {
    font-size: 3.5rem;
  }
}

/* ====== DESKTOP (1200px - 1439px) ====== */
@media (max-width: 1439px) {
  .hero h1 {
    font-size: 3.5rem;
  }

  .domain-prices {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}

/* ====== TABLET LANDSCAPE (1024px - 1199px) ====== */
@media (max-width: 1199px) {
  /* Header adjustments */
  header {
    padding: 0 3%;
  }

  header.scrolled {
    padding: 0 3%;
  }

  nav {
    gap: 2rem;
  }

  /* Hero section */
  .hero {
    padding: 7rem 3% 3rem;
  }

  .hero h1 {
    font-size: 3.2rem;
  }

  .hero p {
    font-size: 1.2rem;
  }

  /* Sections */
  .domain-search,
  .pricing,
  .features,
  .why-choose,
  .data-centers,
  .testimonials,
  .technology,
  .faq,
  .blog,
  .domain-features,
  .hosting-types,
  .services-overview {
    padding: 5rem 3%;
  }

  /* Grid adjustments */
  .pricing-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-content {
    gap: 3rem;
  }

  /* Stats */
  .stat-number {
    font-size: 3.5rem;
  }

  /* CTA */
  .cta h2 {
    font-size: 3rem;
  }
}

/* ====== TABLET PORTRAIT (768px - 1023px) ====== */
@media (max-width: 1023px) {
  /* Logo size reduction */
  .logo-img {
    height: 36px;
  }

  /* Hero adjustments */
  .hero {
    min-height: 85vh;
    padding: 6rem 3% 3rem;
  }

  .hero h1 {
    font-size: 2.8rem;
    line-height: 1.2;
  }

  .hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
  }

  .hero-buttons {
    gap: 1rem;
  }

  .btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
  }

  /* Badge adjustment */
  .badge {
    font-size: 0.85rem;
    padding: 0.4rem 1.2rem;
    transform: translateY(-60px);
  }

  .hero .badge {
    transform: translateY(-50px);
  }

  /* Search container */
  .search-container {
    padding: 2rem;
  }

  .search-box {
    flex-direction: column;
  }

  .search-input {
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  /* Domain prices */
  .domain-prices {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .domain-price {
    padding: 1rem;
  }

  /* Pricing cards */
  .pricing-cards {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .pricing-card {
    padding: 2rem;
  }

  /* Features grid */
  .features-grid,
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  /* Why choose us */
  .why-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .why-text h2 {
    font-size: 2rem;
  }

  .why-illustration {
    height: 300px;
  }

  /* Technology grid */
  .tech-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Blog grid */
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Section titles */
  .section-title h2 {
    font-size: 2.5rem;
  }

  .section-title p {
    font-size: 1.1rem;
  }

  /* CTA section */
  .cta {
    padding: 6rem 3%;
  }

  .cta h2 {
    font-size: 2.5rem;
  }

  .cta p {
    font-size: 1.1rem;
  }

  /* Hosting grid */
  .hosting-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .hosting-card.featured {
    transform: scale(1);
  }

  /* Detail content */
  .detail-content,
  .migration-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .detail-pricing,
  .migration-features {
    position: static;
  }

  /* Comparison table */
  .comparison-table {
    font-size: 0.9rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 1rem;
  }
}

/* ====== MOBILE LANDSCAPE & LARGE PHONES (568px - 767px) ====== */
@media (max-width: 767px) {
  /* Header */
  header {
    padding: 0 4%;
  }

  header.scrolled {
    padding: 0 4%;
  }

  .logo-img {
    height: 34px;
  }

  /* Hero section */
  .hero {
    min-height: 75vh;
    padding: 5rem 4% 2rem;
  }

  .hero h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
  }

  .hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn-large {
    width: 100%;
    padding: 1rem 1.5rem;
  }

  /* Badge */
  .badge {
    font-size: 0.8rem;
    padding: 0.4rem 1rem;
    transform: translateY(-40px);
  }

  .hero .badge {
    transform: translateY(-30px);
  }

  /* Globe canvas - reduce opacity on mobile */
  canvas {
    opacity: 0.2;
  }

  /* All sections */
  .domain-search,
  .pricing,
  .features,
  .why-choose,
  .data-centers,
  .stats,
  .testimonials,
  .technology,
  .faq,
  .blog,
  .cta,
  .domain-features,
  .hosting-types,
  .performance-features,
  .server-locations,
  .services-overview,
  .service-detail,
  .marketing-services,
  .managed-services,
  .migration-section,
  .support-section {
    padding: 4rem 4%;
  }

  /* Search container */
  .search-container {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .search-input {
    padding: 1rem;
    font-size: 1rem;
  }

  /* Domain prices */
  .domain-prices {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .domain-price .tld {
    font-size: 1rem;
  }

  .domain-price .price {
    font-size: 1.2rem;
  }

  /* Section titles */
  .section-title h2 {
    font-size: 2rem;
  }

  .section-title p {
    font-size: 1rem;
  }

  /* Pricing cards */
  .pricing-card {
    padding: 1.5rem;
  }

  .plan-name {
    font-size: 1.3rem;
  }

  .plan-price {
    font-size: 2.5rem;
  }

  /* Features grid */
  .features-grid,
  .feature-grid,
  .category-grid,
  .services-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .feature-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  /* Why choose list */
  .why-list li {
    padding: 1rem;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .stat-label {
    font-size: 1rem;
  }

  /* Testimonials */
  .testimonial-card {
    padding: 2rem;
  }

  .testimonial-content {
    font-size: 1rem;
  }

  /* Technology grid */
  .tech-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tech-item {
    padding: 1.5rem;
  }

  .tech-icon {
    font-size: 2.5rem;
  }

  /* FAQ */
  .faq-question {
    padding: 1rem;
    font-size: 1rem;
  }

  .faq-answer {
    font-size: 0.9rem;
  }

  /* Blog grid */
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-image {
    height: 180px;
  }

  .blog-content {
    padding: 1.5rem;
  }

  /* CTA */
  .cta h2 {
    font-size: 2rem;
  }

  .cta p {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  footer {
    padding: 3rem 4% 1.5rem;
  }

  /* Page hero */
  .page-hero {
    min-height: 45vh;
    padding-top: 8rem;
  }

  .page-hero h1 {
    font-size: 2.2rem;
  }

  /* Hosting grid */
  .hosting-grid,
  .managed-grid {
    grid-template-columns: 1fr;
  }

  /* Locations grid */
  .locations-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Support grid */
  .support-grid {
    grid-template-columns: 1fr;
  }

  /* Comparison table */
  .comparison-table th,
  .comparison-table td {
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  /* Migration steps */
  .migration-step {
    flex-direction: column;
    gap: 1rem;
  }

  .step-number {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

/* ====== SMALL MOBILE (480px - 567px) ====== */
@media (max-width: 567px) {
  /* Hero */
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  /* Reduce all spacing */
  .domain-search,
  .pricing,
  .features,
  .why-choose,
  .data-centers,
  .stats,
  .testimonials,
  .technology,
  .faq,
  .blog,
  .cta,
  .domain-features,
  .hosting-types,
  .services-overview {
    padding: 3rem 4%;
  }

  /* Domain prices */
  .domain-prices {
    grid-template-columns: 1fr;
  }

  /* Stats - single column on very small screens */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Technology grid */
  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Section titles */
  .section-title h2 {
    font-size: 1.8rem;
  }

  /* CTA */
  .cta h2 {
    font-size: 1.8rem;
  }

  /* Footer social icons */
  .social-icons {
    flex-wrap: wrap;
  }

  .payment-methods {
    flex-wrap: wrap;
  }

  /* Locations grid */
  .locations-grid {
    grid-template-columns: 1fr;
  }
}

/* ====== EXTRA SMALL MOBILE (320px - 479px) ====== */
@media (max-width: 479px) {
  /* Logo */
  .logo-img {
    height: 30px;
  }

  /* Hero */
  .hero {
    min-height: 70vh;
    padding: 4rem 4% 2rem;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
  }

  /* Buttons */
  .btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  .btn-large {
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
  }

  /* All sections */
  .domain-search,
  .pricing,
  .features,
  .why-choose,
  .data-centers,
  .stats,
  .testimonials,
  .technology,
  .faq,
  .blog,
  .cta {
    padding: 2.5rem 4%;
  }

  /* Search container */
  .search-container {
    padding: 1rem;
  }

  /* Section titles */
  .section-title {
    margin-bottom: 2rem;
  }

  .section-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .section-title p {
    font-size: 0.9rem;
  }

  /* Pricing */
  .plan-price {
    font-size: 2rem;
  }

  .plan-price span {
    font-size: 1rem;
  }

  /* Feature cards */
  .feature-card h3 {
    font-size: 1.1rem;
  }

  .feature-card p {
    font-size: 0.9rem;
  }

  /* Stats */
  .stat-number {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.9rem;
  }

  /* Testimonials */
  .testimonial-card {
    padding: 1.5rem;
  }

  .testimonial-content {
    font-size: 0.95rem;
  }

  /* CTA */
  .cta {
    padding: 4rem 4%;
  }

  .cta h2 {
    font-size: 1.6rem;
  }

  .cta p {
    font-size: 0.95rem;
  }

  /* Footer */
  footer {
    padding: 2rem 4% 1rem;
  }

  .footer-section h3 {
    font-size: 1.1rem;
  }

  /* Page hero */
  .page-hero {
    padding-top: 7rem;
  }

  .page-hero h1 {
    font-size: 1.8rem;
  }

  /* Hosting price */
  .price-amount {
    font-size: 2.5rem;
  }

  /* Detail text */
  .detail-text h2 {
    font-size: 1.8rem;
  }

  .detail-text > p {
    font-size: 1rem;
  }

  /* Package pricing */
  .package-price {
    font-size: 1.5rem;
  }
}

/* ====== LANDSCAPE ORIENTATION FIXES ====== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding: 3rem 4% 2rem;
  }

  .hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }

  .hero p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .badge {
    margin-bottom: 1rem;
    transform: translateY(-20px);
  }

  .hero .badge {
    transform: translateY(-10px);
  }

  .hero-buttons {
    gap: 0.75rem;
  }

  .btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

/* ====== UTILITY CLASSES FOR RESPONSIVE HELPERS ====== */

/* Hide elements on mobile */
.hide-mobile {
  display: block;
}

@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Show only on mobile */
.show-mobile {
  display: none;
}

@media (max-width: 767px) {
  .show-mobile {
    display: block !important;
  }
}

/* Responsive text alignment */
@media (max-width: 767px) {
  .text-center-mobile {
    text-align: center !important;
  }
}

/* Responsive padding utilities */
@media (max-width: 767px) {
  .padding-small-mobile {
    padding: 1rem !important;
  }
}

/* ====== FIX FOR TOUCH DEVICES ====== */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover transforms on touch devices to prevent sticky states */
  .feature-card:hover,
  .pricing-card:hover,
  .blog-card:hover,
  .hosting-card:hover {
    transform: none;
  }

  /* Keep subtle shadow on active/touch */
  .feature-card:active,
  .pricing-card:active {
    transform: translateY(-5px);
  }
}

/* ====== MOBILE DRAWER MENU ====== */

/* Always hide old mobile-menu-btn */
.mobile-menu-btn { display: none !important; }

/* Hide drawer on desktop */
@media (min-width: 969px) {
  .mob-toggle  { display: none !important; }
  .mob-overlay { display: none !important; }
  .mob-drawer  { display: none !important; }
}

@media (max-width: 968px) {
  /* Hide desktop nav and header buttons */
  #nav             { display: none !important; }
  .header-buttons  { display: none !important; }

  /* Prevent old nav panel behaviour */
  nav#nav {
    position: static !important;
    right: auto !important;
    width: auto !important;
    height: auto !important;
    background: none !important;
    backdrop-filter: none !important;
    flex-direction: row !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    transform: none !important;
  }

  /* ── Hamburger button ── */
  .mob-toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 5px !important;
    width: 40px !important;
    height: 40px !important;
    padding: 8px !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, rgba(0,212,255,0.15), rgba(124,58,237,0.15)) !important;
    border: 1px solid rgba(0,212,255,0.35) !important;
    color: #00d4ff !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }
  .mob-toggle__bar {
    display: block !important;
    width: 20px !important;
    height: 2px !important;
    border-radius: 2px !important;
    background: #00d4ff !important;
    transition: transform 0.3s ease, opacity 0.2s ease !important;
  }
  .mob-toggle.open .mob-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg)  !important; }
  .mob-toggle.open .mob-toggle__bar:nth-child(2) { opacity: 0 !important; }
  .mob-toggle.open .mob-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg) !important; }

  /* ── Dark overlay ── */
  .mob-overlay {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 1900 !important;
    background: rgba(8,12,32,0.78) !important;
    backdrop-filter: blur(4px) !important;
  }
  .mob-overlay.open {
    display: block !important;
  }

  /* ── Slide-in drawer ── */
  .mob-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    bottom: 0 !important;
    width: min(320px, 88vw) !important;
    height: 100% !important;
    z-index: 2000 !important;
    background: rgba(10,14,39,0.97) !important;
    border-left: 1px solid rgba(0,212,255,0.15) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 0 2rem 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: translateX(100%) !important;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1) !important;
    box-shadow: -8px 0 40px rgba(0,0,0,0.6) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .mob-drawer.open {
    transform: translateX(0) !important;
  }
}

/* ====== ACCESSIBILITY IMPROVEMENTS ====== */

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ====== PRINT STYLES ====== */
@media print {
  header,
  .mobile-menu-btn,
  .particles,
  canvas,
  .cta,
  footer,
  .btn {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .hero,
  section {
    page-break-inside: avoid;
  }
}