/* ============================================
   EN CACHITOS — Global Styles (Mobile-First)
   ============================================ */

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f0ff;
  color: #1a1a2e;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }
a { color: inherit; }
input, button, textarea, select { font-family: inherit; }

/* === HEADER (Admin) === */
.header {
  background: linear-gradient(135deg, #771ae3, #4a0ea8);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-title {
  font-size: 16px;
  font-weight: 800;
  color: white;
  font-family: 'Poppins', sans-serif;
}
.header-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  font-family: 'Poppins', sans-serif;
}

/* === CARD === */
.card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(119, 26, 227, 0.08);
  margin-bottom: 16px;
  overflow: hidden;
}

/* === BUTTONS === */
.btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #771ae3, #9b2ef5);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  box-shadow: 0 4px 15px rgba(119, 26, 227, 0.3);
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(119, 26, 227, 0.4); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* === FORMS === */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #555;
  margin-bottom: 6px;
  font-family: 'Poppins', sans-serif;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0d0f5;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #771ae3;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* === SECTIONS (vendedor detail) === */
.section-title {
  font-size: 13px;
  font-weight: 800;
  color: #771ae3;
  margin-top: 20px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0e6fd;
  font-family: 'Poppins', sans-serif;
}

/* === MESSAGES === */
.msg-ok {
  background: #e3f9e5;
  border-left: 4px solid #2e7d32;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: #2e7d32;
  word-wrap: break-word;
}
.msg-err {
  background: #fee;
  border-left: 4px solid #f3420e;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  color: #c00;
  word-wrap: break-word;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4b8f9; border-radius: 3px; }

/* ============================================
   MOBILE RESPONSIVE — Global
   ============================================ */

/* --- Small phones (≤ 480px) --- */
@media (max-width: 480px) {

  /* Header compact */
  .header {
    padding: 10px 14px;
    gap: 8px;
  }
  .header img { height: 30px !important; }
  .header-title { font-size: 14px; }
  .header-subtitle { font-size: 10px; }
  .header > div:last-child {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
    font-size: 10px;
  }
  .header > div:last-child a,
  .header > div:last-child span {
    font-size: 10px !important;
    padding: 4px 0;
  }

  /* Card compact */
  .card { padding: 16px; border-radius: 12px; }

  /* Form stacking */
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Section title smaller */
  .section-title { font-size: 12px; }
}

/* --- Medium phones (≤ 768px) --- */
@media (max-width: 768px) {

  /* Prevent horizontal scroll */
  body, html { overflow-x: hidden; }

  /* Fix tables */
  table { font-size: 12px; }
  th { padding: 8px 6px; font-size: 10px; }
  td { padding: 8px 6px; font-size: 12px; }
}

/* Error messages — hidden by default, shown via .show class */
.error-msg {
  display: none;
  color: #f3420e;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
.error-msg.show {
  display: block;
}
.hint {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}
.hint.suggested {
  color: #0891b2;
  font-weight: 600;
}
.form-group input.error,
.form-group select.error {
  border-color: #f3420e;
  background: #fff5f5;
}
.success-box {
  display: none;
}
