/* Responsive Styles */

@media (min-width: 1025px) {
  .nav-overlay, .mobile-drawer {
    display: none !important;
  }
}
@media (max-width: 1024px) {
  :root {
    --spacing-xl: 6rem;
    --spacing-lg: 3rem;
  }
  .carousel-content {
    margin-top: 0;
  }
}

@media (max-width: 1024px) {
  :root {
    --header-height: 86px;
  }

  /* Typography */
  h1 { font-size: clamp(2.2rem, 8vw, 3rem); }
  h2 { font-size: clamp(1.75rem, 6vw, 2rem); }
  
  /* Navbar Mobile */
  .brand-logo {
    height: 76px;
  }

  .carousel-slide {
    padding-top: var(--header-height);
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    padding: 0;
    width: 40px;
    height: 40px;
    transition: color var(--transition-normal);
  }

  /* Overlay */
  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(10, 47, 107, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Drawer Container */
  .mobile-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background-color: var(--bg-white);
    z-index: 1001;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
  }

  .mobile-drawer.active {
    right: 0;
  }

  /* Header */
  .drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .drawer-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
  }

  .drawer-close-btn {
    background: none;
    border: none;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background-color var(--transition-fast);
  }

  .drawer-close-btn:hover {
    background-color: var(--bg-light);
  }

  /* Links List */
  .drawer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
  }

  .drawer-links li {
    width: 100%;
  }

  .drawer-links a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1.05rem;
    padding: 0.6rem 0.5rem;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    gap: 1rem;
  }

  .drawer-links a:hover,
  .drawer-links a.active {
    background-color: #f1f5f9;
  }

  .drawer-links a.active {
    color: var(--secondary-color);
    font-weight: 600;
  }

  /* Icon Circles */
  .drawer-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
  }

  .drawer-links a:hover .drawer-icon-circle,
  .drawer-links a.active .drawer-icon-circle {
    background-color: var(--primary-color);
    color: var(--bg-white);
  }

  /* Services Link Chevron */
  .drawer-chevron {
    margin-left: auto;
    color: #94a3b8;
    display: flex;
    align-items: center;
  }

  /* Footer */
  .drawer-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }

  .drawer-estimate-btn {
    width: 100%;
    border-radius: 50px;
    padding: 0.85rem 1.5rem;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background-color: var(--secondary-color);
    color: var(--bg-white);
    text-decoration: none;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    transition: background-color var(--transition-fast), transform var(--transition-fast);
  }

  .drawer-estimate-btn:hover {
    background-color: var(--secondary-color-hover);
    transform: translateY(-1px);
  }

  .drawer-estimate-btn .btn-arrow {
    display: flex;
    align-items: center;
  }

  .drawer-trust-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
  }

  .badge-check-icon {
    color: #10b981;
    display: flex;
    align-items: center;
  }

  .nav-links {
    display: none;
  }

  /* Grid Layouts */
  .footer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.75rem 2rem;
  }

  .footer-col:first-child {
    grid-column: 1 / -1;
    text-align: center;
  }

  .footer-col:first-child .nav-brand {
    width: fit-content;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }

  .footer-col:first-child .footer-socials {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .carousel-slide {
    align-items: flex-end;
    padding-top: var(--header-height, 86px);
    padding-bottom: 70px;
  }

  .carousel-slide .container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0 var(--spacing-md, 1.5rem);
    box-sizing: border-box;
  }

  .carousel-content {
    position: static !important;
    margin-top: 0 !important;
    padding: 0 !important;
  }

  /* Heading - pinned to the top */
  .carousel-content h1,
  .carousel-content h1 span {
    color: #ffffff !important;
    text-shadow: 2px 2px 15px rgba(0,0,0,0.85) !important;
  }

  .carousel-content h1 {
    position: absolute;
    top: calc(var(--header-height, 86px) + 4.5rem);
    left: var(--spacing-md, 1.5rem);
    right: var(--spacing-md, 1.5rem);
    margin: 0;
    font-size: 4rem !important;
    line-height: 1.15;
    font-weight: 700 !important;
  }

  /* Description text - pinned to the bottom area, below the face gap */
  .carousel-content p {
    position: absolute;
    bottom: 235px;
    left: var(--spacing-md, 1.5rem);
    right: var(--spacing-md, 1.5rem);
    margin: 0;
    font-size: 2.5rem !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-shadow: 2px 2px 12px rgba(0,0,0,0.9) !important;
    line-height: 1.5;
  }

  /* Buttons - pinned at the very bottom */
  .carousel-content .hero-actions {
    position: absolute;
    bottom: 100px;
    left: var(--spacing-md, 1.5rem);
    right: var(--spacing-md, 1.5rem);
  }

  .carousel-slide::before {
    background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.20) 0%,
      rgba(0, 0, 0, 0.02) 30%,
      rgba(0, 0, 0, 0.0) 50%,
      rgba(0, 0, 0, 0.05) 70%,
      rgba(0, 0, 0, 0.25) 100%) !important;
  }

  .carousel-bg {
    background-position: top center !important;
  }

  .hero-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    width: auto !important;
    margin-top: 0.5rem !important;
  }

  .hero-actions .btn {
    display: flex !important;
    flex: 1 !important;
    min-width: 0 !important;
    padding: 1rem 0.75rem !important;
    font-size: 1.05rem !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 0 !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
  }

  .hero-actions .btn-white {
    background-color: #ffffff !important;
    color: var(--primary-color) !important;
    border-color: #ffffff !important;
    opacity: 1 !important;
  }


  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-col:first-child {
    grid-column: auto;
  }

  .footer-col:first-child .nav-brand {
    display: none;
  }

  .footer-col:nth-child(2),
  .footer-col:nth-child(4) {
    width: auto;
    justify-self: stretch;
  }

  .footer-col:nth-child(3),
  .footer-col:nth-child(5) {
    width: auto;
    justify-self: stretch;
  }

  /* Specific styles for Slide 1 to avoid handyman's face overlay */
  .carousel-slide:nth-child(1) .carousel-content h1 {
    font-size: 3.2rem !important;
  }
  .carousel-slide:nth-child(1) .carousel-content p {
    bottom: 190px !important;
    font-size: 1.8rem !important;
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
  }

  .btn {
    width: auto;
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
  }

  .carousel-content h1 {
    font-size: 3.2rem !important;
    line-height: 1.15;
    color: #ffffff !important;
    margin-bottom: 0.75rem;
  }

  .carousel-content p {
    font-size: 1.6rem !important;
    color: #ffffff !important;
    margin-bottom: 1rem;
  }

  .carousel-slide:nth-child(1) .carousel-content h1 {
    font-size: 2.4rem !important;
  }
  .carousel-slide:nth-child(1) .carousel-content p {
    font-size: 1.25rem !important;
    bottom: 190px !important;
  }
}

