/** Shopify CDN: Minification failed

Line 981:12 Expected identifier but found whitespace
Line 981:13 Unexpected "2px"
Line 981:24 Unexpected "{"
Line 981:34 Expected ":"
Line 1005:12 Expected identifier but found whitespace
Line 1005:13 Unexpected "2px"
Line 1005:24 Unexpected "{"
Line 1005:34 Expected ":"
Line 1217:8 Expected identifier but found whitespace
Line 1217:9 Unexpected "3px"
... and 51 more hidden warnings

**/
input#Email-template--20000194134251__newsletter {
  border-radius: 100px !important;
}

/* Center announcement bar text */
.announcement-bar {
  text-align: center !important;
}

@media screen and (min-width: 769px) {
  .announcement-bar {
    text-align: center !important;
  }
}

/* Hide images in mobile menu and remove spacing */
.slide-nav__image {
  display: none !important;
}

/* Remove padding that was reserved for images */
.slide-nav__image + span {
  padding-left: 0 !important;
}

/* Ensure all menu items align to the left */
.slide-nav__link {
  justify-content: flex-start !important;
}

.slide-nav__link > span {
  padding-left: 0 !important;
}

/* Toast Notification - Positioned on top of avatar canvas */
#avatar-canvas {
  position: relative;
  z-index: 1; /* Lower than header and mobile menu */
}

.avatar-toast {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: #389ffe;
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  border: none;
  white-space: nowrap;
}

.avatar-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.avatar-toast.hide {
  opacity: 0;
  transform: translateY(20px);
}
/* Split screen - Updated proportions */
#wrapper {
display: flex;
min-height: 100vh; /* Base height, will be adjusted by JavaScript based on content */
max-width: 2140px;
margin: 0 auto;
gap: 0;
z-index: 0; /* Lower than header (6) and mobile menu (3+) */
position: relative;
}

/* Prevent horizontal scroll on mobile */
@media screen and (max-width: 1024px) {
  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }
  
  .page-width {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 0;
    padding-right: 0;
  }
  
  #wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 0;
    padding-right: 0;
  }
}

/* Left half (categories + items) - 60% width */
#left-pane {
flex: 0 0 60%;
display: flex;
flex-direction: column;
min-height: 100vh;
padding-right: 0;
margin-right: 0;
padding-top: 0.5rem; /* Match builder-board top padding for alignment */
}

/* Right half (avatar canvas) - 40% width */
#builder-board {
flex: 0 0 40%;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
padding: 0.5rem 1rem;
position: sticky;
top: 0; /* Stick at the top - never move */
height: 100vh;
overflow-y: auto;
align-self: flex-start; /* Ensure it sticks from the top */
z-index: 1; /* Lower than header (6) and mobile menu (3+) */
}

/* Desktop: Ensure sticky positioning works properly */
@media screen and (min-width: 1025px) {
  #builder-board {
    position: sticky !important;
    /* top is set dynamically by JavaScript */
    align-self: flex-start !important;
    height: 100vh !important;
  }
}

/* Mobile Responsive Design */
@media screen and (max-width: 1024px) {
  #wrapper {
    flex-direction: column;
    min-height: auto;
    width: 100%;
    overflow-x: hidden;
    gap: 0; /* Ensure no gap between builder-board and left-pane on mobile */
  }
  
  #left-pane {
    flex: none;
    min-height: auto;
    order: 2; /* Items come second on mobile */
    width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    margin-top: 0; /* Remove top margin on mobile */
    padding-top: 0; /* Remove top padding on mobile */
  }
  
  #cat-items-container {
    width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-top: 0; /* Remove top margin on mobile */
    padding-top: 0; /* Remove top padding on mobile */
  }
  
  #item-grid-container {
    width: 100%;
    overflow-x: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Remove fixed min-height to prevent empty spacing */
    padding: 0;
    margin: 0;
  }
  
  #builder-board {
    flex: none;
    position: relative; /* Changed from static to relative for toast positioning */
    top: auto !important; /* Override sticky top positioning on mobile */
    height: auto;
    order: 1; /* Avatar comes first on mobile */
    padding: 0;
    padding-bottom: 0; /* Remove bottom padding */
    margin-bottom: 0; /* Remove bottom margin */
    background: transparent !important; /* Remove background on mobile */
    border-bottom: none; /* Remove border on mobile */
    width: 100%;
    overflow-x: hidden;
    z-index: 1 !important; /* Lower than mobile menu overlay */
  }
  
  #avatar-canvas {
    max-width: 320px;
    width: 100%;
    margin: 0 auto;
  }
  
  #avatar-controls {
    margin-top: 0.5rem;
    margin-bottom: 0; /* Remove bottom margin on mobile */
    padding: 0.75rem 0; /* Remove horizontal padding */
    padding-bottom: 0.5rem; /* Reduce bottom padding */
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-radius: 20px;
    box-sizing: border-box;
    background: transparent !important; /* Remove background on mobile */
  }
  
  .control-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
  }
  
  .control-row button {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 8px;
    font-size: 12px;
    height: 44px; /* Better touch target */
    touch-action: manipulation; /* Prevent double-tap zoom */
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  #undo-btn,
  #redo-btn {
    flex: 0 0 44px;
    min-width: 44px;
    padding: 10px;
  }
  
  #clear-btn {
    flex: 1 1 auto;
    min-width: 0;
  }
  
  #randomize-btn {
    flex: 1 1 auto;
    min-width: 0;
  }
  
  .download-row {
    margin-top: 0.75rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-sizing: border-box;
  }
  
  #save-btn,
  #download-btn {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
    padding: 12px 20px;
    font-size: 15px;
    height: 48px; /* Larger touch target */
    touch-action: manipulation;
    box-sizing: border-box;
    border-radius: 50px; /* Make download button rounder */
  }
}

