/* WordPress / Contact Form 7 integration, intentionally isolated from source CSS */
.tbe .wpcf7, .tbe .wpcf7 form, .tbe .tbe-quote-fields {width:100%;min-width:0}
.tbe .tbe-quote-fields {display:flex;flex-direction:column;gap:20px}
.tbe .tbe-quote-fields .f-row {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.tbe .tbe-quote-fields .f-field {display:flex;flex-direction:column;gap:8px;min-width:0}
.tbe .tbe-quote-fields .wpcf7-form-control-wrap{display:block;min-width:0;width:100%}
.tbe .tbe-quote-fields :is(input:not([type=submit]),textarea,select){width:100%;max-width:100%;box-sizing:border-box}
.tbe .tbe-form-submit {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;margin-top:4px}
.tbe .tbe-form-submit p{font-size:14px;color:#6B6B60}
.tbe .tbe-form-submit .wpcf7-submit{background:#FFEA00;color:#0F0F0F;padding:16px 28px;border:0;border-radius:999px;cursor:pointer}
.tbe .wpcf7-response-output{margin:16px 0 0!important;padding:12px!important;border-radius:9px}
.tbe .wpcf7-spinner{margin:0 10px}
.tbe .tbe-form-notice{padding:14px;border:1px solid #d3d3d3;background:#fffbd7;border-radius:10px}
.tbe .tbe-fallback{padding:70px 30px}
@media(max-width:560px){
 .tbe .tbe-quote-fields .f-row{grid-template-columns:minmax(0,1fr);gap:16px}
 .tbe .tbe-form-submit{flex-direction:column;align-items:stretch}
 .tbe .tbe-form-submit .wpcf7-submit{width:100%}
}
/* TBE Electrical – Home mobile-only corrections */
@media (max-width: 560px) {
  /* Gallery: regular two-column thumbnails, not desktop mosaics */
  .tbe #gallery .gallery {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-rows: auto !important;
    gap: 10px !important;
  }
  .tbe #gallery .gallery > img,
  .tbe #gallery .gallery > .g-wide,
  .tbe #gallery .gallery > .g-tall {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    border-radius: 12px !important;
  }
  /* Keep About image prominent; position the badge inside it */
  .tbe #about .about-grid > div:first-child {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border-radius: 20px;
  }
  .tbe #about .about-img {
    width: 100% !important;
    height: 310px !important;
    object-fit: cover !important;
    object-position: center 40% !important;
    border-radius: 20px !important;
  }
  .tbe #about .about-grid > div:first-child > div[style*="position: absolute"] {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    max-width: none !important;
    padding: 12px 14px !important;
    gap: 12px !important;
    border-radius: 14px !important;
    justify-content: flex-start !important;
  }
  .tbe #about .about-grid > div:first-child > div[style*="position: absolute"] > span:first-child {
    font-size: 34px !important;
    flex: 0 0 auto;
  }
  .tbe #about .about-grid > div:first-child > div[style*="position: absolute"] > span:last-child {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
  }
  /* Reviews: JavaScript supplies one review per page on mobile */
  .tbe #reviews .rv-track {
    width: 100%;
    align-items: stretch;
  }
  .tbe #reviews .rv-page {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
  }
  .tbe #reviews .rv-page > article {
    min-height: 0 !important;
    padding: 22px !important;
    gap: 14px !important;
  }
  .tbe #reviews .rv-page > article > p {
    font-size: 15px !important;
    line-height: 1.55 !important;
  }
  .tbe #reviews .rv-arrow {
    width: 42px;
    height: 42px;
  }
}

/* ==========================================
   TBE ELECTRICAL - GALLERY LIGHTBOX
========================================== */

#gallery .gallery img {
    cursor: zoom-in;
}

#gallery .gallery img:focus-visible {
    outline: 3px solid #FFEA00;
    outline-offset: 4px;
}

/* Overlay */

.tbe-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    box-sizing: border-box;
}

.tbe-lightbox[hidden] {
    display: none !important;
}

/* Image container */

.tbe-lb-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    max-height: 100%;
    gap: 12px;
    text-align: center;
}

/* Enlarged image */

.tbe-lb-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 10px;
}

/* Caption */

.tbe-lb-caption {
    margin: 0;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Image counter */

.tbe-lb-counter {
    color: #FFEA00;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Navigation buttons */

.tbe-lb-close,
.tbe-lb-prev,
.tbe-lb-next {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.tbe-lb-close:hover,
.tbe-lb-prev:hover,
.tbe-lb-next:hover {
    background: #FFEA00;
    color: #0F0F0F;
}

/* Close */

.tbe-lb-close {
    top: 22px;
    right: 24px;
    width: 46px;
    height: 46px;
    font-size: 30px;
    z-index: 2;
}

/* Previous */

.tbe-lb-prev {
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 22px;
}

/* Next */

.tbe-lb-next {
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    font-size: 22px;
}

/* Mobile */

@media (max-width: 767px) {

    .tbe-lightbox {
        padding: 65px 15px;
    }

    .tbe-lb-image {
        max-width: 100%;
        max-height: 70vh;
        border-radius: 8px;
    }

    .tbe-lb-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .tbe-lb-prev,
    .tbe-lb-next {
        width: 38px;
        height: 38px;
        font-size: 18px;
        top: auto;
        bottom: 22px;
        transform: none;
    }

    .tbe-lb-prev {
        left: 18px;
    }

    .tbe-lb-next {
        right: 18px;
    }

    .tbe-lb-caption {
        font-size: 12px;
    }
}

