/* Pisit Metal — targeted mobile styles. Legacy desktop layout remains unchanged. */
.pm-mobile-header,.pm-mobile-hero{display:none}
@media (max-width:800px){
  body{margin:0!important}
  /* Do not override global table/TR/TD display; legacy layout depends on them. */
  img{max-width:100%;height:auto}
  iframe,video,object,embed{max-width:100%}
  input,select,textarea{max-width:100%;box-sizing:border-box}
  .pm-mobile-header{display:block;background:#e1e8ec;border-bottom:3px solid #33516a;padding:0 0 12px;font-family:Tahoma,Arial,sans-serif;box-sizing:border-box;color:#213f50}
  /* Company banner is now the FIRST visual element on mobile. */
  .pm-mobile-header .pm-logo-link{display:block;width:100%;max-width:968px;margin:0 auto;text-decoration:none}
  .pm-mobile-header .pm-logo-link img{display:block;width:100%;height:auto;max-width:100%}
  .pm-mobile-header .pm-tagline{display:block;font-size:12px;margin:9px 14px;color:#395668}
  .pm-mobile-header details{margin:9px 14px 0}
  /* Hide the old copy of the banner, which follows the hero in the legacy table. */
  .pm-desktop-banner{display:none!important}
  .pm-mobile-header summary{padding:9px 12px;border:1px solid #8ea1ac;border-radius:5px;background:#fff;cursor:pointer;color:#173d59;font-weight:bold}
  .pm-mobile-header nav{display:flex;flex-direction:column;gap:3px;margin-top:5px}
  .pm-mobile-header nav a{display:block;background:white;color:#173d59;text-decoration:none;padding:10px 12px;border-bottom:1px solid #c9d6de}
  .pm-mobile-hero{display:block;margin:0 auto;max-width:968px}
  .pm-mobile-hero img{display:block;width:100%;height:auto}
  /* Old JS slideshow is strictly 968x352; keep it unchanged on desktop only. */
  #wrapper{display:none!important}
  body>table{max-width:100%!important;width:100%!important}
  body>table:first-of-type>tbody>tr>td>table{max-width:100%!important;width:100%!important}
  .pm-content-layout{display:block!important;width:100%!important;max-width:100%!important;border-spacing:0}
  .pm-content-layout>tbody{display:block!important}
  .pm-content-layout>tbody>tr{display:flex!important;flex-direction:column;align-items:stretch;width:100%!important}
  .pm-content-layout>tbody>tr>td{display:block!important;box-sizing:border-box;width:100%!important;max-width:100%!important;height:auto!important}
  .pm-content-layout .pm-main{order:1;padding:8px 12px!important}
  .pm-content-layout .pm-sidebar{order:2;padding:10px 12px!important}
  .pm-main table{max-width:100%!important}
  .pm-main table[width]{width:100%!important}
  .pm-main table[width="749"]{table-layout:fixed}
  .pm-main table[width="749"] td{width:auto!important}
  .pm-main td,.pm-main p,.pm-main h1,.pm-main h2,.pm-main h3{overflow-wrap:break-word}
  .pm-main img{max-width:100%!important;height:auto!important}
  .pm-main iframe{max-width:100%!important}
  .pm-top-navigation-row,.pm-legacy-navigation-row{display:none!important}
  .pm-footer-links{width:100%!important;max-width:100%!important}
  .pm-footer-links>tbody>tr{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:3px 6px}
  .pm-footer-links>tbody>tr>td{display:block;width:auto!important;max-width:100%;height:auto!important;padding:6px;font-size:12px}
  .pm-footer-links>tbody>tr>td:first-child{width:100%!important;text-align:center}
  h1{max-width:100%}
}
@media (max-width:420px){
 .pm-content-layout .pm-main{padding:6px!important}
 .pm-main table[width="749"] td{font-size:12px!important}
 .pm-main table[width="749"] h3{font-size:12px!important;line-height:1.3}
}

/* V4: Homepage product thumbnails — mobile-only fixes.
   The original three-column desktop table and SEO text remain unchanged. */
@media (max-width:800px){
  .pm-main .pm-product-showcase{
    width:100%!important;
    max-width:100%!important;
    table-layout:fixed;
    border-collapse:collapse;
    border-spacing:0;
    margin:0 auto 10px;
  }
  .pm-main .pm-product-showcase > tbody > tr:first-child{display:none!important}
  .pm-main .pm-product-showcase > tbody > tr:nth-child(2),
  .pm-main .pm-product-showcase > tbody > tr:nth-child(3){
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
    width:100%;
  }
  .pm-main .pm-product-showcase > tbody > tr:nth-child(2) > td,
  .pm-main .pm-product-showcase > tbody > tr:nth-child(3) > td{
    display:block!important;
    width:auto!important;
    min-width:0;
    height:auto!important;
    box-sizing:border-box;
    padding:0!important;
    vertical-align:top;
  }
  .pm-main .pm-product-showcase > tbody > tr:nth-child(2) > td img{
    display:block;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    aspect-ratio: 268 / 182;
    object-fit:cover;
    object-position:center;
    border:0;
    margin:0;
  }
  .pm-main .pm-product-showcase > tbody > tr:nth-child(3) > td{
    background-image:none!important;
    background-color:#e3e8eb;
    border-radius:0 0 4px 4px;
    padding:6px 3px 8px!important;
    text-align:center;
  }
  .pm-main .pm-product-showcase > tbody > tr:nth-child(3) > td h3{
    margin:0!important;
    padding:0!important;
    font-size:clamp(11px,2.8vw,15px)!important;
    line-height:1.4!important;
    font-weight:bold;
    overflow-wrap:break-word;
  }
  .pm-main .pm-product-showcase > tbody > tr:nth-child(3) > td h3 font{
    color:#263744!important;
  }
  .pm-main .pm-product-showcase > tbody > tr:nth-child(3) > td br{display:none}
}


/* V5: actual mobile slideshow — desktop Sliderman remains unchanged. */
@media (max-width:800px){
  .pm-mobile-hero{position:relative;overflow:hidden;background:#10242f;touch-action:pan-y}
  .pm-mobile-slides{position:relative;aspect-ratio:968/352;width:100%}
  .pm-mobile-hero .pm-mobile-slide{position:absolute;inset:0;display:block;width:100%;height:100%!important;max-width:none;object-fit:cover;opacity:0;visibility:hidden;transition:opacity .5s ease;pointer-events:none}
  .pm-mobile-hero .pm-mobile-slide.is-active{opacity:1;visibility:visible;pointer-events:auto}
  .pm-mobile-hero .pm-slide-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:2;border:0;border-radius:4px;background:rgba(0,0,0,.4);color:white;font-size:24px;line-height:1;width:32px;height:42px;cursor:pointer}
  .pm-mobile-hero .pm-slide-prev{left:6px}
  .pm-mobile-hero .pm-slide-next{right:6px}
  .pm-mobile-hero .pm-slide-dots{position:absolute;bottom:8px;left:0;right:0;z-index:2;display:flex;justify-content:center;gap:8px}
  .pm-mobile-hero .pm-slide-dots button{width:10px;height:10px;border:1px solid #fff;border-radius:50%;background:rgba(0,0,0,.3);padding:0;cursor:pointer}
  .pm-mobile-hero .pm-slide-dots button.is-active{background:#fff}
}
@media (prefers-reduced-motion:reduce){.pm-mobile-hero .pm-mobile-slide{transition:none}}

/* V8: Expanded navigation on initial page load and visible current-page state.
   Only affects the mobile menu; users can still collapse it manually. */
@media (max-width:800px){
  .pm-mobile-header nav a.pm-current-page,
  .pm-mobile-header nav a[aria-current="page"]{
    background:#d5e8f3;
    color:#073b5c;
    font-weight:700;
    border-left:4px solid #1473a3;
    padding-left:8px;
  }
}

/* V10: Keep ONLY the currently selected section visible on mobile.
   Other destinations are revealed on demand with the native details control. */
@media (max-width:800px){
  .pm-mobile-header .pm-mobile-menu{margin:9px 14px 0}
  .pm-mobile-header .pm-active-menu a{
    display:block;box-sizing:border-box;padding:11px 12px 11px 9px;
    background:#d5e8f3;color:#073b5c;font-weight:bold;text-decoration:none;
    border:1px solid #9dbaca;border-left:4px solid #1473a3;border-radius:5px;
  }
  .pm-mobile-header .pm-other-menu{margin:6px 0 0}
  .pm-mobile-header .pm-other-menu summary{background:#fff}
  .pm-mobile-header .pm-other-menu nav{margin:5px 0 0}
}

/* V11: Current page title IS the expandable menu header on mobile.
   The second independent current-page strip from V10 has been removed. */
@media (max-width:800px){
  .pm-mobile-header .pm-mobile-menu{margin:9px 14px 0}
  .pm-mobile-header .pm-other-menu{margin:0}
  .pm-mobile-header .pm-other-menu > summary{
    display:flex;align-items:center;justify-content:space-between;
    gap:12px;box-sizing:border-box;min-height:52px;
    padding:11px 13px 11px 10px;
    background:#d5e8f3;color:#073b5c;font-weight:700;
    border:1px solid #9dbaca;border-left:4px solid #1473a3;
    border-radius:5px;list-style:none;cursor:pointer;
  }
  .pm-mobile-header .pm-other-menu > summary::-webkit-details-marker{display:none}
  .pm-mobile-header .pm-other-menu > summary::marker{content:''}
  .pm-mobile-header .pm-other-menu .pm-menu-title{display:inline-block}
  .pm-mobile-header .pm-other-menu .pm-menu-chevron{font-size:18px;line-height:1;transition:transform .2s ease}
  .pm-mobile-header .pm-other-menu[open] .pm-menu-chevron{transform:rotate(180deg)}
  .pm-mobile-header .pm-other-menu nav{margin:5px 0 0}
}
@media (prefers-reduced-motion:reduce){
  .pm-mobile-header .pm-other-menu .pm-menu-chevron{transition:none}
}
