/**
 * ==============================================================================
 * KRISHNA INK - B2B INDUSTRIAL DESIGN SYSTEM
 * Responsive Stylesheet
 * 
 * Breakpoints:
 * - Large Desktops:       <= 1440px
 * - Standard Desktops:    <= 1280px
 * - Laptops / Tablets:    <= 1024px
 * - Tablets (Portrait):   <= 768px
 * - Mobile Devices:       <= 480px
 * - Small Mobile Devices: <= 360px
 * - Reduced Motion:       prefers-reduced-motion
 * - Print Media:          print
 * ==============================================================================
 */

/* ==============================================================================
   1. LARGE DESKTOPS (<= 1440px)
   ============================================================================== */
@media (max-width: 1440px) {
  .container {
    max-width: 1200px;
    padding-left: var(--space-5);
    padding-right: var(--space-5);
  }

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

  .display-1 {
    font-size: 3.75rem;
  }
}

/* ==============================================================================
   2. STANDARD DESKTOPS (<= 1280px)
   ============================================================================== */
@media (max-width: 1280px) {
  /* Container & Spacing */
  .container {
    max-width: 100%;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }

  .container-sm {
    max-width: 820px;
  }

  /* Typography Adjustments */
  h1, .h1 {
    font-size: 3rem;
  }

  h2, .h2 {
    font-size: 2.5rem;
  }

  .hero-title {
    font-size: 3rem;
    line-height: 1.15;
  }

  .section-title {
    font-size: 2.5rem;
  }

  /* Hero Section */
  .hero-container {
    gap: 48px;
    grid-template-columns: 1.1fr 0.9fr;
  }

  .hero-image {
    max-width: 500px;
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .stat-item {
    padding: 12px 20px;
  }

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

  /* About Grid */
  .about-grid {
    gap: 56px;
  }

  .about-img {
    height: 440px;
  }

  /* Features & Industries Grids */
  .features-grid,
  .industries-grid {
    gap: 20px;
  }

  .feature-card,
  .industry-card {
    padding: 24px 20px;
  }

  /* Footer Grid */
  .footer-grid {
    grid-template-columns: 1.8fr 1fr 1fr 1.4fr;
    gap: 48px;
  }

  /* Quality Highlight */
  .quality-grid {
    gap: 56px;
  }

  .quality-visual img {
    height: 420px;
  }
}

/* ==============================================================================
   3. LAPTOPS & TABLETS LANDSCAPE (<= 1024px)
   ============================================================================== */
@media (max-width: 1024px) {
  /* Sections */
  .section {
    padding-top: 72px;
    padding-bottom: 72px;
  }

  .section-sm {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  /* Header & Navigation */
  .header .container {
    gap: 20px;
  }

  .header-inner {
    height: 70px;
  }

  .nav-link {
    padding: 8px 10px;
    font-size: 0.9rem;
  }

  /* Mega Menu */
  .mega-menu {
    width: 520px;
    padding: 24px;
  }

  .mega-menu-inner {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .mega-menu-cta {
    grid-column: span 2;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: 20px;
    margin-top: 8px;
  }

  .mega-menu-promo {
    flex-direction: row;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
  }

  .mega-menu-promo .btn {
    flex-shrink: 0;
  }

  /* Hero Section */
  .hero {
    min-height: auto;
    padding: 64px 0;
  }

  .hero-container {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

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

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-image {
    max-width: 100%;
  }

  .hero-stats {
    gap: 24px;
    padding-top: 24px;
  }

  .hero-stat-number {
    font-size: 1.75rem;
  }

  /* About Section */
  .about-grid {
    gap: 48px;
  }

  .about-img {
    height: 400px;
  }

  .about-badge {
    bottom: -16px;
    right: -16px;
    padding: 16px 20px;
  }

  .about-badge-number {
    font-size: 2rem;
  }

  /* Quality Highlight */
  .quality-grid {
    gap: 48px;
  }

  .quality-visual img {
    height: 380px;
  }

  /* Grids */
  .industries-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }

  .footer-col:first-child {
    grid-column: span 2;
  }

  .footer-desc {
    max-width: 100%;
  }

  /* Industry Sector Details */
  .industry-section-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .industry-section-icon-wrap {
    width: 64px;
    height: 64px;
  }

  .industry-section-icon {
    width: 32px;
    height: 32px;
  }

  /* Contact Page */
  .contact-grid {
    gap: 48px;
  }
}

/* ==============================================================================
   4. TABLETS PORTRAIT (<= 768px)
   ============================================================================== */
@media (max-width: 768px) {
  /* Body Overlay when Mobile Menu is Active */
  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    transition: opacity 0.3s ease;
  }

  /* Section Spacing */
  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .section-sm {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .section-xs {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .section-title {
    font-size: 2rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
  }

  /* Topbar */
  .topbar {
    padding: 6px 0;
    font-size: 0.8rem;
  }

  .topbar-info .topbar-link:not(:first-child) {
    display: none; /* Keep primary phone, hide secondary address */
  }

  .topbar-cert {
    display: none; /* Hide topbar cert text to save space */
  }

  .topbar-whatsapp {
    padding: 3px 8px;
    font-size: 0.75rem;
  }

  /* Header */
  .header-inner {
    height: 64px;
    justify-content: space-between;
  }

  .header-logo img {
    height: 44px;
  }

  .header-actions .btn {
    display: none; /* Hide header action button; accessible in drawer */
  }

  /* Hamburger Menu Toggle */
  .hamburger {
    display: flex;
    z-index: 1002;
  }

  /* Mobile Navigation Drawer */
  .nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    width: 85%;
    max-width: 360px;
    background-color: var(--color-white);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    flex-direction: column;
    align-items: stretch;
    padding: 80px 24px 40px;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav.mobile-open {
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }

  .nav-item {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    padding: 14px 16px;
    font-size: 1rem;
    justify-content: space-between;
    width: 100%;
    border-radius: var(--radius-md);
  }

  .nav-link:hover,
  .nav-link.active {
    background-color: var(--color-primary-light);
  }

  /* Mobile Mega Menu Accordion */
  .mega-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    opacity: 1;
    visibility: hidden;
    height: 0;
    max-height: 0;
    overflow: hidden;
    transform: none;
    border: none;
    border-radius: 0;
    padding: 0;
    pointer-events: auto;
    transition: max-height 0.35s ease, padding 0.35s ease;
    background-color: var(--color-bg-subtle);
  }

  .has-dropdown.mobile-dropdown-open .mega-menu {
    visibility: visible;
    height: auto;
    max-height: 800px;
    padding: 12px 16px 20px;
    margin-top: 4px;
    border-radius: var(--radius-md);
  }

  .has-dropdown.mobile-dropdown-open .nav-arrow {
    transform: rotate(180deg);
  }

  .mega-menu-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .mega-menu-col {
    padding: 0;
  }

  .mega-menu-heading {
    margin-bottom: 8px;
    font-size: 0.75rem;
  }

  .mega-menu-list a {
    padding: 8px 10px;
    font-size: 0.875rem;
  }

  .mega-menu-cta {
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: 16px;
    margin-top: 8px;
    grid-column: auto;
  }

  .mega-menu-promo {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Mobile CTA inside Drawer */
  .mobile-nav-cta {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .mobile-nav-cta .btn {
    width: 100%;
    justify-content: center;
  }

  /* Mobile Drawer Close Button */
  .mobile-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-light);
    color: var(--color-text-dark);
    cursor: pointer;
  }

  .mobile-close-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Hero Section */
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-visual {
    order: -1;
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }

  .hero-content {
    align-items: center;
  }

  .hero-badge {
    margin: 0 auto;
  }

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

  .hero-subtitle {
    margin: 0 auto;
    text-align: center;
  }

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

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

  .hero-floating-card {
    left: 50%;
    transform: translateX(-50%);
    bottom: -16px;
    width: 90%;
    justify-content: center;
  }

  /* Stats Bar */
  .stats-bar {
    padding: 36px 0;
  }

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

  .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 20px 16px;
  }

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

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

  /* About Section */
  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .about-img {
    height: 350px;
  }

  .about-badge {
    bottom: -12px;
    right: 12px;
  }

  .about-strengths {
    grid-template-columns: 1fr;
  }

  /* Quality Section */
  .quality-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .quality-visual {
    order: -1;
  }

  .quality-visual img {
    height: 320px;
  }

  /* Cards Grids */
  .categories-grid,
  .industries-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

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

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

  /* Forms */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .contact-map {
    height: 260px;
  }

  /* CTA Section */
  .cta-title {
    font-size: 2rem;
  }

  .cta-text {
    font-size: 1rem;
  }

  /* Page Hero */
  .page-hero {
    padding: 60px 0;
  }

  .page-hero-title {
    font-size: 2.25rem;
  }

  .page-hero-subtitle {
    font-size: 1rem;
  }

  /* Footer */
  .footer-top {
    padding: 60px 0;
  }

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

  .footer-col:first-child {
    grid-column: span 2;
  }

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

  /* Process Steps */
  .process-step {
    grid-template-columns: 60px 1fr;
    gap: 20px;
    padding: 28px 0;
  }

  .step-number {
    width: 48px;
    height: 48px;
    font-size: 1.1rem;
  }

  /* Standards */
  .standards-grid {
    grid-template-columns: 1fr;
  }

  /* Values Grid */
  .values-grid {
    grid-template-columns: 1fr;
  }

  /* Timeline */
  .timeline::before {
    left: 15px;
  }

  .timeline-item {
    gap: 20px;
    padding-bottom: 30px;
  }

  .timeline-dot {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }

  .timeline-content {
    padding: 18px;
  }
}

/* ==============================================================================
   5. MOBILE PHONES (<= 480px)
   ============================================================================== */
@media (max-width: 480px) {
  /* Layout */
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .section {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .section-sm {
    padding-top: 36px;
    padding-bottom: 36px;
  }

  /* Typography */
  h1, .h1 {
    font-size: 2.25rem;
  }

  h2, .h2 {
    font-size: 1.75rem;
  }

  h3, .h3 {
    font-size: 1.5rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  /* Hero Section */
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

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

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

  .hero-stats {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-around;
  }

  .hero-stat-number {
    font-size: 1.5rem;
  }

  .hero-stat-label {
    font-size: 0.75rem;
  }

  /* Stats Bar */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-item {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px;
  }

  .stat-item:last-child {
    border-bottom: none;
  }

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

  /* Cards Grids to 1 Column */
  .categories-grid,
  .industries-grid,
  .features-grid,
  .products-grid,
  .resources-grid {
    grid-template-columns: 1fr;
  }

  /* CTA Section */
  .cta-title {
    font-size: 1.75rem;
  }

  .cta-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

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

  /* Page Hero */
  .page-hero {
    padding: 48px 0;
  }

  .page-hero-title {
    font-size: 1.85rem;
  }

  /* About Badge */
  .about-badge {
    position: static;
    margin-top: 16px;
    width: 100%;
  }

  .about-img {
    height: 260px;
  }

  /* Search Bar */
  .search-form {
    flex-direction: column;
    gap: 8px;
  }

  .search-input {
    border-radius: var(--radius-md);
  }

  .search-btn {
    border-radius: var(--radius-md);
    justify-content: center;
    padding: 12px;
  }

  /* Filter Buttons */
  .product-filters {
    gap: 8px;
    margin-bottom: 24px;
  }

  .filter-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

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

  .footer-col:first-child {
    grid-column: auto;
  }

  .footer-legal {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }

  /* Process Step */
  .process-step {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: var(--radius-md);
  }

  /* Back to Top */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }

  /* Modals */
  .modal-dialog {
    margin: 12px;
    max-height: 94vh;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }
}

/* ==============================================================================
   6. SMALL MOBILE DEVICES (<= 360px)
   ============================================================================== */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.75rem;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.825rem;
  }

  .section-tag {
    font-size: 0.7rem;
    padding: 4px 10px;
  }

  .topbar-whatsapp {
    display: none;
  }
}

/* ==============================================================================
   7. ACCESSIBILITY: PREFERS REDUCED MOTION
   ============================================================================== */
@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;
  }

  .hero-image,
  .hero-badge-dot,
  .ink-accent-1,
  .ink-accent-2 {
    animation: none !important;
  }

  .category-card:hover,
  .product-card:hover,
  .industry-card:hover,
  .feature-card:hover,
  .btn:hover,
  .back-to-top:hover {
    transform: none !important;
  }
}