@media screen and (max-width: 768px) {
  .page-width {
    padding: 0 0.75rem;
  }
  
  #builder-board {
    padding: 0; /* Remove padding on mobile */
    background: transparent !important; /* Remove background on mobile */
    border-bottom: none; /* Remove border on mobile */
  }
  
  #avatar-canvas {
    max-width: 280px;
  }
  
  #filter-toggle {
    padding: 0.25rem 0; /* Remove horizontal padding */
    position: sticky;
    top: 0;
    background: transparent !important; /* Remove background on mobile */
    z-index: 10;
    border-bottom: 1px solid #eee;
    margin-top: 0; /* Ensure no top margin */
  }
  
  .toggle-switch {
    font-size: 14px;
    padding: 0.5rem 0;
  }
  
  .toggle-label {
    font-size: 14px;
  }
  
  .toggle-slider {
    width: 52px;
    height: 26px;
    margin-right: 14px;
  }
  
  .toggle-slider::before {
    width: 18px;
    height: 18px;
    top: 4px;
    left: 4px;
  }
  
  .toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(26px);
  }
  
  #item-grid {
    padding: 0.75rem 0; /* Remove horizontal padding */
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
  }
  
  .control-row {
    gap: 0.5rem;
  }
  
  .control-row button {
    font-size: 12px;
    padding: 10px 12px;
    min-width: 65px;
    height: 42px;
  }
  
  #save-btn,
  #download-btn {
    font-size: 14px;
    padding: 12px 18px;
    height: 46px;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 50px; /* Make download button rounder */
  }
}

@media screen and (max-width: 480px) {
  .page-width {
    padding: 0 0.5rem;
  }
  
  #builder-board {
    padding: 0; /* Remove padding on mobile */
    background: transparent !important; /* Remove background on mobile */
    border-bottom: none; /* Remove border on mobile */
  }
  
  #avatar-canvas {
    max-width: 240px;
  }
  
  #filter-toggle {
    padding: 0.25rem 0; /* Remove horizontal padding */
    background: transparent !important; /* Remove background on mobile */
  }
  
  .toggle-switch {
    font-size: 13px;
  }
  
  .toggle-label {
    font-size: 13px;
  }
  
  #item-grid {
    padding: 0.5rem 0; /* Remove horizontal padding */
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 8px;
  }
  
  .item-btn {
    width: 100%;
  }
  
  #avatar-controls {
    padding: 0.5rem;
    gap: 0.5rem;
    border-radius: 15px;
    display: flex !important;
    flex-direction: column !important;
    background: transparent !important; /* Remove background on mobile */
  }
  
  /* Improve button spacing on very small screens */
  .control-row {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between;
    gap: 0.4rem;
    flex-wrap: wrap;
  }
  
  .control-row {
    display: grid !important;
    grid-template-columns: 1fr 44px 44px 1fr;
    gap: 0.4rem;
    width: 100% !important;
  }
  
  .control-row button {
    font-size: 11px;
    padding: 10px 8px;
    min-width: 0;
    height: 40px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 50px; /* Make buttons rounder */
  }
  
  #clear-btn {
    grid-column: 1;
  }
  
  #undo-btn {
    grid-column: 2;
    font-size: 18px;
    padding: 10px;
    border-radius: 50px; /* Perfect circle */
  }
  
  #redo-btn {
    grid-column: 3;
    font-size: 18px;
    padding: 10px;
    border-radius: 50px; /* Perfect circle */
  }
  
  #randomize-btn {
    grid-column: 4;
  }
  
  .download-row {
    margin-top: 0.5rem;
    gap: 0.5rem;
  }
  
  #save-btn,
  #download-btn {
    font-size: 13px;
    padding: 12px 16px;
    height: 44px;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 50px; /* Make download button rounder */
  }
  
  /* Improve touch targets for small screens */
  .cat-btn {
    min-height: 36px;
    padding: 0.4rem 0.8rem;
    touch-action: manipulation;
  }
  
  .item-btn {
    touch-action: manipulation;
  }
  
  .item-btn img {
    border-radius: 6px;
  }
}

/* Filter Toggle */
#filter-toggle {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid #eee;
}

.toggle-switch {
display: flex;
align-items: center;
cursor: pointer;
user-select: none;
}

.toggle-switch input[type="checkbox"] {
display: none;
}

.toggle-slider {
  position: relative;
  width: 50px;
  height: 22px;
  background: #B1B1B1;
  border-radius: 12px;
  transition: background 0.3s ease;
  margin-right: 12px;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 5px;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
background: #389FFE;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
transform: translateX(26px);
}

.toggle-label {
font-size: 12px;
font-weight: 500;
color: #333;
}

/* Category and Item Grid Container */
#cat-items-container {
display: flex;
flex: 1;
min-height: 0;
}

