/* Kuskuskuy production patch 2026-08-10: mobile containment + new integration panels. */
*,*::before,*::after{box-sizing:border-box}
html,body{width:100%;max-width:100%;overflow-x:clip}
body{min-width:0}
main,section,article,aside,header,footer,nav,form,fieldset,div{min-width:0}
img,picture,video,canvas,svg{max-width:100%}
img,video{height:auto}
input,select,textarea,button{max-width:100%;min-width:0}
pre,code,.codebox{max-width:100%;overflow-wrap:anywhere;word-break:break-word}
.table-wrap{width:100%;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.row-actions,.form-actions{flex-wrap:wrap}

.product-description-sections article{min-width:0}
.product-description-sections p,.product-description-sections li{overflow-wrap:anywhere}
.wa-device-facts{display:grid;gap:10px;margin:18px 0}
.wa-device-facts>div{display:grid;grid-template-columns:minmax(80px,.35fr) minmax(0,1fr);gap:12px;padding-bottom:9px;border-bottom:1px solid rgba(148,163,184,.2)}
.wa-device-facts dt{font-weight:700}.wa-device-facts dd{margin:0;overflow-wrap:anywhere}
.wa-qr-panel{text-align:center;margin:22px 0}
.wa-qr-panel img{display:block;width:min(100%,420px);height:auto;margin:14px auto;background:#fff;padding:14px;border-radius:18px}

@media (max-width:800px){
  .shell{width:calc(100% - 24px)!important;max-width:calc(100% - 24px)!important;margin-left:12px!important;margin-right:12px!important;padding-left:0!important;padding-right:0!important}
  .product-detail,.detail-content,.product-grid,.category-page-grid,.category-directory-grid,.cart-layout,.checkout-layout,.testimonial-grid{grid-template-columns:minmax(0,1fr)!important}
  .product-detail>* ,.detail-content>* ,.product-grid>* ,.category-page-grid>* ,.category-directory-grid>* ,.cart-layout>* ,.checkout-layout>*{min-width:0;max-width:100%}
  .gallery-main,.gallery-thumbs,.detail-actions,.detail-facts,.cart-items,.checkout-form,.payment-wrap,.payment-card{max-width:100%;min-width:0}
  .gallery-thumbs{overflow-x:auto;-webkit-overflow-scrolling:touch}
  .detail-actions{display:grid!important;grid-template-columns:minmax(0,1fr)!important}
  .detail-actions .button,.product-mobile-bar .button{width:100%;min-width:0;white-space:normal;text-align:center}
  .detail-facts{grid-template-columns:minmax(0,1fr)!important}
  .cart-row,.checkout-summary-item{min-width:0;max-width:100%}
  .hero-banner-image,.product-image,.category-hero-image{max-width:100%;object-fit:contain}
  .floating-wa{max-width:calc(100vw - 24px)}

  .admin-shell,.admin-main,.admin-content,.admin-topbar{width:100%;max-width:100%;min-width:0}
  .admin-content{padding-left:12px!important;padding-right:12px!important;overflow-x:hidden}
  .admin-grid,.admin-form,.stats-grid,.stats-grid-extended,.health-grid,.banner-manager-grid,.delivery-list{grid-template-columns:minmax(0,1fr)!important}
  .admin-card,.filter-card,.notice-card,.health-card,.delivery-card,.banner-manager-card{width:100%;max-width:100%;min-width:0;overflow:hidden}
  .admin-form>label,.admin-form>.full,.form-section-title{grid-column:1!important;min-width:0}
  .admin-page-head,.admin-topbar{gap:12px;align-items:flex-start;flex-wrap:wrap}
  .admin-page-head>.row-actions,.admin-page-head>form,.row-actions{width:100%}
  .row-actions>a,.row-actions>button,.row-actions>form{max-width:100%}
  .row-actions>form .admin-button{width:100%}
  .admin-button{white-space:normal}
  .settings-menu>a{min-width:0;overflow-wrap:anywhere}
  .codebox{white-space:pre-wrap!important;overflow-x:auto}
  table{max-width:none}
  .wa-device-facts>div{grid-template-columns:minmax(0,1fr)}
}

@media (max-width:420px){
  .shell{width:calc(100% - 20px)!important;max-width:calc(100% - 20px)!important;margin-left:10px!important;margin-right:10px!important}
  .admin-content{padding-left:10px!important;padding-right:10px!important}
  .product-mobile-bar{left:0!important;right:0!important;width:100%!important;max-width:100vw!important;padding-left:max(10px,env(safe-area-inset-left))!important;padding-right:max(10px,env(safe-area-inset-right))!important}
}

/* Revision 2026-08-10 r2: product detail/mobile/admin form polish. */
.product-description-sections{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:16px}
.product-description-sections article{grid-column:1!important;width:100%;max-width:100%}
.detail-short-description{margin:14px 0 4px;color:var(--muted);font-size:14px;line-height:1.7;overflow-wrap:anywhere}
.product-long-description textarea{min-height:230px;resize:vertical}
.product-optional-field{margin:0;padding:0;border:1px solid rgba(148,163,184,.24);border-radius:14px;background:#fff;overflow:hidden}
.product-optional-field summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;cursor:pointer;font-weight:700;list-style:none}
.product-optional-field summary::-webkit-details-marker{display:none}
.product-optional-field summary small{color:var(--muted);font-size:11px;font-weight:500}
.product-optional-field[open] summary{border-bottom:1px solid rgba(148,163,184,.2)}
.product-optional-field>label{display:block!important;padding:14px 16px!important;margin:0!important}
.product-optional-field textarea{width:100%;min-height:150px;resize:vertical}

@media (max-width:800px){
  body[data-page="product"] .site-header{position:sticky!important;top:0!important;z-index:90!important}
  body[data-page="product"] .detail-actions{display:none!important}
  body[data-page="home"] .product-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  body[data-page="product"] .related-products-grid{display:flex!important;grid-template-columns:none!important;gap:12px!important;overflow-x:auto!important;overflow-y:hidden;padding-bottom:8px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain}
  body[data-page="product"] .related-products-grid>.product-card{flex:0 0 min(72vw,260px);width:min(72vw,260px);max-width:min(72vw,260px);scroll-snap-align:start}
  body[data-page="product"] .product-mobile-bar{grid-template-columns:minmax(78px,.72fr) 86px minmax(130px,1.35fr)!important;gap:6px!important}
  body[data-page="product"] .product-mobile-price{min-width:0}
  body[data-page="product"] .product-mobile-price strong{display:block;white-space:nowrap;font-size:13px;overflow:hidden;text-overflow:ellipsis}
  body[data-page="product"] .product-mobile-bar .button{width:100%!important;min-height:48px!important;padding-inline:7px!important;white-space:nowrap!important}
  body[data-page="product"] .product-mobile-bar .button-secondary{font-size:10px!important;gap:4px!important}
  body[data-page="product"] .product-mobile-bar .button-buy-now{font-size:12px!important;font-weight:800!important}
}

@media (max-width:420px){
  body[data-page="product"] .product-mobile-bar{grid-template-columns:76px 78px minmax(122px,1fr)!important;padding-left:max(8px,env(safe-area-inset-left))!important;padding-right:max(8px,env(safe-area-inset-right))!important}
  body[data-page="product"] .product-mobile-price small{font-size:9px}
  body[data-page="product"] .product-mobile-price strong{font-size:12px}
  body[data-page="product"] .related-products-grid>.product-card{flex-basis:min(76vw,245px);width:min(76vw,245px);max-width:min(76vw,245px)}
}

/* Revision 2026-08-10 R3: fixed mobile product header + homepage WhatsApp artwork. */
body[data-page="home"] .floating-wa-home{
  width:64px!important;
  height:64px!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  overflow:visible!important;
  border:0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:0 10px 24px rgba(18,128,68,.20)!important;
}
body[data-page="home"] .floating-wa-home:hover{
  width:64px!important;
  transform:translateY(-2px)!important;
  box-shadow:0 14px 30px rgba(18,128,68,.25)!important;
}
body[data-page="home"] .floating-wa-image{
  display:block;
  width:64px;
  height:64px;
  object-fit:contain;
}

@media (max-width:800px){
  body[data-page="product"] .site-header{
    position:fixed!important;
    top:0!important;
    left:0!important;
    right:0!important;
    width:100%!important;
    z-index:120!important;
    transform:translateZ(0);
  }
  body[data-page="product"] main{
    padding-top:134px!important;
  }
  body[data-page="home"] .floating-wa-home{
    right:14px!important;
    bottom:102px!important;
    width:56px!important;
    height:56px!important;
  }
  body[data-page="home"] .floating-wa-image{
    width:56px;
    height:56px;
  }
}

@media (max-width:420px){
  body[data-page="product"] main{
    padding-top:134px!important;
  }
  body[data-page="home"] .floating-wa-home{
    right:12px!important;
    width:52px!important;
    height:52px!important;
  }
  body[data-page="home"] .floating-wa-image{
    width:52px;
    height:52px;
  }
}
