/*
=====================================
  HERO SECTION
  Main hero, forms, buttons, emergency
=====================================
*/

/*---------------------------------------
  SITE HEADER BACKGROUND
-----------------------------------------*/
.site-header {
  background-image: url("../images/empty-living-room-with-blue-sofa-plants-table-empty-white-wall-background-3d-rendering.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  padding-top: 80px;
  padding-bottom: 150px;
}

/* Reduce site header padding for mobile */
@media (max-width: 575.98px) {
  .site-header {
    padding-top: 30px;
    padding-bottom: 100px;
  }
}

/* Reduce site header padding for tablets */
@media (min-width: 576px) and (max-width: 991.98px) {
  .site-header {
    padding-top: 50px;
    padding-bottom: 120px;
  }
}

/* Override hero section height for mobile to reduce top spacing */
@media (max-width: 767.98px) {
  .hero-section {
    min-height: calc(100vh - 45px) !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  .hero-section-text {
    margin-top: -15px !important;
    padding-top: 0 !important;
  }

  /* Target emergency service and form specifically */
  .hero-section-text .row:first-child {
    margin-top: -20px !important;
  }

  #emergency-service-container {
    margin-top: -10px !important;
  }

  .hero-form {
    margin-top: -5px !important;
  }
}

/* Extra spacing reduction for small mobile devices */
@media (max-width: 480px) {
  .hero-section {
    min-height: calc(100vh - 35px) !important;
    margin-top: 0 !important;
  }

  .hero-section-text {
    margin-top: 0 !important;
    padding-top: 0px !important;
  }
}

/* Even more reduction for very small mobile devices */
@media (max-width: 380px) {
  .hero-section {
    min-height: calc(100vh - 25px) !important;
    margin-top: 0 !important;
  }

  .hero-section-text {
    margin-top: 0 !important;
    padding-top: 0px !important;
  }
}

/*---------------------------------------
  HERO SECTION
-----------------------------------------*/
.hero-section {
  position: relative;
  padding-bottom: 50px;
  min-height: calc(100vh - var(--header-toolbar-combined-height));
  z-index: 1;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("../images/slideshow/board.jpg");
  background-size: var(--hero-bg-size, cover);
  background-position: var(--hero-bg-position, center center);
  background-repeat: no-repeat;
  /* filter: brightness(0.6) contrast(1.05); */ /* color-themes.css */
  z-index: -1;
}

/* Smart Background Image Positioning System */
/* -------------------------------------------------- */

/* Mobile Portrait (0-575px) - Show top/center part of image */
@media (max-width: 575.98px) {
  :root {
    --hero-bg-size: auto 100%;
    --hero-bg-position: top center;
  }
}

/* Mobile Landscape/Small Tablet (576-767px) - Show upper center */
@media (min-width: 576px) and (max-width: 767.98px) {
  :root {
    --hero-bg-size: auto 120%;
    --hero-bg-position: center top;
  }
}

/* Tablet Portrait (768-991px) - Show center area */
@media (min-width: 768px) and (max-width: 991.98px) {
  :root {
    --hero-bg-size: cover;
    --hero-bg-position: center center;
  }
}

/* Desktop (992-1199px) - Show full image with smart positioning */
@media (min-width: 992px) and (max-width: 1199.98px) {
  :root {
    --hero-bg-size: cover;
    --hero-bg-position: center 40%;
  }
}

/* Large Desktop (1200px+) - Optimal positioning */
@media (min-width: 1200px) {
  :root {
    --hero-bg-size: cover;
    --hero-bg-position: center 35%;
  }
}

/* Ultra-wide screens (1600px+) - Prevent image stretching */
@media (min-width: 1600px) {
  :root {
    --hero-bg-size: auto 100%;
    --hero-bg-position: center center;
  }
}

/* Reduce padding for mobile and tablet */
@media (max-width: 991.98px) {
  .hero-section {
    padding-bottom: 0;
  }
}

.hero-section-text h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: var(--hero-heading-shadow, 2px 2px 4px rgba(0, 0, 0, 0.5));
  color: var(--hero-heading-color, var(--color-white, #ffffff));
  line-height: 1.2;
}

.hero-section-text {
  animation: fadeInUp 0.8s ease-out;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
}

/*---------------------------------------
  HERO FORM STYLING
-----------------------------------------*/
.hero-form {
  background: var(--hero-form-bg, rgba(255, 255, 255, 0.98));
  border-radius: 12px;
  padding: 32px;
  padding-bottom: 16px;
  box-shadow: var(--hero-form-shadow, 0 10px 30px rgba(0, 0, 0, 0.1));
  border: 1px solid var(--hero-form-border, rgba(255, 215, 79, 0.3));
  backdrop-filter: blur(10px);
  max-width: 800px;
  min-width: 600px;
  margin-left: auto;
  margin-right: auto;
  transition: all 0.3s ease;
  /* Enhanced visual connection with emergency container */
  position: relative;
  margin-top: 2rem; /* Consistent spacing with emergency container */
}

.hero-form:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* Unified background gradient container */
.hero-section-text {
  position: relative;
}

.hero-section-text::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 900px;
  height: calc(100% + 2rem);
  background: linear-gradient(180deg,
    var(--hero-emergency-bg, rgba(26, 37, 47, 0.95)) 0%,
    var(--hero-emergency-bg, rgba(26, 37, 47, 0.95)) 45%,
    var(--hero-form-bg, rgba(255, 255, 255, 0.98)) 55%,
    var(--hero-form-bg, rgba(255, 255, 255, 0.98)) 100%
  );
  border-radius: 16px;
  z-index: -1;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Restore emergency service container original styling */
#emergency-service-container {
  position: relative;
  margin-bottom: 1rem;
  background: var(--hero-emergency-bg, rgba(26, 37, 47, 0.95));
  backdrop-filter: blur(10px);
  border: 1px solid var(--hero-emergency-border, rgba(255, 215, 79, 0.3));
  border-radius: 12px;
}

.hero-form {
  position: relative;
  margin-top: 0;
  background: transparent !important;
  backdrop-filter: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* Hero form content styling with transparent background */
.hero-form .form-control,
.hero-form .btn {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.hero-form:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

/* Improved form controls */
.hero-form .form-control {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  padding: 14px 20px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.9);
}

.hero-form .form-control:focus {
  border-color: #ffd74f;
  box-shadow: 0 0 0 0.2rem rgba(255, 215, 79, 0.25);
  background: rgba(255, 255, 255, 1);
}

/* Improved button styling */
.hero-form .btn {
  border-radius: 8px;
  padding: 14px 24px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hero-form .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(25, 135, 84, 0.3);
}

/*---------------------------------------
  HERO POSTCODE FORM
-----------------------------------------*/

/* POSTCODE INPUT - Single source of truth */
#hero-postcode-input,
.hero-section-text input[type="text"].form-control,
.postcode-input {
  background: var(--hero-input-bg, rgba(255, 255, 255, 0.98)) !important;
  border: var(
    --hero-input-border,
    3px solid rgba(255, 255, 255, 0.6)
  ) !important;
  border-radius: var(--hero-input-border-radius, 16px) !important;
  font-weight: 600 !important;
  text-align: center !important;
  color: var(--hero-input-text, var(--text-primary, #2c3e50)) !important;
  backdrop-filter: blur(15px) !important;
  -webkit-backdrop-filter: blur(15px) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: var(
    --hero-input-shadow,
    0 4px 20px rgba(0, 0, 0, 0.08)
  ) !important;
  font-size: 1.1rem !important;
  padding: 12px 20px !important;
  height: auto !important;
  min-height: 52px !important;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#hero-postcode-input::placeholder,
.hero-section-text input[type="text"].form-control::placeholder,
.postcode-input::placeholder {
  color: var(
    --hero-input-placeholder,
    var(--text-secondary, #717275)
  ) !important;
  opacity: 0.7 !important;
  font-weight: 500 !important;
  text-align: center !important;
}

#hero-postcode-input:hover,
.hero-section-text input[type="text"].form-control:hover,
.postcode-input:hover {
  border-color: rgba(255, 255, 255, 0.9) !important;
  background: rgba(255, 255, 255, 1) !important;
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.12) !important;
}

#hero-postcode-input:focus,
.hero-section-text input[type="text"].form-control:focus,
.postcode-input:focus {
  border-color: var(--primary-color) !important;
  background: rgba(255, 255, 255, 1) !important;
  box-shadow: 0 0 0 5px rgba(25, 118, 210, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.15) !important;
  outline: none !important;
  transform: translateY(-3px) scale(1.02) !important;
}

/* POSTCODE INPUT GROUP */
.hero-section-text .custom-form .postcode-input-group {
  position: relative;
  width: 100%;
  display: block;
}

.hero-section-text .custom-form .postcode-input-group .postcode-input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/*---------------------------------------
  GET QUOTE BUTTON
-----------------------------------------*/
.get-quote-btn,
.hero-section-text .custom-form .get-quote-btn {
  background: linear-gradient(
    135deg,
    rgba(25, 135, 84, 0.15) 0%,
    rgba(25, 135, 84, 0.25) 100%
  ) !important;
  border: 1px solid var(--success-color) !important;
  border-radius: 12px !important;
  font-weight: 600 !important;
  text-transform: capitalize !important;
  letter-spacing: 0.3px !important;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  color: var(--success-color) !important;
  box-sizing: border-box !important;
  position: relative !important;
  overflow: hidden !important;
  font-size: 0.95rem !important;
  padding: 14px 24px !important;
  height: auto !important;
  min-height: 52px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  width: 100% !important;
  white-space: nowrap !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  box-shadow: 0 2px 8px rgba(25, 135, 84, 0.15) !important;
}

.get-quote-btn:hover,
.hero-section-text .custom-form .get-quote-btn:hover {
  background: linear-gradient(
    135deg,
    var(--success-color) 0%,
    rgba(25, 135, 84, 0.95) 100%
  ) !important;
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 6px 20px rgba(25, 135, 84, 0.3) !important;
  color: var(--white-color) !important;
  border-color: rgba(25, 135, 84, 0.8) !important;
}

.get-quote-btn:focus,
.hero-section-text .custom-form .get-quote-btn:focus {
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.2),
    0 2px 8px rgba(25, 135, 84, 0.15) !important;
  outline: none !important;
  transform: translateY(-1px) scale(1.01) !important;
}

/*---------------------------------------
  EMERGENCY SERVICES
-----------------------------------------*/

/* Emergency phone display styling - Professional */
.emergency-phone-display {
  color: var(--emergency-phone-text, #1a1a1a) !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: var(
    --emergency-phone-bg,
    linear-gradient(
      135deg,
      var(--brand-primary, #ffd74f) 0%,
      #ffed4e 50%,
      var(--brand-primary, #ffd74f) 100%
    )
  );
  border: none;
  border-radius: 50px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: var(
    --emergency-phone-shadow,
    0 8px 30px rgba(255, 215, 79, 0.4),
    0 4px 15px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3)
  );
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}

.emergency-phone-display::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.6s ease;
}

.emergency-phone-display:hover::before {
  left: 100%;
}

.emergency-phone-display:hover {
  color: #1a1a1a !important;
  background: linear-gradient(135deg, #FFC700 0%, #FFB300 50%, #FFA000 100%);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 40px rgba(255, 215, 0, 0.5),
    0 8px 25px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.emergency-phone-display:active {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4), 0 4px 15px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.emergency-phone-display i {
  background: #1a1a1a;
  color: #ffd74f;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.emergency-phone-display:hover i {
  transform: rotate(-15deg) scale(1.1);
  background: #2a2a2a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Call Now text styling - Enhanced caption */
.emergency-phone-display .call-now-text {
  color: var(--emergency-call-text-color);
  font-weight: var(--font-weight-bold);
  text-shadow: var(--emergency-text-shadow);
  margin-right: 2px;
}

.emergency-phone-display:hover .call-now-text {
  color: var(--emergency-call-text-hover);
  text-shadow: var(--emergency-text-shadow-hover);
}

/* Emergency description styling - Enhanced visibility */
.emergency-description {
  font-size: var(--font-size-base, 1rem);
  line-height: var(--line-height-base, 1.6);
  font-weight: var(--font-weight-medium, 500);
  text-shadow: var(--emergency-text-shadow);
  margin-bottom: 0.5rem;
}

/* Enhanced readability for larger screens */
@media screen and (min-width: 768px) {
  .emergency-description {
    font-size: 1.1rem;
  }
}

@media screen and (min-width: 1200px) {
  .emergency-description {
    font-size: 1.15rem;
  }
}

/* Emergency phone link styling */
.emergency-phone-link {
  color: #ffffff !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  padding: 5px 15px;
  border-radius: 25px;
  border: 2px solid transparent;
}

.emergency-phone-link:hover {
  color: #ffffff !important;
  transform: translateY(-2px);
  border-color: var(--brand-primary, #ffd74f);
  box-shadow: 0 5px 15px rgba(255, 215, 79, 0.4);
}

.emergency-phone-link i {
  transition: transform 0.3s ease;
}

.emergency-phone-link:hover i {
  transform: scale(1.2) rotate(15deg);
}

/* Emergency clock icon - simple styling */
.emergency-clock-icon {
  transition: color 0.3s ease;
}

/* Service info box improvements */
.service-info-box {
  background: var(--hero-emergency-bg, rgba(255, 255, 255, 0.15));
  backdrop-filter: blur(15px);
  border: 1px solid var(--hero-emergency-border, rgba(255, 255, 255, 0.25));
  width: 100%;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Emergency container responsive improvements */
#emergency-service-container {
  max-width: 800px;
  min-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/*---------------------------------------
  CUSTOM FORM STYLES
-----------------------------------------*/
.custom-form .input-group {
  background-color: var(--white-color);
  border: 2px solid var(--border-color);
  border-radius: 0.25rem;
  margin-bottom: 24px;
  padding-left: 20px;
}

.custom-form .textarea-group label {
  margin-top: 13px;
}

.custom-form label {
  margin-right: 10px;
  margin-bottom: 0;
}

.custom-form .form-control {
  background-color: var(--form-input-bg, var(--color-white, #ffffff));
  box-shadow: var(--form-input-shadow, none);
  border: var(--form-input-border, 0);
  color: var(--form-input-text, var(--text-primary, #2c3e50));
  padding-top: 12px;
  padding-bottom: 12px;
  outline: none;
}

.custom-form .form-control:hover,
.custom-form .form-control:focus {
  border-color: var(--form-input-focus-border, var(--brand-secondary, #f65129));
}

.custom-form button[type="submit"] {
  background: var(--secondary-color);
  border: none;
  color: var(--white-color);
  font-size: var(--p-font-size);
  font-weight: var(--font-weight-normal);
  transition: all 0.3s;
  margin-bottom: 0;
}

.custom-form button[type="submit"]:hover,
.custom-form button[type="submit"]:focus {
  background: var(--primary-color);
  border-color: transparent;
}

/*---------------------------------------
  HERO BUTTONS
-----------------------------------------*/
.hero-icon,
.contact-icon {
  color: var(--secondary-color);
}

.hero-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  margin: 60px auto;
}

.hero-btn-link {
  background: var(
    --hero-btn-bg,
    var(--btn-primary-bg, var(--brand-primary, #ffd74f))
  );
  border-radius: var(
    --hero-btn-border-radius,
    var(--border-radius-large, 25px)
  );
  color: var(
    --hero-btn-text,
    var(--btn-primary-text, var(--text-primary, #2c3e50))
  );
  font-size: var(--h4-font-size);
  width: 64px;
  height: 64px;
  line-height: 68px;
  text-align: center;
}

.hero-btn-link:hover {
  background: var(
    --hero-btn-hover-bg,
    var(--btn-primary-hover, var(--brand-secondary, #f65129))
  );
  color: var(--hero-btn-hover-text, var(--color-white, #ffffff));
}

/*---------------------------------------
  UTILITY CLASSES
-----------------------------------------*/
.transition-all-duration-300 {
  transition: all 300ms ease;
}

.emergency-container-padding-compact {
  padding: var(--emergency-padding-compact, 1rem 0.75rem);
}

/*---------------------------------------
  RESPONSIVE STYLES
-----------------------------------------*/

/* Mobile sizes - adjusted width for very small screens */
@media (max-width: 767.98px) {
  #emergency-service-container,
  .hero-form {
    min-width: auto;
    max-width: 100%;
    width: 100%;
  }

  /* Keep gradient background on mobile with adjusted sizing */
  .hero-section-text::before {
    max-width: 95%;
    width: 95%;
  }
}

/* Responsive containers for different screen sizes */
@media (min-width: 768px) {
  .hero-section-text {
    max-width: 100%;
    width: 100%;
  }

  #emergency-service-container,
  .hero-form {
    min-width: 650px;
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 992px) {
  #emergency-service-container,
  .hero-form {
    min-width: 700px;
    max-width: 850px;
  }
}

@media (min-width: 1200px) {
  #emergency-service-container,
  .hero-form {
    min-width: 750px;
    max-width: 900px;
  }
}

/* Consistent spacing for responsive layouts */
@media (max-width: 991.98px) {
  .hero-section-text {
    padding: 15px;
  }

  #emergency-service-container,
  .hero-form {
    max-width: 500px;
  }

  /* Fix Get Quote button width when it stacks below the input */
  #hero-quote-btn {
    max-width: var(--hero-btn-max-width-lg);
    margin: 0 auto;
    display: block;
  }
}

@media (max-width: 767.98px) {
  .hero-section-text {
    padding: 12px;
  }

  #emergency-service-container,
  .hero-form {
    max-width: 100%;
  }

  .hero-form {
    padding: 16px 20px; /* Reduced vertical padding */
  }
}

/* Clean responsive styles for mobile devices */
@media (max-width: 575.98px) {
  .hero-section-text {
    padding: 0.5rem 1rem !important;
    margin-top: 0 !important;
  }

  .hero-form {
    padding: 1.5rem 1rem !important; /* Reduced vertical padding */
    margin-top: 0 !important;
  }

  #emergency-service-container {
    padding: 0.5rem 1rem !important;
    margin-top: 0 !important;
  }

  /* Force hero content to start closer to top */
  .hero-section .container {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }

  .hero-section .row:first-child {
    margin-top: 0 !important;
  }

  .hero-section-text .row:first-child {
    margin-top: -10px !important;
  }
}

  /* Emergency clock cursor styles for mobile */
  .emergency-clock-icon[aria-expanded="false"] {
    cursor: pointer;
  }

  .emergency-clock-icon[aria-expanded="true"] {
    cursor: default;
  }

  .hero-form .form-control {
    padding: 12px 16px;
    font-size: 16px;
  }

  .hero-form .btn {
    padding: 12px 20px;
    font-size: 15px;
  }

  /* Responsive max-width for small screens */
  .hero-form,
  #emergency-service-container {
    max-width: 380px !important;
    margin: 0 auto !important;
  }

  /* Restore spacing between emergency services and postcode form */
  #emergency-service-container {
    margin-bottom: 1rem !important;
  }

  /* Fix Get Quote button width and centering on mobile */
  #hero-quote-btn {
    max-width: var(--hero-btn-max-width-md);
    margin: 0 auto;
    display: block;
  }
}

@media (max-width: 420px) {
  .hero-section-text {
    padding: 1.2rem 0.75rem;
  }

  /* Adjust gradient for very small screens */
  .hero-section-text::before {
    max-width: 92%;
    width: 92%;
  }

  .hero-form {
    padding: 0.75rem 0.75rem; /* Further reduced vertical padding */
  }

  #emergency-service-container {
    padding: 0.75rem;
  }

  /* Fix text wrapping in emergency service for small screens */
  #emergency-service-container h5,
  #emergency-service-container .emergency-phone-link {
    white-space: nowrap;
  }

  .hero-form .form-control {
    font-size: 0.9rem;
  }

  /* Very small screens */
  .hero-form,
  #emergency-service-container {
    max-width: 340px !important;
  }

  /* Fix Get Quote button width and centering on very small screens */
  #hero-quote-btn {
    max-width: var(--hero-btn-max-width-sm);
    margin: 0 auto;
    display: block;
  }
}

@media (max-width: 350px) {
  /* Tiny screens - adjust gradient further */
  .hero-section-text::before {
    max-width: 90%;
    width: 90%;
  }

  /* Tiny screens */
  .hero-form,
  #emergency-service-container {
    max-width: 300px !important;
  }

  /* Fix Get Quote button width and centering on tiny screens */
  #hero-quote-btn {
    max-width: var(--hero-btn-max-width-xs);
    margin: 0 auto;
    display: block;
  }

  /* Further reduce font size for very small screens */
  #emergency-service-container h5,
  #emergency-service-container .emergency-phone-link {
    font-size: 0.8rem;
    white-space: nowrap;
  }
}

/*---------------------------------------
  MODAL CONTACT FORM
  Navy Elite themed modal for quote requests
-----------------------------------------*/

/* Modal Dialog Styling */
#modal-container .modal-dialog {
  max-width: 600px;
  margin: 1.75rem auto;
}

/* Modal Content with Navy Elite Theme */
#modal-container .modal-content {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  border: 1px solid var(--navy-700);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  color: #ffffff; /* High contrast white for better readability */
}

/* Modal Header */
#modal-container .modal-header {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--navy-700);
  border-radius: 12px 12px 0 0;
  padding: 1.5rem;
}

#modal-container .modal-title {
  color: #ffffff;
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0;
}

#modal-container .btn-close {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

#modal-container .btn-close:hover {
  opacity: 1;
}

/* Modal Body */
#modal-container .modal-body {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.02);
}

/* Form Labels */
#modal-container .form-label {
  color: #ffffff;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); /* Add subtle text shadow for better contrast */
}

/* Form Controls with Navy Elite Theme */
#modal-container .form-control,
#modal-container .form-select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

#modal-container .form-control::placeholder,
#modal-container .form-select::placeholder {
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

#modal-container .form-control:focus,
#modal-container .form-select:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  color: #ffffff;
  outline: none;
}

#modal-container .form-control:valid {
  background: rgba(40, 167, 69, 0.1);
  border-color: var(--success-green);
}

#modal-container .form-control.is-invalid {
  background: rgba(220, 53, 69, 0.1);
  border-color: var(--accent-red);
}

