/* TR Global website/app frontend integrity fixes v054 */
:root{--tr-image-bg:#eef3fa;--tr-image-line:#d9e2ef;--tr-image-text:#59657d}
html,body{max-width:100%}
body{overflow-x:clip}
img,svg,video,canvas{max-width:100%}
:is(.product-detail-grid,.public-page-hero-grid,.public-hero-grid,.portal-layout,.portal-content,.product-visual-grid,.managed-product-grid,.fabric-grid,.team-grid,.style-workspace,.order-summary-content)>*{min-width:0}

/* Products page hero collage was previously unstyled, leaving HTML image heights in control. */
.catalogue-hero-collage{position:relative;width:100%;min-width:0;min-height:560px;border-radius:34px;overflow:hidden;background:radial-gradient(circle at 82% 18%,rgba(72,98,198,.22),transparent 28%),linear-gradient(145deg,#eef3fb,#dfe7f5);box-shadow:0 28px 70px rgba(22,28,76,.14);isolation:isolate}
.catalogue-hero-collage>img{position:absolute;display:block;width:auto!important;height:auto!important;max-width:none;object-fit:cover;border-radius:25px;border:6px solid rgba(255,255,255,.9);box-shadow:0 22px 52px rgba(15,24,73,.19)}
.catalogue-hero-collage .catalogue-main{left:7%;top:7%;width:64%!important;height:76%!important;object-position:center top;z-index:1}
.catalogue-hero-collage .catalogue-secondary{right:6%;bottom:7%;width:47%!important;height:58%!important;object-position:center top;z-index:2}
.catalogue-hero-collage .catalogue-badge{position:absolute;left:8%;right:auto;bottom:7%;z-index:3;max-width:min(74%,390px);padding:16px 18px;border:1px solid rgba(255,255,255,.78);border-radius:19px;background:rgba(17,20,69,.9);color:#fff;box-shadow:0 18px 42px rgba(15,24,73,.25);backdrop-filter:blur(14px)}
.catalogue-hero-collage .catalogue-badge span{display:block;color:#e9c77e;font-size:.67rem;font-weight:950;letter-spacing:.13em;text-transform:uppercase;margin-bottom:5px}
.catalogue-hero-collage .catalogue-badge strong{display:block;font-size:.86rem;line-height:1.4}

/* Product previews must size from available width, never force the parent wider. */
.model-preview{width:100%;max-width:100%!important;min-width:0!important}
.product-photo-card{width:100%;max-width:100%;min-width:0;min-height:0!important;aspect-ratio:4/5}
.product-photo-card>.product-photo,.product-photo-card>.product-placeholder-art{position:absolute;inset:0;width:100%!important;height:100%!important;max-width:none;display:block;object-fit:cover;object-position:center top}
.product-photo-card>.product-placeholder-art{filter:saturate(.9);background:#edf2fa}
.product-photo-card.product-photo-placeholder:before{z-index:2;background:linear-gradient(180deg,rgba(7,18,66,.02),rgba(7,18,66,.14) 54%,rgba(7,18,66,.72))}
.product-photo-placeholder .product-image-coming-soon{inset:auto 18px 112px;z-index:3;min-height:0;padding:17px 18px;border:1px solid rgba(255,255,255,.82);border-radius:20px;background:rgba(255,255,255,.91);box-shadow:0 16px 38px rgba(18,29,82,.16);backdrop-filter:blur(12px);color:#59657d}
.product-photo-placeholder .product-image-coming-soon strong{font-size:1.18rem}
.product-photo-placeholder .product-image-coming-soon-label{margin-bottom:10px;padding:6px 11px}

/* Shared image sizing for database-rendered cards and portal previews. */
:is(.visual-product-card,.managed-product-image,.fabric-card-image,.team-photo,.catalogue-admin-thumb,.file-style-lookup-image,.communication-active-thumb,.communication-style-image,.style-summary-picture-media,.style-list-card-image,.qc-selected-style-image,.qc-image-preview,.tech-pack-image-editor-preview,.doc-image,.doc-drawing,.order-sheet-images a){overflow:hidden}
:is(.visual-product-card,.managed-product-image,.fabric-card-image,.team-photo,.catalogue-admin-thumb,.file-style-lookup-image,.communication-active-thumb,.communication-style-image,.style-summary-picture-media,.style-list-card-image,.qc-selected-style-image,.qc-image-preview,.tech-pack-image-editor-preview,.doc-image,.doc-drawing,.order-sheet-images a)>img{display:block;width:100%!important;height:100%!important;max-width:none;object-fit:cover}
:is(.communication-style-image,.style-summary-picture-media,.style-list-card-image,.qc-selected-style-image,.qc-image-preview,.tech-pack-image-editor-preview,.doc-image,.doc-drawing,.order-sheet-images a)>img{object-fit:contain}
.visual-product-card>img{object-position:center top}

/* Runtime image failure treatment: no broken-image icon and no collapsed card. */
.tr-image-error{position:relative;background:linear-gradient(145deg,#f8faff,#eaf0f8)!important}
.tr-image-error>img[data-tr-image-failed="true"]{display:none!important}
.tr-image-fallback{display:grid!important;place-items:center;align-content:center;gap:7px;width:100%;min-height:120px;padding:18px;text-align:center;color:var(--tr-image-text);background:radial-gradient(circle at 78% 18%,rgba(54,82,190,.12),transparent 28%),linear-gradient(145deg,#f8faff,#edf2f9)}
.tr-image-fallback:before{content:"TR";display:grid;place-items:center;width:46px;height:46px;border-radius:15px;background:#fff;border:1px solid var(--tr-image-line);color:#18205b;font-weight:950;box-shadow:0 10px 24px rgba(18,29,82,.1)}
.tr-image-fallback strong{font-size:.82rem;color:#252d5e}.tr-image-fallback small{font-size:.72rem;line-height:1.35}

/* Long text, tables and controls should shrink or scroll instead of widening the page. */
:is(.portal-card,.card,.admin-management-card,.appointment-card,.inquiry-thread-card,.document-list-card,.style-card,.production-card){min-width:0;max-width:100%}
:is(h1,h2,h3,h4,p,strong,small,span,a,button,label,td,th){overflow-wrap:anywhere}
.table-wrap,.invoice-items-scroll,.order-summary-table-wrap,.style-browse-filters{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
input,select,textarea,button{max-width:100%}

/* Welcome/header bleed caused negative coordinates in the packaged app. */
html.tr-native-app .tr-app-welcome-top{left:auto!important;right:auto!important;max-width:100%!important}

@media(max-width:980px){
  .catalogue-hero-collage{min-height:520px;max-width:720px;margin-inline:auto}
  .catalogue-hero-collage .catalogue-main{width:68%!important;height:74%!important}
  .catalogue-hero-collage .catalogue-secondary{width:48%!important;height:55%!important}
}
@media(max-width:700px){
  body{overflow-x:hidden}
  .catalogue-hero-collage{min-height:470px;border-radius:26px}
  .catalogue-hero-collage>img{border-width:4px;border-radius:20px}
  .catalogue-hero-collage .catalogue-main{left:5%;top:5%;width:72%!important;height:70%!important}
  .catalogue-hero-collage .catalogue-secondary{right:4%;bottom:5%;width:52%!important;height:51%!important}
  .catalogue-hero-collage .catalogue-badge{left:6%;bottom:5%;max-width:76%;padding:12px 14px;border-radius:16px}
  .model-preview{margin-inline:0!important;padding:9px!important}
  .product-photo-card{min-height:0!important;width:100%!important;height:auto!important;aspect-ratio:4/5}
  .product-photo-placeholder .product-image-coming-soon{left:12px;right:12px;bottom:96px;padding:13px 14px}
  .product-photo-placeholder .product-image-coming-soon strong{font-size:1rem}
  .product-photo-placeholder .product-image-coming-soon>span:last-child{font-size:.78rem}
  .photo-caption{left:12px!important;right:12px!important;bottom:12px!important}
  html.tr-native-app .tr-app-welcome-top{margin:0!important;padding-top:max(4px,var(--app-safe-top))!important}
}

/* TR v062: keep the public mobile brand, language selector and Menu button inside the viewport. */
@media (max-width:700px){
  body.public-site .nav{gap:8px;min-width:0}
  body.public-site .brand{min-width:0;flex:1 1 auto;gap:8px;overflow:hidden}
  body.public-site .brand-mark{width:44px;height:44px;border-radius:14px;flex:0 0 44px}
  body.public-site .brand-mark img{width:36px;max-height:34px}
  body.public-site .brand-name{min-width:0;max-width:118px;overflow:hidden}
  body.public-site .brand-name strong,
  body.public-site .brand-name small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.public-site .tr-language-switcher{margin-left:auto;flex:0 0 auto}
  body.public-site .nav-toggle{margin-left:0!important;flex:0 0 auto;padding:10px 11px}
}
@media (max-width:370px){body.public-site .brand-name{display:none}}
