/* 
 * RESPONSIVE DESIGN BREAKPOINTS
 * Mobile-first approach
 */

/* =============== TABLET - 768px =============== */
@media (max-width: 768px) {
  :root {
    scroll-padding-top: 90px;
  }

  /* Typography — clamp() handles responsive scaling; only line-height needs tuning */
  h1 { line-height: 1.15; }
  h2 { line-height: 1.2; }
  h3 { line-height: 1.25; }
  h4 { line-height: 1.3; }

  /* Navigation */
  .navbar {
    height: 90px;
    padding: 0.5rem 0;
  }

  .navbar-logo {
    font-size: 1.5rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 90px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--white);
    padding: 2rem 1rem;
    gap: 1rem;
    box-shadow: var(--shadow);
    z-index: 99;
  }

  .nav-links.active {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  /* Dropdown Menu Mobile */
  .dropdown-menu {
    position: static;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    background: var(--light-gray);
    box-shadow: none;
    transform: none;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
  }

  .nav-item.dropdown:hover .dropdown-menu {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
  }

  .nav-item.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    max-height: 500px;
    padding: 0.5rem 0;
  }

  .dropdown-menu a {
    padding: 0.5rem 2rem;
    font-size: 0.95rem;
  }

  /* Hero Slider — tablet */
  .hero-slide {
    padding: 0 5% 7%;
  }

  .slider-content {
    max-width: 100%;
    padding: 1.5rem 1.6rem 1.8rem;
  }

  .slider-label {
    font-size: 0.8rem;
    letter-spacing: 1.5px;
  }

  .slider-controls {
    right: 1rem;
    bottom: 1rem;
    gap: 8px;
  }

  .slider-btn {
    width: 38px;
    height: 38px;
    font-size: 0.85rem;
  }

  .slider-dots {
    bottom: 1rem;
    left: 1.5rem;
    transform: none;
  }

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

  /* Service cards */
  .service-card-img {
    height: 180px;
  }

  /* Footer — tablet two cols */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .nav-item.dropdown > a::after {
    content: none;
  }

  .nav-item.dropdown.active > a::after {
    transform: none;
  }

  /* Hero */
  .hero {
    height: calc(100vh - 90px);
    min-height: 420px;
    padding: 0;
  }


  .hero p {
    font-size: 1.1rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
  }

  .hero-buttons .btn {
    width: 100%;
  }

  /* Sections */
  section {
    padding: 60px 0;
  }

  /* Grids */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Cards */
  .card {
    padding: 1.5rem;
  }

  /* Buttons */
  .btn {
    padding: 10px 24px;
    font-size: 0.95rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  /* Hero decorative elements */
  .hero::before {
    width: 300px;
    height: 300px;
  }

  .hero::after {
    width: 250px;
    height: 250px;
  }

  /* Tables */
  table {
    font-size: 0.9rem;
  }

  th, td {
    padding: 0.8rem;
  }

  /* Spacing adjustments */
  .gap-1 { gap: 0.8rem; }
  .gap-2 { gap: 1.5rem; }
  .gap-3 { gap: 2rem; }

  /* Modal */
  .modal-content {
    width: 95%;
    padding: 1.5rem;
  }

  /* Testimonials carousel */
  .testimonial-card {
    padding: 1.5rem;
  }

  /* Contact form */
  .form-group {
    margin-bottom: 1.2rem;
  }

  input, textarea, select {
    padding: 10px 12px;
    font-size: 16px;
  }
}

