/* ==========================================================================
   S.B. Technical Training Institute - Responsive Media Queries
   Mobile-First & All-Device Layout Adaptations
   ========================================================================== */

/* Universal Overflow & Container Constraints */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

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

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .reveal-fade-left, .reveal-fade-right {
    transform: translateY(20px) !important;
  }
}

/* ==========================================================================
   Large Tablets & Laptops (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-badge-wrap {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-trust-tags {
    justify-content: center;
  }

  .hero-visual-wrapper {
    max-width: 540px;
    margin: 0 auto;
    width: 100%;
  }

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

  .stat-item:nth-child(2) {
    border-right: none;
  }

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

  .lab-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .cert-card-wrapper {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

/* ==========================================================================
   Tablets & Mobile Landscape (<= 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Announcement Top Bar */
  .top-alert-bar {
    padding: 6px 0;
    font-size: 0.82rem;
  }

  .alert-quick-links {
    display: none;
  }

  .top-alert-inner {
    justify-content: flex-start;
    gap: 8px;
  }

  .alert-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
  }

  /* Header & Navigation */
  .nav-wrapper {
    padding: 10px 0;
    gap: 12px;
  }

  .brand-text h1 {
    font-size: 1.1rem;
  }

  .brand-text p {
    font-size: 0.68rem;
  }

  .nav-cta {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    background: #FFFFFF;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.18);
    flex-direction: column;
    align-items: flex-start;
    padding: 75px 22px 30px 22px;
    gap: 8px;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border-radius: 0;
    border: none;
  }

  .main-nav.active {
    right: 0;
  }

  .nav-link {
    font-size: 1rem;
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid #F1F5F9;
  }

  .mobile-menu-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: #F1F5F9;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
  }

  .nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .nav-backdrop.active {
    opacity: 1;
    visibility: visible;
  }

  /* Hero Section */
  .hero-section {
    padding: 40px 0 60px 0;
  }

  .hero-title {
    font-size: clamp(1.8rem, 5.5vw, 2.3rem);
    line-height: 1.25;
  }

  .typewriter-box {
    font-size: 1rem;
    padding: 6px 12px;
    margin-left: auto;
    margin-right: auto;
    max-width: 100%;
    justify-content: center;
  }

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

  .hero-image {
    height: 300px;
  }

  /* Floating badges - stay inside viewport */
  .floating-badge {
    padding: 8px 12px;
    font-size: 0.8rem;
  }

  .badge-top-left {
    top: 8px;
    left: 8px;
  }

  .badge-bottom-right {
    bottom: 8px;
    right: 8px;
  }

  /* Stats Section */
  .stats-section {
    margin-top: -20px;
    margin-bottom: 40px;
  }

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

  .stat-item {
    border-right: none;
    border-bottom: 1px solid #F1F5F9;
    padding: 10px 4px;
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }

  .stat-item:nth-last-child(-n+2) {
    border-bottom: none;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.78rem;
  }

  /* Courses Grid */
  .course-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
  }

  .course-card-3d {
    height: 490px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
  }

  /* Features (Why Us) */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .feature-box {
    padding: 24px 20px;
  }

  /* Lab Showcase */
  .lab-showcase-section {
    padding: 50px 0;
  }

  .lab-visuals-collage {
    gap: 10px;
  }

  .lab-img-item {
    height: 150px;
  }

  .lab-img-item.featured {
    height: 190px;
  }

  /* Certificate */
  .certificate-section {
    padding: 50px 0;
  }

  .cert-card-wrapper {
    padding: 26px 18px;
  }

  .cert-features-list {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Testimonials */
  .testimonials-section {
    padding: 50px 0;
  }

  .testimonial-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Contact & Admission Form */
  .contact-section {
    padding: 50px 0;
  }

  .form-card {
    padding: 28px 20px;
  }

  /* FAQ */
  .faq-section {
    padding: 50px 0;
  }

  /* Footer */
  .site-footer {
    padding: 45px 0 20px 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

  /* Floating Action Buttons */
  .floating-call-btn {
    bottom: 16px;
    left: 14px;
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }

  .floating-whatsapp-btn {
    bottom: 16px;
    right: 14px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   Smartphones & Small Screens (<= 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .container {
    padding: 0 14px;
    width: 100%;
  }

  /* Header Logo & Button Alignment */
  .nav-wrapper {
    padding: 8px 0;
  }

  .brand-logo {
    gap: 8px;
    max-width: calc(100% - 50px);
  }

  .logo-img-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .brand-text h1 {
    font-size: 1rem;
    letter-spacing: -0.2px;
    line-height: 1.1;
  }

  .brand-text p {
    font-size: 0.65rem;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
  }

  .mobile-menu-btn {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
    flex-shrink: 0;
  }

  /* Hero Section */
  .hero-section {
    padding: 30px 0 50px 0;
  }

  .hero-badge-wrap {
    padding: 5px 12px;
    font-size: 0.78rem;
    margin-bottom: 12px;
    width: 100%;
    justify-content: center;
  }

  .hero-badge-wrap span {
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .hero-title {
    font-size: 1.65rem;
    line-height: 1.25;
    margin-bottom: 12px;
  }

  .typewriter-box {
    font-size: 0.88rem;
    padding: 5px 10px;
    min-height: 34px;
    margin-bottom: 14px;
    border-left: 3px solid var(--secondary);
    width: 100%;
  }

  .hero-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 20px;
  }

  /* Full-width Stacked Hero Action Buttons */
  .hero-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin-bottom: 20px;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 12px 18px;
    font-size: 0.92rem;
    text-align: center;
    justify-content: center;
  }

  .hero-trust-tags {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 14px;
  }

  .trust-item {
    font-size: 0.8rem;
  }

  /* Hero Visual Card */
  .hero-visual-wrapper {
    max-width: 100%;
  }

  .hero-main-card {
    border-width: 2px;
    border-radius: var(--radius-md);
  }

  .hero-image {
    height: 240px;
  }

  .floating-badge {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    gap: 8px;
  }

  .floating-badge .badge-icon-box {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  .floating-badge .badge-meta h5 {
    font-size: 0.78rem;
  }

  .floating-badge .badge-meta span {
    font-size: 0.65rem;
  }

  .badge-top-left {
    top: 6px;
    left: 6px;
  }

  .badge-bottom-right {
    bottom: 6px;
    right: 6px;
  }

  /* Stats Section 2x2 Clean Grid */
  .stats-section {
    margin-top: -15px;
    margin-bottom: 35px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 14px 10px;
    gap: 10px;
    border-radius: var(--radius-md);
  }

  .stat-item {
    padding: 6px 2px;
    gap: 4px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    border-radius: var(--radius-sm);
  }

  .stat-number {
    font-size: 1.35rem;
  }

  .stat-label {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  /* Section Header Titles */
  .section-header {
    margin-bottom: 30px;
  }

  .section-badge {
    font-size: 0.78rem;
    padding: 4px 14px;
  }

  .section-title {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .section-subtitle {
    font-size: 0.85rem;
    padding: 0 4px;
  }

  /* Course Search & Filter Tabs */
  .course-search-bar {
    margin-bottom: 16px;
  }

  .course-search-bar input {
    padding: 10px 16px 10px 42px;
    font-size: 0.86rem;
  }

  .course-search-bar i {
    left: 14px;
    font-size: 0.9rem;
  }

  .course-tabs-wrapper {
    gap: 6px;
  }

  .tab-btn {
    padding: 7px 12px;
    font-size: 0.78rem;
    gap: 5px;
  }

  .tab-btn i {
    font-size: 0.85rem;
  }

  /* Course 3D Cards */
  .course-card-3d {
    height: 520px;
    max-width: 100%;
  }

  .course-thumb-wrap {
    height: 170px;
  }

  .card-front-content {
    padding: 14px;
  }

  .course-main-title {
    font-size: 1.1rem;
  }

  .course-hindi-name {
    font-size: 0.85rem;
  }

  .course-excerpt {
    font-size: 0.82rem;
    margin-bottom: 10px;
  }

  .key-tag {
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .card-front-footer {
    padding-top: 10px;
  }

  .flip-trigger-btn {
    font-size: 0.82rem;
  }

  .card-back {
    padding: 14px;
  }

  .card-back-header h4 {
    font-size: 1rem;
  }

  .syllabus-list li {
    font-size: 0.78rem;
    margin-bottom: 5px;
  }

  .back-course-meta {
    padding: 6px 10px;
    font-size: 0.74rem;
    margin-bottom: 10px;
  }

  .card-back-actions {
    flex-direction: column;
    gap: 6px;
  }

  .card-back-actions .btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  /* Lab Collage */
  .lab-visuals-collage {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .lab-img-item.featured {
    grid-column: span 1;
    height: 170px;
  }

  .lab-img-item {
    height: 140px;
  }

  .lab-highlights-list li {
    font-size: 0.86rem;
    gap: 8px;
    margin-bottom: 10px;
  }

  /* Certificate Section */
  .cert-card-wrapper {
    padding: 20px 12px;
    border-radius: var(--radius-lg);
  }

  .cert-features-list {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .cert-feat-item {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  /* Form & Contact Section */
  .form-card {
    padding: 20px 14px;
    border-radius: var(--radius-lg);
  }

  .form-header h3 {
    font-size: 1.25rem;
  }

  .form-header p {
    font-size: 0.82rem;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .form-label {
    font-size: 0.8rem;
  }

  .form-input, .form-select, .form-textarea {
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .info-box {
    padding: 14px 12px;
    gap: 10px;
  }

  .info-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  .info-content h5 {
    font-size: 0.92rem;
  }

  .info-content p, .info-content a {
    font-size: 0.82rem;
  }

  .director-badge-box {
    padding: 16px 12px;
  }

  .director-badge-box h5 {
    font-size: 0.98rem;
  }

  .director-badge-box p {
    font-size: 0.8rem;
  }

  /* FAQ Accordion */
  .faq-question {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .faq-answer {
    padding: 0 14px;
    font-size: 0.82rem;
  }

  .faq-item.active .faq-answer {
    padding: 10px 14px 14px 14px;
  }

  /* Footer */
  .site-footer {
    padding: 35px 0 16px 0;
  }

  .footer-brand h4 {
    font-size: 1.15rem;
  }

  .footer-links h5 {
    font-size: 0.92rem;
    margin-bottom: 12px;
  }

  .footer-links a {
    font-size: 0.8rem;
  }

  /* Floating Call & WhatsApp Buttons on Small Phones */
  .floating-call-btn {
    bottom: 14px;
    left: 12px;
    width: 46px;
    height: 46px;
    font-size: 1.2rem;
  }

  .floating-whatsapp-btn {
    bottom: 14px;
    right: 12px;
    width: 46px;
    height: 46px;
    font-size: 1.4rem;
  }
}

/* ==========================================================================
   Extra Small Devices (<= 360px - e.g., Galaxy Fold & Small Phones)
   ========================================================================== */
@media (max-width: 360px) {
  .container {
    padding: 0 10px;
  }

  .brand-text h1 {
    font-size: 0.92rem;
  }

  .brand-text p {
    display: none;
  }

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

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

  .stat-item {
    border-bottom: 1px solid #F1F5F9;
  }

  .course-card-3d {
    height: 540px;
  }
}
