/* ============================================
   Blue Box Cold Chain - Responsive Design (WordPress Version)
   ============================================ */

/* ========== TABLETS (768px - 1024px) ========== */
@media (max-width: 1024px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .hero-section {
    flex-direction: column;
  }

  .hero-content {
    order: 2;
  }

  .hero-image {
    order: 1;
    margin-bottom: 1.5rem;
  }

  .site-nav {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== MOBILE (< 768px) ========== */
@media (max-width: 768px) {
  :root {
    --spacing: 0.75rem;
  }

  body {
    font-size: 15px;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.1rem; }
  h4 { font-size: 1rem; }

  .container {
    padding: 0 0.75rem;
  }

  .section {
    padding: 2rem 0;
  }

  .header-container {
    padding: 0 0.75rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  /* Navigation Mobile Menu */
  .site-nav {
    flex-direction: column;
    flex-wrap: wrap;
    gap: 1rem;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--secondary);
    padding: 1rem;
    border-bottom: 2px solid var(--accent);
    justify-content: center;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav.active {
    display: flex;
    max-height: 500px;
  }

  .site-nav li {
    border-bottom: none;
    padding: 0;
    list-style: none;
  }

  .site-nav a {
    padding: 0.5rem 0.75rem;
    display: block;
  }

  .site-nav a::after {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  /* ========== GRID ========== */
  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  /* ========== CARDS ========== */
  .card-img {
    height: 200px;
  }

  .card-body {
    padding: 1rem;
  }

  /* ========== BUTTONS ========== */
  .btn {
    width: 100%;
    text-align: center;
    display: block;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
  }

  /* ========== FORMS ========== */
  input, textarea, select {
    font-size: 16px; /* Prevent zoom on iOS */
  }

  /* ========== HERO SECTION ========== */
  .hero-section {
    padding: 3rem 0 2rem;
    flex-direction: column;
  }

  .hero-content {
    text-align: center;
  }

  .hero-image img {
    width: 100%;
    max-width: 100%;
  }

  .hero-kpis {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
  }

  .hero-lead {
    margin-bottom: 1rem;
    flex-direction: column;
  }

  /* ========== BREADCRUMB ========== */
  .breadcrumb ol {
    font-size: 0.85rem;
    flex-wrap: wrap;
  }

  /* ========== FOOTER ========== */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .social-links {
    justify-content: flex-start;
  }

  /* ========== TABLES ========== */
  table {
    font-size: 0.85rem;
    overflow-x: auto;
    display: block;
  }

  th, td {
    padding: 0.5rem;
  }

  /* ========== STICKY CTA ========== */
  .sticky-cta {
    padding: 0.75rem;
  }

  .sticky-cta p {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
  }

  .sticky-cta .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    width: 100%;
  }

  /* ========== BACK TO TOP ========== */
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 1rem;
    right: 1rem;
    font-size: 1.25rem;
  }
}

/* ========== SMALL MOBILE (< 480px) ========== */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1rem; }

  .container {
    padding: 0 0.5rem;
  }

  .section {
    padding: 1.5rem 0;
  }

  .logo {
    font-size: 1.1rem;
  }

  .custom-logo {
    max-height: 35px;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .card-body {
    padding: 0.75rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  input, textarea {
    padding: 0.6rem;
    font-size: 16px;
  }

  .form-row {
    gap: 0.5rem;
  }

  .social-links {
    gap: 0.5rem;
  }

  .social-links a {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .breadcrumb ol {
    flex-direction: column;
    gap: 0.25rem;
  }

  .breadcrumb li::after {
    display: none;
  }

  /* Back to top button for mobile */
  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 1rem;
    right: 0.75rem;
    font-size: 1.25rem;
  }

  /* Hero section adjustments */
  .hero-section {
    padding: 2rem 0 1.5rem;
  }

  .hero-lead span {
    width: 2rem;
    height: 2rem;
  }

  .hero-kpi {
    padding: 1rem;
  }

  .hero-kpi h3 {
    font-size: 1.5rem;
  }

  /* Feature cards */
  .feature-card {
    padding: 1.5rem;
  }

  /* Footer adjustments */
  .site-footer {
    padding: 2rem 0 1rem;
  }

  .footer-section h3 {
    font-size: 1rem;
  }

  .footer-section p {
    font-size: 0.85rem;
  }

  /* Service pill */
  .service-pill {
    font-size: 0.85rem;
  }

  /* Sticky CTA adjustments */
  .sticky-cta {
    padding: 0.5rem;
  }

  .sticky-cta p {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
  }

  .sticky-cta .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* ========== LARGE SCREENS (> 1024px) ========== */
@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }

  h1 { font-size: 3.5rem; }
  h2 { font-size: 2.5rem; }
  h3 { font-size: 1.75rem; }

  .hero-kpis {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }

  .grid-3 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ========== HOVER ENHANCEMENTS (Desktop) ========== */
@media (hover: hover) and (pointer: fine) {
  .card {
    cursor: pointer;
  }

  .feature-card:hover {
    transform: translateY(-15px) scale(1.03);
  }

  .btn {
    cursor: pointer;
  }

  a {
    text-decoration: none;
  }

  a:hover {
    text-decoration: underline;
  }
}

/* ========== ACCESSIBILITY & MOTION ========== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .back-to-top {
    transition: none;
  }

  .sticky-cta {
    transition: none;
  }
}

/* ========== HIGH CONTRAST MODE ========== */
@media (prefers-contrast: more) {
  :root {
    --primary: #003d7a;
    --secondary: #000d1a;
    --accent: #00a3cc;
    --border-color: #333;
  }

  .btn {
    border: 2px solid currentColor;
    font-weight: 700;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  .site-header,
  .site-footer,
  .back-to-top,
  .sticky-cta,
  .progress-bar,
  .nav-toggle,
  .wp-admin-bar {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  a {
    color: #0066cc;
    text-decoration: underline;
  }

  a::after {
    content: " (" attr(href) ")";
  }

  .card {
    page-break-inside: avoid;
  }
}

/* ========== LANDSCAPE ORIENTATION ========== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section {
    min-height: auto;
    padding: 1rem 0;
  }

  .section {
    padding: 1rem 0;
  }

  .hero-kpis {
    display: none;
  }
}

/* ========== HIGH DPI SCREENS ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-img {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* ========== DARK MODE (Optional) ========== */
@media (prefers-color-scheme: dark) {
  :root {
    --dark-text: #e0e0e0;
    --light-bg: #1a1a1a;
    --border-color: #333;
    --surface: #0a0a0a;
  }

  body {
    background: #0a0a0a;
    color: var(--dark-text);
  }

  .card {
    background: #1a1a1a;
    border-color: var(--border-color);
  }

  input, textarea, select {
    background: #1a1a1a;
    color: var(--dark-text);
    border-color: var(--border-color);
  }

  .breadcrumb {
    background: #1a1a1a;
  }

  .site-nav.active {
    background: rgba(11, 95, 168, 0.95);
  }
}

/* ========== MOBILE NAV TRANSITIONS ========== */
.site-nav {
  z-index: 110;
}

.site-nav.active {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

@media (max-width: 768px) {
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
  }

  .site-nav.active {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--secondary);
    display: flex;
    flex-direction: column;
  }
}
