/* ====== ADMIN — Helen Personalizados ====== */
:root {
  --bg:        #f7f5f3;
  --surface:   #ffffff;
  --surface-2: #fbf5ef;
  --line:      #ece4dd;
  --line-2:    #d8ccc2;
  --ink:       #2d2424;
  --ink-soft:  #6b5252;
  --muted:     #998a82;

  --rose:      #db8270;
  --rose-d:    #c25e4d;
  --rose-l:    #fde9e3;
  --rose-50:   #fdf6f3;
  --gold:      #c9a96a;
  --green:     #2a8f5a;
  --danger:    #d24c4c;
  --danger-l:  #fde9e9;

  --r: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(45, 36, 36, .06);
  --shadow-md: 0 10px 30px rgba(45, 36, 36, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 14px; }

code {
  background: var(--rose-l);
  color: var(--rose-d);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'SF Mono', Consolas, monospace;
}

/* ====== LOGIN ====== */
.login-screen {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #fde9e3 0%, #fbf5ef 50%, #e9e3f0 100%);
  z-index: 1000;
  padding: 24px;
}
.login-card {
  background: white;
  width: 100%; max-width: 400px;
  padding: 44px 36px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.login-title {
  font-family: 'Cormorant Garamond', serif;
  margin-bottom: 6px;
  font-weight: 500;
}
.login-script {
  font-family: 'Dancing Script', cursive;
  font-size: 44px;
  color: var(--rose);
  display: block;
  line-height: 1;
}
.login-sub {
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
}
.login-hint { color: var(--ink-soft); margin: 24px 0 20px; font-size: 13px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; }
.login-card input {
  padding: 14px 16px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 15px;
  text-align: center;
  letter-spacing: 2px;
  transition: all .2s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--rose);
  background: white;
  box-shadow: 0 0 0 4px var(--rose-50);
}
.login-foot { color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ====== APP ====== */
.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  height: 100vh;
}

/* ====== SIDEBAR ====== */
.sidebar {
  background: white;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 24px 16px;
}
.brand {
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.brand-script {
  font-family: 'Dancing Script', cursive;
  font-size: 34px;
  color: var(--rose);
  display: block;
  line-height: 1;
}
.brand-sub {
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
}

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.side-link {
  background: none;
  border: none;
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 400;
  transition: all .15s;
}
.side-link:hover { background: var(--rose-50); color: var(--rose-d); }
.side-link.active {
  background: linear-gradient(135deg, var(--rose), var(--rose-d));
  color: white;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(219, 130, 112, .35);
}

.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ====== MAIN ====== */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: white;
  border-bottom: 1px solid var(--line);
}
.topbar-admin h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
}
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.status {
  font-size: 12px;
  color: var(--green);
  background: #e8f5ec;
  padding: 5px 12px;
  border-radius: 99px;
  font-weight: 500;
}
.status.saving { color: var(--gold); background: #fcf2e0; }

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 60px;
}

/* ====== CARDS ====== */
.card {
  background: white;
  border-radius: var(--r-lg);
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}
.card h4.sub {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-top: 24px;
  margin-bottom: 10px;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.card.danger {
  border-color: var(--danger-l);
  background: #fffbfb;
}
.card.danger h3 { color: var(--danger); }

.muted { color: var(--muted); font-size: 13px; margin-bottom: 12px; }

/* ====== FIELDS ====== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field span {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: .3px;
}
.field span small { color: var(--muted); font-weight: 300; }
.field input,
.field textarea,
.field select {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  transition: all .15s;
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--rose);
  background: white;
  box-shadow: 0 0 0 3px var(--rose-50);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-3.nested { grid-column: span 1; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-link { flex: 1 1 calc(50% - 4px); text-align: center; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar-admin { padding: 14px 20px; }
  .tab-content { padding: 20px; }
}

/* ====== BUTTONS ====== */
.btn-pri {
  background: linear-gradient(135deg, var(--rose), var(--rose-d));
  color: white;
  border: none;
  padding: 11px 22px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .5px;
  transition: all .2s;
  box-shadow: 0 6px 16px rgba(219, 130, 112, .3);
}
.btn-pri:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(219, 130, 112, .45); }
.btn-pri:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line-2);
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
}
.btn-ghost:hover { border-color: var(--rose); color: var(--rose-d); }

.btn-link {
  background: none;
  border: none;
  color: var(--ink-soft);
  text-decoration: underline;
  font-size: 12px;
  padding: 6px;
  transition: color .15s;
}
.btn-link:hover { color: var(--rose-d); }

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  padding: 11px 22px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
}
.btn-danger:hover { background: #b53e3e; }

.btn-block { width: 100%; }

/* ====== IMAGE UPLOAD ====== */
.img-upload {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}
.img-upload input[type="file"] {
  padding: 8px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}
.img-upload input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
  background: var(--rose);
  color: white;
  cursor: pointer;
  font-size: 12px;
}
.img-upload input[type="text"] {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.img-preview {
  grid-column: 1 / -1;
  min-height: 0;
  margin-top: 6px;
}
.img-preview:not(:empty) {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  display: inline-block;
  min-height: 60px;
}
.img-preview img,
.img-preview video {
  max-height: 100px;
  max-width: 200px;
  border-radius: 6px;
  display: block;
}

/* ====== HERO IMAGES LIST ====== */
.hero-img-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 10px;
}
.hero-img-row .thumb-mini {
  width: 80px; height: 80px;
  border-radius: 8px;
  background: white;
  overflow: hidden;
  border: 1px solid var(--line);
}
.hero-img-row .thumb-mini img { width: 100%; height: 100%; object-fit: cover; }