/* Category column - Slightly wider for better proportions */
/* Desktop Category List */
#cat-list {
flex: 0 0 180px;
padding: 1rem 0;
overflow-y: auto;
display: block;
}

.cat-btn {
display: block;
padding: 0.5rem 1rem;
cursor: pointer;
font-weight: 400;
font-size: 12px;
}

.cat-btn.active {
background: #e5e4df;
border-radius: 4px;
}

/* Desktop/Mobile visibility */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media screen and (max-width: 1024px) {
  .desktop-only {
    display: none !important;
  }
  
  .mobile-only {
    display: block;
  }
  
  /* Mobile Category Dropdown - Desktop-inspired design */
  #mobile-cat-dropdown {
    width: 100%;
    margin-top: 0.5rem;
    position: relative;
    z-index: 100;
  }
  
  .mobile-cat-toggle {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #e5e4df;
    border: none;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    touch-action: manipulation;
    text-align: left;
    box-shadow: none;
  }
  
  .mobile-cat-toggle:active {
    opacity: 0.8;
  }
  
  .mobile-cat-toggle.active {
    background: #e5e4df;
    box-shadow: none;
  }
  
  .mobile-cat-arrow {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: #666;
    flex-shrink: 0;
  }
  
  .mobile-cat-arrow::before {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .mobile-cat-toggle.active .mobile-cat-arrow::before {
    transform: rotate(225deg);
  }
  
  .mobile-cat-menu {
    max-height: 0;
    overflow: hidden;
    background: transparent;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
    padding: 0;
    margin-top: 0;
  }
  
  .mobile-cat-menu.open {
    max-height: 500px;
    padding: 0.5rem 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  #mobile-cat-list {
    display: flex;
    flex-direction: column;
    padding: 0;
  }
  
  #mobile-cat-list .cat-btn {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    margin: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 12px;
    font-weight: 400;
    color: #333;
    transition: background 0.2s ease;
    touch-action: manipulation;
    cursor: pointer;
  }
  
  #mobile-cat-list .cat-btn:hover,
  #mobile-cat-list .cat-btn:active {
    background: rgba(229, 228, 223, 0.3);
  }
  
  #mobile-cat-list .cat-btn.active {
    background: #e5e4df;
    color: #333;
    font-weight: 400;
    border-radius: 4px;
  }
  
  /* Desktop category list - hidden on mobile */
  #cat-list {
    display: none !important;
  }
}

/* Item grid container - Full height with pagination */
#item-grid-container {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0; /* No fixed min-height to prevent empty spacing */
position: relative;
width: 100%;
box-sizing: border-box;
overflow-x: hidden; /* Prevent horizontal overflow */
}

/* View Toggle - Simple button design */
.view-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 6px;
  border: none;
  background: #f8f9fa;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  box-sizing: border-box;
  min-height: 32px;
}

.view-btn:hover {
  background: #e5e4df;
  color: #333;
}

.view-btn.active {
  background: #389ffe;
  color: white;
}

.view-btn svg {
  width: 14px;
  height: 14px;
  stroke-width: 1;
}

/* Grid View (Default) - 3 columns per row, full width */
#item-grid.grid-view,
#item-grid:not(.compact-view) {
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

#item-grid.grid-view .item-btn,
#item-grid:not(.compact-view):not(.single-view) .item-btn {
  width: 100%;
  max-width: 100%;
}

/* Compact Grid View - 5 items per row */
#item-grid.compact-view {
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

#item-grid.compact-view .item-btn {
  aspect-ratio: 1;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0; /* Prevent overflow */
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

#item-grid.compact-view .item-btn img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  flex-shrink: 0;
}

#item-grid.compact-view .item-btn .product-name {
  margin-top: 4px;
  margin-bottom: 0;
  padding-top: 2px;
  line-height: 1.2;
}

/* Mobile: View toggle adjustments */
@media screen and (max-width: 1024px) {
  .view-toggle {
    margin-top: 0.5rem;
    gap: 0.4rem;
  }
  
  .view-btn {
    padding: 5px;
    min-height: 28px;
  }
  
  .view-btn svg {
    width: 13px;
    height: 13px;
  }
  
  /* Mobile grid views */
  #item-grid.grid-view,
  #item-grid:not(.compact-view) {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  
  #item-grid.compact-view {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  
  #item-grid.compact-view .item-btn {
    aspect-ratio: auto;
    min-height: 0;
  }
  
  #item-grid.compact-view .item-btn img {
    aspect-ratio: 1;
    width: 100%;
    height: auto;
  }
  
  #item-grid.compact-view .item-btn .product-name {
    margin-top: 6px;
    padding-top: 0;
    font-size: 0.6rem;
    line-height: 1.3;
  }
}

@media screen and (max-width: 480px) {
  /* Smaller screens: 2 columns for grid view, 3 for compact */
  #item-grid.grid-view,
  #item-grid:not(.compact-view) {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  #item-grid.compact-view {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  #item-grid.compact-view .item-btn {
    aspect-ratio: auto;
    min-height: 0;
    padding-bottom: 0;
  }
  
  #item-grid.compact-view .item-btn img {
    aspect-ratio: 1;
    width: 100%;
    height: auto;
    display: block;
  }
  
  #item-grid.compact-view .item-btn .product-name {
    margin-top: 6px;
    padding-top: 0;
    font-size: 0.6rem;
    line-height: 1.3;
    display: block;
  }
}

