/* ==========================================================================
   Ceylon Computer Service - Responsive Styles
   ========================================================================== */

/* Ultra-wide screens */
@media (min-width: 1920px) {
  .container { max-width: 1520px; }
  .hero__visual { max-width: 720px; }
}

/* Large desktop */
@media (max-width: 1400px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.5fr repeat(3, 1fr); }
}

/* Desktop / Laptop */
@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .hero__visual { width: 40%; opacity: 0.7; }
  .mega-menu--enterprise { min-width: min(760px, calc(100vw - 2rem)); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet landscape */
@media (max-width: 1024px) {
  :root { --header-height: 72px; }
  .nav-menu, .nav-actions .nav-btn:not(.nav-toggle) { display: none; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-actions .theme-toggle, .nav-actions .nav-icon-btn { display: flex; }
  .hero { min-height: auto; padding: 5rem 0 3rem; }
  .hero__visual { display: none; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .timeline::before { left: 24px; }
  .timeline-item, .timeline-item:nth-child(even) { flex-direction: row; padding-left: 60px; }
  .timeline-item__content { width: 100%; text-align: left !important; }
  .timeline-item__dot { left: 24px; transform: translateX(-50%); }
  .newsletter-inner { flex-direction: column; text-align: center; }
  .newsletter-form { max-width: 100%; width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}

/* Mobile menu panel */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 90vw);
  height: 100vh;
  background: var(--surface);
  z-index: 10001;
  padding: 1.5rem;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.mobile-nav__close {
  background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; color: var(--text);
}
.mobile-nav ul li a {
  display: block; padding: 0.85rem 0; color: var(--text);
  font-weight: 500; border-bottom: 1px solid var(--border);
}
.mobile-nav ul li a:hover { color: var(--primary-light); }
.mobile-nav__sub { padding-left: 1rem; }
.mobile-nav__sub a { font-size: 0.875rem; color: var(--text-muted); }
.mobile-nav__actions { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
.mobile-nav__lang { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.mobile-nav__lang .lang-switcher a, .mobile-nav__lang .lang-switcher button { color: var(--text-muted); }
.mobile-nav-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 10000; opacity: 0; visibility: hidden; transition: all var(--transition);
}
.mobile-nav-overlay.open { opacity: 1; visibility: visible; }

/* Tablet portrait */
@media (max-width: 768px) {
  .section { padding: 3.5rem 0; }
  .top-bar__info span:not(:first-child) { display: none; }
  .top-bar__social { display: none; }
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stats-enterprise { padding: 2.5rem 0; }
  .stat-enterprise { padding: 1rem 0.5rem; min-width: 0; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }
  .hero__stats { gap: 1.25rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .fab { width: 46px; height: 46px; }
  .form-card { padding: 1.5rem; }
  .page-header { padding: 3rem 0 2rem; }
  .product-card__footer { flex-direction: column; }
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }
}

/* Mobile */
@media (max-width: 480px) {
  html { font-size: 15px; }
  .container { padding: 0 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
  .stat-enterprise { padding: 0.875rem 0.35rem; }
  .stat-card__number { font-size: 1.75rem; }
  .hero__stats { flex-direction: column; gap: 0.75rem; }
  .newsletter-form { flex-direction: column; }
  .toast-container { left: 1rem; right: 1rem; }
  .toast { min-width: auto; }
  .search-box { padding: 1.25rem; }
  .gallery-grid { grid-template-columns: 1fr; }
  .breadcrumb { font-size: 0.8125rem; }
  .team-card__photo { height: 220px; }
}

/* Small mobile */
@media (max-width: 360px) {
  .logo span { font-size: 1rem; }
  .btn { padding: 0.65rem 1.25rem; font-size: 0.875rem; }
}

/* Print styles */
@media print {
  .top-bar, .site-header, .fab-rail-stack, .fab-top, .page-loader,
  .scroll-progress, .search-overlay, .toast-container, .mobile-bottom-nav { display: none !important; }
  body { background: #fff; color: #000; }
  .section { padding: 1rem 0; }
}