/* Specific fix for iPhone 17 (402px) and 17 Pro Max (440px) */
@media (width: 402px), (width: 440px) {
  .carousel-content h1 {
    font-size: 2.4rem !important;
  }
  .carousel-slide:nth-child(1) .carousel-content h1 {
    font-size: 2.0rem !important;
  }
}

/* Specific fix for Samsung Galaxy S23 and smaller mobile screens (360px and below) */
@media (max-width: 360px) {
  .carousel-content h1 {
    font-size: 2.2rem !important;
    line-height: 1.25 !important;
    top: calc(var(--header-height, 86px) + 1.2rem) !important;
  }

  .carousel-slide:nth-child(1) .carousel-content h1 {
    font-size: 2.2rem !important;
  }

  .carousel-content p {
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
    bottom: 145px !important;
  }

  .carousel-slide:nth-child(1) .carousel-content p {
    font-size: 0.88rem !important;
    bottom: 145px !important;
  }

  .carousel-content .hero-actions {
    bottom: 75px !important;
    left: var(--spacing-md, 1.5rem) !important;
    right: var(--spacing-md, 1.5rem) !important;
    gap: 0.4rem !important;
  }

  .hero-actions .btn {
    font-size: 0.8rem !important;
    padding: 0.7rem 0.3rem !important;
  }

  .circular-text {
    display: none !important;
  }

  .floating-btn-container {
    width: 50px !important;
    height: 50px !important;
    bottom: 15px !important;
    right: 15px !important;
  }

  .floating-message-btn {
    width: 50px !important;
    height: 50px !important;
  }
}


/* Push logo to far left and menu to far right on 1920px screens */
@media (min-width: 1900px) {
  .navbar .container,
  .footer .container,
  .hero-carousel-section .container {
    max-width: 1550px;
    padding: 0 2rem;
    margin: 0 auto;
  }
  
  .footer-grid {
    grid-template-columns: 1.5fr 0.8fr 1fr auto;
    gap: 3rem;
  }
}
