/* =========================================================
   PINO FACU · Remates (remates.html y admin-remates.html)
   ========================================================= */

/* ---------- Hero ---------- */

.rem-hero {
  position: relative;
  overflow: hidden;
  padding: 85px 0 110px;
  background: radial-gradient(ellipse at 80% 10%, #f6d85d, #ffb477 35%, #fc5d5c 85%);
}

.rem-hero::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 50px;
  background: #fff;
  clip-path: polygon(0 45%, 15% 20%, 30% 75%, 47% 30%, 64% 65%, 80% 20%, 100% 55%, 100% 100%, 0 100%);
}

.rem-hero .pf-wrap {
  position: relative;
  z-index: 1;
}

.rem-hero h1 {
  margin: 25px 0;
  font:
    900 clamp(75px, 12vw, 160px) / 0.9 Outfit,
    sans-serif;
  letter-spacing: -0.08em;
  color: #fff;
}

.rem-hero p {
  max-width: 600px;
  margin: 0 0 28px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
}

.rem-hammer {
  position: absolute;
  top: 15%;
  right: 9%;
  font-size: clamp(90px, 18vw, 250px);
  filter: drop-shadow(10px 15px 10px #a5383840);
  animation: hammer 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hammer {
  0%,
  100% {
    transform: rotate(-25deg);
  }
  40% {
    transform: rotate(7deg);
  }
  65% {
    transform: rotate(-35deg);
  }
}

/* ---------- Cómo funciona ---------- */

.rem-how {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 28px 0 80px;
}

.rem-how article {
  padding: 25px;
  border-radius: 25px;
  background: #fff;
  border: 1px solid #f3f3f3;
  box-shadow: 0 12px 40px #0000000b;
}

.rem-how strong {
  font:
    900 48px Outfit,
    sans-serif;
  color: var(--coral);
}

.rem-how h3 {
  margin: 12px 0;
  font:
    900 22px Outfit,
    sans-serif;
}

.rem-how p {
  font-size: 14px;
  line-height: 1.5;
}

/* ---------- Vidriera ---------- */

.rem-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 35px;
  margin: 30px 0 70px;
}

.rem-gallery {
  position: sticky;
  top: 100px;
}

.rem-photo {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 480px;
  padding: 30px;
  border-radius: 35px;
  background: radial-gradient(circle at 70% 20%, #f6d85d, #ffaf78 43%, #fc5d5c);
}

.rem-photo::before {
  content: "";
  position: absolute;
  inset: 15%;
  border: 3px solid #ffffff9a;
  border-radius: 47% 53% 68% 32% / 55% 34% 66% 45%;
  animation: orbit 8s ease-in-out infinite;
}

@keyframes orbit {
  50% {
    transform: rotate(20deg) scale(1.07);
  }
}

.rem-photo img {
  position: relative;
  width: 100%;
  height: 420px;
  object-fit: contain;
  filter: drop-shadow(0 20px 20px #5e332e55);
  transition: opacity 0.25s;
}

.rem-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.rem-thumbs button {
  width: 72px;
  height: 72px;
  padding: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #f4f4f4;
  cursor: pointer;
  transition:
    border-color 0.2s,
    transform 0.2s;
}

.rem-thumbs button:hover {
  transform: translateY(-2px);
}

.rem-thumbs button.active {
  border-color: var(--coral);
}

.rem-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---------- Panel de oferta ---------- */

.rem-panel {
  padding: 34px;
  border: 1px solid #eee;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 20px 70px #00000010;
  transition: opacity 0.25s;
}

.rem-panel[aria-busy="true"] {
  opacity: 0.55;
}

.rem-panel h2 {
  margin: 15px 0;
  font:
    900 clamp(35px, 4vw, 56px) / 1 Outfit,
    sans-serif;
  letter-spacing: -0.05em;
}

.rem-panel p {
  line-height: 1.55;
}

.rem-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 100px;
  background: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.rem-badge[data-status="active"] {
  background: var(--ink);
  color: #fff;
}

.rem-badge[data-status="active"]::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 #4ade80aa;
  animation: live 1.8s infinite;
}

@keyframes live {
  70% {
    box-shadow: 0 0 0 8px #4ade8000;
  }
  100% {
    box-shadow: 0 0 0 0 #4ade8000;
  }
}

.rem-badge[data-status="closed"] {
  background: #ececec;
  color: #555;
}

.rem-price {
  margin: 26px 0;
  padding: 22px;
  border-radius: 22px;
  background: #fff7df;
}

.rem-price span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.rem-price strong {
  display: block;
  font:
    900 clamp(36px, 4vw, 55px) Outfit,
    sans-serif;
  letter-spacing: -0.03em;
}

.rem-field {
  display: grid;
  gap: 9px;
  margin: 22px 0 14px;
}

.rem-field small {
  color: #666;
}

.rem-field label,
.admin-field > label {
  font-weight: 900;
}

.rem-input {
  display: flex;
  align-items: center;
  border: 2px solid #ddd;
  border-radius: 15px;
  background: #fff;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.rem-input:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 4px #fc5d5c22;
}

.rem-input span {
  padding-left: 16px;
  font:
    900 22px Outfit,
    sans-serif;
  color: #999;
}

.rem-input input {
  flex: 1;
  min-width: 0;
  padding: 15px 15px 15px 8px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--ink);
  font:
    900 22px Outfit,
    sans-serif;
}

.rem-input input:focus {
  outline: 0;
}

.rem-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.rem-quick button {
  padding: 9px 14px;
  border: 1px solid #f1d0cf;
  border-radius: 999px;
  background: #fff4f3;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.2s;
}

.rem-quick button:hover {
  background: #ffe6e4;
  transform: translateY(-2px);
}

.rem-send {
  width: 100%;
}

.rem-message {
  min-height: 1.5em;
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 800;
}

.rem-message[data-tone="error"] {
  color: #a32626;
}

.rem-message[data-tone="info"] {
  color: #6b5a1e;
}

.rem-message[data-tone="ok"] {
  color: #1d7a3e;
}

.rem-notice {
  margin-top: 22px;
  padding: 22px;
  border-radius: 22px;
  background: #f7f7f7;
}

.rem-notice strong {
  font:
    900 22px Outfit,
    sans-serif;
}

.rem-notice p {
  margin: 8px 0 18px;
}

.rem-rules {
  padding: 25px;
  border-radius: 24px;
  background: #f7f7f7;
  font-size: 14px;
  line-height: 1.6;
}

.rem-rules p:last-child {
  margin-bottom: 0;
}

.rem-hidden {
  display: none !important;
}

/* ---------- Administrador ---------- */

.admin-tag {
  margin-left: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.rem-admin {
  max-width: 820px;
  margin: 65px auto 110px;
}

.rem-admin h1 {
  margin: 10px 0 25px;
  font:
    900 clamp(45px, 7vw, 80px) / 0.95 Outfit,
    sans-serif;
  letter-spacing: -0.07em;
}

.admin-note {
  margin: 20px 0;
  padding: 18px;
  border-radius: 17px;
  background: #fff5d9;
  line-height: 1.5;
}

.admin-note[data-tone="ok"] {
  background: #e9f8ef;
}

.admin-note[data-tone="error"] {
  background: #fdeaea;
  color: #8a1f1f;
}

.admin-box {
  padding: 30px;
  border: 1px solid #eee;
  border-radius: 30px;
  box-shadow: 0 15px 50px #0000000d;
}

.admin-box h2 {
  margin: 0 0 20px;
  font:
    900 26px Outfit,
    sans-serif;
  letter-spacing: -0.03em;
}

.admin-fields {
  display: grid;
  gap: 20px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.admin-field {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-field small {
  color: #666;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
  width: 100%;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.admin-field textarea {
  resize: vertical;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
  outline: 0;
  border-color: var(--coral);
  box-shadow: 0 0 0 4px #fc5d5c22;
}

.admin-field [aria-invalid="true"] {
  border-color: #c33;
}

.admin-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-drop {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 26px;
  border: 2px dashed #e3c4c3;
  border-radius: 20px;
  background: #fffaf9;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s;
}

.admin-drop span {
  font-size: 28px;
}

.admin-drop:hover,
.admin-drop.is-over {
  border-color: var(--coral);
  background: #fff0ee;
}

.admin-file:focus-visible + .admin-drop,
.admin-drop:focus-within {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

.admin-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-preview:empty {
  display: none;
}

.admin-photo {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0;
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 16px;
  background: #f7f7f7;
}

.admin-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-photo button {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.admin-photo button:hover {
  background: var(--coral);
}

.admin-photo figcaption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #ffffffe6;
  font-size: 11px;
  font-weight: 800;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 25px;
}

.admin-message {
  min-height: 1.5em;
  margin: 16px 0 0;
  font-weight: 800;
}

.admin-message[data-tone="error"] {
  color: #a32626;
}

.admin-message[data-tone="ok"] {
  color: #1d7a3e;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  .rem-how,
  .rem-stage,
  .admin-row {
    grid-template-columns: 1fr;
  }

  .rem-how {
    margin-bottom: 60px;
  }

  .rem-gallery {
    position: static;
  }

  .rem-hero {
    padding: 60px 0 90px;
  }

  .rem-hammer {
    top: 7%;
    right: 2%;
    opacity: 0.3;
  }

  .rem-photo {
    min-height: 310px;
  }

  .rem-photo img {
    height: 300px;
  }

  .rem-panel,
  .admin-box {
    padding: 23px;
  }

  .rem-admin {
    margin-top: 40px;
  }

  .admin-actions .pf-button {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rem-hammer,
  .rem-photo::before,
  .rem-badge[data-status="active"]::before {
    animation: none;
  }
}

/* =========================================================
   Varios remates + administrador con GitHub (v4)
   ========================================================= */

/* ---------- Lista pública ---------- */

.rem-list {
  display: grid;
  gap: 40px;
  margin: 30px 0 70px;
}

.rem-list .rem-stage {
  margin: 0;
}

.rem-item + .rem-item {
  padding-top: 40px;
  border-top: 1px dashed #e7d6d5;
}

.rem-loading {
  padding: 60px 0;
  text-align: center;
  font-weight: 800;
  color: var(--muted);
}

.rem-panel .rem-name {
  margin: 15px 0;
  font:
    900 clamp(35px, 4vw, 56px) / 1 Outfit,
    sans-serif;
  letter-spacing: -0.05em;
}

/* Las fotos llenan el recuadro con bordes redondeados (como en el inicio) */
.rem-photo {
  padding: 0;
}

.rem-photo img {
  height: 480px;
  object-fit: cover;
  filter: none;
}

.rem-photo.is-empty::after {
  content: "📷";
  position: relative;
  font-size: 60px;
  opacity: 0.6;
}

.rem-item.is-closed .rem-photo img {
  filter: grayscale(0.7);
}

.rem-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 30px 0 70px;
  padding: 50px 25px;
  border-radius: 30px;
  background: #fff7df;
  text-align: center;
}

.rem-empty > span {
  font-size: 60px;
}

.rem-empty strong {
  font:
    900 clamp(24px, 3vw, 34px) / 1.1 Outfit,
    sans-serif;
  letter-spacing: -0.03em;
}

.rem-empty p {
  margin: 0 0 10px;
}

/* ---------- Admin: acceso ---------- */

.admin-login {
  max-width: 460px;
}

.admin-login .admin-field {
  margin-bottom: 14px;
}

.admin-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  cursor: pointer;
}

.admin-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--coral);
}

.admin-intro {
  margin: -6px 0 22px;
  line-height: 1.55;
  color: var(--muted);
}

.admin-help {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #eee;
  font-size: 14px;
}

.admin-help summary {
  font-weight: 800;
  cursor: pointer;
}

.admin-help p {
  color: var(--muted);
}

/* ---------- Admin: lista de remates ---------- */

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.admin-toolbar h2 {
  margin: 0;
  font:
    900 28px Outfit,
    sans-serif;
  letter-spacing: -0.03em;
}

.admin-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-list {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.admin-empty {
  padding: 30px;
  border: 2px dashed #e3c4c3;
  border-radius: 20px;
  text-align: center;
  color: var(--muted);
}

.admin-item {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border: 1px solid #eee;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px #0000000a;
}

.admin-item[data-status="hidden"] {
  background: #fafafa;
}

.admin-item[data-status="hidden"] .admin-item-thumb {
  opacity: 0.5;
}

.admin-item-thumb {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  overflow: hidden;
  border-radius: 14px;
  background: #f4f4f4;
  font-size: 26px;
}

.admin-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-item-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-item-info strong {
  overflow: hidden;
  font:
    900 20px Outfit,
    sans-serif;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.admin-item-info > span:last-child {
  font-size: 14px;
  color: var(--muted);
}

.admin-chip {
  justify-self: start;
  padding: 3px 9px;
  border-radius: 999px;
  background: #ececec;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-chip[data-status="active"] {
  background: #e3f6ea;
  color: #1d7a3e;
}

.admin-chip[data-status="closed"] {
  background: #fff1cc;
  color: #7a5b00;
}

.admin-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-mini {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.admin-mini:hover {
  border-color: var(--ink);
}

.admin-mini.danger {
  border-color: #f2c2c2;
  color: #a32626;
}

.admin-mini.danger:hover {
  background: #fdeaea;
  border-color: #a32626;
}

body.is-busy .admin-mini,
body.is-busy #new-item {
  pointer-events: none;
  opacity: 0.5;
}

.admin-editor {
  scroll-margin-top: 100px;
}

.admin-photo-cover {
  position: absolute;
  top: -8px;
  left: -8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #c79a00;
  font-size: 15px;
  box-shadow: 0 3px 10px #0000002a;
  cursor: pointer;
}

@media (max-width: 760px) {
  .rem-photo img {
    height: 320px;
  }

  .admin-item {
    grid-template-columns: 64px 1fr;
  }

  .admin-item-thumb {
    width: 64px;
    height: 64px;
  }

  .admin-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Sin flechitas en los campos de importe */
.rem-input input,
#admin-base {
  -moz-appearance: textfield;
  appearance: textfield;
}

.rem-input input::-webkit-inner-spin-button,
.rem-input input::-webkit-outer-spin-button,
#admin-base::-webkit-inner-spin-button,
#admin-base::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
