/* =============================================================
   Kathmandu Dairy - Responsive Stylesheet
   ============================================================= */

/* ----- 2K+ Screens ----- */
@media screen and (min-width: 2000px) {
  :root {
    --max-width: 1400px;
    --max-width-wide: 1600px;
  }

  .hero-title {
    font-size: var(--text-8xl);
  }
}

/* ----- Large Desktops (1025px - 1440px) ----- */
@media screen and (max-width: 1440px) {
  :root {
    --text-7xl: 3.75rem;
    --text-8xl: 5rem;
  }

  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
  }
}

/* ----- Tablets & Small Laptops (769px - 1024px) ----- */
@media screen and (max-width: 1024px) {
  :root {
    --text-6xl: 3rem;
    --text-7xl: 3.25rem;
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
    --text-3xl: 1.625rem;
    --space-3xl: 5rem;
    --space-2xl: 3.5rem;
  }

  .nav-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-mobile-nav);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-primary-dark);
    padding: var(--space-md) 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .header-scrolled .nav-menu {
    top: 64px;
  }

  .nav-menu.open {
    max-height: none;
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
  }

  .nav-menu li {
    width: 100%;
  }

  .nav-menu a {
    display: block;
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-lg);
    color: var(--color-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background var(--transition-base);
  }

  .nav-menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-secondary);
  }

  .nav-menu a::after {
    display: none;
  }

  .scrolled .nav-menu a {
    color: var(--color-white);
  }

  body.nav-open {
    overflow: hidden;
  }

  .menu-item-has-children {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
  }

  .menu-item-has-children > a {
    flex: 1;
  }

  .menu-item-has-children > a::before {
    display: none;
  }

  .sub-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--color-white);
    background: none;
    border: none;
    cursor: pointer;
    transition: transform var(--transition-base);
    flex-shrink: 0;
  }

  .sub-menu-toggle.active {
    transform: rotate(180deg);
  }

  .mega-menu {
    position: static;
    transform: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
    width: 100%;
    opacity: 1;
    visibility: visible;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mega-menu::before {
    display: none;
  }

  .menu-item-has-children .mega-menu.open {
    transform: none;
  }

  .mega-menu.open {
    max-height: 500px;
  }

  .mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg) var(--space-md);
  }

  .mega-menu-grid .mega-menu-item {
    display: flex !important;
    flex-direction: row;
    gap: var(--space-sm);
    padding: var(--space-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-base);
    color: var(--color-white);
    border-bottom: none;
  }

  .mega-menu-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-color: rgba(255, 255, 255, 0.15);
  }

  .mega-menu-label {
    color: var(--color-white);
    font-size: var(--text-sm);
  }

  .mega-menu-grid .mega-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .mega-menu-grid .mega-menu-item:hover .mega-menu-label {
    color: var(--color-secondary);
  }

  .hero-title {
    font-size: var(--text-6xl);
  }

  .hero-trust {
    gap: var(--space-lg);
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .about-content {
    padding-right: 0;
  }

  .about-image-wrapper img {
    min-height: 350px;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .distributor-benefits {
    grid-template-columns: 1fr;
  }

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

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }

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

  .ic-hero-title { font-size: var(--text-6xl); }
  .ic-story-grid { gap: var(--space-xl); }
  .ic-story-text h2 { font-size: var(--text-4xl); }
  .ic-card { padding: 0 20px; }
  .ic-card-inner { grid-template-columns: 1fr; }
  .ic-card-visual { min-height: 300px; }
  .ic-features-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ----- Mobile Large (426px - 768px) ----- */
@media screen and (max-width: 768px) {
  :root {
    --text-6xl: 2.5rem;
    --text-7xl: 2.75rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
    --text-xl: 1.125rem;
    --space-3xl: 4rem;
    --space-2xl: 2.5rem;
    --space-xl: 2rem;
    --space-lg: 1.5rem;
    --header-height: 64px;
  }

  .section {
    padding: var(--space-2xl) 0;
  }

  .hero {
    min-height: 100svh;
    height: 100svh;
  }

  .hero-slide {
    padding-bottom: 40px;
  }

  .hero-title {
    font-size: var(--text-5xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

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

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

  .hero-trust {
    gap: var(--space-md);
  }

  .hero-trust-item .number {
    font-size: var(--text-xl);
  }

  .scroll-cue {
    display: none;
  }

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

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

  .counter-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .counter-number {
    font-size: var(--text-4xl);
  }

  .distributor-cta {
    flex-direction: column;
    align-items: center;
  }

  .distributor-cta .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  .contact-cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .contact-cta-buttons .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-brand p {
    max-width: 100%;
  }

  .mobile-nav-links a {
    font-size: var(--text-2xl);
  }

  .about-image-wrapper img {
    min-height: 280px;
  }

  .product-card-body {
    padding: var(--space-md);
  }

  .product-card-body h3 {
    font-size: var(--text-lg);
  }

  .feature-card {
    padding: var(--space-lg);
  }

  .ic-hero-title { font-size: var(--text-5xl); }
  .ic-hero-arrow { width: 36px; height: 36px; }
  .ic-hero-prev { left: var(--space-sm); }
  .ic-hero-next { right: var(--space-sm); }
  .ic-hero-dots { bottom: 70px; }
  .ic-story-grid { grid-template-columns: 1fr; }
  .ic-story-image-wrapper img { height: 350px; }
  .ic-story-stats { grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
  .ic-card { max-width: 100%; padding: 0 20px; }
  .ic-card-info { padding: var(--space-lg); }
  .ic-card-info h3 { font-size: var(--text-2xl); }
}

/* ----- Mobile Small (up to 425px) ----- */
@media screen and (max-width: 425px) {
  :root {
    --text-5xl: 1.75rem;
    --text-6xl: 2rem;
    --text-4xl: 1.5rem;
    --text-3xl: 1.375rem;
    --space-lg: 1.25rem;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-trust {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .product-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .product-card-body {
    padding: var(--space-sm);
  }

  .product-card-body h3 {
    font-size: var(--text-base);
  }

  .product-card-body p {
    font-size: var(--text-xs);
  }

  .counter-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .counter-item {
    padding: var(--space-md);
  }

  .counter-number {
    font-size: var(--text-3xl);
  }

  .distributor-benefits {
    grid-template-columns: 1fr;
  }

  .mobile-nav-links a {
    font-size: var(--text-xl);
  }

  .mega-menu-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: var(--space-xs) var(--space-md) var(--space-sm);
  }

  .mega-menu-grid .mega-menu-item {
    padding: var(--space-xs) var(--space-sm);
    gap: var(--space-xs);
  }

  .mega-menu-icon {
    width: 32px;
    height: 32px;
  }

  .ic-hero-title { font-size: var(--text-4xl); }
  .ic-hero-arrow { display: none; }
  .ic-hero-content { padding-top: 60px; }
  .ic-features-grid { grid-template-columns: 1fr; }
}

/* ----- Landscape Mobile Height Adjustment ----- */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 500px;
    height: auto;
    padding: 100px 0 60px;
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-trust {
    display: none;
  }

  .scroll-cue {
    display: none;
  }
}

/* ----- Print Styles ----- */
@media print {
  .site-header {
    position: relative;
    background: var(--color-white);
    color: var(--color-text);
  }

  .site-header::before {
    opacity: 1;
  }

  .main-navigation a,
  .site-logo {
    color: var(--color-text);
  }

  .hero {
    height: auto;
    min-height: 0;
    padding: 60px 0;
  }

  .hero-overlay,
  .hero-gradient-overlay,
  .hero-three-scene,
  .hero-floating,
  .scroll-cue {
    display: none;
  }

  .hero-title {
    color: var(--color-text);
  }

  .hero-subtitle {
    color: var(--color-text-light);
  }

  .hero-trust-item .number {
    color: var(--color-primary);
  }

  .hero-trust-item .label {
    color: var(--color-text-light);
  }

  .btn {
    border: 2px solid var(--color-text);
    color: var(--color-text);
    background: transparent;
  }

  .btn-primary,
  .btn-gold {
    background: transparent;
    color: var(--color-text);
  }

  .section {
    padding: 40px 0;
    page-break-inside: avoid;
  }

  .hamburger,
  .mobile-nav-overlay,
  .distributor-floating,
  .contact-cta-overlay,
  .contact-cta-bg {
    display: none;
  }

  .site-footer {
    background: var(--color-white);
    color: var(--color-text);
    border-top: 1px solid var(--color-border);
  }

  .site-footer a,
  .footer-column h4,
  .footer-logo {
    color: var(--color-text);
  }

  .footer-column a {
    color: var(--color-text-light);
  }

  .counter-item:hover {
    background: var(--color-off-white);
    transform: none;
  }

  .counter-item:hover .counter-number {
    color: var(--color-secondary);
  }

  .counter-item:hover .counter-label {
    color: var(--color-text-light);
  }

  .product-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .feature-card:hover {
    transform: none;
  }
}
