/* =============================================================================
   COMPONENTE — butoane, calendar, formular, lupă, butoane plutitoare.
   ============================================================================= */

@layer componente;

@layer componente {

/* ───────────────────────────────────────────────────────── BUTOANE ───── */
.buton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 30px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  transition: transform 0.3s var(--elan), background 0.3s, border-color 0.3s, box-shadow 0.3s;
  white-space: nowrap;
}
.buton:hover { transform: translateY(-2px); }
.buton:active { transform: translateY(0); }

.buton-plin { background: var(--sezon-plin); color: var(--pe-sezon); box-shadow: var(--umbra-1); }
.buton-plin:hover { box-shadow: var(--umbra-2); }

.buton-lemn { background: var(--lemn-ars); color: var(--pergament); box-shadow: var(--umbra-1); }
:root[data-lumina="noapte"] .buton-lemn { background: var(--pergament); color: var(--lemn-ars); }

.buton-gol { border-color: var(--linie-tare); color: inherit; }
.buton-gol:hover { border-color: currentColor; background: color-mix(in oklab, currentColor 8%, transparent); }

.buton-mic {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--linie-tare);
  font-size: 0.84rem;
  transition: background 0.25s, border-color 0.25s, transform 0.25s var(--elan);
}
.buton-mic:hover { transform: translateY(-1px); border-color: var(--sezon); }
.buton-mic.plin { background: var(--sezon-plin); border-color: var(--sezon-plin); color: var(--pe-sezon); }

/* Pe benzile întunecate (rezervare, subsol) un buton închis nu se vede.
   Acolo folosim varianta deschisă a anotimpului, cu text închis peste. */
.rezervare .buton-plin, .subsol .buton-plin,
.rezervare .buton-mic.plin, .subsol .buton-mic.plin {
  background: var(--sezon-clar);
  border-color: var(--sezon-clar);
  color: var(--lemn-adanc);
}
.rezervare .buton-gol, .subsol .buton-gol { border-color: oklch(97% 0.011 88 / 0.34); }
/* inelul de focalizare trebuie deschis și el, pe fundal închis */
.rezervare :focus-visible, .subsol :focus-visible, .zi :focus-visible { outline-color: var(--sezon-clar); }

