/* ==========================================================================
   CHB Mobile Home Estimate CTA & Modal
   Mobile-Only Feature — Completely Hidden on Desktop (>= 768px)
   ========================================================================== */

/* 1. Desktop & Tablet Suppression */
@media (min-width: 768px) {
  .chb-mobile-estimate-cta,
  .chb-estimate-backdrop,
  .chb-estimate-modal {
    display: none !important;
  }
}

/* 2. Mobile Viewport Layout & CTA Styling (< 768px) */
@media (max-width: 767px) {
  /* Eliminate layout gaps from empty mobile video container */
  .elementor-element-bfc12d9,
  .elementor-element-bfc12d9 .elementor-background-video-container {
    display: none !important;
  }

  .chb-mobile-estimate-cta {
    display: block;
    width: 100%;
    margin: 22px 0 16px 0;
    padding: 0 4px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
  }

  .chb-mobile-estimate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f36c21 0%, #e05510 100%);
    color: #ffffff;
    font-family: var(--chb-font-headings, 'Montserrat', sans-serif);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(243, 108, 33, 0.40);
    transition: box-shadow 0.12s ease, background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .chb-mobile-estimate-btn:active {
    background: #d44d08;
    box-shadow: 0 4px 12px rgba(243, 108, 33, 0.35);
  }

  .chb-mobile-estimate-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .chb-mobile-estimate-btn__text {
    flex-grow: 1;
    text-align: center;
  }

  .chb-mobile-estimate-btn__arrow {
    font-size: 1.4rem;
    line-height: 1;
    font-weight: 300;
    opacity: 0.85;
    flex-shrink: 0;
  }

  /* Backdrop */
  .chb-estimate-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 12, 16, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    transition: opacity 0.2s ease;
  }

  /* Modal Bottom Sheet */
  .chb-estimate-modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 90vh;
    overflow-y: auto;
    background: #181b22;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px 20px 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)) 20px;
    z-index: 9999;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    animation: chbSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes chbSlideUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  body.chb-modal-open {
    overflow: hidden;
  }

  .chb-estimate-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }

  .chb-estimate-modal__title {
    margin: 0;
    font-family: var(--chb-font-headings, 'Montserrat', sans-serif);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
  }

  .chb-estimate-modal__close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    color: #a0aec0;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }

  .chb-estimate-modal__close:active {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
  }

  .chb-estimate-modal__subtitle {
    margin: 0 0 20px 0;
    font-size: 0.88rem;
    color: #94a3b8;
    line-height: 1.45;
  }

  .chb-estimate-modal__options {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .chb-estimate-option-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: #20242d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .chb-estimate-option-card:active {
    background: #282d38;
    border-color: #f36c21;
  }

  .chb-estimate-option-card__num {
    font-family: var(--chb-font-headings, 'Montserrat', sans-serif);
    font-size: 1.1rem;
    font-weight: 800;
    color: #f36c21;
    opacity: 0.9;
    flex-shrink: 0;
  }

  .chb-estimate-option-card__content {
    flex-grow: 1;
    min-width: 0;
  }

  .chb-estimate-option-card__title {
    display: block;
    font-family: var(--chb-font-headings, 'Montserrat', sans-serif);
    font-size: 1.02rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
    line-height: 1.25;
  }

  .chb-estimate-option-card__desc {
    display: block;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.4;
  }

  .chb-estimate-option-card__chevron {
    font-size: 1.5rem;
    line-height: 1;
    color: #64748b;
    flex-shrink: 0;
    font-weight: 300;
  }

  .chb-estimate-option-card:active .chb-estimate-option-card__chevron {
    color: #f36c21;
  }
}
