:root {
  /* Modern Color Palette */
  --bg: #fafbfc;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --banner: #111827;
  --accent: #10b981;
  --accent-hover: #059669;
  --card: #ffffff;
  --soft: #f3f4f6;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  
  /* Shadows - Modern and subtle */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  
  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Gatekeeper Overlay */
.gatekeeper-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--banner) 0%, #374151 100%);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gatekeeper-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  text-align: center;
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gatekeeper-box h3 {
  color: var(--text);
  margin: 0 0 10px 0;
  font-size: 24px;
  font-weight: 700;
}

.gatekeeper-box p {
  color: var(--muted);
  margin: 0 0 24px 0;
  font-size: 15px;
}

.gatekeeper-logo {
  height: 60px;
  margin-bottom: 24px;
  object-fit: contain;
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--banner);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.brand-logo {
  height: 40px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.text-logo {
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.brandText {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.logo {
  color: var(--header-text, #ffffff);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-size: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Controls */
.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Input Fields */
.input {
  width: 100%;
  max-width: 500px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--card);
  color: var(--text);
  outline: none;
  font-size: 15px;
  transition: var(--transition);
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.status {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

/* Buttons */
.btn {
  border: none;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: var(--transition);
  white-space: nowrap;
  min-height: 44px; /* Better for touch targets */
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn:active {
  transform: translateY(0);
}

.btn.small {
  padding: 8px 16px;
  font-size: 13px;
  height: 36px;
  min-height: 36px;
}

.btn.danger {
  background: var(--danger);
}

.btn.danger:hover {
  background: #dc2626;
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

.btn.ghost:hover {
  background: var(--soft);
  color: var(--text);
  border-color: var(--muted);
  transform: none;
}

.btn.ok {
  background: var(--accent);
}

.btn.fullWidth {
  width: 100%;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  height: 100%;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Image Wrapper */
.imgwrap {
  position: relative;
  background: var(--soft);
  border-bottom: 1px solid var(--border);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.imgwrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.3s ease;
}

.card:hover .imgwrap img {
  transform: scale(1.05);
}

.imgwrap .placeholder {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 0 16px;
}

/* Badge */
.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: white;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.badge.ok {
  background: var(--accent);
}

.badge.out {
  background: var(--muted);
}

.dynamic-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  box-shadow: var(--shadow);
}

/* Content */
.content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.code {
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
  font-size: 16px;
}

.qty {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.name {
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  min-height: 42px;
  font-weight: 500;
}

.description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  color: var(--muted);
  font-size: 14px;
}

/* Prices */
.prices {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
}

.muted {
  color: var(--muted);
}

.strike {
  color: var(--muted);
  text-decoration: line-through;
  opacity: 0.7;
}

.priceRow {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.priceRow.strong {
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
}

.meta {
  position: relative;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

/* Admin Notes */
.admin-notes {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: var(--radius);
  padding: 12px;
  margin: 8px 0;
  font-size: 13px;
  color: #92400e;
  display: none;
}

.admin-notes.show {
  display: block;
}

/* Admin Section */
.admin {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.qtyInput {
  width: 100px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
}

/* Footer */
.footer {
  margin-top: 32px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--border);
}

.footerNote {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.footerNote code {
  background: var(--soft);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-family: ui-monospace, monospace;
}

.footerActions {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 500px;
}

.footerActions.center {
  justify-content: center;
}

/* Soldout Section */
.soldout {
  margin-top: 40px;
}

.soldout h2 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--muted);
  font-weight: 600;
}

.h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--text);
}

.h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 15px;
}

/* Admin Panel */
.adminPanel {
  margin: 20px 0 32px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.adminPanel .panelTitle {
  margin-bottom: 16px;
}

.adminPanel .panelTitle h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.adminPanel .hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* Admin Details */
.adminDetails {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 16px;
  margin-bottom: 16px;
}

.adminDetails summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  list-style: none;
  user-select: none;
  padding: 4px 0;
}

.adminDetails summary::-webkit-details-marker {
  display: none;
}

.adminDetails .editor {
  margin-top: 16px;
}

.adminPanel .editor .formRow {
  margin-bottom: 16px;
}

.formRow {
  margin-bottom: 16px;
}

.formRow label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.smallNote {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Info Notice */
.info-notice {
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
  border: 1px solid #93c5fd;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.info-notice p {
  margin: 0 0 8px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.info-notice p:last-child {
  margin: 0;
}

/* Tab Navigation */
.tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  min-height: 48px; /* Better touch target */
}

.tab-btn:hover {
  color: var(--text);
  background: var(--soft);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Modal Overlay */
.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modalOverlay[hidden] {
  display: none !important;
}

.modalContent {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  animation: slideUp 0.3s ease;
}

/* Print Styles */
.printHeader {
  display: none;
}

@media print {
  .topbar,
  .controls,
  .footer,
  .adminPanel,
  .admin,
  .btn,
  .modalOverlay {
    display: none !important;
  }

  .printHeader {
    display: block !important;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000;
  }

  .printBrand {
    display: flex;
    align-items: center;
    gap: 15px;
  }

  .printLogo {
    height: 50px;
  }

  .printTitle {
    font-size: 24px;
    font-weight: bold;
  }

  .printMeta {
    font-size: 14px;
    color: #666;
  }

  body {
    background: white;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .container {
    padding: 16px;
  }

  .topbar {
    padding: 12px 16px;
  }

  .logo {
    font-size: 16px;
  }

  .subtitle {
    font-size: 12px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .input {
    max-width: 100%;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
  }

  .footer {
    padding: 20px 16px;
  }

  .footerActions {
    flex-direction: column;
    width: 100%;
  }

  .modalContent {
    max-width: 95%;
    padding: 20px;
  }

  .h2 {
    font-size: 20px;
  }

  .adminPanel {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 12px;
  }

  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .brand-logo {
    height: 32px;
  }

  .logo {
    font-size: 15px;
  }

  .subtitle {
    display: none; /* Hide subtitle on very small screens */
  }

  .actions {
    gap: 6px;
  }

  .btn {
    padding: 10px 16px;
    font-size: 14px;
  }

  .btn.small {
    padding: 6px 12px;
    font-size: 12px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .imgwrap {
    height: 180px;
  }

  .content {
    padding: 14px;
  }

  .code {
    font-size: 15px;
  }

  .name {
    font-size: 14px;
  }

  .priceRow.strong {
    font-size: 18px;
  }

  .modalContent {
    padding: 16px;
    border-radius: var(--radius);
  }

  .tab-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .gatekeeper-box {
    padding: 28px 20px;
  }
}

@media (max-width: 375px) {
  .topbar {
    padding: 8px 10px;
  }

  .brand-logo {
    height: 28px;
  }

  .logo {
    font-size: 14px;
  }

  .btn {
    padding: 8px 14px;
    font-size: 13px;
    height: 40px;
    min-height: 40px;
  }

  .imgwrap {
    height: 160px;
  }
}

/* Compact Admin Grid */
.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.admin-card:hover {
  box-shadow: var(--shadow);
}

.admin-card h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.admin-input {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--card);
  color: var(--text);
  outline: none;
  font-size: 14px;
  transition: var(--transition);
}

.admin-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

@media (max-width: 768px) {
  .compact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Layout Variations */
.grid.layout-list {
  grid-template-columns: 1fr;
  gap: 12px;
}

.grid.layout-list .card {
  flex-direction: row;
  align-items: stretch;
}

.grid.layout-list .imgwrap {
  width: 150px;
  height: auto;
  border-right: 1px solid var(--border);
  border-bottom: none;
  flex-shrink: 0;
}

.grid.layout-list .content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.grid.layout-list .description {
  display: none;
}

.grid.layout-list .prices {
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.grid.layout-list .actions-row {
  margin-top: 0;
  border-top: none;
  width: auto;
}

.grid.layout-list .btn {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

@media (max-width: 600px) {
  .grid.layout-list .card {
    flex-direction: column;
  }

  .grid.layout-list .imgwrap {
    width: 100%;
    height: 160px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .grid.layout-list .content {
    grid-template-columns: 1fr;
  }

  .grid.layout-list .prices {
    align-items: flex-start;
    flex-direction: row;
  }
}

/* Style Minimal */
.card.style-minimal {
  border: none;
  box-shadow: none;
  background: transparent;
}

.card.style-minimal .imgwrap {
  background: transparent;
  border: none;
  border-radius: var(--radius);
}

.card.style-minimal .content {
  padding-left: 0;
  padding-right: 0;
}

/* Cart Styles */
#cartModal .modalContent {
  background: var(--soft);
}

.btn.cart-add {
  background: var(--cart-btn, var(--accent));
  border: none;
  color: white;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
  width: 100%;
  min-height: 44px;
}

.btn.cart-add:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  background: var(--card);
  margin-bottom: 8px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.cart-item:last-child {
  margin-bottom: 0;
}

.cart-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.cart-item .details {
  flex: 1;
  min-width: 0;
}

.cart-item .name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item .code {
  font-size: 13px;
  color: var(--muted);
}

.cart-item .remove-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item .remove-btn:hover {
  background: #fee2e2;
  color: var(--danger);
}

.form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.form-section h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
  font-weight: 600;
}

/* Color Input Fix */
input[type="color"].input {
  padding: 4px;
  height: 48px;
  min-width: 80px;
  cursor: pointer;
  background: var(--card);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
}

input[type="color"]::-moz-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-sm);
}

/* Switch Slider */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-label {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  transition: 0.3s;
  border-radius: 28px;
}

.switch-label:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch-input:checked + .switch-label {
  background-color: var(--accent);
}

.switch-input:checked + .switch-label:before {
  transform: translateX(24px);
}

/* Quantity Stepper */
.qty-stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 44px;
  width: 130px;
  background: var(--card);
}

.stepper-btn {
  background: var(--soft);
  border: none;
  width: 40px;
  height: 100%;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  min-width: 40px;
  min-height: 40px;
}

.stepper-btn:hover {
  background: #e5e7eb;
}

.stepper-btn:active {
  background: #d1d5db;
}

.stepper-input {
  flex: 1;
  border: none;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  height: 100%;
  appearance: none;
  -moz-appearance: textfield;
  background: transparent;
  color: var(--text);
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-qty-badge {
  background: var(--soft);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-right: 8px;
  min-width: 35px;
  text-align: center;
}

/* Product Detail Modal */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 500px;
}

.product-detail-img {
  position: relative;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.product-detail-img img {
  width: 100%;
  height: 100%;
  max-height: 450px;
  object-fit: contain;
}

.product-detail-info {
  padding: 32px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  max-height: 80vh;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .product-detail-img {
    height: 300px;
    padding: 20px;
  }

  .product-detail-info {
    padding: 24px;
    max-height: none;
  }
}

@media (max-width: 480px) {
  .product-detail-img {
    height: 250px;
    padding: 16px;
  }

  .product-detail-info {
    padding: 20px;
  }
}

/* Badge Notify */
.badge-notify {
  background: var(--danger);
  color: white;
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 12px;
  margin-left: 6px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.tab-btn:has(#reqBadge:not([style*="display: none"])) {
  border-bottom-color: var(--danger);
}

/* Emoji Picker */
.emoji-trigger-btn {
  background: transparent;
  border: 1.5px solid var(--border);
  cursor: pointer;
  font-size: 20px;
  padding: 0 12px;
  border-radius: var(--radius);
  transition: var(--transition);
  margin-left: 6px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.emoji-trigger-btn:hover {
  background: var(--soft);
  transform: scale(1.05);
}

.emoji-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}

.emoji-modal-overlay[hidden] {
  display: none !important;
}

.emoji-picker-box {
  background: var(--card);
  width: 90%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 70vh;
  animation: slideUp 0.3s;
}

.emoji-header {
  padding: 16px 20px;
  background: var(--soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
}

.emoji-grid {
  padding: 16px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
}

.emoji-item {
  font-size: 24px;
  cursor: pointer;
  text-align: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emoji-item:hover {
  background: var(--soft);
  transform: scale(1.2);
}

.input-group {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
}

.input-group .input {
  flex: 1;
}

/* Filter Chips */
.filter-chip {
  background: var(--soft);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.filter-chip:hover {
  background: #e5e7eb;
  border-color: var(--muted);
}

.filter-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.filter-chip:active {
  transform: scale(0.95);
}

.filter-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

/* Actions Row */
.actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 480px) {
  .actions-row {
    flex-direction: column;
  }

  .actions-row .btn {
    width: 100%;
  }
}

/* Mobile Break */
.mobile-break {
  display: none;
}

@media (max-width: 480px) {
  .mobile-break {
    display: block;
  }
}

/* Utility Classes */
.fullWidth {
  width: 100%;
}

.center {
  text-align: center;
}

/* Coin Icon - If used */
.coinIcon {
  position: absolute;
  bottom: 0;
  right: 0;
  background: url('images/hcoin.png') no-repeat;
  background-size: contain;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #333;
}

/* Custom Fields in Product Detail */
#pmCustomFields {
  background: var(--soft);
  padding: 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

/* Gallery thumbnails if needed */
#pmGallery {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

#pmGallery img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}

#pmGallery img:hover {
  border-color: var(--accent);
}

/* Improved scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--soft);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Loading states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: var(--accent);
  color: white;
}