/* ==============================================================================
   8. PRINT STYLESHEET (@media print)
   ============================================================================== */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.4;
    background: #fff !important;
  }

  /* Hide Interactive and Screen-Only Elements */
  .topbar,
  .header,
  .hamburger,
  .nav,
  .hero-actions,
  .cta-section,
  .footer-social,
  .footer-bottom,
  .back-to-top,
  .product-filters,
  .search-form,
  .form-submit,
  .btn,
  .modal-overlay {
    display: none !important;
  }

  /* Show Print Headers */
  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .section {
    padding: 20pt 0 !important;
    page-break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    color: #000 !important;
  }

  table,
  .spec-table {
    border: 1pt solid #ddd !important;
    page-break-inside: avoid;
  }

  th, td {
    border: 1pt solid #ddd !important;
    padding: 6pt 8pt !important;
  }

  /* URL print decoration */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555 !important;
  }

  a[href^="#"]:after {
    content: "";
  }
}


/* ==============================================================================
   MOBILE HEADER ALIGNMENT (added with logo/slider update)
   The hamburger turns into an "X" when open, so the injected .nav-close is hidden.
   ============================================================================== */
.nav-close { display: none !important; }
@media (max-width: 768px) {
  .header-actions { margin-left: auto; }
}

/* Keep the open mobile drawer above the dimmed page overlay */
@media (max-width: 768px) {
  body.nav-open .header { z-index: 1100; }
}