/* Item grid - More space to use */
.item-grid::-webkit-scrollbar {
  display: none;  /* Chrome, Safari, Opera */
}
#item-grid {
-ms-overflow-style: none;  /* IE and Edge */
scrollbar-width: none;     /* Firefox */
flex: 0 1 auto; /* Change from flex: 1 to flex: 0 1 auto to prevent expansion */
overflow-y: auto;
overflow-x: hidden; /* Prevent horizontal overflow */
padding: 0 1rem 0 1rem; /* Remove top and bottom padding */
margin-bottom: 0 !important; /* Ensure no bottom margin */
padding-bottom: 0 !important; /* Ensure no bottom padding */
display: grid;
grid-template-columns: repeat(auto-fill, 120px);
gap: 12px;
align-content: start;
min-height: 0 !important; /* Remove min-height to prevent empty spacing */
height: auto !important; /* Ensure height is auto, not fixed */
scroll-behavior: smooth;
-webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
width: 100%;
box-sizing: border-box;
}

/* Mobile responsive item grid */
@media screen and (max-width: 1024px) {
  #item-grid {
    padding: 0.75rem 0 0 0; /* Remove horizontal and bottom padding */
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
  }
  
  .item-btn {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media screen and (max-width: 768px) {
  #item-grid {
    padding: 0.75rem 0 0 0; /* Remove horizontal and bottom padding */
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
  }
  
  .item-btn {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .item-btn.active img {
    outline: 2px solid {{ settings.color_button | default: '#389FFE' }};
    outline-offset: 2px;
  }
}

@media screen and (max-width: 480px) {
  #item-grid {
    padding: 0.5rem 0 0 0; /* Remove horizontal and bottom padding */
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 100%;
  }
  
  .item-btn {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .item-btn.active img {
    outline: 2px solid {{ settings.color_button | default: '#389FFE' }};
    outline-offset: 2px;
  }
  
  .product-name {
    font-size: 0.6rem;
    margin-top: 3px;
  }
}

/* Hide pagination controls since we're using infinite scroll */
#pagination-controls {
display: none !important;
visibility: hidden !important;
opacity: 0 !important;
height: 0 !important;
padding: 0 !important;
margin: 0 !important;
background: transparent !important;
border: none !important;
min-height: 0 !important;
max-height: 0 !important;
overflow: hidden !important;
}

/* Infinite scroll sentinel element */
#infinite-scroll-sentinel {
height: 20px;
width: 100%;
background: transparent;
pointer-events: none;
}

/* Load more button styling */
.load-more-btn {
width: 100%;
padding: 12px;
margin: 0; /* Reset all margins */
margin-top: 10px; /* Consistent spacing from grid content */
margin-bottom: 20px; /* Spacing from footer */
background: #389FFE;
color: white;
border: none;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s ease;
}

/* Desktop: Ensure consistent spacing */
@media screen and (min-width: 1025px) {
  /* Ensure builder-board stays fixed at the top */
  /* Note: top value is set dynamically by JavaScript based on header height */
  /* Position is set to fixed in the earlier media query above */
  #builder-board {
    /* position: fixed is set in earlier media query - don't override */
    /* top is set by JavaScript - don't override with CSS */
    align-self: flex-start !important; /* Ensure it sticks from the top */
    height: 100vh !important; /* Full viewport height */
  }
  
  /* Ensure left-pane aligns with builder-board at the top */
  #left-pane {
    padding-top: 0.5rem !important; /* Match builder-board top padding */
  }
  
  /* Ensure filter-toggle has no extra top padding on desktop */
  #filter-toggle {
    padding-top: 0 !important; /* Remove top padding since left-pane already has it */
  }
  
  .load-more-btn {
    margin-top: 10px !important; /* Force consistent spacing on desktop */
    padding-left: 1rem !important; /* Match grid's left padding */
    padding-right: 1rem !important; /* Match grid's right padding */
    width: calc(100% - 2rem) !important; /* Subtract grid's left and right padding to match content width */
    margin-left: 1rem !important; /* Align with grid's left padding */
    margin-right: 1rem !important; /* Align with grid's right padding */
    box-sizing: border-box !important; /* Include padding in width calculation */
  }
  
  /* Ensure grid has no bottom padding that could create inconsistent spacing */
  #item-grid {
    padding-bottom: 0 !important;
    padding-top: 0 !important; /* Ensure no top padding */
    flex: 0 1 auto !important; /* Prevent grid from expanding to fill space */
    min-height: 0 !important; /* Remove min-height to prevent empty spacing */
    height: auto !important; /* Ensure height is auto, not fixed */
  }
  
  /* Ensure container doesn't force height */
  #item-grid-container {
    flex: 0 1 auto !important; /* Prevent container from expanding */
    min-height: 0 !important;
    height: auto !important;
    padding-top: 0 !important; /* No top padding */
    margin-top: 0 !important; /* No top margin */
  }
}

.load-more-btn:hover {
background: #2b7ce9;
}

.load-more-btn:active {
transform: translateY(1px);
}

.pagination-btn {
background: #389FFE;
color: white;
border: none;
padding: 8px 16px;
border-radius: 6px;
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s ease, transform 0.1s ease;
min-width: 80px;
}

.pagination-btn:hover:not(:disabled) {
background: #2b7ce9;
transform: translateY(-1px);
}

