/* Large Tablets (1024px se neeche) */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr 1fr; /* 50-50 */
    gap: 30px;
  }

  .hero-text h1 {
    font-size: 42px;
  }
  
  /* Adjust image heights for tablet */
  .hero-images img:nth-child(1),
  .hero-images img:nth-child(3) {
    height: 320px;
  }
  
  .hero-images img:nth-child(2),
  .hero-images img:nth-child(4),
  .hero-images img:nth-child(6) {
    height: 160px;
  }
  
  .hero-images img:nth-child(5) {
    height: 240px;
  }
}

/* Medium Tablets (768px se neeche) */
@media (max-width: 768px) {
  .container {
    width: 95%;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .nav {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .nav-links {
    justify-content: center;
    gap: 15px;
  }

  .nav-links li a {
    font-size: 14px;
  }

  .hero-content {
    grid-template-columns: 1fr; /* Single column */
    gap: 40px;
  }

  /* Responsive heights for tablet */
  .hero-images {
    order: 1; /* Pehle images aayengi (UPPAR) */
  }
  
  .hero-images img:nth-child(1),
  .hero-images img:nth-child(3) {
    height: 280px;
  }
  
  .hero-images img:nth-child(2),
  .hero-images img:nth-child(4),
  .hero-images img:nth-child(6) {
    height: 140px;
  }
  
  .hero-images img:nth-child(5) {
    height: 210px;
  }

  .hero-text {
    padding: 15px;
    order: 2; /* Text neeche */
  }
  
  .animated-words {
    min-width: 180px;
  }
  
  .hero-text p {
    padding: 15px 20px;
    font-size: 14px;
  }
  
  .hero-text h1::before,
  .hero-text h1::after {
    display: none;
  }

  .search-box {
    position: relative;  /* absolute ki jagah relative */
    top: auto;           /* top hatao */
    left: auto;          /* left hatao */
    transform: none;     /* transform hatao */
    width: 100%;         /* full width */
    margin-top: 30px;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 30px;
  }

  .search-box input,
  .search-box button {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
  }

  .search-box button {
    padding: 16px 20px;
    font-size: 18px;
  }
}

/* Small Mobile (480px se neeche) */
@media (max-width: 480px) {
  .hero {
    padding: 63px 0;
  }

  .hero-text h1 {
    font-size: 28px;
  }

  .hero-text p {
    font-size: 14px;
  }

  /* Mobile grid layout */
  .hero-images {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  /* Responsive heights for mobile */
  .hero-images img:nth-child(1) {
    grid-row: span 2;
    height: 220px;
    border-top-left-radius: 30px;
  }
  
  .hero-images img:nth-child(2) {
    grid-row: span 1;
    height: 110px;
  }
  
  .hero-images img:nth-child(3) {
    grid-row: span 2;
    height: 220px;
    border-top-right-radius: 30px;
    border-bottom-right-radius: 30px;
  }
  
  .hero-images img:nth-child(4) {
    grid-row: span 1;
    height: 110px;
  }
  
  .hero-images img:nth-child(5) {
    grid-row: span 2;
    height: 165px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
  }
  
  .hero-images img:nth-child(6) {
    grid-row: span 1;
    height: 110px;
    border-bottom-right-radius: 30px;
  }

  .hero-text {
    order: 2; /* Text neeche */
  }
  
  .hero-images {
    order: 1; /* Images upar */
  }

  .nav-links {
    gap: 10px;
  }

  .nav-links li a {
    font-size: 13px;
  }

  .logo {
    font-size: 20px;
  }

  .search-box {
    padding: 15px;
    margin-top: 20px;
  }

  .search-box input,
  .search-box button {
    padding: 14px 15px;
    font-size: 15px;
  }

  .animated-words {
    min-width: 140px;
  }
  
  .word-item {
    font-size: 28px;
  }
}

/* Extra Small Mobile (360px se neeche) */
@media (max-width: 360px) {
  .hero-text h1 {
    font-size: 24px;
  }
  
  /* Adjust heights for very small screens */
  .hero-images img:nth-child(1),
  .hero-images img:nth-child(3) {
    height: 180px;
  }
  
  .hero-images img:nth-child(2),
  .hero-images img:nth-child(4),
  .hero-images img:nth-child(6) {
    height: 90px;
  }
  
  .hero-images img:nth-child(5) {
    height: 135px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links li a {
    font-size: 12px;
  }
  
  .search-box {
    padding: 12px;
  }

  .search-box input,
  .search-box button {
    padding: 12px 12px;
    font-size: 14px;
  }
}

/* Height based responsive for mobile landscape */
@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    padding-top: 30px;
    padding-bottom: 10px;
  }
  
  /* Landscape mode heights */
  .hero-images img:nth-child(1),
  .hero-images img:nth-child(3) {
    height: 200px;
  }
  
  .hero-images img:nth-child(2),
  .hero-images img:nth-child(4),
  .hero-images img:nth-child(6) {
    height: 100px;
  }
  
  .hero-images img:nth-child(5) {
    height: 150px;
  }
}