/* Responsive corrections for secondary pages and the administration interface. */
.top-bar>div {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.top-bar .thc-address-value {
    white-space: normal;
}

.thc-v64-dash-actions {
    min-width: 0;
    max-width: 100%;
    flex-wrap: wrap;
}

/* Native select options must not dictate the width of the order form. */
.bpc-modal-dialog {
    max-height: calc(100dvh - 32px);
}

.bpc-modal-head {
    flex-shrink: 0;
}

.bpc-modal-title {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bpc-modal-close {
    flex-shrink: 0;
}

.bpc-modal-body {
    min-width: 0;
    min-height: 0;
}

.bpc-modal-body input:not([type="checkbox"]):not([type="radio"]),
.bpc-modal-body select,
.bpc-modal-body textarea {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.bpc-modal-body .thc-prov34-grid {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bpc-modal-body .thc-prov34-grid>* {
    min-width: 0;
    width: 100%;
}

.bpc-quote-sheet {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
}

/* Decorative login glows must stay inside the viewport. */
body:has(> .login-card)::before,
body:has(> .login-card)::after {
    max-width: 70vw;
}

body:has(> .login-card) {
    min-height: 100dvh;
}

body:has(> .login-card) .login-card {
    margin-block: auto;
    overflow-wrap: anywhere;
}

@media (max-width: 820px) {
    .header .header-wrap {
        flex-wrap: wrap !important;
    }

    .header .brand {
        min-width: 0;
        max-width: 100%;
    }

    .header .brand>div {
        min-width: 0;
    }

    .header .brand-title,
    .header .brand-sub {
        overflow-wrap: anywhere;
    }

    .blog-mob-actions,
    .mkt-mob-actions {
        flex-shrink: 0;
        margin-left: auto;
    }

    .blog-mob-actions>button,
    .mkt-mob-actions>button {
        flex-shrink: 0;
    }

    .bpc-nav-actions {
        max-width: 100%;
        flex-wrap: wrap !important;
    }

    .bpc-hero-pill {
        white-space: normal !important;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 600px) {
    .bpc-picker-item {
        flex-wrap: wrap;
    }

    .bpc-picker-item .bpc-sel-left {
        flex-basis: 100%;
    }

    .bpc-picker-item .bpc-sel-right {
        min-width: 0;
        max-width: 100%;
    }

    .bpc-sel-title,
    .bpc-sel-chips {
        overflow-wrap: anywhere;
    }

    .bpc-modal-head {
        flex-wrap: wrap;
    }

    .bpc-modal-head>div:has(.bpc-modal-close) {
        margin-left: auto;
        flex-wrap: wrap;
    }

    .bpc-modal-body .thc-prov34-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #bpcOrderModal .bpc-modal-body>div:has(#bpcCustName) {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    #bpcOrderMethodGroup {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .bpc-picker-search {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-height: 540px) {
    body:has(> .login-card) {
        align-items: flex-start;
    }
}
@media (max-width: 480px) {
  #thcProd5ImgModal .thc-u-modal > div { padding-left: 12px !important; padding-right: 12px !important; min-width: 0; }
  #thcProd5ImgModal .thc-v95-cards-stack,
  #thcProd5ImgModal .thc-v95-card-sec,
  #thcProd5ImgModal .thc-v95-card-sec * { min-width: 0 !important; max-width: 100%; box-sizing: border-box; }
  #thcProd5ImgModal .thc-v95-grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
  #thcProd5ImgModal .thc-v95-framing-studio { flex-wrap: wrap; }
  #thcProd5ImgModal #pm5_ImagesListWrap > div { flex-wrap: wrap !important; }
  #thcProd5ImgModal button { white-space: normal !important; overflow-wrap: anywhere; }
}
@media print {
  .bpc-modal-dialog { max-height: none; }
  .bpc-quote-sheet { overflow: visible; max-width: none; }
}

@media (max-width: 820px) {
  html body .header .header-wrap { flex-wrap: wrap !important; }
  html body .header .brand { flex: 1 1 200px !important; }
}

@media (max-width: 820px) {
  html body .header .header-wrap { display: flex !important; flex-wrap: wrap !important; }
  html body .header .nav-links { order: 3; flex-basis: 100%; }
}
@media (max-width: 480px) {
  #thcProd5ImgModal .thc-v95-img-stage-grid { grid-template-columns: minmax(0, 1fr) !important; }
  #thcProd5ImgModal .thc-v95-img-stage-grid > div { flex-wrap: wrap; }
  #thcProd5ImgModal .thc-v95-img-stage-grid span { flex-shrink: 0; }
}

@media (max-width: 480px) {
  #thcProd5ImgModal div:has(> label > input[type="file"][multiple]) { flex-wrap: wrap !important; }
  #thcProd5ImgModal label:has(> input[type="file"][multiple]) { flex: 1 1 100% !important; height: auto !important; min-height: 40px; padding: 8px; }
}
