/* Base layout & typography */
:root {
  --brand: #7ac30f;
  --brand-dark: #5b920b;
  --bg: #ffffff;
  --text: #222222;
  --text-muted: #666666;
  --border: #e3e3e3;
  --danger: #d93025;
  --success-bg: #f0ffe5;
  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.app-header {
  background-color: var(--brand);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Add a little horizontal breathing room (helps on very small screens) */
  padding: 10px 26px;
  gap: 12px;
}

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

.header-cart-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.header-cart-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.header-cart-btn:active {
  transform: translateY(1px);
}

.header-cart-icon-wrap {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 0;
  /* Tweak these to move the badge further out (more negative = more top/right) */
  --cart-badge-offset-top: -15px;
  --cart-badge-offset-right: -15px;
}

.header-cart-icon {
  display: block;
}

.header-cart-badge {
  position: absolute;
  /* Pin to the icon's top-right corner (independent of button padding) */
  top: var(--cart-badge-offset-top);
  right: var(--cart-badge-offset-right);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

.brand-name {
  font-size: 18px;
}

.steps-nav {
  display: flex;
  gap: 8px;
  font-size: 13px;
}

.lang-switcher {
  display: none;
}

.lang-btn {
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  color: #ffffff;
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
}

.lang-btn.active {
  background: #ffffff;
  color: var(--brand);
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.7;
}

.step-indicator.active {
  opacity: 1;
  font-weight: 600;
}

.step-number {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.step-label {
  white-space: nowrap;
}

.app-main {
  flex: 1;
  padding: 20px 0 40px;
}

.app-footer {
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  background: #fafafa;
}

.footer-inner {
  padding: 10px 0;
  text-align: center;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-title {
  margin: 0 0 4px;
  font-size: 24px;
}

.page-subtitle {
  margin: 0 0 16px;
  color: var(--text-muted);
}

.card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.section-title {
  margin: 0 0 12px;
  font-size: 18px;
}

.loading {
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-muted);
}

.empty-state {
  margin: 16px 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #fafafa;
  border: 1px dashed var(--border);
  font-size: 14px;
  color: var(--text-muted);
}

.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 12px;
}

.alert-error {
  background: #ffefed;
  color: var(--danger);
  border: 1px solid #f3bab2;
}

.alert-success {
  background: #e6f6e6;
  color: #256029;
  border: 1px solid #a3d9a5;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.category-tab {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f7f7f7;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text-muted);
}

.category-tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.search-box {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14px;
  height: 38px;
  box-sizing: border-box;
}

.search-input:focus {
  outline: 2px solid rgba(122, 195, 15, 0.3);
  border-color: var(--brand);
}

.btn-search {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: none;
  background: var(--brand);
  color: #ffffff;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease;
  flex-shrink: 0;
}

.btn-search:hover {
  background: var(--brand-dark);
}

.btn-search:active {
  transform: scale(0.95);
}

mark.search-highlight {
  background-color: #ffeb3b;
  color: #000000;
  font-weight: 700;
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(255, 235, 59, 0.3);
  display: inline;
}

.search-highlight {
  background-color: #ffeb3b;
  color: #000000;
  font-weight: 700;
  border-radius: 3px;
  box-shadow: 0 0 0 2px rgba(255, 235, 59, 0.3);
}

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

.product-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  min-height: 110px;
  position: relative;
}

.product-image-wrapper {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-image-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.product-description {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Image modal */
.image-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
}

.image-modal[hidden] {
  display: none;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.image-modal-dialog {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 8px;
  z-index: 1;
}

#image-modal-img {
  display: block;
  max-width: 86vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.image-modal-close {
  position: absolute;
  top: 4px;
  right: 6px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.image-modal-close:hover {
  color: var(--text);
}

.product-stock {
  font-size: 12px;
  color: var(--text-muted);
}

.stock-remark {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(217, 48, 37, 0.55);
  background: rgba(217, 48, 37, 0.1);
  color: var(--danger);
  font-weight: 800;
  font-size: 13px;
  line-height: 1.35;
}

.stock-remark--compact {
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 12px;
}

.product-card.out-of-stock {
  opacity: 0.92;
}

.product-price {
  text-align: right;
  font-size: 14px;
}

.price-main {
  font-weight: 600;
}

.price-original {
  font-size: 12px;
  text-decoration: line-through;
  color: var(--text-muted);
  display: block;
}

.price-special {
  color: var(--brand-dark);
}

.product-footer {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.quantity-input {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 13px;
}

.quantity-input input[type="number"] {
  width: 120px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font: inherit;
  height: 38px;
  box-sizing: border-box;
}

textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(122, 195, 15, 0.3);
  border-color: var(--brand);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn-primary {
  background-color: var(--brand);
  color: #ffffff;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: var(--brand-dark);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

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

.order-summary {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
  border-top: 1px solid var(--border);
  padding: 10px 0 40px;
  margin-top: 16px;
}

.order-summary-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.summary-label {
  font-weight: 500;
}

.summary-value {
  font-size: 18px;
  font-weight: 700;
}

.field-error {
  margin-top: 4px;
  font-size: 12px;
  color: var(--danger);
  min-height: 14px;
}

.field-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  table-layout: fixed;
}

.table th,
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}

.table th {
  text-align: left;
  font-weight: 600;
  background: #fafafa;
}

.table th:nth-child(1),
.table td:nth-child(1) {
  width: 40%;
  text-align: left;
}

.table th:nth-child(2),
.table td:nth-child(2) {
  width: 15%;
  text-align: right;
}

.table th:nth-child(3),
.table td:nth-child(3) {
  width: 20%;
  text-align: right;
}

.table th:nth-child(4),
.table td:nth-child(4) {
  width: 25%;
  text-align: right;
}

.text-right {
  text-align: right;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

.form-field-full {
  grid-column: 1 / -1;
}

.form-field label {
  margin-bottom: 4px;
  font-weight: 500;
}

.form-field label::after {
  content: none;
}

.form-field label:has(+ input[required])::after,
.form-field label:has(+ textarea[required])::after,
.form-field label:has(+ select[required])::after,
.form-field label:has(+ .mobile-input-group)::after,
.form-field label:has(+ .file-upload-wrapper input[required])::after {
  content: " *";
  color: var(--danger);
}

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

.mobile-input-group select {
  width: 85px;
  flex-shrink: 0;
}

.mobile-input-group input {
  flex: 1;
  min-width: 0;
}

.delivery-method-options {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.delivery-method-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  user-select: none;
}

.delivery-method-option input[type="radio"] {
  margin: 0;
}

.delivery-method-option:has(input[type="radio"]:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}

.delivery-method-option:has(input[type="radio"]:checked) {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(122, 195, 15, 0.18);
}

.payment-info {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 8px;
  background: #fafafa;
}

.payment-info p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.6;
}

.payment-info strong {
  font-size: 15px;
}

.delivery-info {
  /* border: 1px solid var(--border);
  border-radius: var(--radius-sm); */
  padding: 12px 16px;
  background: #fafafa;
}

.delivery-info p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.6;
}

.delivery-info .delivery-method-title {
  color: var(--brand-dark);
}

.delivery-info strong {
  font-size: 15px;
}

#delivery-info-wrapper {
  background-color: #fafafa;  
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.success-card {
  text-align: center;
  background: var(--success-bg);
  border-color: var(--brand);
}

.success-order-number {
  margin-top: 8px;
  font-weight: 600;
}

/* Product modal */
.product-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.product-modal[hidden] {
  display: none;
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.product-modal-dialog {
  position: relative;
  max-width: 90vw;
  width: 900px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 1;
  overflow: auto;
}

.product-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-modal-close:hover {
  color: var(--text);
}

.product-modal-content {
  padding: 20px;
}

.product-modal-content h2 {
  margin: 0 0 16px;
  font-size: 20px;
  padding-right: 32px;
}

.product-modal-body {
  display: flex;
  gap: 20px;
  flex-direction: row;
}

.product-modal-image-wrapper {
  width: 40%;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-modal-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.product-modal-image-wrapper img:hover {
  transform: scale(1.02);
}

.product-modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-modal-no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

.modal-image-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
}

.modal-image-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.modal-image-prev {
  left: 10px;
}

.modal-image-next {
  right: 10px;
}

.modal-image-counter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  z-index: 2;
}

.product-modal-info h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.product-modal-description {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

.product-modal-price {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
}

.product-modal-qty {
  margin-bottom: 16px;
}

.product-modal-qty label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
}

.product-modal-qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 135px;
}

.product-modal-actions {
  display: flex;
  gap: 8px;
}

/* Cart page */
.cart-badge {
  background: var(--brand-dark);
  color: white;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 14px;
  font-weight: 600;
  min-width: 24px;
  text-align: center;
}

.cart-items-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fafafa;
  align-items: center;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f5f5f5;
  flex-shrink: 0;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.cart-item-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 14px;
  color: var(--text-muted);
}

.cart-item-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-item-total {
  font-weight: 600;
  font-size: 16px;
}

.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  text-decoration: underline;
}