/* Form Help Text */
#modal-container .form-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-weight: 400;
}

/* Invalid Feedback */
#modal-container .invalid-feedback {
  color: var(--accent-red);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Required Field Indicator */
#modal-container .text-danger {
  color: var(--accent-red) !important;
}

/* Modal Footer */
#modal-container .modal-footer {
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid var(--navy-700);
  border-radius: 0 0 12px 12px;
  padding: 1.5rem;
  justify-content: flex-start; /* Move buttons to the left */
  gap: 1rem; /* Add space between buttons */
}

/* Modal Buttons */
#modal-container .btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  color: white;
  font-weight: 600;
  padding: 0.75rem 2rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

#modal-container .btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

#modal-container .btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
  border-color: #ffffff;
}

#modal-container .btn-primary:hover::before {
  left: 100%;
}

#modal-container .btn-primary:active {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

#modal-container .btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  color: #ffffff;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

#modal-container .btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

#modal-container .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
  color: #ffffff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

#modal-container .btn-secondary:hover::before {
  left: 100%;
}

#modal-container .btn-secondary:active {
  transform: translateY(-1px) scale(1.01);
  background: rgba(255, 255, 255, 0.2);
}

/* Enhanced focus states for accessibility */
#modal-container .btn-primary:focus,
#modal-container .btn-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

