/* FTIG iPad adaptation. Loaded after the Windows kiosk stylesheet. */
:root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
html,body{height:100dvh;overscroll-behavior:none;-webkit-text-size-adjust:100%;}
body{padding:0;position:fixed;inset:0;touch-action:manipulation;}
button,a{touch-action:manipulation;-webkit-touch-callout:none;}
img,video{-webkit-user-drag:none;}
#app,.screen{height:100dvh;}

/* Safe areas for iPad when launched from Home Screen. */
.topbar{padding-left:max(30px,var(--safe-left));padding-right:max(30px,var(--safe-right));padding-top:var(--safe-top);height:calc(96px + var(--safe-top));}
.catalogBody{height:calc(100dvh - 96px - var(--safe-top));padding-bottom:max(24px,var(--safe-bottom)) !important;}
.attractBrand{top:calc(5% + var(--safe-top));}
.touchCta{bottom:max(5%,calc(20px + var(--safe-bottom)));}
.homeQr{bottom:max(18px,var(--safe-bottom));}

/* iPad portrait: preserve proportions rather than stretching the Windows 9:16 layout. */
@media (min-width:700px) and (max-width:1366px) and (orientation:portrait){
  .topbar{grid-template-columns:72px 1fr 72px;}
  .roundBtn{width:56px;height:56px;}
  .catalogBody{padding:24px 30px 32px !important;}
  .pageIntro h2,.sectionHeader h2{font-size:44px;}
  .pageIntro p{font-size:17px;margin-bottom:22px;}
  .brandGrid{gap:16px;height:calc(100% - 150px);}
  .brandCard{min-height:180px;padding:24px;}
  .brandCard strong{font-size:29px;}
  .brandHero{width:40%;height:88%;}
  .productGrid{grid-auto-rows:minmax(330px,38vh) !important;gap:16px !important;height:calc(100% - 100px) !important;}
  .productCard{height:auto !important;min-height:330px !important;max-height:none !important;padding:18px;}
  .productImageWrap{height:235px !important;min-height:235px !important;}
  .productCard img{max-height:215px !important;}
  .formatGrid{gap:16px !important;}
  .formatCard{min-height:0 !important;}
  .formatImageWrap{height:235px;min-height:235px;}
  .formatImageWrap img{max-height:215px;}
  .formatCardCopy strong{font-size:21px;}

  #detailView .sectionHeader.compact{margin-bottom:8px !important;}
  #detailView .detailLayout{
    height:calc(100% - 68px) !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    grid-template-rows:minmax(330px,42vh) minmax(250px,1fr) !important;
    column-gap:18px !important;row-gap:18px !important;padding-bottom:8px !important;
  }
  #detailView .heroPack,#detailView .detailMedia,#detailView .detailMedia .detailMediaItem,
  #detailView .detailInfo,#detailView .specPanel{
    height:100% !important;min-height:0 !important;max-height:none !important;
  }
  #detailView .detailMedia .detailMediaItem{padding:18px !important;}
  #detailView .detailMedia .detailMediaItem img,#detailView #detailImage{max-height:90% !important;max-width:88% !important;}
  #detailView .specTitle{padding:14px 18px;font-size:20px;}
  #detailView .specRow{padding-left:18px;padding-right:18px;}
  #detailView .specRow span{font-size:10px;}
  #detailView .specRow b{font-size:14px;}
  #detailView .detail360Wrap{padding:14px !important;}
  #detailView .detail360Wrap video{object-fit:contain !important;}
  .companyHero{padding:30px;grid-template-columns:1fr 120px;}
  .companyHero h3{font-size:32px;}
  .companyMonogram{width:110px;height:110px;}
  .companyGrid article{padding:20px;}
}

/* iPad landscape: use available width and allow vertical scrolling only inside catalog content. */
@media (min-width:900px) and (max-width:1400px) and (orientation:landscape){
  .catalogBody{padding:22px 30px 26px !important;overflow:hidden;}
  .pageIntro h2,.sectionHeader h2{font-size:40px;}
  .brandGrid{grid-template-columns:repeat(3,1fr);height:calc(100% - 135px);overflow:auto;}
  .brandCard{min-height:190px;}
  .productGrid{grid-template-columns:repeat(3,1fr) !important;grid-auto-rows:320px !important;height:calc(100% - 90px) !important;}
  .productCard{height:320px !important;min-height:320px !important;max-height:320px !important;}
  .productImageWrap{height:205px !important;min-height:205px !important;}
  .productCard img{max-height:185px !important;}
  .formatGrid{grid-template-columns:repeat(3,1fr) !important;overflow:auto;}
  .formatImageWrap{height:205px;min-height:205px;}
  .formatImageWrap img{max-height:185px;}
  #detailView .detailLayout{
    height:calc(100% - 65px) !important;
    grid-template-columns:35% 35% 30% !important;
    grid-template-rows:minmax(0,1fr) !important;
    gap:16px !important;padding-bottom:0 !important;
  }
  #detailView .heroPack{grid-column:1 !important;grid-row:1 !important;}
  #detailView .detailInfo{grid-column:2 !important;grid-row:1 !important;}
  #detailView .detail360Wrap{grid-column:3 !important;grid-row:1 !important;}
  #detailView .heroPack,#detailView .detailMedia,#detailView .detailMedia .detailMediaItem,
  #detailView .detailInfo,#detailView .specPanel,#detailView .detail360Wrap{
    height:100% !important;min-height:0 !important;max-height:none !important;
  }
  #detailView .detailMedia .detailMediaItem{padding:14px !important;}
  #detailView .detailMedia .detailMediaItem img,#detailView #detailImage{max-height:88% !important;max-width:90% !important;}
  #detailView .detail360Wrap{padding:10px !important;}
  #detailView .specTitle{padding:12px 15px;font-size:18px;}
  #detailView .specRow{padding-left:15px;padding-right:15px;gap:8px;}
  #detailView .specRow span{font-size:9px;}
  #detailView .specRow b{font-size:12px;}
}

/* Disable hover-only visual behavior on touch hardware. */
@media (hover:none){button:hover{transform:none !important;}.detail360Wrap::after{pointer-events:none !important;}}
