/* ==========================================================================
   Design App Mobile Responsive Styles
   Only affects viewports <= 768px. Desktop is completely unaffected.
   ========================================================================== */

/* Hide JS-injected mobile elements on desktop */
.mobile-hamburger,
.mobile-panel-close,
.mobile-overlay,
.mobile-bottom-bar {
  display: none !important;
}

@media (max-width: 768px) {

  /* ==========================================================================
     1. GLOBAL / RESET
     ========================================================================== */
  html {
    overflow-x: hidden !important;
  }

  body {
    min-width: 0 !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    background-color: #fff !important;
  }

  .container {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  #app-wrap {
    min-width: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    padding-bottom: 100px !important;
  }

  /* ==========================================================================
     2. HEADER (logo bar + hamburger)
     ========================================================================== */
  header {
    min-width: 0 !important;
    position: relative !important;
    height: auto !important;
    background: #fff;
    z-index: 100 !important;
  }

  header > .container {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 12px !important;
    border-bottom: 1px solid #E3E5E7;
    flex-direction: row !important;
  }

  header h1 {
    float: none !important;
    margin: 0 !important;
    order: -1;
    flex-shrink: 0;
  }

  header h1 a {
    font-size: 18px !important;
  }

  header .icon-header-separator {
    display: none !important;
  }

  /* Hamburger button */
  .mobile-hamburger {
    display: block !important;
    background: none;
    border: none;
    font-size: 22px;
    color: #475C66;
    cursor: pointer;
    padding: 8px 4px;
    order: 3;
    line-height: 1;
  }

  /* Top menu — always in DOM, no opacity (so child tooltips can render) */
  header .top-menu {
    display: block !important;
    position: absolute;
    top: 50px;
    right: 0;
    left: 0;
    z-index: 3000;
    float: none !important;
    margin: 0 !important;
    height: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    border: none !important;
    background: transparent;
  }

  /* Individual menu items — hidden by default */
  header .top-menu .top-menu-item {
    float: none !important;
    display: none !important;
    margin: 0 !important;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    line-height: normal !important;
  }

  /* When hamburger is open — show items and add menu chrome */
  header .top-menu.mobile-menu-open {
    height: auto !important;
    padding: 4px 0 !important;
    border-bottom: 1px solid #E3E5E7 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    background: #fff;
  }

  header .top-menu.mobile-menu-open .top-menu-item {
    display: block !important;
  }

  /* First item (save tooltip container) — always in DOM but collapsed */
  header .top-menu.mobile-menu-open .top-menu-item:first-child,
  header .top-menu .top-menu-item:first-child {
    display: block !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: visible !important;
    position: relative !important;
  }

  header .top-menu .top-menu-item:first-child > a,
  header .top-menu .top-menu-item:first-child > p {
    display: none !important;
  }

  header .top-menu .top-menu-item:last-child {
    border-bottom: none;
  }

  /* Chat/phone items — match desktop styling */
  header .top-menu .top-menu-item[style*="margin-top:-10px"] {
    padding: 8px 16px !important;
    margin-top: 0 !important;
    line-height: 1.3 !important;
    border-bottom: none !important;
  }

  header .top-menu .top-menu-item[style*="margin-top:-10px"] a {
    line-height: 1.3 !important;
    display: inline !important;
  }

  header .top-menu .top-menu-item[style*="margin-top:-10px"] font {
    line-height: 1.3 !important;
  }

  /* Separator between Live Chat and Phone sections */
  header .top-menu .top-menu-item[style*="margin-top:-10px"] + .top-menu-item[style*="margin-top:-10px"] {
    border-top: 1px solid #f0f0f0 !important;
    margin-top: 2px !important;
    padding-top: 8px !important;
  }

  header .top-menu .top-menu-item a {
    font-size: 14px !important;
    display: block;
    color: #475C66;
    text-decoration: none;
  }

  /* ==========================================================================
     3. TOOLBAR (Choose Shirt / Add Text / Upload / Clipart tabs)
     ========================================================================== */
  #main-menu {
    height: auto !important;
    clear: both;
    border-top: 1px solid #E3E5E7 !important;
    background: #fff;
  }

  #main-menu > .container {
    padding: 0 !important;
  }

  #toolbar {
    width: 100% !important;
    min-width: 0 !important;
    float: none !important;
    display: flex !important;
    margin: 0;
    height: auto !important;
    border-left: none !important;
  }

  #toolbar li {
    flex: 1;
    width: auto !important;
    min-width: 0 !important;
  }

  /* Keep desktop-sized icons and text — just slightly smaller */
  #toolbar a {
    font-size: 10px !important;
    padding-top: 40px !important;
    height: 22px !important;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    border-right: 1px solid #E3E5E7 !important;
  }

  #toolbar li:last-child a {
    border-right: none !important;
  }

  /* Active tab arrow indicator */
  #toolbar a.active .nav-arrow {
    bottom: -12px !important;
  }

  /* Hide estimate's direct content but keep tooltips functional */
  #estimate {
    height: 0 !important;
    overflow: visible !important;
    float: none !important;
    clear: both !important;
    position: relative !important;
  }

  #estimate #estimate-price,
  #estimate #estimate-qty,
  #estimate > .buy-now-button,
  #estimate > .open-quote-tooltip-button {
    display: none !important;
  }

  /* Zero ink notice — show as fixed toast when triggered */
  #estimate #zero-ink-notice {
    position: fixed !important;
    bottom: 68px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: auto !important;
    max-width: 280px !important;
    z-index: 3000 !important;
    border-radius: 8px !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25) !important;
    background: #fff !important;
    padding: 12px 16px !important;
    text-align: center !important;
  }

  #estimate #zero-ink-notice .tooltip-pointer {
    display: none !important;
  }

  /* Quote tooltip — hidden by default, full-screen when shown by JS */
  .get-quote-info-entered {
    display: none !important;
  }

  .get-quote-info-entered[style*="display: block"],
  .get-quote-info-entered[style*="display:block"] {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
    z-index: 3001 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #f5f6f8 !important;
    padding: 0 !important;
  }

  /* Header — sticky top bar */
  .get-quote-info-entered .panel-header {
    margin: 0 !important;
    padding: 14px 16px !important;
    border-radius: 0 !important;
    background: #fff !important;
    border-bottom: 1px solid #e0e0e0 !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
  }

  .get-quote-info-entered .panel-header h2 {
    font-size: 17px !important;
    flex: 1 !important;
    margin: 0 !important;
    float: none !important;
  }

  .get-quote-info-entered .panel-header .close-link {
    position: static !important;
    float: none !important;
    flex-shrink: 0 !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    order: 10 !important;
    margin-left: 8px !important;
  }

  .get-quote-info-entered .panel-header .add-t-shirt {
    font-size: 13px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  /* Details area — scrollable content */
  .get-quote-info-entered .get-quote-details {
    width: 100% !important;
    margin: 0 !important;
    padding: 12px 16px !important;
    box-sizing: border-box !important;
    flex: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Ink colors — card */
  .get-quote-info-entered .get-quote-colors {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    border-right: none !important;
    border-bottom: none !important;
    padding: 10px 12px !important;
    margin-bottom: 10px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    border-radius: 8px !important;
    border: 1px solid #e3e5e7 !important;
  }

  .get-quote-info-entered .get-quote-colors .total-inks {
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
  }

  .get-quote-info-entered .get-quote-colors .list-title {
    font-size: 12px !important;
    color: #666 !important;
  }

  /* Shirt list — full width */
  .get-quote-info-entered .scroll-wrapper {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
  }

  .get-quote-info-entered .scroll-wrapper .content {
    position: relative !important;
    overflow: visible !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
  }

  .get-quote-info-entered .t-shirt-list {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  /* Shirt item — card style */
  .get-quote-info-entered .t-shirt-item {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    padding: 12px !important;
    border-bottom: none !important;
    background: #fff !important;
    border-radius: 8px !important;
    border: 1px solid #e3e5e7 !important;
    margin-bottom: 10px !important;
  }

  .get-quote-info-entered .t-shirt-item .clip-art-image {
    float: left !important;
    width: 56px !important;
    height: 66px !important;
    margin-right: 10px !important;
    margin-bottom: 6px !important;
  }

  /* Make t-shirt-information transparent so its children participate in parent layout */
  .get-quote-info-entered .t-shirt-information {
    display: contents !important;
  }

  .get-quote-info-entered .t-shirt-information .t-shirt-name {
    font-size: 14px !important;
    font-weight: bold !important;
  }

  .get-quote-info-entered .t-shirt-information .t-shirt-price {
    font-size: 13px !important;
    color: #666 !important;
  }

  /* Size inputs — larger and more tappable */
  .get-quote-info-entered .t-shirt-size-list {
    clear: both !important;
    float: none !important;
    width: 100% !important;
    margin-top: 8px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    box-sizing: border-box !important;
    padding: 8px 0 0 0 !important;
    list-style: none !important;
    border-top: 1px solid #f0f0f0 !important;
  }

  .get-quote-info-entered .t-shirt-size {
    flex: 1 1 0 !important;
    min-width: 32px !important;
    text-align: center !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
  }

  .get-quote-info-entered .t-shirt-size .input-text-1 {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 6px 2px !important;
    text-align: center !important;
    font-size: 14px !important;
    border: 1px solid #d0d4d6 !important;
    border-radius: 4px !important;
  }

  .get-quote-info-entered .t-shirt-size label {
    font-size: 9px !important;
    display: block !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    color: #666 !important;
    margin-bottom: 2px !important;
    text-transform: uppercase !important;
    font-weight: bold !important;
  }

  /* Checkout section — fixed at bottom */
  .get-quote-info-entered .get-quote-checkout {
    clear: both !important;
    height: auto !important;
    padding: 12px 16px !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid #d0d4d6 !important;
    margin: 0 !important;
    background: #fff !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06) !important;
  }

  .get-quote-info-entered .get-quote-checkout .primary-button {
    display: block !important;
    float: none !important;
    width: 100% !important;
    text-align: center !important;
    padding: 14px !important;
    font-size: 17px !important;
    color: #fff !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    order: 2 !important;
    border-radius: 8px !important;
  }

  .get-quote-info-entered .get-quote-price {
    text-align: center !important;
    margin: 0 0 10px 0 !important;
    width: 100% !important;
    float: none !important;
    order: 1 !important;
  }

  .get-quote-info-entered .get-quote-price .subtotal {
    font-size: 28px !important;
    display: block !important;
    font-weight: bold !important;
  }

  .get-quote-info-entered .get-quote-price .labels {
    display: block !important;
    font-size: 12px !important;
    color: #666 !important;
  }

  .get-quote-info-entered .get-quote-checkout .no-items {
    order: 1 !important;
    width: 100% !important;
    text-align: center !important;
  }

  /* Hide checkout and details when save step is active */
  .get-quote-info-entered.save-step-active .get-quote-checkout {
    display: none !important;
  }
  .get-quote-info-entered.save-step-active .get-quote-details {
    display: none !important;
  }
  .get-quote-info-entered.save-step-active .add-t-shirt {
    display: none !important;
  }

  /* Hide bottom bar when quote modal is open (toggled by JS) */
  .mobile-bottom-bar.hidden {
    display: none !important;
  }

  /* Save design tooltip — anchored just above bottom bar */
  #save-design-tooltip {
    position: fixed !important;
    bottom: 68px !important;
    top: auto !important;
    left: auto !important;
    right: 12px !important;
    width: 260px !important;
    z-index: 3000 !important;
    border-radius: 8px !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25) !important;
    background: #fff !important;
  }

  #save-design-tooltip .tooltip-pointer {
    display: block !important;
    position: absolute !important;
    bottom: -7px !important;
    top: auto !important;
    right: 170px !important;
    left: auto !important;
    transform: rotate(180deg) !important;
  }

  /* When in checkout mode, point at the Quote & Buy button */
  #save-design-tooltip.save-and-checkout .tooltip-pointer {
    right: 70px !important;
  }

  #load-design-tooltip .tooltip-pointer {
    display: none !important;
  }

  #save-design-tooltip .input-text-2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Save button inside form — white text */
  #save-design-tooltip .primary-button {
    color: #fff !important;
  }

  #load-design-tooltip .primary-button {
    color: #fff !important;
  }

  /* Ensure all primary buttons in tooltips and modals have white text */
  .tooltip-outline .primary-button,
  .get-quote-info-entered .primary-button {
    color: #fff !important;
  }

  /* Edit quantities tooltip */
  #edit-quantities-tooltip {
    position: fixed !important;
    top: 100px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    z-index: 3000 !important;
  }

  /* Load design tooltip — inline within menu item */
  #load-design-tooltip {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    display: none !important;
    border: none !important;
    margin: 0 !important;
  }

  /* Show load form when parent menu item is visible (hamburger open) */
  header .top-menu.mobile-menu-open #load-design-tooltip {
    display: block !important;
  }

  /* Hide label + "Load Design" menu link text — form is self-explanatory */
  #load-design-tooltip .tooltip-label {
    display: none !important;
  }

  /* Style the "Load Design" link as a section header */
  header .top-menu .top-menu-item #top-menu-load-design {
    font-size: 13px !important;
    margin-bottom: 4px !important;
    display: block !important;
  }

  /* Load form — input + button side by side */
  #load-design-tooltip #load-design-form {
    width: 100% !important;
  }

  #load-design-tooltip #load-design-form .clearfix {
    display: flex !important;
    gap: 6px !important;
    align-items: center !important;
  }

  #load-design-tooltip #load-design-form .input-text-2 {
    flex: 1 !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
  }

  /* Load button — styled like Save button */
  #load-design-tooltip #load-design-form .primary-button {
    background: linear-gradient(to bottom, #FAFBFC, #edf0f2) !important;
    border: 1px solid #CDD5D8 !important;
    color: #465C65 !important;
    font: bold 14px 'museosans', sans-serif !important;
    padding: 10px 16px !important;
    border-radius: 3px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    text-shadow: none !important;
  }

  /* Hide other form elements that aren't needed inline */
  #load-design-tooltip #load-design-form .tooltip-loading,
  #load-design-tooltip #load-design-form #load-notice {
    display: none !important;
  }

  /* ==========================================================================
     4. CANVAS (shirt display area)
     ========================================================================== */
  #canvas,
  .heightlt768 #canvas {
    margin-left: 0 !important;
    width: 100% !important;
    float: none !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    margin-right: 0 !important;
    min-height: 0 !important;
    background-size: 100% auto !important;
    background-position: top center !important;
    background-repeat: no-repeat !important;
    overflow: visible !important;
    position: relative !important;
    padding-bottom: 10px !important;
  }

  /* Design overlay — height set by mobile.js to maintain 237:409 aspect ratio */
  #tshirt,
  .heightlt768 #tshirt {
    width: 39.5% !important;
    min-height: 200px !important;
    top: 62px !important;
    margin: 0 auto !important;
  }

  /* Scale any images inside canvas/tshirt */
  #canvas > img,
  #tshirt img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* ==========================================================================
     5. SHIRT SIDE SELECTOR (Front / Back / Sleeves)
     ========================================================================== */
  #shirt-side-select-menu,
  .heightlt768 #shirt-side-select-menu,
  .heightlt610 #shirt-side-select-menu {
    position: relative !important;
    bottom: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: clamp(100px, 41vw, calc(100vh - 350px)) 0 calc(66px + env(safe-area-inset-bottom, 0px)) 0 !important;
    padding: 8px 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
    overflow: visible !important;
    list-style: none !important;
    text-align: center !important;
  }

  #shirt-side-select-menu li {
    display: block !important;
    float: none !important;
    margin: 0 6px !important;
    padding: 0 !important;
    text-align: center !important;
    flex: 0 0 auto !important;
  }

  #shirt-side-select-menu li a {
    font-size: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    color: #748289 !important;
    text-decoration: none !important;
    overflow: hidden !important;
  }

  #shirt-side-select-menu li a img {
    width: 64px !important;
    height: 64px !important;
    display: block !important;
    margin: 0 auto 4px !important;
    background-color: #fff !important;
    border: 1px solid #d0d0d0 !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    /* Sprite is 318x79. Scale so each 78px section = 64px */
    background-size: 261px 64px !important;
  }

  /* Scaled sprite positions (desktop pos × 0.8205) */
  #front-tshirt-btn img { background-position: 0px center !important; }
  #back-tshirt-btn img { background-position: -64px center !important; }
  #left-sleeve-btn img { background-position: -130px center !important; }
  #right-sleeve-btn img { background-position: -197px center !important; }

  #shirt-side-select-menu li a span {
    font-size: 10px !important;
    display: block !important;
    text-transform: uppercase;
    font-weight: bold !important;
    word-spacing: 100vw !important;
  }

  /* ==========================================================================
     6. CONTROLS PANEL (side drawer)
     ========================================================================== */
  .controls {
    position: fixed !important;
    left: -92vw !important;
    top: 0 !important;
    width: 90vw !important;
    max-width: 340px !important;
    height: 100vh !important;
    z-index: 2000 !important;
    background: #fff;
    transition: left 0.25s ease;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-shadow: none;
    padding-top: 0 !important;
    border-right: 1px solid #C6CBCD;
  }

  .controls.mobile-panel-open {
    left: 0 !important;
    box-shadow: 4px 0 15px rgba(0,0,0,0.15);
  }

  /* Handlebar — right edge drag affordance */
  .mobile-panel-handlebar {
    display: block !important;
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 4px;
    height: 36px;
    background: #c0c4c8;
    border-radius: 2px;
    z-index: 2002;
    opacity: 0.7;
    pointer-events: none;
  }

  /* Panel close button — vertically centered in the panel header */
  .mobile-panel-close {
    display: block !important;
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    z-index: 2001;
    padding: 0 12px;
    height: 36px;
    line-height: 36px;
  }

  /* Panel header */
  .controls .panel-header {
    position: relative !important;
  }

  .interaction-panel {
    width: 100% !important;
    height: auto !important;
    border: none !important;
    margin: 0 !important;
    position: relative !important;
  }

  /* panels-container: override desktop absolute positioning (top:180px)
     Also override .heightlt768 which changes top to 150px */
  .panels-container,
  .heightlt768 .panels-container {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
  }

  /* Panel cards */
  .panels-container .panel {
    width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }

  .panels-container .panel .content {
    width: 100% !important;
    box-sizing: border-box;
  }

  .controls .panel-header {
    background: #f9f9f9 !important;
    border-bottom: 1px solid #C6CBCD !important;
    padding: 0 36px 0 12px !important;
    height: 36px !important;
    line-height: 36px !important;
  }

  .controls .panel-header h2 {
    font: bold 14px/36px 'museosans', sans-serif !important;
    color: #465C65 !important;
    margin: 0 !important;
  }

  /* Override nanoscroller — use native scrolling on mobile */
  .controls .nano {
    height: auto !important;
    overflow: visible !important;
  }

  .controls .nano > .content,
  .controls .nano .content {
    position: relative !important;
    overflow: visible !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
  }

  .controls .nano > .pane {
    display: none !important;
  }

  .controls .scroll-wrapper {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Font family panel — scrollable */
  #text-font-family .scroll-wrapper {
    height: auto !important;
    max-height: 60vh;
    overflow-y: auto !important;
  }

  /* Panel control buttons */
  .controls .panel-control-buttons {
    margin-bottom: 0;
  }

  /* Hide undo button on mobile */
  .controls .undo,
  .undo.tertiary-button {
    display: none !important;
  }

  /* Color picker grid */
  .controls .color-picker-list {
    display: flex;
    flex-wrap: wrap;
  }

  /* Clipart grid */
  .clip-art-element {
    width: 45% !important;
    margin: 2% !important;
  }

  /* Clipart panel header — color swatch next to close button */
  #clip-art-categories .panel-header,
  #clip-art-cartegory .panel-header {
    display: flex !important;
    align-items: center !important;
    padding-right: 44px !important;
    gap: 6px !important;
  }

  #clip-art-categories .panel-header h2,
  #clip-art-cartegory .panel-header h2 {
    flex-shrink: 0 !important;
  }

  #clip-art-categories .panel-header .clipart-color-dropdown,
  #clip-art-cartegory .panel-header .clipart-color-dropdown {
    order: 10 !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }

  #clip-art-categories .panel-header .clipart-categories-dropdown,
  #clip-art-cartegory .panel-header .clipart-categories-dropdown {
    flex: 1 !important;
    min-width: 0 !important;
  }

  /* Overlay backdrop */
  .mobile-overlay {
    display: none !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1999;
  }

  .mobile-overlay.active {
    display: block !important;
  }

  /* ==========================================================================
     7. BOTTOM BAR (Price + Save + Quote & Buy)
     ========================================================================== */
  .mobile-bottom-bar {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #d0d4d6;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    z-index: 1998;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  }

  .mobile-bottom-bar .mobile-price-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex-shrink: 0;
  }

  .mobile-bottom-bar .mobile-price-amount {
    font: bold 24px 'museosans', sans-serif;
    color: #475C66;
    white-space: nowrap;
  }

  .mobile-bottom-bar .mobile-price-label {
    font-size: 11px;
    color: #999;
  }

  /* Group Save and Quote & Buy together on the right */
  .mobile-bottom-bar .mobile-btn-group {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .mobile-bottom-bar .mobile-save-btn {
    background: linear-gradient(to bottom, #FAFBFC, #edf0f2);
    border: 1px solid #CDD5D8;
    color: #465C65;
    font: bold 14px 'museosans', sans-serif;
    padding: 10px 16px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
  }

  .mobile-bottom-bar .mobile-buy-btn {
    background: linear-gradient(to bottom, #6ac4ed, #2a93db);
    border: 1px solid #0074af;
    color: #fff;
    font: bold 14px 'museosans', sans-serif;
    padding: 10px 16px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
  }

  /* Hide chat/phone items from hamburger menu */
  .mobile-hide-chat {
    display: none !important;
  }

  /* ==========================================================================
     8. SELECTION HANDLERS (border + corner icons around selected items)
     ========================================================================== */
  .handlers-layout {
    z-index: 5 !important;
  }

  /* Upload panel — replicate desktop inline layout */
  #upload-panel-box {
    text-align: center !important;
    position: relative !important;
  }

  #upload-panel-box .drag-drop-notes {
    display: inline !important;
  }

  #uploadContainer {
    display: inline-block !important;
    position: static !important;
    overflow: visible !important;
    vertical-align: middle !important;
  }

  #uploadContainer .upload-button {
    width: auto !important;
    float: none !important;
  }

  #uploadContainer .input-file {
    position: fixed !important;
    left: -9999px !important;
    opacity: 0 !important;
    width: 1px !important;
    height: 1px !important;
  }

  /* Show canvas bounding box while dragging an item */
  #tshirt.mobile-dragging {
    outline: 2px dashed rgba(100, 149, 237, 0.6) !important;
    outline-offset: -1px;
  }

  .handlers-layout .handler,
  .handlers-layout .ui-resizable-handle {
    width: 16px !important;
    height: 16px !important;
    touch-action: none !important;
  }

  .handlers-layout .delete-handler {
    top: -8px !important;
    left: -8px !important;
  }

  .handlers-layout .rotate-handler {
    top: -8px !important;
    right: -8px !important;
  }

  .handlers-layout .ui-resizable-handle {
    bottom: -8px !important;
    right: -8px !important;
  }

  .handlers-layout .menu-handler {
    bottom: -8px !important;
    left: -8px !important;
  }

  /* Edit button — centered above the handlers box */
  .handlers-layout .edit-handler {
    top: -28px !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%);
    pointer-events: all !important;
    cursor: pointer !important;
    color: #586d78;
    width: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center;
    gap: 3px;
    padding: 2px 6px 2px 4px !important;
    font-size: 10px;
    font-weight: bold;
    font-family: 'museosans', sans-serif;
    white-space: nowrap;
  }

  /* ==========================================================================
     9. UPLOADED IMAGE / INK COLORS DIALOG
     ========================================================================== */
  /* Uploaded image dialog — only when actively shown */
  #dialog-container .uploaded-image.mobile-dialog-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #fff !important;
    z-index: 2001 !important;
  }

  /* Uploaded image preview — top section */
  #dialog-container .uploaded-image.mobile-dialog-open .image-example {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-height: 50vh !important;
    float: none !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f5f5f5 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }

  /* Color selection — bottom section */
  #dialog-container .uploaded-image.mobile-dialog-open .color-selection {
    flex: 1 !important;
    width: 100% !important;
    float: none !important;
    overflow-y: auto !important;
    padding: 12px !important;
    box-sizing: border-box !important;
  }

  #dialog-container .uploaded-image.mobile-dialog-open .color-selection h3 {
    font-size: 18px !important;
    margin: 0 0 6px 0 !important;
  }

  #dialog-container .uploaded-image.mobile-dialog-open .color-selection p {
    font-size: 13px !important;
    margin: 0 0 8px 0 !important;
  }

  /* Color swatches — no overlap with Full Color button */
  #dialog-container .uploaded-image.mobile-dialog-open .multiple-color-select {
    width: 100% !important;
    position: relative !important;
  }

  #dialog-container .uploaded-image.mobile-dialog-open .color-picker-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 4px !important;
    padding: 0 !important;
    margin: 0 0 8px 0 !important;
  }

  /* Custom PMS — left aligned, no box */
  #dialog-container .uploaded-image .custom-colors {
    border: none !important;
    padding: 0 !important;
    margin: 6px 0 0 0 !important;
    text-align: left !important;
    display: block !important;
    overflow: visible !important;
    float: left !important;
  }

  /* Collapse empty pantone-colors list so it doesn't push custom-pms right */
  #dialog-container .uploaded-image .custom-colors .pantone-colors {
    float: none !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: none !important;
  }

  #dialog-container .uploaded-image .custom-colors .pantone-colors:not(:empty) {
    display: flex !important;
    width: auto !important;
    height: auto !important;
    float: none !important;
    margin-bottom: 4px !important;
  }

  #dialog-container .uploaded-image .custom-pms {
    position: static !important;
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
    justify-content: flex-start !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }

  /* Input first, then ADD button */
  #dialog-container .uploaded-image .custom-pms .input-text-1 {
    float: none !important;
    width: 110px !important;
    font-size: 11px !important;
    padding: 4px !important;
    border: 1px solid #ccc !important;
    order: 1 !important;
  }

  #dialog-container .uploaded-image .custom-pms .tertiary-button {
    float: none !important;
    flex-shrink: 0 !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    order: 2 !important;
  }

  /* Full Color button — right, same row as Custom PMS */
  #dialog-container .uploaded-image .full-color-btn {
    float: right !important;
    display: inline-block !important;
    margin: 6px 0 0 0 !important;
    position: static !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
  }

  /* Fix color swatches alignment */
  #dialog-container .uploaded-image .color-picker {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  #dialog-container .uploaded-image .color-picker .regular-colors {
    padding: 0 !important;
    padding-inline-start: 0 !important;
    -webkit-padding-start: 0 !important;
    margin: 0 !important;
    list-style: none !important;
  }

  /* Action buttons — sticky at bottom */
  #dialog-container .uploaded-image.mobile-dialog-open .uploaded-image-buttons {
    flex-shrink: 0 !important;
    display: flex !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid #e0e0e0 !important;
    background: #fff !important;
    justify-content: center !important;
  }

  #dialog-container .uploaded-image.mobile-dialog-open .uploaded-image-buttons .primary-button,
  #dialog-container .uploaded-image.dialog .uploaded-image-buttons .primary-button {
    color: #fff !important;
    padding: 12px 20px !important;
    font-size: 15px !important;
  }

  /* Shared image preview styling for both dialog states */
  #dialog-container .uploaded-image.mobile-dialog-open .image-example img,
  #dialog-container .uploaded-image.dialog .image-example img {
    max-width: 100% !important;
    max-height: 48vh !important;
    object-fit: contain !important;
  }

  /* Ensure uploaded-image dialog is flex column so buttons stay visible */
  #dialog-container .uploaded-image.dialog {
    display: flex !important;
    flex-direction: column !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
  }

  #dialog-container .uploaded-image.dialog .color-selection {
    flex: 1 !important;
    overflow-y: auto !important;
    float: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 12px 12px 70px 12px !important;
    margin: 0 !important;
    min-height: 0 !important;
  }

  #dialog-container .uploaded-image.dialog .image-example {
    flex-shrink: 0 !important;
    float: none !important;
    width: 100% !important;
    max-height: 50vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    background: #f5f5f5 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
  }

  /* Buttons — fixed at screen bottom */
  #dialog-container .uploaded-image.dialog .uploaded-image-buttons {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    border-top: 1px solid #e0e0e0 !important;
    padding: 10px 12px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex !important;
    gap: 10px !important;
    justify-content: center !important;
    z-index: 2002 !important;
  }

  /* ==========================================================================
     10. TOOLTIPS & DIALOGS
     ========================================================================== */
  .tooltip-outline {
    max-width: 280px;
    left: 5px !important;
    right: 5px;
  }

  /* Override tooltip-outline defaults for specific tooltips */
  #save-design-tooltip.tooltip-outline {
    left: auto !important;
    right: 12px !important;
    width: 260px !important;
    max-width: none !important;
  }

  #load-design-tooltip.tooltip-outline {
    left: auto !important;
    right: auto !important;
    max-width: none !important;
  }

  /* (quote tooltip styles are above in section 4) */

  /* Change Shirt dialog — full-screen mobile modal */
  #dialog-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    z-index: 2500 !important;
  }

  #dialog-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
  }

  #dialog-container .dialog {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border: none !important;
    border-radius: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
  }

  /* ================================================================
     CHANGE SHIRT DIALOG — Mobile top/bottom split layout
     Top 1/3: horizontal scrolling product strip
     Bottom 2/3: product details, colors, "Use this Shirt" CTA
     ================================================================ */

  /* Full-screen dialog — only when visible (JS adds mobile-dialog-open class) */
  .choose-t-shirt.mobile-dialog-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #fff !important;
    z-index: 2001 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  /* Dialog header — category selector + close */
  .choose-t-shirt .dialog-header {
    flex-shrink: 0 !important;
    padding: 8px 10px !important;
    margin: 0 !important;
    border-bottom: 1px solid #e0e0e0 !important;
    display: flex !important;
    align-items: center !important;
    background: #f9f9f9 !important;
    height: auto !important;
    gap: 6px !important;
  }

  .choose-t-shirt .dialog-header h2 {
    font-size: 13px !important;
    margin: 0 !important;
    float: none !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .choose-t-shirt .dialog-header .close-link {
    position: static !important;
    float: none !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }

  .choose-t-shirt .dialog-header .dropdown {
    margin: 0 !important;
    flex-shrink: 1 !important;
  }

  /* T-shirt details — takes remaining space, split top/bottom */
  .choose-t-shirt .t-shirt-details {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    overflow: hidden !important;
    min-height: 0 !important;
  }

  /* TOP STRIP: Horizontal scrolling product list */
  .choose-t-shirt .scroll-wrapper {
    flex: 0 0 auto !important;
    width: 100% !important;
    height: 145px !important;
    float: none !important;
    border-right: none !important;
    border-bottom: 1px solid #e0e0e0 !important;
    overflow: hidden !important;
    position: relative !important;
  }

  /* Right-edge shadow to hint more content is scrollable */
  .choose-t-shirt .scroll-wrapper::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 25px !important;
    height: 100% !important;
    background: linear-gradient(to right, transparent, rgba(0,0,0,0.08)) !important;
    pointer-events: none !important;
    z-index: 1 !important;
  }

  /* Thin scroll track indicator below the strip */
  .choose-t-shirt .scroll-wrapper::before {
    content: '' !important;
    position: absolute !important;
    bottom: 2px !important;
    left: 10% !important;
    width: 30% !important;
    height: 3px !important;
    background: #ccc !important;
    border-radius: 2px !important;
    z-index: 2 !important;
    pointer-events: none !important;
  }

  /* Override nano scroller — use native horizontal scroll */
  .choose-t-shirt .scroll-wrapper.nano {
    overflow: hidden !important;
    height: 145px !important;
  }

  .choose-t-shirt .scroll-wrapper .content {
    position: relative !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    height: 145px !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px !important;
  }

  /* Force visible scrollbar — override .nano .content::-webkit-scrollbar { visibility: hidden } */
  .nano .content.mobile-show-scrollbar::-webkit-scrollbar,
  .choose-t-shirt .nano .content::-webkit-scrollbar {
    height: 8px !important;
    visibility: visible !important;
    display: block !important;
    -webkit-appearance: auto !important;
  }
  .nano .content.mobile-show-scrollbar::-webkit-scrollbar-track,
  .choose-t-shirt .nano .content::-webkit-scrollbar-track {
    background: #eee !important;
    visibility: visible !important;
    border-radius: 4px !important;
  }
  .nano .content.mobile-show-scrollbar::-webkit-scrollbar-thumb,
  .choose-t-shirt .nano .content::-webkit-scrollbar-thumb {
    background: #bbb !important;
    border-radius: 4px !important;
    visibility: visible !important;
  }

  .choose-t-shirt .scroll-wrapper .pane {
    display: none !important;
  }

  /* Product list — horizontal row */
  .choose-t-shirt .t-shirt-style-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    padding: 4px 8px !important;
    padding-inline-start: 8px !important;
    margin: 0 !important;
    list-style: none !important;
    gap: 6px !important;
    height: 125px !important;
  }

  /* Individual product card in the strip */
  .choose-t-shirt .t-shirt-style {
    flex: 0 0 85px !important;
    width: 85px !important;
    text-align: center !important;
    margin: 0 !important;
    float: none !important;
  }

  .choose-t-shirt .t-shirt-style .clip-art-image {
    width: 80px !important;
    height: 90px !important;
    margin: 0 auto !important;
    padding: 1px !important;
    overflow: hidden !important;
  }

  .choose-t-shirt .t-shirt-style .clip-art-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .choose-t-shirt .t-shirt-style .t-shirt-style-name {
    font-size: 10px !important;
    display: block !important;
    margin-top: 4px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* BOTTOM SECTION: Product details + colors — very tight spacing */
  .choose-t-shirt .t-shirt-description {
    flex: 1 !important;
    width: 100% !important;
    float: none !important;
    overflow-y: auto !important;
    padding: 6px 10px !important;
    box-sizing: border-box !important;
    min-height: 0 !important;
  }

  /* Kill ALL default margins/padding inside description */
  .choose-t-shirt .t-shirt-description p {
    margin: 0 0 2px 0 !important;
  }

  .choose-t-shirt .t-shirt-description strong {
    margin: 0 !important;
  }

  .choose-t-shirt .t-shirt-description .divider {
    border-top: none !important;
    padding: 0 !important;
  }

  .choose-t-shirt .t-shirt-description .clip-art-image {
    width: 70px !important;
    height: 82px !important;
    float: left !important;
    margin-right: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }

  .choose-t-shirt .t-shirt-description .clip-art-image .t-shirt-style-link {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
  }

  .choose-t-shirt .t-shirt-description .clip-art-image img {
    width: auto !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: contain !important;
    position: static !important;
  }

  .choose-t-shirt .t-shirt-description .t-shirt-information {
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Flex row for image + info */
  .choose-t-shirt .t-shirt-description {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    align-content: flex-start !important;
  }

  .choose-t-shirt .t-shirt-description > .clip-art-image {
    flex: 0 0 80px !important;
    height: 95px !important;
    width: 80px !important;
    margin-right: 10px !important;
    margin-bottom: 4px !important;
  }

  .choose-t-shirt .t-shirt-description > .t-shirt-information {
    flex: 1 !important;
    margin-bottom: 4px !important;
  }

  .choose-t-shirt .t-shirt-description > .t-shirt-product-description {
    flex-basis: 100% !important;
    margin-bottom: 4px !important;
  }

  .choose-t-shirt .t-shirt-description > fieldset {
    flex-basis: 100% !important;
  }

  .choose-t-shirt .t-shirt-description .t-shirt-type {
    font-size: 16px !important;
  }

  .choose-t-shirt .t-shirt-description .t-shirt-product-description {
    clear: both !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  .choose-t-shirt .t-shirt-description .t-shirt-product-description p {
    margin: 0 0 3px 0 !important;
  }

  /* Choose Color fieldset — minimal spacing */
  .choose-t-shirt .t-shirt-description fieldset {
    padding: 2px 0 0 0 !important;
    margin: 0 !important;
    border: none !important;
  }

  .choose-t-shirt .t-shirt-description fieldset label {
    margin: 0 0 3px 0 !important;
    padding: 0 !important;
    display: block !important;
    font-size: 13px !important;
  }

  /* Color swatches — reset ALL inherited padding including browser defaults */
  .choose-t-shirt .color-picker-list {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    padding: 0 !important;
    padding-inline-start: 0 !important;
    -webkit-padding-start: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    border: none !important;
  }

  .choose-t-shirt .color-picker-list .color-picker-element {
    margin: 0 3px 3px 0 !important;
    padding: 0 !important;
    float: none !important;
  }

  /* "Use this Shirt" button — always visible at bottom of dialog */
  .choose-t-shirt .button-confirmation,
  .choose-t-shirt .dialog-button-container {
    flex-shrink: 0 !important;
    padding: 8px 10px !important;
    border-top: 1px solid #e0e0e0 !important;
    background: #fff !important;
    display: block !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
  }

  .choose-t-shirt .button-confirmation .primary-button,
  .choose-t-shirt .dialog-button-container .primary-button {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
    float: none !important;
    padding: 14px !important;
    font-size: 16px !important;
    color: #fff !important;
    box-sizing: border-box !important;
    border-radius: 4px !important;
  }

  /* Tshirt photos dialog — only when actively shown (JS adds mobile-dialog-open) */
  #dialog-container .tshirt-photos.mobile-dialog-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #000 !important;
    z-index: 2001 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* Main photo container — only when dialog is active */
  #dialog-container .tshirt-photos.mobile-dialog-open .image-window {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    min-height: 0 !important;
    width: 100vw !important;
    max-height: calc(100vh - 85px) !important;
    padding: 5px !important;
    box-sizing: border-box !important;
    position: relative !important;
  }

  /* Nuclear reset — force ALL descendants to behave */
  .tshirt-photos.mobile-dialog-open .image-window,
  .tshirt-photos.mobile-dialog-open .image-window * {
    position: static !important;
    float: none !important;
    overflow: visible !important;
  }

  .tshirt-photos.mobile-dialog-open .image-window {
    position: relative !important;
    overflow: hidden !important;
  }

  /* Force image to fit — override HTML width/height attributes */
  .tshirt-photos.mobile-dialog-open .image-window img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: calc(100vh - 95px) !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
  }

  .tshirt-photos.mobile-dialog-open .image-window img[height] {
    height: auto !important;
  }

  .tshirt-photos.mobile-dialog-open .image-window img[width] {
    width: auto !important;
  }

  /* Thumbnail strip — horizontal row at bottom */
  /* Thumbnail strip at bottom */
  #dialog-container .tshirt-photos.mobile-dialog-open .nano {
    flex: 0 0 auto !important;
    height: 75px !important;
    width: 100% !important;
    overflow: visible !important;
    background: rgba(0,0,0,0.85) !important;
    position: relative !important;
  }

  #dialog-container .tshirt-photos .nano .content {
    position: relative !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    top: auto !important; bottom: auto !important;
    left: auto !important; right: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 75px !important;
    padding: 8px 10px !important;
    gap: 10px !important;
    -webkit-overflow-scrolling: touch;
  }

  #dialog-container .tshirt-photos .nano .pane {
    display: none !important;
  }

  #dialog-container .tshirt-photos.mobile-dialog-open .photo-side {
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 58px !important;
    float: none !important;
    margin: 0 !important;
  }

  #dialog-container .tshirt-photos.mobile-dialog-open .photo-side img {
    width: 48px !important;
    height: 58px !important;
    object-fit: cover !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    border-radius: 3px !important;
  }

  #dialog-container .tshirt-photos.mobile-dialog-open .photo-side.active img {
    border-color: #fff !important;
    border-width: 2px !important;
  }

  /* Close button — top right, visible X on dark background */
  #dialog-container .tshirt-photos.mobile-dialog-open .close-link {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 2002 !important;
    background: rgba(255,255,255,0.25) !important;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0 !important;
  }

  /* Hide the invisible sprite icon, show a real X */
  #dialog-container .tshirt-photos.mobile-dialog-open .close-link * {
    display: none !important;
  }

  #dialog-container .tshirt-photos.mobile-dialog-open .close-link::after {
    content: '\00D7' !important;
    font-size: 28px !important;
    color: #fff !important;
    line-height: 1 !important;
    display: block !important;
    text-decoration: none !important;
  }

  #dialog-container .tshirt-photos.mobile-dialog-open .close-link {
    color: #fff !important;
    text-decoration: none !important;
  }

  /* Photo viewer header — hide title, keep close button */
  #dialog-container .tshirt-photos.mobile-dialog-open .dialog-header {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    z-index: 2002 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #dialog-container .tshirt-photos.mobile-dialog-open .dialog-header h2 {
    display: none !important;
  }

  #dialog-container .screen-name {
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* ==========================================================================
     9. HIDE OLARK CHAT & FOOTER (overlap bottom bar)
     ========================================================================== */
  /* Remove Olark chat entirely on mobile */
  #olark-wrapper,
  #habla_window_div,
  #habla_beta_container_do_not_rely_on_this_div_id,
  .olark-launch-button {
    display: none !important;
  }

  footer {
    display: none !important;
  }

  /* Short screens — shrink shirt side buttons and move up */
  @media (max-height: 700px) {
    #shirt-side-select-menu,
    .heightlt768 #shirt-side-select-menu,
    .heightlt610 #shirt-side-select-menu {
      margin-top: 60px !important;
      margin-bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important;
      padding: 4px 0 !important;
    }

    #shirt-side-select-menu li a img {
      width: 48px !important;
      height: 48px !important;
      background-size: 196px 48px !important;
    }

    #front-tshirt-btn img { background-position: 0px center !important; }
    #back-tshirt-btn img { background-position: -48px center !important; }
    #left-sleeve-btn img { background-position: -98px center !important; }
    #right-sleeve-btn img { background-position: -148px center !important; }

    #shirt-side-select-menu li a span {
      font-size: 8px !important;
    }
  }

}