#modal-container .btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);
}

/* Loading State */
#modal-loading .spinner-border {
  width: 2rem;
  height: 2rem;
  border-width: 0.25rem;
}

#modal-loading p {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 400;
}

/* Success Message */
#modal-success {
  background: rgba(40, 167, 69, 0.2);
  border: 1px solid var(--success-green);
  border-radius: 8px;
  color: #ffffff;
}

#modal-success .alert-heading {
  color: var(--success-green);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Error Message */
#modal-error {
  background: rgba(220, 53, 69, 0.2);
  border: 1px solid var(--accent-red);
  border-radius: 8px;
  color: #ffffff;
}

#modal-error .alert-heading {
  color: var(--accent-red);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Character Counter */
#modal-message-count {
  color: #ffffff;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Select Dropdown Options - Fix for dark backgrounds */
#modal-container .form-select {
  /* Ensure select element itself has proper styling */
  background: rgba(255, 255, 255, 0.1) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='white' d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 0.75rem center/8px 10px;
}

#modal-container .form-select option {
  background-color: #1a365d !important; /* Dark navy for dropdown options */
  color: #ffffff !important;
  padding: 8px 12px;
  border: none;
}

#modal-container .form-select option:hover,
#modal-container .form-select option:focus {
  background-color: #2c5282 !important; /* Slightly lighter navy on hover */
  color: #ffffff !important;
}