.pagination-btn:active:not(:disabled) {
transform: translateY(0);
}

.pagination-btn:disabled {
background: #ccc;
color: #888;
cursor: not-allowed;
transform: none;
}

.pagination-info {
font-size: 12px;
color: #666;
margin: 0 1rem;
font-weight: 500;
min-width: 160px;
text-align: center;
white-space: nowrap;
}

/* Page number buttons */
.page-numbers {
display: flex;
gap: 0.25rem;
align-items: center;
}

.page-btn {
background: transparent;
color: #666;
border: 1px solid #ddd;
padding: 6px 12px;
border-radius: 4px;
font-size: 12px;
cursor: pointer;
transition: all 0.2s ease;
min-width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
}

.page-btn:hover:not(.ellipsis) {
background: #f0f0f0;
border-color: #bbb;
transform: translateY(-1px);
}

.page-btn.active {
background: #389FFE;
color: white;
border-color: #389FFE;
font-weight: 600;
}

.page-btn.ellipsis {
border: none;
cursor: default;
color: #999;
background: transparent;
}

.page-btn.ellipsis:hover {
background: transparent;
transform: none;
}

.item-btn {
width: 120px;
cursor: pointer;
text-align: left;
display: flex;
flex-direction: column;
}

.item-btn img {
width: 100%;
height: auto;
background: #fff;
border-radius: 8px;
}

.item-btn.active img {
outline: 3px solid {{ settings.color_button | default: '#389FFE' }}; /* Uses theme button color */
outline-offset: 0px;
border-radius: 4px;
}

/* Mobile responsive item buttons - REMOVED CONFLICTING STYLES */
/* These are now handled in the item-grid media queries above */

/* Avatar canvas styling - Adjusted for smaller space */
#avatar-canvas {
background: #fff;
border: none;
border-radius: 15px;
overflow: hidden;
width: 100%;
max-width: 424px;
aspect-ratio: 1;
position: relative;
}

/* Placed pieces */
.asset-item {
position: absolute;
width: 100%;
height: 100%;
object-fit: contain;
pointer-events: none;
top: 0;
left: 0;
}

/* Download section styling */
#download-section {
margin-top: 20px;
width: 100%;
text-align: center;
}

#download-btn {
background: #3cd500;
color: white;
border: none;
padding: 12px 24px;
border-radius: 100px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s ease;
width: 100%;
max-width: none; /* Remove max-width constraint */
}

/* Mobile: Full width download button */
@media screen and (max-width: 1024px) {
  #download-btn {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 50px;
  }
}

#download-btn:hover {
background: #3cd500;
}

#download-btn:active {
transform: translateY(1px);
}

/* Updated Remove Button Styling */
.item-btn.remove-btn {
width: 120px;
cursor: pointer;
text-align: left;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
order: -1;
}

/* Mobile responsive remove and get-more buttons */
@media screen and (max-width: 1024px) {
  .item-btn.remove-btn,
  .item-btn.get-more-btn {
    width: 100px;
  }
}

@media screen and (max-width: 768px) {
  .item-btn.remove-btn,
  .item-btn.get-more-btn {
    width: 100px;
  }
  
  .item-btn.remove-btn .remove-box,
  .item-btn.get-more-btn .get-more-box {
    font-size: 20px;
  }
}

@media screen and (max-width: 480px) {
  .item-btn.remove-btn,
  .item-btn.get-more-btn {
    width: 80px;
  }
  
  .item-btn.remove-btn .remove-box,
  .item-btn.get-more-btn .get-more-box {
    font-size: 18px;
  }
}

.item-btn.remove-btn .remove-box {
width: 100%;
aspect-ratio: 1;
background: rgba(255, 255, 255, 0.5);
border: 2px solid {{ settings.color_borders | default: '#ddd' }};
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
font-weight: bold;
color: {{ settings.color_body_text | default: '#666' }};
transition: all 0.2s ease;
}

.item-btn.remove-btn:hover .remove-box {
background: rgba(255, 255, 255, 0.7);
border-color: {{ settings.color_borders | color_darken: 10 | default: '#ccc' }};
color: {{ settings.color_body_text | default: '#333' }};
}

.item-btn.remove-btn.active .remove-box {
outline: 3px solid {{ settings.color_button | default: '#389FFE' }};
outline-offset: 0px;
border-radius: 4px;
}

.item-btn.remove-btn p {
margin: 4px 0 0 0;
font-size: 0.65rem;
}

/* Get More Items Button Styling */
.item-btn.get-more-btn {
width: 120px;
cursor: pointer;
text-align: left;
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
order: -1;
}

.item-btn.get-more-btn .get-more-box {
width: 100%;
aspect-ratio: 1;
background: rgba(60, 213, 0, 0.5);
border: 2px solid #3CD500;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
font-weight: bold;
color: #3CD500;
transition: all 0.2s ease;
}

.item-btn.get-more-btn:hover .get-more-box {
background: rgba(60, 213, 0, 0.7);
border-color: #32B800;
color: #32B800;
}

.item-btn.get-more-btn.active .get-more-box {
outline: 3px solid #3CD500;
outline-offset: 0px;
border-radius: 4px;
}

.item-btn.get-more-btn p {
margin: 4px 0 0 0;
font-size: 0.65rem;
}

