/* Catalog page — mobile-first product management UI */

.page-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* Lang bar */
.lang-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px 0;
}
.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-btn.active {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}

/* Form section */
.form-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-top: 24px;
}
.form-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 24px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
}
.field input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

/* Image upload */
.img-upload-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.img-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.img-upload-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.img-name {
  font-size: 13px;
  color: var(--fg-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.img-preview {
  margin-top: 12px;
  max-height: 180px;
  max-width: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.img-preview.hidden { display: none; }

/* Actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.btn-primary {
  background: var(--dark);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-cancel {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
}
.btn-cancel.hidden { display: none; }

/* Status */
.form-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}
.form-status.success {
  background: #D1FAE5;
  color: #065F46;
}
.form-status.error {
  background: #FEE2E2;
  color: #991B1B;
}

/* Gallery */
.gallery-section {
  margin-top: 40px;
}
.gallery-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 20px;
}
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.6;
  background: white;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state svg { display: block; margin: 0 auto 12px; }

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.product-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.product-card:hover {
  box-shadow: 0 4px 20px rgba(13,27,42,0.08);
}
.product-img-wrap {
  height: 160px;
  overflow: hidden;
  background: var(--bg-alt);
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-img-placeholder {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
}
.product-info {
  padding: 14px 16px 8px;
}
.product-name {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: var(--dark);
  margin-bottom: 2px;
}
.product-name-ar {
  display: block;
  font-size: 14px;
  color: var(--fg-muted);
  direction: rtl;
  text-align: right;
  margin-bottom: 2px;
}
.product-price {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-display);
  margin-bottom: 4px;
}
.product-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}
.product-actions {
  display: flex;
  gap: 6px;
  padding: 8px 16px 14px;
}
.action-edit, .action-delete {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--fg-muted);
  transition: background 0.15s, color 0.15s;
}
.action-edit:hover { background: var(--accent-light); color: #92400E; }
.action-delete:hover { background: #FEE2E2; color: #991B1B; }

/* RTL */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .product-name-ar { text-align: right; }
[dir="rtl"] .product-actions { flex-direction: row-reverse; }