/* Fix for browser default dropdown styling */
#modal-container .form-select option:checked {
  background-color: var(--accent-blue) !important;
  color: #ffffff !important;
}

/* Fix for selected item display in the dropdown after selection */
#modal-container .form-select {
  /* Ensure selected text is visible when dropdown is closed */
  color: #ffffff !important;
}

/* Target the selected option that's displayed when dropdown is closed */
#modal-container .form-select:valid {
  color: #ffffff !important;
}

/* Additional styling for WebKit browsers (Chrome, Safari) */
#modal-container .form-select option[selected] {
  background-color: var(--accent-blue) !important;
  color: #ffffff !important;
}

/* Force selected item to be visible in the dropdown (Firefox fix) */
#modal-container .form-select::-moz-selection {
  background-color: var(--accent-blue) !important;
  color: #ffffff !important;
}

/* Force selected item to be visible in the dropdown (Chrome/Safari fix) */
#modal-container .form-select::selection {
  background-color: var(--accent-blue) !important;
  color: #ffffff !important;
}

/* Ensure the selected value text is visible when dropdown is closed */
#modal-container .form-select:has(option:checked) {
  color: #ffffff !important;
}

/* Fix for browsers that support :has() selector */
@supports selector(:has(*)) {
  #modal-container .form-select:has(option:checked) {
    color: #ffffff !important;
  }
}