/* Product name styling */
.product-name {
margin: 4px 0 0 0;
font-size: 0.65rem;
}

/* Category separator */
.category-separator {
height: 1px;
background: {{ settings.color_borders | default: '#ddd' }};
margin: 12px 8px;
}

/* Store category button */
.store-cat-btn {
color: {{ settings.color_body_text | color_lighten: 20 | default: '#888' }};
font-style: italic;
}

/* Store item styling */
.store-item-container {
position: relative;
width: 100%;
}

.store-item-btn .store-item-container img {
width: 100%;
height: auto;
background: #fff;
border-radius: 8px;
}

/* Locked Icon */
.locked-icon {
position: absolute;
top: 4px;
right: 4px;
background: #b1b1b1;
border-radius: 4px;
padding: 4px;
pointer-events: none;
display: flex;
align-items: center;
justify-content: center;
}

.locked-icon svg {
width: 12px;
height: 14px;
}

/* Add to Cart Icon */
.add-to-cart-icon {
position: absolute;
bottom: 4px;
right: 4px;
background: #32CD32;
color: white;
border-radius: 3px;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: bold;
cursor: pointer;
transition: all 0.2s ease;
border: none;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.2s ease;
}

.add-to-cart-icon:hover {
transform: scale(1);
}

/* Show add to cart button when hovering over the store item */
.store-item-btn:hover .add-to-cart-icon {
opacity: 1;
visibility: visible;
}

/* Optional: Add a subtle animation when appearing */
.store-item-btn:hover .add-to-cart-icon:hover {
transform: scale(1.1);
}

/* Mobile: Always show add to cart icon on touch devices */
@media (hover: none) and (pointer: coarse) {
  .add-to-cart-icon {
    opacity: 1 !important;
    visibility: visible !important;
    background: rgba(50, 205, 50, 0.9);
    width: 24px;
    height: 24px;
    font-size: 16px;
  }
  
  .store-item-btn:active .add-to-cart-icon {
    transform: scale(0.95);
  }
}

/* Login and No Items Messages */
#login-message,
#no-items-message {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 400px;
padding: 40px 20px;
text-align: center;
background: {{ settings.color_body_bg | default: '#f9f9f9' }};
border-radius: 15px;
margin: 20px auto;
max-width: 600px;
border: 1px solid {{ settings.color_borders | default: '#ddd' }};
}

#login-message h2,
#no-items-message h2 {
font-size: 2rem;
margin-bottom: 16px;
color: {{ settings.color_body_text | default: '#1c1d1d' }};
}

#login-message p,
#no-items-message p {
font-size: 1.1rem;
margin-bottom: 24px;
color: {{ settings.color_body_text | color_lighten: 30 | default: '#666' }};
line-height: 1.5;
}

.login-button,
.shop-button {
background: {{ settings.color_button | default: '#389FFE' }};
color: {{ settings.color_button_text | default: 'white' }};
text-decoration: none;
padding: 14px 28px;
border-radius: 8px;
font-size: 16px;
font-weight: 500;
transition: background 0.2s ease, transform 0.1s ease;
display: inline-block;
}

.login-button:hover,
.shop-button:hover {
background: {{ settings.color_button | color_darken: 15 | default: '#2b7ce9' }};
text-decoration: none;
color: {{ settings.color_button_text | default: 'white' }};
}

.login-button:active,
.shop-button:active {
transform: translateY(1px);
}

a.login-button {
background-color: #389FFE;
color:white;
border-radius:100px;
}

/* Placeholder body styling */
.placeholder-body,
.placeholder-bodyhead {
opacity: 1;
pointer-events: none;
}

/* Optional: Add a subtle indication that these are placeholders */
.placeholder-body::after,
.placeholder-bodyhead::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
z-index: 1;
}

/* Modern Avatar Control Buttons - Pill Style */
#avatar-controls {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 0;
background: transparent; /* Remove background on desktop */
border-radius: 0;
margin-top: 0.5rem;
box-sizing: border-box;
width: 100%;
max-width: 424px; /* Match avatar canvas max-width */
margin-left: auto;
margin-right: auto;
}

.control-row {
display: grid;
grid-template-columns: 1fr 44px 44px 1fr;
gap: 0.5rem;
width: 100%;
box-sizing: border-box;
}

.download-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0.5rem;
width: 100%;
box-sizing: border-box;
margin-top: 0;
}

/* Mobile overrides */
@media screen and (max-width: 1024px) {
  #avatar-controls {
    background: transparent !important; /* Remove background on mobile */
  }
  
  .control-row {
    display: grid !important;
    grid-template-columns: 1fr 44px 44px 1fr;
  }
}

/* Base button styling - Modern pill shape */
#avatar-controls button {
padding: 12px 14px;
border: none;
border-radius: 50px;
font-size: 12px;
font-weight: 400;
min-width: 0;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
width: 100%;
}

/* Control row buttons */
.control-row button {
width: 100%;
}

#clear-btn {
grid-column: 1;
}

#undo-btn {
grid-column: 2;
font-size: 18px;
padding: 12px;
}

#redo-btn {
grid-column: 3;
font-size: 18px;
padding: 12px;
}

#randomize-btn {
grid-column: 4;
}

/* Download row buttons - full width */
.download-row button {
width: 100%;
}

