/* Senior-friendly admin for phones (Techno Pova 6 / Android gallery) */
html, body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body[data-page="admin"] {
  font-size: 18px;
  line-height: 1.5;
}

body.admin-lock-scroll {
  overflow: hidden;
}

.admin-button,
.admin-product-edit,
.admin-image-row button,
.admin-close-btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(47, 109, 87, 0.25);
}

.admin-button {
  min-height: 52px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  border-radius: 14px;
}

.admin-button.primary {
  background: #157a45;
  border-color: #157a45;
  color: #fff;
  box-shadow: 0 6px 0 #0d5230;
}

.admin-button.danger {
  background: #c0392b;
  border-color: #c0392b;
  color: #fff;
  box-shadow: 0 6px 0 #7a2118;
}

.admin-hero {
  padding: 28px 5% 18px;
}

.admin-hero h1 {
  font-size: clamp(28px, 8vw, 48px);
  letter-spacing: -1px;
}

.admin-hero p,
.admin-help-inner,
.admin-help-inner ol {
  font-size: 17px;
  line-height: 1.7;
  color: #2b2422;
}

.admin-help-inner {
  background: #fff8e7;
  border: 3px solid #e0b429;
}

.admin-field {
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  color: #2b2422;
  font-weight: 700;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
  min-height: 52px;
  font-size: 18px !important;
  border: 2px solid #1f1a1a !important;
  border-radius: 12px;
  letter-spacing: normal;
  text-transform: none;
}

.admin-file-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 16px;
  background: #157a45;
  color: #fff;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 6px 0 #0d5230;
}

.admin-file-btn span {
  pointer-events: none;
  text-align: center;
}

.admin-file-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  font-size: 80px;
  cursor: pointer;
}

.admin-image-actions .admin-file-btn {
  width: 100%;
  min-height: 48px;
  font-size: 15px;
  box-shadow: none;
}

.admin-file-btn.secondary {
  background: #1d4e89;
  box-shadow: 0 6px 0 #123056;
}

.admin-native-file {
  display: none;
}

.admin-photo-box {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: #e8f8ee;
  border: 3px solid #157a45;
  border-radius: 16px;
}

.admin-photo-box strong {
  font-size: 20px;
  color: #0d5230;
}

.admin-photo-box small {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: #1f1a1a;
  line-height: 1.5;
}

.admin-image-preview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.admin-image-preview-item {
  background: #fff;
  border: 2px solid #1f1a1a;
  border-radius: 12px;
  overflow: hidden;
}

.admin-image-preview-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  background: #efe5df;
}

.admin-image-preview-item button {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: #c0392b;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.admin-ez-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #fff3cd;
  border: 2px solid #e0b429;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #1f1a1a;
  line-height: 1.5;
}

.admin-modal {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}

.admin-modal-panel {
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  background: #f8f4f0;
}

.admin-modal-header {
  flex-shrink: 0;
  padding: 14px 16px;
  background: #157a45;
  color: #fff;
}

.admin-modal-header h2 {
  font-size: 22px;
  color: #fff;
  letter-spacing: 0;
}

.admin-close-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: #1f1a1a;
  font-size: 32px;
}

.admin-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: block;
  padding-bottom: 110px;
}

.admin-gallery,
.admin-form {
  width: 100%;
}

.admin-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 250;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: stretch;
  padding: 10px 10px calc(12px + env(safe-area-inset-bottom, 10px));
  background: #10261b;
  border-top: 4px solid #95d5b2;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
}

.admin-action-bar:empty {
  display: none;
}

.admin-action-bar .admin-button {
  flex: 1 1 0;
  min-height: 56px;
  font-size: 16px;
  margin: 0;
  white-space: nowrap;
}

.admin-action-bar .admin-button.danger {
  flex: 0.9 1 0;
}

.admin-action-bar .admin-button.primary {
  flex: 1.4 1 0;
  background: #ffd60a;
  border-color: #ffd60a;
  color: #1f1a1a;
  box-shadow: 0 5px 0 #b8860b;
}

.admin-toast {
  position: fixed;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 300;
  padding: 16px 18px;
  border-radius: 16px;
  background: #157a45;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  text-align: center;
}

.admin-toast.wait {
  background: #1d4e89;
}

.admin-toast.bad {
  background: #c0392b;
}

.admin-toast.hidden {
  display: none;
}

.admin-voice-prompt {
  top: 12px;
  bottom: auto;
  font-size: 16px;
  padding: 16px;
}

.admin-product-edit {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  background: #157a45;
  color: #fff;
  border: 0;
  border-radius: 10px;
}

.admin-product-body h3 {
  font-size: 26px;
}

.admin-product-body p,
.admin-product-price {
  font-size: 16px;
}

@media (max-width: 900px) {
  .admin-hero-inner,
  .admin-actions {
    width: 100%;
  }

  .admin-actions .admin-button {
    width: 100%;
    font-size: 18px;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-modal-body {
    grid-template-columns: 1fr;
  }

  .admin-gallery {
    border-right: 0;
    padding: 12px;
  }

  .admin-form {
    padding: 12px 14px 24px;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-main-image {
    width: min(100%, 280px);
    max-height: 280px;
    margin: 0 auto;
  }

  .admin-image-row {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .admin-image-row button {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
    white-space: normal;
    text-transform: none;
    letter-spacing: 0;
  }
}

#productModal .admin-form-actions {
  display: none;
}

@media (min-width: 901px) {
  .admin-modal {
    padding: 24px;
    align-items: center;
    justify-content: center;
  }

  .admin-modal-panel {
    width: min(1200px, 100%);
    height: auto;
    max-height: 90vh;
  }

  .admin-modal-body {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr;
  }
}