/* AGGRESSIVE FIX FOR SELECTED ITEM - Override all browser defaults */
#modal-container .form-select option:checked,
#modal-container .form-select option[selected],
#modal-container .form-select option:hover,
#modal-container .form-select option:focus,
#modal-container .form-select option:active {
  background-color: #1e3a5f !important;
  background-image: none !important;
  color: #ffffff !important;
}

/* Override browser default selected option styling */
#modal-container .form-select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* Force white text for the selected value */
#modal-container .form-select:focus,
#modal-container .form-select:active,
#modal-container .form-select:valid {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* Additional fallback for stubborn browsers */
#modal-container .form-select::after {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  pointer-events: none;
}

/* FINAL FIX - Override absolutely everything */
#modal-container .form-select {
  background-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* Force the select field text to be white no matter what */
#modal-container .form-select,
#modal-container .form-select * {
  color: #ffffff !important;
}

/* Force white text for all option states */
#modal-container .form-select option,
#modal-container .form-select option:checked,
#modal-container .form-select option:selected,
#modal-container .form-select option:hover {
  background-color: #1e3a5f !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Responsive Modal Design */
@media (max-width: 575.98px) {
  #modal-container .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  #modal-container .modal-content {
    border-radius: 8px;
  }

  #modal-container .modal-header,
  #modal-container .modal-body,
  #modal-container .modal-footer {
    padding: 1rem;
  }

  #modal-container .modal-title {
    font-size: 1.25rem;
  }

  #modal-container .form-control,
  #modal-container .form-select {
    padding: 0.625rem 0.75rem;
    font-size: 0.9rem;
  }

  #modal-container .btn-primary,
  #modal-container .btn-secondary {
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    border-width: 1.5px; /* Slightly thinner border on mobile */
  }

  /* Reduce hover effects for touch devices */
  #modal-container .btn-primary:hover {
    transform: translateY(-2px) scale(1.01); /* More subtle on mobile */
  }

  #modal-container .btn-secondary:hover {
    transform: translateY(-1px) scale(1.01); /* More subtle on mobile */
  }
}