/* ====== FEATURES LIST ====== */
.feature-row {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
}
.feature-row .feature-head {
  display: flex; gap: 12px; align-items: center; margin-bottom: 12px;
}
.feature-row .icon-input {
  width: 60px; text-align: center; font-size: 24px; padding: 8px;
  border-radius: 10px; border: 1px solid var(--line); background: white;
}

/* ====== CATEGORIES LIST ====== */
.category-row {
  display: grid;
  grid-template-columns: 70px 130px 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}
.category-row input { padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: white; }
.category-row .icon-input { font-size: 22px; text-align: center; }

@media (max-width: 700px) {
  .category-row { grid-template-columns: 1fr 1fr; }
  .hero-img-row { grid-template-columns: 1fr; }
}

/* ====== PRODUCTS GRID (admin) ====== */
.products-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.product-card-admin {
  background: var(--surface-2);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.product-card-admin:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--rose); }
.product-card-admin .pc-img {
  aspect-ratio: 1/1;
  background: white;
  overflow: hidden;
  position: relative;
}
.product-card-admin .pc-img img,
.product-card-admin .pc-img video { width: 100%; height: 100%; object-fit: cover; }
.product-card-admin .pc-info { padding: 12px; }
.product-card-admin .pc-info h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.2;
}
.product-card-admin .pc-info p {
  font-size: 13px;
  color: var(--rose-d);
  font-weight: 500;
}
.product-card-admin .pc-cat {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(255,255,255,.95);
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.product-card-admin .pc-mediacount {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,.6);
  color: white;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
}

/* ====== REVIEWS LIST ====== */
.review-row {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.review-row .review-head {
  display: grid;
  grid-template-columns: 90px 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}

/* ====== TRANSLATIONS EDITOR ====== */
.lang-tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.lang-tab {
  background: none; border: none;
  padding: 10px 18px;
  color: var(--ink-soft);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.lang-tab.active { color: var(--rose-d); border-bottom-color: var(--rose); font-weight: 500; }

.translation-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 14px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.translation-row .key {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 12px;
  color: var(--ink-soft);
}
.translation-row textarea {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  resize: vertical;
  min-height: 38px;
  font-size: 13px;
}

/* ====== PUBLISH STEPS ====== */
.publish-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}
.step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 18px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rose), var(--rose-d));
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  flex-shrink: 0;
}
.step strong { display: block; margin-bottom: 4px; }
.step p { margin-bottom: 8px; }
.step .btn-pri { margin-top: 6px; }

/* ====== MODAL ====== */
.modal-admin {
  position: fixed; inset: 0;
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-admin.open { display: flex; animation: fade .2s; }
.modal-back {
  position: absolute; inset: 0;
  background: rgba(45, 36, 36, .55);
  backdrop-filter: blur(4px);
}
.modal-body {
  position: relative;
  background: white;
  border-radius: var(--r-lg);
  width: 100%; max-width: 800px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.modal-body h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
}
.modal-x {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 22px;
  color: var(--ink-soft);
  border: none;
  transition: all .15s;
}
.modal-x:hover { background: var(--danger-l); color: var(--danger); transform: rotate(90deg); }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

/* ====== MEDIA LIST (product editor) ====== */
.media-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}
.media-row .m-thumb {
  width: 80px; height: 80px;
  border-radius: 8px;
  background: white;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
}
.media-row .m-thumb img,
.media-row .m-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-row .m-type {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,.6);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
}
.media-row .m-fields { display: flex; flex-direction: column; gap: 6px; }
.media-row .m-fields input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: white;
  font-size: 12px;
}
.media-row .m-actions { display: flex; flex-direction: column; gap: 4px; }
.media-row .m-actions button {
  background: white;
  border: 1px solid var(--line);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 14px;
  color: var(--ink-soft);
  transition: all .15s;
}
.media-row .m-actions button:hover { border-color: var(--rose); color: var(--rose-d); }
.media-row .m-actions button.del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-l); }

.media-add-buttons { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ====== TOAST ====== */
.toast-admin {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: white;
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 13px;
  z-index: 300;
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.toast-admin.show { transform: translateX(-50%) translateY(0); }
.toast-admin.error { background: var(--danger); }
.toast-admin.success { background: var(--green); }

/* ====== LIST ITEM ACTIONS ====== */
.item-actions {
  display: flex; gap: 6px;
}
.item-actions button {
  background: white;
  border: 1px solid var(--line);
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 13px;
  color: var(--ink-soft);
  transition: all .15s;
}
.item-actions button:hover { border-color: var(--rose); color: var(--rose-d); }
.item-actions button.del:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-l); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--rose); }
