/* Mobile Spacing & Layout Fixes for All Pages */

/* ===== ABOUT PAGE MOBILE FIXES ===== */
@media (max-width: 768px) {
  .about-hero {
    margin: 0.5rem auto !important;
    padding: 1rem 0.75rem !important;
    gap: 0.75rem !important;
    flex-direction: column !important;
  }

  .about-hero .photo {
    flex: 0 0 auto !important;
    margin-bottom: 0.5rem !important;
  }

  .about-hero .photo img.kevin-img {
    width: 120px !important;
    height: 120px !important;
  }

  .about-copy {
    padding: 0 !important;
  }

  .about-copy h1 {
    font-size: 1.6rem !important;
    margin-bottom: 0.6rem !important;
  }

  .about-copy p {
    margin-bottom: 0.8rem !important;
  }

  .about-features {
    flex-direction: column !important;
    gap: 0.8rem !important;
    margin: 0.8rem 0 !important;
  }

  .about-features .badge {
    width: 100% !important;
  }
}

/* ===== CONTACT FORM MOBILE FIXES ===== */
@media (max-width: 768px) {
  .contact-hero {
    padding: 1rem 0.75rem !important;
    margin: 0.5rem 0 !important;
    gap: 0.75rem !important;
  }

  .contact-form-wrapper {
    padding: 1rem 0.75rem !important;
    margin: 0.5rem 0 !important;
  }

  .contact-form-wrapper h2 {
    font-size: 1.4rem !important;
    margin-bottom: 1rem !important;
  }

  .form-group {
    margin-bottom: 0.6rem !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .form-group label {
    margin-bottom: 0.25rem !important;
    font-size: 0.9rem !important;
  }

  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 0.75rem 0.8rem !important;
    font-size: 16px !important;
    border-radius: 6px !important;
  }

  textarea {
    min-height: 120px !important;
    resize: vertical !important;
  }

  .form-group button {
    padding: 0.9rem 1.5rem !important;
    min-height: 44px !important;
    font-size: 1rem !important;
    margin-top: 0.5rem !important;
  }

  .contact-info {
    padding: 0.75rem !important;
    margin: 0.75rem 0 !important;
    gap: 0.75rem !important;
  }

  .contact-info-item {
    padding: 0.8rem 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  }

  .contact-info-item:last-child {
    border-bottom: none !important;
  }
}