@media (max-width: 400px) {
  #modal-container .modal-header,
  #modal-container .modal-body,
  #modal-container .modal-footer {
    padding: 0.75rem;
  }

  #modal-container .form-control,
  #modal-container .form-select {
    padding: 0.5rem 0.625rem;
    font-size: 0.85rem;
  }

  #modal-container .btn-primary,
  #modal-container .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  #modal-container .modal-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; /* Vertical gap for mobile */
  }
}

/*---------------------------------------
  MODAL SCROLL FIX
  Prevent background scrolling when modal is open
-----------------------------------------*/

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
  padding-right: 0 !important; /* Override Bootstrap's scrollbar compensation */
}

/* Ensure modal itself is scrollable if content is long */
.modal-open .modal {
  overflow: hidden;
}

.modal-open .modal-dialog {
  overflow: hidden;
}

.modal-open .modal-content {
  overflow-y: auto;
  max-height: 90vh;
}

/* Fix for mobile devices */
@media (max-width: 575.98px) {
  .modal-open .modal-content {
    max-height: 85vh; /* Reduced to leave space for keyboard */
  }

  /* Ensure modal fits properly on small screens */
  .modal-open .modal-dialog {
    margin: 5px;
    max-height: calc(100vh - 10px);
  }

  /* Make modal content fully scrollable */
  .modal-open .modal-body {
    max-height: calc(85vh - 180px); /* Leave space for header and footer */
    overflow-y: auto;
  }

  /* Ensure buttons are always visible */
  .modal-open .modal-footer {
    position: sticky;
    bottom: 0;
    background: rgba(30, 58, 95, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Additional mobile fixes for very small screens */
@media (max-width: 400px) {
  .modal-open .modal-content {
    max-height: 80vh; /* Even smaller for very small screens */
  }

  .modal-open .modal-body {
    max-height: calc(80vh - 180px);
  }

  .modal-open .modal-dialog {
    margin: 2px;
  }

  /* Reduce padding on small screens */
  .modal-open .modal-body {
    padding: 1rem;
  }

  .modal-open .modal-footer {
    padding: 1rem;
  }
}
