/* Identidad según el manual de marca de Villa Italia: ver docs/MARCA.md. */
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/noto-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/noto-sans-600.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/noto-sans-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  /* Colores de marca */
  --dorado: #e2ad64;       /* principal, Pantone 7509C */
  --dorado-hover: #d4a259;
  --dorado-suave: #f7e6cd;
  --vino: #770803;         /* complementario, máx. 5 % */
  --cafe: #2b2320;
  --crema: #f6ebdd;
  /* Roles */
  --background: var(--crema);
  --surface: #fffdf9;
  --text: var(--cafe);
  --muted: #6b5a4c;
  --border: #9c8466;
  --border-suave: #e6d6bf;
  --error: var(--vino);
  --focus: var(--vino);
  --radius: 12px;
  --sombra: 0 1px 2px rgb(43 35 32 / 0.06), 0 12px 32px -12px rgb(43 35 32 / 0.22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--text);
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Cabecera: café con el pattern de la marca y logo dorado */
.marca {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 16px 88px;
  background:
    linear-gradient(180deg, rgb(43 35 32 / 0.82), rgb(43 35 32 / 0.94)),
    url("/pattern.jpg") center / 420px repeat;
  background-color: var(--cafe);
  border-bottom: 3px solid var(--dorado);
  text-align: center;
}
.marca img { display: block; width: 220px; height: auto; }
.marca h1 {
  margin: 0;
  color: var(--crema);
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

main { max-width: 560px; margin: -56px auto 48px; padding: 0 16px; }
form, #panel {
  padding: 28px 24px;
  border: 1px solid var(--border-suave);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--sombra);
}
fieldset { min-width: 0; padding: 0; margin: 0 0 24px; border: 0; }
legend, label { font-weight: 600; }
legend { padding: 0; margin-bottom: 10px; }

/* Selector de sede */
.segments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.segments label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-size: 15px;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.segments label:hover { border-color: var(--cafe); }
.segments label:has(:checked) {
  background: var(--dorado-suave);
  border: 2px solid var(--cafe);
  padding: 7px 11px;
}
.segments input { accent-color: var(--cafe); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }

/* Campos */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; min-width: 0; }
.optional { color: var(--muted); font-size: 14px; font-weight: 400; }
input:not([type="radio"]), select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color 150ms ease;
}
input:not([type="radio"]):hover, select:hover { border-color: var(--cafe); }
input::placeholder { color: var(--muted); opacity: 1; }
input[readonly] {
  background: var(--crema);
  border-color: var(--border-suave);
  color: var(--muted);
  cursor: default;
}

/* Botones: dorado con texto café (7.6:1) */
button {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--dorado);
  border-radius: 10px;
  background: var(--dorado);
  color: var(--cafe);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
button:hover:not(:disabled) { background: var(--dorado-hover); border-color: var(--dorado-hover); }
button:disabled { cursor: default; opacity: 0.6; }
#calcular { width: 100%; height: 52px; font-size: 17px; letter-spacing: 0.01em; }
.secondary { background: var(--surface); border-color: var(--cafe); color: var(--cafe); }
.secondary:hover:not(:disabled) { background: var(--dorado-suave); border-color: var(--cafe); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.segments input:focus-visible { outline: none; }
.segments label:has(:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }

p { overflow-wrap: anywhere; }
.error { color: var(--error); font-weight: 600; }
#sedes-estado:empty, #copia-estado:empty { display: none; }

/* Resultado: filete vino como acento puntual */
#panel { margin-top: 20px; border-top: 4px solid var(--vino); }
h2 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
#detalle p { margin: 6px 0; }
#detalle .price {
  margin: 4px 0 18px;
  color: var(--cafe);
  font-size: clamp(2.4rem, 10vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
#detalle .breakdown { border-top: 1px solid var(--border-suave); padding-top: 16px; margin-top: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.actions button { flex: 1 1 160px; }
.notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--dorado);
  border-radius: 10px;
  background: var(--dorado-suave);
  font-weight: 600;
}
.stale #detalle, .stale #detalle .price { color: var(--muted); }
.stale #detalle .price { font-weight: 600; }

@media (min-width: 480px) { .location { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } }
@media (max-width: 360px) {
  form, #panel { padding: 20px 16px; }
  .segments { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