.cart-summary {
  border-top: 2px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}

.coupon-box {
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.coupon-input-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.coupon-label {
  font-size: 13px;
  color: var(--text-muted);
}

.coupon-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.coupon-input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  min-width: 220px;
  flex: 1 1 220px;
}

.coupon-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(122, 195, 15, 0.18);
}

.btn-coupon-action {
  height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #b3261e;
  border-color: #b3261e;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cart-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

/* Make product cards clickable */
.product-card {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.product-card .product-footer {
  display: none;
}

/* Product quantity control */
.product-quantity-control {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: flex-end;
  margin-top: auto;
  width:135px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  transition: background-color 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-input {
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding: 0 4px;
  background: #ffffff;
  color: var(--text);
}

.qty-input:focus {
  outline: 2px solid rgba(122, 195, 15, 0.3);
  border-color: var(--brand);
}

/* Hide number input arrows/spinners */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input[type="number"] {
  -moz-appearance: textfield;
}

/* File upload component */
.file-upload-wrapper {
  width: 100%;
}

.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafafa;
  display: block;
}

.file-upload-area[hidden] {
  display: none;
}

.file-upload-area:hover {
  border-color: var(--brand);
  background: #f0ffe5;
}

.file-upload-area.drag-over {
  border-color: var(--brand);
  background: #f0ffe5;
  transform: scale(1.02);
}

.file-upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.file-upload-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-upload-main {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.file-upload-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.file-info-area {
  border: 1px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  background: #f0ffe5;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.file-info-area[hidden] {
  display: none;
}

.file-info-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.file-info-icon {
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: bold;
  flex-shrink: 0;
}

.file-info-name {
  font-size: 14px;
  font-weight: 500;
  word-break: break-all;
  color: var(--text);
  flex: 1;
}

.file-remove-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.file-remove-btn:hover {
  background: var(--danger);
  color: white;
}

/* Receipt preview */
.receipt-preview-container {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fafafa;
}

.receipt-preview-container[hidden] {
  display: none;
}

.receipt-preview-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.receipt-preview-image {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s ease;
  display: block;
}

.receipt-preview-image:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  /* Force header to stay single-row on mobile (prevents stacking) */
  .app-header .header-inner {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 10px 16px;
  }

  .app-header .brand {
    min-width: 0;
    flex: 1 1 auto;
  }

  .app-header .brand-logo {
    /* Shrink logo so the cart icon fits on the same line */
    height: 24px;
    width: auto;
    max-width: 68vw;
  }

  .app-header .header-actions {
    flex-shrink: 0;
    margin-left: 10px;
  }

  .app-header .header-cart-btn {
    width: 32px;
    height: 32px;
  }

  .steps-nav {
    width: 100%;
    justify-content: space-between;
  }

  .lang-switcher {
    align-self: stretch;
    justify-content: flex-end;
  }

  .app-main {
    padding-top: 16px;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    align-items: flex-start;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

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

  .summary-value {
    font-size: 16px;
  }

  .product-modal-dialog {
    width: 95vw;
  }

  .product-modal-body {
    flex-direction: column;
  }

  .product-modal-image-wrapper {
    width: 100%;
  }

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

  .cart-item-controls {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .cart-actions {
    flex-direction: column;
  }

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

  .file-upload-area {
    padding: 24px 16px;
  }

  .file-upload-icon {
    font-size: 36px;
  }

  .file-upload-main {
    font-size: 14px;
  }

  .file-info-area {
    flex-wrap: wrap;
  }

  .file-info-content {
    flex: 1 1 100%;
    margin-bottom: 8px;
  }
}

/* Maintenance overlay */
.maintenance-overlay {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.maintenance-overlay[hidden] {
  display: none;
}

.maintenance-content {
  text-align: center;
  padding: 20px;
  max-width: 500px;
}

.maintenance-gear {
  font-size: 120px;
  margin-bottom: 24px;
  animation: rotate 3s linear infinite;
  display: inline-block;
}

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

.maintenance-title {
  font-size: 32px;
  margin: 0 0 12px;
  color: var(--text);
  font-weight: 600;
}

.maintenance-subtitle {
  font-size: 18px;
  margin: 0;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .maintenance-gear {
    font-size: 80px;
  }

  .maintenance-title {
    font-size: 24px;
  }

  .maintenance-subtitle {
    font-size: 16px;
  }
}

