/* Design Tokens & Core Variables */
:root {
  --font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Color Palette - Dark Mode Default */
  --bg-app: #0a0b0d;
  --bg-card: rgba(20, 22, 28, 0.7);
  --bg-input: #15181f;
  --border-color: rgba(255, 255, 255, 0.08);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-primary: #8b5cf6; /* Violet */
  --accent-primary-hover: #7c3aed;
  --accent-secondary: #10b981; /* Emerald/Green */
  --accent-secondary-hover: #059669;
  --accent-danger: #ef4444;
  --accent-danger-hover: #dc2626;

  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode overrides */
[data-theme="light"] {
  --bg-app: #f9fafb;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-input: #f3f4f6;
  --border-color: rgba(0, 0, 0, 0.08);
  
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;

  --accent-primary: #6d28d9;
  --accent-primary-hover: #5b21b6;
  --accent-secondary: #047857;
  --accent-secondary-hover: #065f46;
  
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --glass-border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  height: 100vh;
  height: -webkit-fill-available;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color var(--transition-normal);
}

/* Container limits app width on desktop, acts as phone shell */
.app-container {
  width: 100%;
  max-width: 480px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-app);
  border-left: var(--glass-border);
  border-right: var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

/* Header styling */
.app-header {
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: var(--border-color) 1px solid;
  background: rgba(10, 11, 13, 0.5);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3);
}

.logo-icon svg {
  width: 20px;
  height: 20px;
}

.header-logo h1 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--text-primary) 30%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.header-btn:hover {
  color: var(--text-primary);
  background-color: var(--border-color);
}

.header-btn svg {
  width: 20px;
  height: 20px;
}

/* Main Content with custom scrollbars */
.app-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 80px 20px; /* space at bottom for nav */
  position: relative;
  scrollbar-width: none; /* Firefox */
}

.app-main::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}

/* Tabs layout */
.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.tab-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Summary Card (Header inside Tab 1) */
.list-summary-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.list-summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
}

.summary-details {
  display: flex;
  justify-content: space-between;
}

.summary-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-col.border-left {
  padding-left: 20px;
  border-left: 1px solid var(--border-color);
}

.summary-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-value {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

#total-cart {
  color: var(--accent-secondary);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 3px;
  transition: width var(--transition-normal) ease;
}

.summary-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.btn-text-action:hover {
  color: var(--accent-primary-hover);
}

/* Scan Button (CTA) */
.scan-cta-container {
  margin-bottom: 20px;
}

.btn-scan {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-primary) 0%, #7c3aed 100%);
  border: none;
  border-radius: var(--border-radius-md);
  color: white;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-scan:active {
  transform: scale(0.98);
}

.btn-scan-icon svg {
  width: 24px;
  height: 24px;
}

/* Manual Add styling */
.manual-add-container {
  background-color: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 12px;
  margin-bottom: 24px;
}

.manual-add-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.manual-add-form input[type="text"] {
  flex: 1;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.manual-add-form input[type="number"] {
  width: 90px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.manual-add-form input:focus {
  border-color: var(--accent-primary);
}

.btn-add-manual {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-add-manual:hover {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.btn-add-manual svg {
  width: 20px;
  height: 20px;
}

/* List Items Container */
.list-section h2, .history-header h2, .compare-header h2, .settings-header h2 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Empty state styling */
.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  opacity: 0.7;
}

.empty-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Product Card */
.product-card {
  display: flex;
  align-items: center;
  background-color: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  gap: 12px;
  position: relative;
  transition: opacity var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
  overflow: hidden;
}

.product-card.checked {
  border-color: rgba(16, 185, 129, 0.15);
  background-color: rgba(20, 22, 28, 0.35);
}

.product-card.checked .product-info-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.product-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--bg-input);
}

.product-card.checked .product-checkbox {
  background-color: var(--accent-secondary);
  border-color: var(--accent-secondary);
}

.product-checkbox svg {
  width: 14px;
  height: 14px;
  color: white;
  display: none;
}

.product-card.checked .product-checkbox svg {
  display: block;
}

/* Info section inside Card */
.product-card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.product-info-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
  word-break: break-word;
  transition: color var(--transition-fast);
}

.product-info-pricing {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  gap: 6px;
  align-items: center;
}

