/* Customer-facing visual and accessibility corrections.
   Loaded last so legacy/customizer layers cannot reintroduce the audited layout failures. */

html,
body{
  min-height:100%;
}

body{
  display:flex;
  min-height:100vh;
  flex-direction:column;
  overflow-wrap:anywhere;
}

body > main,
.store-page-layout{
  width:100%;
  min-width:0;
  flex:1 0 auto;
}

/* Carousels intentionally keep off-screen replicas; clip their paint without
   creating a horizontal page scrollbar at the desktop/sidebar boundary. */
.store-page-layout{
  overflow-x:clip;
}

.site-footer{
  flex:0 0 auto;
}

/* The generic summary-card direct-child rule must never turn customer lists into rows. */
.support-ticket-panel > .ticket-list,
.support-ticket-panel > .support-ticket-list,
.returns-list-card > .ticket-list,
.summary-card > .ticket-list{
  display:grid !important;
  width:100%;
  min-width:0;
  max-width:100%;
  gap:10px;
  padding:0;
  border:0;
  overflow:visible;
}

.support-ticket-panel{
  min-width:0;
}

.support-ticket-panel .ticket-list{
  max-height:min(62vh,680px);
  overflow-x:hidden;
  overflow-y:auto;
  padding-inline-end:5px;
  scrollbar-gutter:stable;
  overscroll-behavior:contain;
}

.support-ticket-panel .support-ticket-list{
  display:grid !important;
  width:100%;
  min-width:0;
  max-width:100%;
  grid-template-columns:minmax(0,1fr) !important;
  gap:10px;
}

.support-ticket-panel .ticket-list-item{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  align-items:center;
  gap:10px;
}

.support-ticket-panel .support-ticket-list > .ticket-list-item{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) !important;
  width:100% !important;
  min-width:0 !important;
  max-width:100% !important;
  align-items:stretch !important;
}

.ticket-list-copy,
.ticket-list-copy > *{
  min-width:0;
  max-width:100%;
}