/* ===== BLOG PAGE MOBILE FIXES ===== */
@media (max-width: 768px) {
  .blog-hero {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .blog-hero h1 {
    font-size: 1.6rem !important;
    margin-bottom: 0.6rem !important;
  }

  .blog-filters {
    gap: 0.6rem !important;
    padding: 1rem 0.5rem !important;
    flex-wrap: wrap !important;
  }

  .blog-posts-grid {
    gap: 1rem !important;
    padding: 0 0.5rem !important;
  }

  .blog-card {
    padding: 1rem !important;
    margin-bottom: 0.5rem !important;
  }

  .blog-card h3 {
    font-size: 1.1rem !important;
    margin-bottom: 0.5rem !important;
  }

  .blog-card p {
    font-size: 0.9rem !important;
    margin-bottom: 0.6rem !important;
  }

  .blog-meta {
    font-size: 0.8rem !important;
    gap: 0.8rem !important;
    margin-bottom: 0.6rem !important;
  }

  .blog-excerpt {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
  }

  .pagination {
    gap: 0.4rem !important;
    margin: 1rem 0 !important;
  }

  .pagination a,
  .pagination button {
    padding: 0.6rem 0.8rem !important;
    font-size: 0.9rem !important;
  }
}

/* ===== BUSINESS-IT PAGE MOBILE FIXES ===== */
@media (max-width: 768px) {
  .business-hero {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .services-list {
    gap: 0.8rem !important;
    padding: 0 !important;
  }

  .service-item {
    padding: 1rem !important;
    margin-bottom: 0.5rem !important;
  }

  .service-item h3 {
    font-size: 1.05rem !important;
    margin-bottom: 0.4rem !important;
  }

  .service-item p {
    font-size: 0.9rem !important;
    margin: 0 !important;
  }

  .features-grid {
    gap: 0.8rem !important;
    grid-template-columns: 1fr !important;
  }

  .feature-box {
    padding: 1rem !important;
  }

  .feature-box h4 {
    font-size: 1rem !important;
    margin-bottom: 0.4rem !important;
  }

  .feature-box p {
    font-size: 0.9rem !important;
    margin: 0 !important;
  }
}

/* ===== LOCAL SUPPORT PAGE MOBILE FIXES ===== */
@media (max-width: 768px) {
  .location-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .location-card {
    padding: 1rem !important;
    margin-bottom: 0.5rem !important;
  }

  .location-card h3 {
    font-size: 1.1rem !important;
    margin-bottom: 0.6rem !important;
  }

  .location-card p {
    font-size: 0.9rem !important;
    margin-bottom: 0.4rem !important;
  }

  .services-in-location {
    margin: 0.8rem 0 0 0 !important;
    padding: 0.8rem 0 !important;
  }

  .services-in-location li {
    font-size: 0.9rem !important;
    margin-bottom: 0.3rem !important;
  }

  .service-coverage-area {
    padding: 1rem !important;
    margin: 1rem 0 !important;
  }
}

/* ===== WEB-HOSTING PAGE MOBILE FIXES ===== */
@media (max-width: 768px) {
  .hosting-hero {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .hosting-features {
    gap: 0.8rem !important;
    grid-template-columns: 1fr !important;
  }

  .hosting-feature-card {
    padding: 1rem !important;
  }

  .hosting-feature-card h3 {
    font-size: 1.05rem !important;
    margin-bottom: 0.5rem !important;
  }

  .hosting-feature-card p {
    font-size: 0.9rem !important;
    margin: 0 !important;
  }

  .pricing-table {
    font-size: 0.85rem !important;
    margin: 1rem 0 !important;
  }

  .pricing-table th,
  .pricing-table td {
    padding: 0.6rem 0.4rem !important;
  }

  .pricing-row {
    flex-direction: column !important;
    gap: 0.8rem !important;
    margin-bottom: 1rem !important;
  }
}

/* ===== BILLING PAGE MOBILE FIXES ===== */
@media (max-width: 768px) {
  .billing-hero {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .billing-hero h1 {
    font-size: 1.5rem !important;
    margin-bottom: 0.6rem !important;
  }

  .billing-instructions {
    padding: 1rem !important;
    margin: 1rem 0 !important;
    gap: 0.8rem !important;
  }

  .billing-instruction-step {
    padding: 0.8rem !important;
    margin-bottom: 0.5rem !important;
  }

  .payment-container {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .payment-container h2 {
    font-size: 1.3rem !important;
    margin-bottom: 1rem !important;
  }

  .invoice-details {
    font-size: 0.9rem !important;
    padding: 0.8rem !important;
    margin: 0.8rem 0 !important;
  }

  .invoice-details p {
    margin-bottom: 0.4rem !important;
  }
}

/* ===== SUPPORT TICKETS PAGE MOBILE FIXES ===== */
@media (max-width: 768px) {
  .tickets-hero {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .access-gate-form {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .access-gate-form h2 {
    font-size: 1.3rem !important;
    margin-bottom: 0.8rem !important;
  }

  .access-gate-form input {
    padding: 0.75rem 0.8rem !important;
    font-size: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .access-gate-form button {
    padding: 0.9rem 1.5rem !important;
    min-height: 44px !important;
    width: 100% !important;
    margin-top: 0.5rem !important;
  }

  .ticket-form-wrapper {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .ticket-form-wrapper h2 {
    font-size: 1.3rem !important;
    margin-bottom: 0.8rem !important;
  }

  .form-group {
    margin-bottom: 0.8rem !important;
  }

  .form-group label {
    font-size: 0.95rem !important;
    margin-bottom: 0.3rem !important;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 0.75rem 0.8rem !important;
    font-size: 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .form-group textarea {
    min-height: 120px !important;
  }

  .form-group button {
    padding: 0.9rem 1.5rem !important;
    min-height: 44px !important;
    width: 100% !important;
  }

  .billing-section {
    padding: 1rem !important;
    margin: 1rem 0 !important;
  }

  .paypal-payment-section {
    padding: 1rem !important;
  }
}

/* ===== PRODUCTS PAGE MOBILE FIXES ===== */
@media (max-width: 768px) {
  .products-hero {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .products-hero h1 {
    font-size: 1.5rem !important;
  }

  .products-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 0.5rem !important;
  }

  .product-card {
    padding: 1rem !important;
    margin-bottom: 0.5rem !important;
  }

  .product-card h3 {
    font-size: 1.05rem !important;
    margin-bottom: 0.5rem !important;
  }

  .product-card p {
    font-size: 0.9rem !important;
    margin-bottom: 0.6rem !important;
  }

  .product-link {
    padding: 0.7rem 1rem !important;
    font-size: 0.9rem !important;
  }
}

/* ===== SERVICES PAGES MOBILE FIXES ===== */
@media (max-width: 768px) {
  .services-hero {
    padding: 1.25rem 1rem !important;
    margin: 1rem 0 !important;
  }

  .services-hero h1 {
    font-size: 1.5rem !important;
    margin-bottom: 0.6rem !important;
  }

  .service-benefits {
    gap: 0.8rem !important;
    grid-template-columns: 1fr !important;
  }

  .benefit-item {
    padding: 0.8rem !important;
    margin-bottom: 0.4rem !important;
  }

  .benefit-item h3 {
    font-size: 1rem !important;
    margin-bottom: 0.4rem !important;
  }

  .benefit-item p {
    font-size: 0.9rem !important;
    margin: 0 !important;
  }

  .service-details {
    padding: 1rem !important;
    margin: 1rem 0 !important;
  }

  .service-details h2 {
    font-size: 1.3rem !important;
    margin-bottom: 0.8rem !important;
  }

  .service-details p {
    margin-bottom: 0.8rem !important;
    font-size: 0.95rem !important;
  }
}

/* ===== EXTRA SMALL SCREENS (<480px) ===== */
@media (max-width: 480px) {
  /* Navigation adjustments for very small screens */
  .main-nav {
    gap: 0.5rem !important;
    padding: 0.7rem !important;
  }

  .main-nav a {
    padding: 0.9rem 1rem !important;
    font-size: 1.05rem !important;
  }

  .dropdown-toggle {
    padding: 0.9rem 1rem !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
  }

  .dropdown-menu a {
    padding: 0.8rem 0.9rem !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
  }

  .dropdown-menu a:hover {
    transform: translateY(-1px) !important;
  }

  /* Further reduce padding on very small screens */
  section {
    padding: 1rem 0.7rem !important;
  }

  .contact-form-wrapper,
  .ticket-form-wrapper,
  .about-hero,
  .billing-hero,
  .products-hero {
    padding: 1rem 0.7rem !important;
    margin: 0.7rem 0 !important;
  }

  h1 {
    font-size: 1.6rem !important;
  }

  h2 {
    font-size: 1.3rem !important;
  }

  h3 {
    font-size: 1rem !important;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
    padding: 0.7rem 0.7rem !important;
  }

  button,
  .btn {
    padding: 0.8rem 1rem !important;
    min-height: 44px !important;
  }

  .form-group {
    margin-bottom: 0.7rem !important;
  }

  .feature-card,
  .service-card,
  .blog-card,
  .product-card,
  .location-card {
    padding: 0.9rem !important;
    margin-bottom: 0.4rem !important;
  }

  p {
    font-size: 0.9rem !important;
    margin-bottom: 0.7rem !important;
  }
}

/* ===== MOBILE NAVIGATION GAP FIX & REDESIGN ===== */
@media (max-width: 768px) {
  /* Remove excessive gap between header and content */
  header.logo-header {
    margin-bottom: 0 !important;
    padding-bottom: 0.8rem !important;
  }

  .main-nav {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    border-top: none !important;
    border-bottom: 1px solid rgba(0, 255, 224, 0.2) !important;
    padding: 0 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    background: rgba(13, 13, 13, 0.8) !important;
    gap: 0 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
  }

  .main-nav a {
    padding: 1rem 0.8rem !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
    flex: 1 1 auto !important;
    text-align: center !important;
    border-radius: 0 !important;
    border-bottom: 3px solid transparent !important;
  }

  .main-nav a::before {
    display: none !important;
  }

  .main-nav a:hover::before,
  .main-nav a[aria-current="page"]::before {
    width: 0 !important;
  }

  .main-nav a:hover {
    background: rgba(0, 255, 224, 0.1) !important;
    border-bottom-color: #00FFE0 !important;
  }

  .main-nav a[aria-current="page"] {
    border-bottom-color: #00FFE0 !important;
    background: rgba(0, 255, 224, 0.08) !important;
  }

  /* Mobile Services Dropdown */
  .nav-dropdown {
    position: relative !important;
    flex: 1 1 auto !important;
    display: flex !important;
  }

  .dropdown-toggle {
    width: 100% !important;
    padding: 1rem 0.8rem !important;
    font-size: 0.95rem !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-bottom: 3px solid transparent !important;
  }

  .dropdown-toggle::before {
    display: none !important;
  }

  .dropdown-toggle:hover::before,
  .nav-dropdown.open .dropdown-toggle::before {
    width: 0 !important;
  }

  .dropdown-toggle:hover {
    background: rgba(0, 255, 224, 0.1) !important;
    border-bottom-color: #00FFE0 !important;
  }

  .nav-dropdown.open .dropdown-toggle {
    background: rgba(0, 255, 224, 0.08) !important;
    border-bottom-color: #00FFE0 !important;
  }

  .dropdown-menu {
    position: static !important;
    display: none !important;
    flex-basis: 100% !important;
    background: rgba(13, 13, 13, 0.95) !important;
    border: none !important;
    border-top: 1px solid rgba(0, 255, 224, 0.2) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-width: auto !important;
    padding: 0.5rem 0 !important;
    margin-top: 0 !important;
    z-index: 999 !important;
  }

  .nav-dropdown.open .dropdown-menu {
    display: block !important;
  }

  .dropdown-menu a {
    padding: 0.8rem 1.2rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    border-bottom: 1px solid rgba(0, 255, 224, 0.1) !important;
    display: block !important;
    white-space: normal !important;
  }

  .dropdown-menu a:last-child {
    border-bottom: none !important;
  }

  .dropdown-menu a:hover {
    background: rgba(0, 255, 224, 0.15) !important;
    padding-left: 1.4rem !important;
  }

  /* Ensure no gap between nav and first content */
  .main-nav + * {
    margin-top: 0 !important;
  }

  .main-nav + section,
  .main-nav + main > section:first-child {
    margin-top: 0 !important;
  }
}

/* ===== HOMEPAGE HERO GAP FIX (INDEX ONLY) ===== */
@media (max-width: 768px) {
  body.index-home .modern-hero {
    margin-top: 0 !important;
    padding-top: 1.2rem !important;
  }
}

/* Extra small screens - further optimization */
@media (max-width: 480px) {
  header.logo-header {
    padding: 1rem 0.75rem 0.5rem 0.75rem !important;
  }

  header.logo-header h1 {
    font-size: 1.4rem !important;
  }

  .main-nav {
    padding: 0 !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  .main-nav a,
  .dropdown-toggle {
    padding: 0.9rem 0.6rem !important;
    font-size: 0.9rem !important;
    flex: 1 1 100% !important;
    border-bottom: 1px solid rgba(0, 255, 224, 0.1) !important;
  }

  .dropdown-menu {
    border-top: 1px solid rgba(0, 255, 224, 0.1) !important;
  }

  .dropdown-menu a {
    padding: 0.75rem 1rem !important;
    font-size: 0.85rem !important;
  }
}