/* Mobile: Remove background and adjust button sizes */
@media screen and (max-width: 1024px) {
  #avatar-controls button {
    font-size: 12px;
    padding: 10px 8px;
    height: 44px;
    border-radius: 50px; /* Make buttons rounder */
  }
  
  #undo-btn,
  #redo-btn {
    font-size: 18px;
    padding: 10px;
    flex: 0 0 44px;
    min-width: 44px;
    border-radius: 50px; /* Make round buttons perfectly round */
  }
}

/* Clear button - Orange */
#clear-btn {
background-color:#ff6100;
color: white;
min-width: 0;
}

/* Undo button - Gray with arrow */
#undo-btn {
background-color:#b1b1b1;
color: white;
min-width: 44px;
font-size: 18px;
padding: 12px;
}

#undo-btn:hover:not(:disabled) {
}

#undo-btn:disabled {
color: #fff;
cursor: not-allowed;
transform: none;
}

#undo-btn:active:not(:disabled) {
}

/* Redo button - Gray with arrow */
#redo-btn {
background-color:#b1b1b1;
color: white;
min-width: 44px;
font-size: 18px;
padding: 12px;
}

#redo-btn:hover:not(:disabled) {
}

#redo-btn:disabled {
color: #fff;
cursor: not-allowed;
transform: none;
}

#redo-btn:active:not(:disabled) {
}

/* Randomize button - Blue */
#randomize-btn {
color:white;
background-color: #389ffe;
min-width: 0;
}

/* Download button - Green */
#download-btn {
background-color: #3cd500;
color: white;
min-width: 0;
font-size: 16px;
font-weight: 400;
width: 100%;
}

/* Save button - Blue */
#save-btn {
background-color: #389ffe;
color: white;
min-width: 0;
font-size: 16px;
font-weight: 400;
width: 100%;
}

#save-btn:disabled {
background-color: #b1b1b1;
cursor: not-allowed;
opacity: 0.7;
}

/* Loading states for pagination */
.pagination-loading {
opacity: 0.6;
pointer-events: none;
}

.pagination-loading::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 20px;
margin: -10px 0 0 -10px;
border: 2px solid #389FFE;
border-radius: 50%;
border-top-color: transparent;
animation: spin 1s linear infinite;
}

@keyframes spin {
to { transform: rotate(360deg); }
}

/* Mobile responsive pagination */
@media (max-width: 768px) {
#pagination-controls {
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem;
}

.page-numbers {
  order: 1;
  justify-content: center;
}

.pagination-info {
  order: 2;
  margin: 0;
  min-width: auto;
}

.pagination-btn {
  order: 3;
  min-width: 100px;
}

/* Stack prev/next buttons */
.pagination-btn:first-of-type {
  margin-right: 0.5rem;
}
}