/* =============== MOBILE - 480px =============== */
@media (max-width: 480px) {
  :root {
    scroll-padding-top: 50px;
  }

  html, body {
    font-size: 14px;
  }

  /* Typography — clamp handles most sizes; these are safety overrides */
  h1 { margin-bottom: 1rem; }
  h2 { margin-bottom: 0.8rem; }
  h3 { margin-bottom: 0.6rem; }

  p {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
  }

  /* Container */
  .container {
    padding: 0 15px;
  }

  /* Hero Slider — mobile */
  .hero-slide {
    padding: 0 4% 10%;
  }

  .slider-content {
    padding: 1.2rem 1.2rem 1.4rem;
    border-radius: 8px;
  }

  .slider-label {
    font-size: 0.72rem;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
  }

  .slider-content .btn {
    padding: 10px 22px;
    font-size: 0.9rem;
  }

  .slider-controls {
    bottom: 12px;
  }

  .slider-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  /* Navigation */
  .navbar {
    height: 70px;
    padding: 0.5rem 0;
  }

  .navbar-logo {
    font-size: 1.2rem;
  }

  .nav-links {
    padding: 1.5rem 1rem;
    gap: 0.8rem;
    top: 70px;
  }

  .nav-links a {
    font-size: 0.95rem;
  }

  /* Hero */
  .hero {
    height: calc(100vh - 70px);
    min-height: 360px;
    padding: 0;
  }


  .hero p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 0.8rem;
  }

  .hero-buttons .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
    width: 100%;
  }

  /* Sections */
  section {
    padding: 40px 0;
  }

  /* Cards */
  .card {
    padding: 1.2rem;
    border-radius: 8px;
  }

  .card-icon {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  /* Grids */
  .grid {
    gap: 1.2rem;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  /* Buttons */
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  /* Flexbox utilities */
  .flex-between {
    flex-wrap: wrap;
    gap: 1rem;
  }

  /* Footer */
  footer {
    padding: 40px 0 15px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-section h4 {
    margin-bottom: 1rem;
  }

  .social-links {
    justify-content: center;
  }

  /* Hero decorations */
  .hero::before {
    width: 200px;
    height: 200px;
    right: -50px;
  }

  .hero::after {
    width: 150px;
    height: 150px;
    left: -50px;
  }

  /* Tables */
  table {
    font-size: 0.85rem;
    margin: 1rem 0;
  }

  th, td {
    padding: 0.6rem 0.4rem;
  }

  /* Spacing utilities */
  .mt-1 { margin-top: 0.8rem; }
  .mt-2 { margin-top: 1.5rem; }
  .mt-3 { margin-top: 2rem; }
  .mb-1 { margin-bottom: 0.8rem; }
  .mb-2 { margin-bottom: 1.5rem; }
  .mb-3 { margin-bottom: 2rem; }

  /* Modal */
  .modal-content {
    width: 98%;
    padding: 1.2rem;
    max-width: 500px;
  }

  .modal-close {
    font-size: 1.2rem;
  }

  /* Testimonial */
  .testimonial-card {
    padding: 1rem;
  }

  .testimonial-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .testimonial-info h4 {
    font-size: 1rem;
  }

  /* Forms */
  label {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
  }

  input, textarea, select {
    padding: 10px 10px;
    font-size: 16px;
    border-radius: 8px;
  }

  textarea {
    min-height: 100px;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  /* Stat numbers */
  .stat-number {
    font-size: 2rem;
  }

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

  /* Badges */
  .badge {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  /* Breadcrumb */
  .breadcrumb {
    font-size: 0.85rem;
  }
}

/* =============== SMALL MOBILE - 360px =============== */
@media (max-width: 360px) {
  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    padding: 10px 15px;
  }

  .btn {
    padding: 8px 16px;
  }

  .container {
    padding: 0 12px;
  }

  section {
    padding: 30px 0;
  }

  .hero {
    height: calc(100vh - 70px);
    min-height: 300px;
    padding: 0;
  }

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

/* =============== COMPONENT-LEVEL RESPONSIVE =============== */

/* --- Contact Hero --- */
@media (max-width: 768px) {
  .contact-hero .container {
    display: block;
    padding: 2rem 1.5rem;
    border-radius: 0;
    width: 100%;
  }

  .contact-hero {
    min-height: 360px;
  }
}

/* --- CEO / Message Section --- */
@media (max-width: 768px) {
  .ceo-section-inner {
    flex-direction: column !important;
    align-items: center !important;
    gap: 2rem !important;
  }

  .ceo-photo-col {
    text-align: center;
  }

  .ceo-photo-col img {
    width: 220px !important;
    height: 220px !important;
  }
}

/* --- Loan Cards grid --- */
@media (max-width: 900px) {
  .loans-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 560px) {
  .loans-grid {
    grid-template-columns: 1fr !important;
  }
}

/* --- Service Cards — 2 columns on tablet --- */
@media (max-width: 900px) and (min-width: 561px) {
  .grid-3 .service-card {
    min-width: 0;
  }
}

/* --- Navbar logo sizing --- */
@media (max-width: 480px) {
  .navbar-logo img {
    height: 64px !important;
  }
}

/* --- Touch device: disable hover lifts --- */
@media (hover: none) {
  .card:hover,
  .service-card:hover,
  .team-card:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .btn:hover,
  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
  }
}

/* --- Section heading centred on mobile --- */
@media (max-width: 768px) {
  .text-center h2,
  .text-center p {
    text-align: center;
  }
}

/* --- Footer single col on mobile --- */
@media (max-width: 480px) {
  footer .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 360px) {
  footer .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* =============== LARGE DESKTOP - 1400px+ =============== */
@media (min-width: 1400px) {
  .container {
    max-width: 1300px;
  }

  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 3rem;
  }

  section {
    padding: 100px 0;
  }

  .hero {
    height: calc(100vh - 120px);
    min-height: 600px;
    padding: 0;
  }

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

/* =============== PRINT STYLES =============== */
@media print {
  nav,
  footer,
  .btn-secondary,
  .modal {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }

  * {
    page-break-inside: avoid;
  }
}

/* =============== REDUCED MOTION =============== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============== DARK MODE SUPPORT =============== */
@media (prefers-color-scheme: dark) {
  :root {
    --white: #1a1a1a;
    --dark-text: #f5f5f5;
    --light-gray: #2a2a2a;
    --border-gray: #444;
    --text-light: #aaa;
  }

  body {
    background-color: #1a1a1a;
    color: #f5f5f5;
  }

  nav {
    background: #2a2a2a;
  }

  .card {
    background: #2a2a2a;
  }

  input, textarea, select {
    background: #2a2a2a;
    color: #f5f5f5;
    border-color: #444;
  }

  table th {
    background: #333;
  }

  tr:hover {
    background: #333;
  }
}
/* =============== HERO SLIDER RESPONSIVE =============== */
@media (max-width: 1024px) {
  .hero-slide {
    padding: 60px 40px;
  }

  .slider-content h1 {
    font-size: 2.5rem;
  }

  .slider-content p {
    font-size: 0.95rem;
  }

  .slider-controls {
    right: 40px;
  }

  .slider-dots {
    right: 40px;
    bottom: 40px;
  }
}

@media (max-width: 768px) {
  .hero-slide {
    padding: 40px 20px;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .slider-content {
    max-width: 100%;
  }

  .slider-label {
    font-size: 0.85rem;
    letter-spacing: 1.5px;
  }

  .slider-content h1 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  .slider-content p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .slider-controls {
    right: 20px;
    gap: 15px;
  }

  .slider-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .slider-dots {
    right: 20px;
    bottom: 20px;
    gap: 10px;
  }

  .slider-dot {
    width: 35px;
    height: 35px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .hero-slide {
    padding: 30px 15px;
  }

  .slider-content h1 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
  }

  .slider-content p {
    font-size: 0.85rem;
  }

  .slider-label {
    font-size: 0.75rem;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
  }

  .slider-controls {
    right: 15px;
    gap: 12px;
  }

  .slider-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .slider-dots {
    right: 15px;
    bottom: 15px;
    gap: 8px;
  }

  .slider-dot {
    width: 30px;
    height: 30px;
    font-size: 0.7rem;
  }
}
/* Mobile footer: compact two-column navigation */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 1.25rem;
  }
  .footer-section:first-child {
    grid-column: 1 / -1;
    text-align: center;
  }
  .footer-section:first-child img {
    margin-left: auto;
    margin-right: auto;
  }
  .footer-section h4 { font-size: .95rem; }
  .footer-links a { font-size: .84rem; }
}