.product-qty-badge {
  background-color: var(--bg-input);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.product-subtotal-val {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-right: 8px;
}

.product-card.checked .product-subtotal-val {
  color: var(--accent-secondary);
}

/* Product Actions (Edit / Delete) */
.product-actions {
  display: flex;
  gap: 6px;
}

.btn-item-action {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.btn-item-action:hover {
  background-color: var(--bg-input);
}

.btn-item-action.delete:hover {
  color: var(--accent-danger);
  background-color: rgba(239, 68, 68, 0.08);
}

.btn-item-action.edit:hover {
  color: var(--accent-primary);
  background-color: rgba(139, 92, 246, 0.08);
}

.btn-item-action svg {
  width: 16px;
  height: 16px;
}

/* HISTORIAL TAB STYLING */
.section-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card {
  background-color: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-date {
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font-title);
}

.history-total {
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--accent-secondary);
  font-size: 1.1rem;
}

.history-card-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* COMPARISON TAB STYLING */
.search-compare-container {
  margin-bottom: 20px;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper input {
  width: 100%;
  background-color: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 14px 16px 14px 44px;
  color: var(--text-primary);
  font-family: var(--font-body);
  outline: none;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.search-input-wrapper input:focus {
  border-color: var(--accent-primary);
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.compare-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.compare-item-card {
  background-color: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

.compare-item-title {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.compare-history-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compare-timeline-node {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.compare-node-date {
  color: var(--text-secondary);
}

.compare-node-price {
  font-weight: 600;
  font-family: var(--font-title);
}

.price-indicator-up {
  color: var(--accent-danger);
}

.price-indicator-down {
  color: var(--accent-secondary);
}

.price-indicator-equal {
  color: var(--text-muted);
}

/* SETTINGS TAB STYLING */
.settings-card {
  background-color: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toggle-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.label-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  padding-right: 16px;
}

.setting-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.setting-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Custom Checkbox Toggle Switch */
.switch-wrapper {
  position: relative;
  width: 46px;
  height: 26px;
}

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

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  transition: .3s;
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .3s;
  border-radius: 50%;
}

.switch-wrapper input:checked + .switch-slider {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.switch-wrapper input:checked + .switch-slider:before {
  transform: translateX(20px);
  background-color: white;
}

/* API Key password wrapper */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px 48px 12px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.password-wrapper input:focus {
  border-color: var(--accent-primary);
}

.btn-icon-inside {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-inside svg {
  width: 18px;
  height: 18px;
}

.settings-link {
  color: var(--accent-primary);
  font-size: 0.8rem;
  text-decoration: none;
  font-weight: 500;
  align-self: flex-start;
}

.settings-link:hover {
  text-decoration: underline;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), #7c3aed);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-title);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
  transition: transform var(--transition-fast);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-title);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.info-card h3 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.info-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.info-card ul {
  padding-left: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* NAVIGATION BAR */
.app-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(20px);
  border-top: var(--border-color) 1px solid;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
  z-index: 10;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex: 1;
  padding: 8px 0;
  border-radius: var(--border-radius-sm);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
}

.nav-item span {
  font-size: 0.7rem;
  font-weight: 500;
}

.nav-item:active svg {
  transform: scale(0.9);
}

.nav-item.active {
  color: var(--accent-primary);
}

.nav-item.active svg {
  color: var(--accent-primary);
}

/* CAMERA OVERLAY SYSTEM */
.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  z-index: 100;
  display: none;
  flex-direction: column;
}

.camera-overlay.active {
  display: flex;
}

.camera-header {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: relative;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), rgba(0,0,0,0));
  z-index: 102;
}

.btn-close-overlay {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-close-overlay svg {
  width: 20px;
  height: 20px;
}

.camera-title {
  color: white;
  font-size: 0.85rem;
  margin-left: 16px;
  font-weight: 500;
}

.camera-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.camera-target-frame {
  position: absolute;
  width: 70%;
  aspect-ratio: 1.6;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
  z-index: 101;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 12px;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: white;
  border-style: solid;
  pointer-events: none;
}

.top-left { top: -2px; left: -2px; border-width: 4px 0 0 4px; border-top-left-radius: 12px; }
.top-right { top: -2px; right: -2px; border-width: 4px 4px 0 0; border-top-right-radius: 12px; }
.bottom-left { bottom: -2px; left: -2px; border-width: 0 0 4px 4px; border-bottom-left-radius: 12px; }
.bottom-right { bottom: -2px; right: -2px; border-width: 0 4px 4px 0; border-bottom-right-radius: 12px; }

.target-helper-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 20px;
  text-align: center;
}

.camera-processing-indicator {
  position: absolute;
  z-index: 103;
  background: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: var(--border-radius-md);
  border: var(--glass-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: var(--glass-shadow);
}

.camera-processing-indicator span {
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s linear infinite;
}

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

.camera-controls {
  height: 100px;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 20px 20px 20px;
  z-index: 102;
}

.btn-shutter {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: white;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-shutter-inner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid black;
  background-color: white;
  transition: transform var(--transition-fast);
}

.btn-shutter:active .btn-shutter-inner {
  transform: scale(0.9);
}

.btn-camera-aux {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-camera-aux svg {
  width: 20px;
  height: 20px;
}

.btn-camera-aux-placeholder {
  width: 44px; /* balance gallery button */
}

/* MODAL SYSTEM (CONFIRMATION) */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 200;
  display: none;
  justify-content: center;
  align-items: flex-end; /* Mobile drawer style */
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  background-color: var(--bg-app);
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  border-top: var(--glass-border);
  padding: 24px;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.5);
  transform: translateY(100%);
  transition: transform var(--transition-normal) ease-out;
  max-height: 90%;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header h3 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.modal-preview-container {
  width: 100%;
  height: 160px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background-color: #000;
  margin-bottom: 18px;
  border: var(--glass-border);
  display: flex;
  justify-content: center;
  align-items: center;
}

#confirm-preview {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.confirm-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"] {
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-group input:focus {
  border-color: var(--accent-primary);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

/* Quantity Selector styling */
.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  background-color: var(--bg-input);
  height: 46px;
}

.btn-qty {
  width: 36px;
  height: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color var(--transition-fast);
}

.btn-qty:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.qty-selector input {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: none;
  text-align: center;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  /* hide default spinner */
  -moz-appearance: textfield;
}

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

.confirm-total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  background-color: rgba(16, 185, 129, 0.08);
  border: 1px dashed rgba(16, 185, 129, 0.2);
  border-radius: var(--border-radius-sm);
  margin-top: 6px;
  margin-bottom: 6px;
}

.confirm-total-box span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.confirm-total-box strong {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--accent-secondary);
  font-weight: 700;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 12px;
  margin-top: 20px;
}

/* Fullscreen Loader */
.app-loader-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 11, 13, 0.85);
  backdrop-filter: blur(10px);
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loader-content p {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
}