@media (max-width: 480px) {
.page-numbers {
  gap: 0.125rem;
}

.page-btn {
  min-width: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.pagination-btn {
  padding: 6px 12px;
  font-size: 11px;
  min-width: 70px;
}

.pagination-info {
  font-size: 11px;
}
}

/* Pagination keyboard focus indicators */
.pagination-btn:focus,
.page-btn:focus {
outline: 2px solid #389FFE;
outline-offset: 2px;
}

/* Hide focus outline for mouse users */
.pagination-btn:focus:not(:focus-visible),
.page-btn:focus:not(:focus-visible) {
outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
.pagination-btn,
.page-btn {
  border: 2px solid currentColor;
}

.page-btn.active {
  background: ButtonHighlight;
  color: ButtonText;
}
}

/* Fade-in animations for items and avatar assets */

/* Item grid fade-in animation - applies to ALL item buttons */
.item-btn,
.item-btn.remove-btn,
.item-btn.get-more-btn,
.store-item-btn {
  animation: fadeIn 0.4s ease-out;
  animation-fill-mode: both;
}

/* Stagger the animation for grid items - using a more comprehensive approach */
.item-btn:nth-child(1),
.item-btn.remove-btn:nth-child(1),
.item-btn.get-more-btn:nth-child(1),
.store-item-btn:nth-child(1) { animation-delay: 0.05s; }
.item-btn:nth-child(2),
.item-btn.remove-btn:nth-child(2),
.item-btn.get-more-btn:nth-child(2),
.store-item-btn:nth-child(2) { animation-delay: 0.1s; }
.item-btn:nth-child(3),
.item-btn.remove-btn:nth-child(3),
.item-btn.get-more-btn:nth-child(3),
.store-item-btn:nth-child(3) { animation-delay: 0.15s; }
.item-btn:nth-child(4),
.item-btn.remove-btn:nth-child(4),
.item-btn.get-more-btn:nth-child(4),
.store-item-btn:nth-child(4) { animation-delay: 0.2s; }
.item-btn:nth-child(5),
.item-btn.remove-btn:nth-child(5),
.item-btn.get-more-btn:nth-child(5),
.store-item-btn:nth-child(5) { animation-delay: 0.25s; }
.item-btn:nth-child(6),
.item-btn.remove-btn:nth-child(6),
.item-btn.get-more-btn:nth-child(6),
.store-item-btn:nth-child(6) { animation-delay: 0.3s; }
.item-btn:nth-child(7),
.item-btn.remove-btn:nth-child(7),
.item-btn.get-more-btn:nth-child(7),
.store-item-btn:nth-child(7) { animation-delay: 0.35s; }
.item-btn:nth-child(8),
.item-btn.remove-btn:nth-child(8),
.item-btn.get-more-btn:nth-child(8),
.store-item-btn:nth-child(8) { animation-delay: 0.4s; }
.item-btn:nth-child(9),
.item-btn.remove-btn:nth-child(9),
.item-btn.get-more-btn:nth-child(9),
.store-item-btn:nth-child(9) { animation-delay: 0.45s; }
.item-btn:nth-child(10),
.item-btn.remove-btn:nth-child(10),
.item-btn.get-more-btn:nth-child(10),
.store-item-btn:nth-child(10) { animation-delay: 0.5s; }
.item-btn:nth-child(11),
.item-btn.remove-btn:nth-child(11),
.item-btn.get-more-btn:nth-child(11),
.store-item-btn:nth-child(11) { animation-delay: 0.55s; }
.item-btn:nth-child(12),
.item-btn.remove-btn:nth-child(12),
.item-btn.get-more-btn:nth-child(12),
.store-item-btn:nth-child(12) { animation-delay: 0.6s; }
.item-btn:nth-child(13),
.item-btn.remove-btn:nth-child(13),
.item-btn.get-more-btn:nth-child(13),
.store-item-btn:nth-child(13) { animation-delay: 0.65s; }
.item-btn:nth-child(14),
.item-btn.remove-btn:nth-child(14),
.item-btn.get-more-btn:nth-child(14),
.store-item-btn:nth-child(14) { animation-delay: 0.7s; }
.item-btn:nth-child(15),
.item-btn.remove-btn:nth-child(15),
.item-btn.get-more-btn:nth-child(15),
.store-item-btn:nth-child(15) { animation-delay: 0.75s; }
.item-btn:nth-child(16),
.item-btn.remove-btn:nth-child(16),
.item-btn.get-more-btn:nth-child(16),
.store-item-btn:nth-child(16) { animation-delay: 0.8s; }
.item-btn:nth-child(17),
.item-btn.remove-btn:nth-child(17),
.item-btn.get-more-btn:nth-child(17),
.store-item-btn:nth-child(17) { animation-delay: 0.85s; }
.item-btn:nth-child(18),
.item-btn.remove-btn:nth-child(18),
.item-btn.get-more-btn:nth-child(18),
.store-item-btn:nth-child(18) { animation-delay: 0.9s; }
.item-btn:nth-child(19),
.item-btn.remove-btn:nth-child(19),
.item-btn.get-more-btn:nth-child(19),
.store-item-btn:nth-child(19) { animation-delay: 0.95s; }
.item-btn:nth-child(20),
.item-btn.remove-btn:nth-child(20),
.item-btn.get-more-btn:nth-child(20),
.store-item-btn:nth-child(20) { animation-delay: 1.0s; }
.item-btn:nth-child(21),
.item-btn.remove-btn:nth-child(21),
.item-btn.get-more-btn:nth-child(21),
.store-item-btn:nth-child(21) { animation-delay: 1.05s; }
.item-btn:nth-child(22),
.item-btn.remove-btn:nth-child(22),
.item-btn.get-more-btn:nth-child(22),
.store-item-btn:nth-child(22) { animation-delay: 1.1s; }
.item-btn:nth-child(23),
.item-btn.remove-btn:nth-child(23),
.item-btn.get-more-btn:nth-child(23),
.store-item-btn:nth-child(23) { animation-delay: 1.15s; }
.item-btn:nth-child(24),
.item-btn.remove-btn:nth-child(24),
.item-btn.get-more-btn:nth-child(24),
.store-item-btn:nth-child(24) { animation-delay: 1.2s; }
.item-btn:nth-child(25),
.item-btn.remove-btn:nth-child(25),
.item-btn.get-more-btn:nth-child(25),
.store-item-btn:nth-child(25) { animation-delay: 1.25s; }
.item-btn:nth-child(26),
.item-btn.remove-btn:nth-child(26),
.item-btn.get-more-btn:nth-child(26),
.store-item-btn:nth-child(26) { animation-delay: 1.3s; }
.item-btn:nth-child(27),
.item-btn.remove-btn:nth-child(27),
.item-btn.get-more-btn:nth-child(27),
.store-item-btn:nth-child(27) { animation-delay: 1.35s; }
.item-btn:nth-child(28),
.item-btn.remove-btn:nth-child(28),
.item-btn.get-more-btn:nth-child(28),
.store-item-btn:nth-child(28) { animation-delay: 1.4s; }
.item-btn:nth-child(29),
.item-btn.remove-btn:nth-child(29),
.item-btn.get-more-btn:nth-child(29),
.store-item-btn:nth-child(29) { animation-delay: 1.45s; }
.item-btn:nth-child(30),
.item-btn.remove-btn:nth-child(30),
.item-btn.get-more-btn:nth-child(30),
.store-item-btn:nth-child(30) { animation-delay: 1.5s; }

/* Avatar canvas asset fade-in animation */
.asset-item {
  animation: fadeIn 0.5s ease-out;
  animation-fill-mode: both;
}

/* Simple fade-in keyframe animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
.pagination-btn,
.page-btn {
  transition: none;
}

.pagination-loading::after {
  animation: none;
}

/* Disable animations for users who prefer reduced motion */
.item-btn,
.asset-item {
  animation: none;
}
}
}