/* comutatorul zi/noapte */
.comutator-lumina {
  inline-size: 38px; block-size: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--linie-tare);
  transition: background 0.25s, border-color 0.25s, rotate 0.5s var(--elan);
  flex: none;
}
.comutator-lumina:hover { rotate: 22deg; border-color: var(--sezon); }
.comutator-lumina svg { inline-size: 17px; block-size: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.comutator-lumina .luna { display: none; }
:root[data-lumina="noapte"] .comutator-lumina .soare { display: none; }
:root[data-lumina="noapte"] .comutator-lumina .luna { display: block; }
.bara[data-lipita="nu"] .comutator-lumina { border-color: rgb(255 255 255 / 0.4); }


/* ─────────────────────────────────────────────────────── CALENDAR ───── */
.calendar {
  background: color-mix(in oklab, var(--pergament) 8%, transparent);
  border: 1px solid oklch(97% 0.011 88 / 0.16);
  border-radius: var(--raza);
  padding: clamp(18px, 2.4vw, 26px);
}
.cal-cap { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 18px; }
.cal-luna {
  font-family: var(--afis);
  font-variation-settings: "SOFT" 24, "opsz" 40;
  font-size: 1.24rem;
  text-transform: capitalize;
}
.cal-sageata {
  inline-size: 34px; block-size: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid oklch(97% 0.011 88 / 0.24);
  font-size: 1rem;
  transition: background 0.25s, border-color 0.25s;
}
.cal-sageata:hover:not(:disabled) { background: oklch(97% 0.011 88 / 0.12); }
.cal-sageata:disabled { opacity: 0.28; cursor: not-allowed; }

.cal-grila { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-zi-nume {
  text-align: center;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: oklch(97% 0.011 88 / 0.5);
  padding-block-end: 8px;
}
.cal-zi {
  aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 9px;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  color: var(--pergament);
  position: relative;
  transition: background 0.2s, color 0.2s;
}
.cal-zi.gol { visibility: hidden; }
.cal-zi:disabled { color: oklch(97% 0.011 88 / 0.22); cursor: not-allowed; }
.cal-zi.ocupat {
  color: oklch(97% 0.011 88 / 0.3);
  cursor: not-allowed;
  background: repeating-linear-gradient(135deg,
    oklch(97% 0.011 88 / 0.07) 0 3px, transparent 3px 6px);
}
.cal-zi.libera:hover { background: oklch(97% 0.011 88 / 0.16); }
.cal-zi.aleasa { background: var(--sezon-clar); color: var(--lemn-adanc); font-weight: 600; }
.cal-zi.intre { background: color-mix(in oklab, var(--sezon-clar) 26%, transparent); border-radius: 0; }
.cal-zi.azi::after {
  content: ""; position: absolute; inset-block-end: 5px;
  inline-size: 4px; block-size: 4px; border-radius: 50%;
  background: currentColor;
}
.cal-legenda {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-block-start: 16px; padding-block-start: 14px;
  border-block-start: 1px solid oklch(97% 0.011 88 / 0.14);
  font-size: 0.78rem; color: oklch(97% 0.011 88 / 0.6);
}
.cal-legenda span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legenda i { inline-size: 11px; block-size: 11px; border-radius: 3px; flex: none; }
.cal-legenda .i-libera { background: oklch(97% 0.011 88 / 0.16); }
.cal-legenda .i-ocupat { background: repeating-linear-gradient(135deg, oklch(97% 0.011 88 / 0.28) 0 3px, transparent 3px 6px); }
.cal-legenda .i-aleasa { background: var(--sezon-clar); }
.cal-nota { margin-block-start: 12px; font-size: 0.8rem; color: oklch(97% 0.011 88 / 0.55); }
.cal-nota.avertisment { color: var(--miere); }


/* ──────────────────────────────────────────────────────── FORMULAR ──── */
.formular { display: grid; gap: 16px; }
.camp { display: grid; gap: 7px; }
.camp label { font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--miere); }
.camp input, .camp select, .camp textarea {
  padding: 13px 16px;
  border-radius: var(--raza-mica);
  border: 1px solid oklch(97% 0.011 88 / 0.2);
  background: color-mix(in oklab, var(--pergament) 7%, transparent);
  color: var(--pergament);
  font-size: 0.96rem;
  transition: border-color 0.25s, background 0.25s;
  field-sizing: content;
}
.camp textarea { min-block-size: 4lh; max-block-size: 10lh; resize: vertical; }
.camp input:focus, .camp select:focus, .camp textarea:focus {
  border-color: var(--sezon-clar);
  background: color-mix(in oklab, var(--pergament) 11%, transparent);
  outline: none;
}
.camp input::placeholder, .camp textarea::placeholder { color: oklch(97% 0.011 88 / 0.36); }
.camp select option { background: var(--lemn-ars); color: var(--pergament); }
.camp-pereche { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.camp-eroare { color: var(--miere); font-size: 0.8rem; }

.rez-sumar {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  padding: 15px 18px;
  border-radius: var(--raza-mica);
  background: color-mix(in oklab, var(--pergament) 7%, transparent);
  border: 1px dashed oklch(97% 0.011 88 / 0.24);
  font-size: 0.88rem;
}
.rez-sumar b { font-weight: 600; }
.rez-sumar .gol { color: oklch(97% 0.011 88 / 0.45); }

.rez-alternative {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-block-start: 6px;
  padding-block-start: 18px;
  border-block-start: 1px solid oklch(97% 0.011 88 / 0.14);
}
.rez-marunt { font-size: 0.8rem; color: oklch(97% 0.011 88 / 0.55); margin-block-start: 4px; }


/* ────────────────────────────────────────────────────────── LUPA ────── */
.lupa {
  border: 0;
  padding: 0;
  inline-size: 100vw;
  max-inline-size: 100vw;
  block-size: 100vh;
  max-block-size: 100vh;
  background: transparent;
  overflow: hidden;
}
.lupa::backdrop { background: oklch(11% 0.012 55 / 0.94); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lupa-corp { block-size: 100%; display: grid; place-items: center; padding: clamp(16px, 4vw, 48px); }
.lupa img { max-inline-size: min(94vw, 1500px); max-block-size: 84vh; border-radius: var(--raza-mica); box-shadow: var(--umbra-3); object-fit: contain; }
.lupa-legenda {
  margin-block-start: 16px; text-align: center;
  color: oklch(97% 0.011 88 / 0.72); font-size: 0.86rem;
  max-inline-size: 60ch;
}
.lupa-inchide, .lupa-sageata {
  position: fixed;
  inline-size: 46px; block-size: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgb(255 255 255 / 0.10);
  border: 1px solid rgb(255 255 255 / 0.2);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 1.3rem;
  transition: background 0.25s, transform 0.25s var(--elan);
}
.lupa-inchide:hover, .lupa-sageata:hover { background: rgb(255 255 255 / 0.22); transform: scale(1.08); }
.lupa-inchide { inset-block-start: 22px; inset-inline-end: 22px; }
.lupa-sageata.stanga { inset-block-start: 50%; inset-inline-start: 18px; translate: 0 -50%; }
.lupa-sageata.dreapta { inset-block-start: 50%; inset-inline-end: 18px; translate: 0 -50%; }
@media (width < 640px) {
  .lupa-sageata.stanga { inset-block-start: auto; inset-block-end: 22px; inset-inline-start: calc(50% - 58px); translate: 0; }
  .lupa-sageata.dreapta { inset-block-start: auto; inset-block-end: 22px; inset-inline-end: calc(50% - 58px); translate: 0; }
}

/* poze pe care se poate apăsa */
.mareste { cursor: zoom-in; }


/* ────────────────────────────────────────────── BUTOANE PLUTITOARE ──── */
.plutitor {
  position: fixed;
  inset-block-end: 22px;
  inset-inline-end: 22px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}
.wa {
  inline-size: 56px; block-size: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #25d366;
  box-shadow: 0 12px 32px -10px oklch(20% 0.02 60 / 0.6);
  transition: transform 0.28s var(--elan);
  position: relative;
}
.wa:hover { transform: scale(1.08); }
.wa svg { inline-size: 29px; block-size: 29px; fill: #fff; }
.wa .balon {
  position: absolute;
  inset-inline-end: calc(100% + 12px);
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--lemn-ars);
  color: var(--pergament);
  font-size: 0.82rem;
  white-space: nowrap;
  box-shadow: var(--umbra-2);
  opacity: 0; transform: translateX(8px);
  transition: opacity 0.25s, transform 0.25s var(--elan);
  pointer-events: none;
}
.wa:hover .balon, .wa:focus-visible .balon { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .wa::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    box-shadow: 0 0 0 0 rgb(37 211 102 / 0.55);
    animation: unda 2.6s ease-out infinite;
  }
}
@keyframes unda { 0% { box-shadow: 0 0 0 0 rgb(37 211 102 / 0.5); } 70% { box-shadow: 0 0 0 20px rgb(37 211 102 / 0); } 100% { box-shadow: 0 0 0 0 rgb(37 211 102 / 0); } }

.sus {
  inline-size: 42px; block-size: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--fundal) 88%, transparent);
  border: 1px solid var(--linie-tare);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--text);
  box-shadow: var(--umbra-1);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.28s var(--elan);
}
.sus.vizibil { opacity: 1; visibility: visible; }
.sus:hover { transform: translateY(-3px); }
@media (width < 600px) { .plutitor { inset-block-end: 16px; inset-inline-end: 16px; } .wa { inline-size: 52px; block-size: 52px; } .wa .balon { display: none; } }


/* ────────────────────────────────── TRANZIȚIA DE SCHIMBARE A ANOTIMPULUI */
@media (prefers-reduced-motion: no-preference) {
  ::view-transition-old(root) { animation: iese 0.32s var(--lin) both; }
  ::view-transition-new(root) { animation: intra 0.42s var(--lin) both; }
}
@keyframes iese { to { opacity: 0; } }
@keyframes intra { from { opacity: 0; } }


/* ────────────────────────────────────────────────── STARE DE ÎNCĂRCARE ─ */
.fara-js { padding: 14px 18px; border-radius: var(--raza-mica); background: var(--sezon-spalat); border: 1px solid var(--linie); font-size: 0.9rem; }

}