.ticket-list-copy b,
.ticket-list-copy span,
.ticket-list-copy small,
.ticket-list-meta,
.ticket-list-preview{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.ticket-number,
[data-ticket-number]{
  direction:ltr;
  unicode-bidi:isolate;
  text-align:right;
}

.ticket-list-meta{
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  font-size:.76rem;
}

.ticket-list-preview{
  font-size:.78rem;
}

.support-ticket-pagination{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:7px;
  margin-top:14px;
}

.support-ticket-pagination a,
.support-ticket-pagination span{
  display:grid;
  min-width:38px;
  min-height:38px;
  place-items:center;
  border-radius:11px;
  font-weight:800;
}

/* Long policy/content strings and legacy non-breaking spaces must not widen the viewport. */
.text-page,
.page-content,
.page-content *{
  min-width:0;
  max-width:100%;
}

.page-content{
  overflow:hidden;
  overflow-wrap:anywhere;
  word-break:normal;
}

.page-content p,
.page-content li,
.page-content a,
.page-content span,
.page-content strong{
  white-space:normal !important;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.page-content table,
.page-content pre{
  display:block;
  max-width:100%;
  overflow:auto;
}

/* Product gallery: predictable count direction and a visible scroll affordance. */
.product-gallery__counter{
  direction:ltr;
  unicode-bidi:isolate;
}

.product-gallery__thumbs{
  width:100%;
  max-width:100%;
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
}

.product-gallery__thumbs::after{
  content:"";
  flex:0 0 2px;
}

.product-gallery__scroll-hint{
  display:none;
  margin:0;
  font-size:.75rem;
  text-align:center;
}

.checkout-summary-item > span,
.confirmation-order-item > span{
  min-width:0;
}

.checkout-summary-item small,
.confirmation-order-item small,
.order-item-detail{
  display:block;
  margin-top:3px;
  font-weight:400;
  line-height:1.55;
  overflow-wrap:anywhere;
}

.confirmation-order-item__product,
.confirmation-order-item__details,
.confirmation-order-item__details > div{
  min-width:0;
}

.confirmation-order-item__details{
  display:grid;
  gap:4px;
  margin:5px 0 0;
}

.confirmation-order-item__details > div{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:6px;
  font-size:.82rem;
  line-height:1.55;
}

.confirmation-order-item__details dt,
.confirmation-order-item__details dd{
  min-width:0;
  margin:0;
  overflow-wrap:anywhere;
}

.confirmation-order-item__details dt{
  font-weight:800;
}

/* Shop filters remain visible on desktop and clearly collapse on smaller screens. */
@media (min-width:1051px){
  .store-page-layout .shop-layout{
    grid-template-columns:240px minmax(0,1fr) !important;
  }

  .shop-layout > .filters,
  .shop-layout .filters{
    display:block !important;
  }
}

/* Header category menus should advertise that more content is available. */
.header-categories__grid{
  scrollbar-width:auto !important;
}

.header-categories__grid::-webkit-scrollbar{
  width:9px !important;
  height:9px !important;
}

.shop-active-filter,
.shop-filter-state{
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:7px;
  margin-top:12px;
  padding:7px 12px;
  border-radius:999px;
  font-size:.86rem;
  font-weight:800;
}

.cart-summary-actions{
  display:grid;
  gap:10px;
  margin-top:14px;
}

.cart-item-field-label{
  display:none;
}

.checkout-form .address-default-option{
  display:flex;
  align-items:center;
  gap:8px;
}

.checkout-form input.address-default-checkbox{
  position:static !important;
  width:1rem !important;
  height:1rem !important;
  margin:0 !important;
  padding:0 !important;
  overflow:visible !important;
  clip:auto !important;
  white-space:normal !important;
}

.cart-item-product-copy{
  min-width:0;
}

.cart-item-product-copy b,
.cart-item-product-copy small{
  overflow-wrap:anywhere;
}

.cart-items-footer{
  display:flex;
  justify-content:flex-start;
  margin-top:14px;
}

.cart-summary-actions > .muted,
.cart-summary-actions > .text-link{
  display:block;
  margin:0;
  line-height:1.7;
}

@media (max-width:760px){
  .header-categories__toggle,
  .search--header__toggle,
  .cart-link--icon,
  .account-menu__toggle{
    width:44px !important;
    min-width:44px !important;
    height:44px !important;
    min-height:44px !important;
  }

  .nav-wrap--reordered .header-actions,
  .nav-wrap--reordered .header-nav-zone{
    gap:5px !important;
  }

  .support-ticket-panel .ticket-list{
    max-height:none;
    overflow:visible;
    padding-inline-end:0;
  }

  .support-ticket-panel .ticket-list-item{
    grid-template-columns:minmax(0,1fr);
    align-items:stretch !important;
  }

  .ticket-open-btn{
    width:100%;
    min-height:44px;
  }

  /* Replace the clipped 620px table with stacked product cards. */
  .cart-table{
    overflow:visible !important;
    padding:12px !important;
  }

  .cart-table table,
  .cart-table thead,
  .cart-table tbody,
  .cart-table tr,
  .cart-table th,
  .cart-table td{
    display:block;
    width:100%;
    min-width:0 !important;
  }

  .cart-table table{
    min-width:0 !important;
  }

  .cart-table thead{
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip:rect(0 0 0 0);
    white-space:nowrap;
  }

  .cart-table tbody{
    display:grid;
    gap:14px;
  }

  .cart-table tr{
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(108px,.55fr);
    gap:10px 12px;
    padding:14px;
    border-radius:16px;
  }

  .cart-table td{
    padding:0;
    border:0;
  }

  .cart-table td.cart-product{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:64px minmax(0,1fr);
    align-items:start;
  }

  .cart-table td:not(.cart-product){
    display:grid;
    gap:4px;
  }

  .cart-item-field-label{
    display:block;
    font-size:.72rem;
    font-weight:700;
  }

  .cart-table .cart-item-quantity{
    grid-column:1;
    grid-row:3;
  }

  .cart-table .cart-item-total{
    grid-column:2;
    grid-row:3;
  }

  .cart-table .cart-item-price{
    grid-column:2;
    grid-row:2;
  }

  .cart-table .cart-item-actions{
    grid-column:1/-1;
    grid-row:4;
  }

  .cart-item-quantity-control{
    display:grid;
    gap:5px;
    margin:0;
  }

  .cart-quantity-input{
    width:100%;
    min-height:44px;
  }

  .cart-table .link-btn{
    min-height:44px;
    width:100%;
    border-radius:12px;
  }

  .cart-items-footer,
  .cart-table > .btn[data-quantity-submit]{
    width:100%;
    margin-top:14px;
  }

  .cart-items-footer .btn,
  .cart-table > .btn[data-quantity-submit]{
    width:100%;
    min-height:46px;
  }

  .product-gallery__thumbs{
    padding-inline:4px 18px !important;
  }

  .product-gallery__scroll-hint{
    display:block;
  }

  .text-page{
    width:calc(100% - 24px);
    padding:18px;
  }

  .text-page h1,
  .simple h1{
    font-size:clamp(28px,9vw,36px);
    line-height:1.25;
  }

  .page-contact-actions{
    display:grid;
  }

  .page-contact-actions .btn{
    width:100%;
  }

  .site-header .header-categories__toggle,
  .site-header .search--header,
  .site-header .search--header__toggle,
  .site-header .cart-link--icon,
  .site-header .account-menu__toggle{
    --control-size:44px !important;
    width:44px !important;
    min-width:44px !important;
    max-width:44px !important;
    height:44px !important;
    min-height:44px !important;
    max-height:44px !important;
  }
}

@media (max-width:380px){
  .nav-wrap--reordered .brand--header .site-logo{
    max-width:64px !important;
  }

  .nav-wrap--reordered .header-actions,
  .nav-wrap--reordered .header-nav-zone{
    gap:2px !important;
  }
}

@media (prefers-reduced-motion:reduce){
  .ticket-list-item,
  .btn,
  .floating-whatsapp{
    transition:none !important;
  }
}
