/* iabunicii.ro — lumea vizuală „Firul Roșu”
   In ivoriu, roșu de ie, indigo, fir auriu. Tricolorul e țesut, nu fluturat. */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,400..900,0..100&family=Work+Sans:wght@400;500;600&display=swap');

:root {
  --in-ivoriu: #f6f0e4;
  --in-cald: #efe6d3;
  --rosu-ie: #b3202c;
  --rosu-adanc: #7e1622;
  --indigo: #2c4079;
  --fir-auriu: #c69a43;
  --cerneala: #2b211c;
  --lemn: #6e4b31;
  --display: 'Fraunces', 'Georgia', serif;
  --body: 'Work Sans', 'Helvetica Neue', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  color: var(--cerneala);
  background-color: var(--in-ivoriu);
  /* textură de pânză: hașuri fine în două direcții, abia ghicite */
  background-image:
    repeating-linear-gradient(0deg, rgba(110, 75, 49, 0.035) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(110, 75, 49, 0.03) 0 1px, transparent 1px 5px);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .titlu {
  font-family: var(--display);
  font-weight: 640;
  font-variation-settings: 'SOFT' 60, 'opsz' 90;
  line-height: 1.12;
  text-wrap: balance;
  color: var(--cerneala);
}

a { color: var(--indigo); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--rosu-ie); }

img { max-width: 100%; display: block; }

/* ------- antet ------- */

.antet {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.6rem);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.antet.plin {
  background: rgba(246, 240, 228, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(110, 75, 49, 0.18);
}

.antet .sigla { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.antet .sigla svg { display: block; height: 34px; width: auto; }

.antet nav { display: flex; align-items: center; gap: clamp(0.9rem, 2.5vw, 1.8rem); }
.antet nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--cerneala);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.antet nav a:hover { color: var(--rosu-ie); }
.antet nav a.activ { color: var(--rosu-ie); }

/* peste film: totul devine ivoriu; .on-light îl întoarce la cerneală */
.antet.pe-film:not(.plin) .sigla svg .fir { stroke: var(--in-ivoriu); }
.antet.pe-film:not(.plin) .sigla svg .litere { fill: var(--in-ivoriu); }
.antet.pe-film:not(.plin) nav a,
.antet.pe-film:not(.plin) nav .buton-cos { color: var(--in-ivoriu); }
.antet.pe-film:not(.plin).on-light .sigla svg .litere { fill: var(--cerneala); }
.antet.pe-film:not(.plin).on-light .sigla svg .fir { stroke: var(--rosu-ie); }
.antet.pe-film:not(.plin).on-light nav a,
.antet.pe-film:not(.plin).on-light nav .buton-cos { color: var(--cerneala); }

.buton-cos {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  font-weight: 500;
  color: inherit;
}
.buton-cos .numar {
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--rosu-ie);
  color: var(--in-ivoriu);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.buton-cos .numar:empty { display: none; }

/* ------- butoane cusute ------- */

.buton {
  position: relative;
  display: inline-block;
  padding: 0.85rem 1.9rem;
  background: var(--rosu-ie);
  color: var(--in-ivoriu);
  font-family: var(--body);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.2s ease;
}
.buton::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1.5px dashed rgba(246, 240, 228, 0.65);
  border-radius: 5px;
  pointer-events: none;
}
.buton:hover { background: var(--rosu-adanc); transform: translateY(-1px); }
.buton:active { transform: translateY(0); }
.buton[disabled] { opacity: 0.55; cursor: wait; }

.buton.secundar {
  background: transparent;
  color: var(--cerneala);
  border: 1.5px solid var(--lemn);
}
.buton.secundar::after { border-color: rgba(110, 75, 49, 0.35); }
.buton.secundar:hover { background: var(--in-cald); }

/* ------- secțiuni + separatoare ------- */

.sectiune { padding: clamp(3.5rem, 9vw, 7rem) clamp(1.2rem, 5vw, 3rem); }
.ingust { max-width: 720px; margin-inline: auto; }
.lat { max-width: 1180px; margin-inline: auto; }

.eticheta {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rosu-ie);
  margin-bottom: 0.9rem;
}

.separator-cusut { display: block; width: min(340px, 70%); margin: 0 auto; overflow: visible; }
.separator-cusut path,
.separator-cusut rect {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.4s ease 0.15s;
}
.separator-cusut.vazut path,
.separator-cusut.vazut rect { stroke-dashoffset: 0; }

/* brâul de romburi (bandă de motive, repetată) */
.banda-motiv {
  height: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='26' viewBox='0 0 52 26'%3E%3Cpath d='M13 3 23 13 13 23 3 13Z' fill='none' stroke='%23b3202c' stroke-width='2'/%3E%3Cpath d='M13 8 18 13 13 18 8 13Z' fill='%23c69a43'/%3E%3Cpath d='M39 3 49 13 39 23 29 13Z' fill='none' stroke='%232c4079' stroke-width='2'/%3E%3Crect x='36' y='10' width='6' height='6' transform='rotate(45 39 13)' fill='%23b3202c'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: center;
}

/* ------- carduri produs ------- */

.grila-produse {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: clamp(1.2rem, 3vw, 2rem);
}

.card-produs {
  background: var(--in-cald);
  border: 1px solid rgba(110, 75, 49, 0.25);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-produs:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px -18px rgba(43, 33, 28, 0.45);
}
.card-produs .poza {
  aspect-ratio: 4 / 5;
  background: var(--in-ivoriu);
  display: block;
  position: relative;
  overflow: hidden;
}
.card-produs .poza img { width: 100%; height: 100%; object-fit: cover; }
.card-produs .corp { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.card-produs h3 { font-size: 1.28rem; }
.card-produs h3 a { color: inherit; text-decoration: none; }
.card-produs h3 a:hover { color: var(--rosu-ie); }
.card-produs .pret {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--rosu-ie);
}
.card-produs .actiuni { margin-top: auto; padding-top: 0.7rem; display: flex; gap: 0.6rem; align-items: center; }
.card-produs .actiuni .buton { padding: 0.6rem 1.1rem; font-size: 0.92rem; }

/* poza lipsă: motiv țesut pe in */
.img-lipsa {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cpath d='M32 12 52 32 32 52 12 32Z' fill='none' stroke='%23b3202c' stroke-width='2.5' opacity='0.5'/%3E%3Cpath d='M32 22 42 32 32 42 22 32Z' fill='none' stroke='%232c4079' stroke-width='2' opacity='0.5'/%3E%3Crect x='29' y='29' width='6' height='6' transform='rotate(45 32 32)' fill='%23c69a43' opacity='0.7'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 64px 64px;
  background-position: center;
}

/* ------- sertar coș ------- */

.voal-cos {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(43, 33, 28, 0.45);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.voal-cos.deschis { opacity: 1; pointer-events: auto; }

.sertar-cos {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(420px, 92vw);
  background: var(--in-ivoriu);
  border-left: 1px solid rgba(110, 75, 49, 0.3);
  box-shadow: -18px 0 40px -20px rgba(43, 33, 28, 0.5);
  transform: translateX(105%);
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex; flex-direction: column;
}
.sertar-cos.deschis { transform: translateX(0); }
.sertar-cos header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px dashed rgba(110, 75, 49, 0.4);
}
.sertar-cos header h2 { font-size: 1.5rem; }
.sertar-cos .inchide {
  border: none; background: none; cursor: pointer;
  font-size: 1.6rem; line-height: 1; color: var(--lemn);
}
.sertar-cos .lista { flex: 1; overflow-y: auto; padding: 1rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; }
.rand-cos { display: grid; grid-template-columns: 64px 1fr auto; gap: 0.9rem; align-items: center; }
.rand-cos .poza { width: 64px; height: 80px; border-radius: 6px; overflow: hidden; background: var(--in-cald); }
.rand-cos .poza img { width: 100%; height: 100%; object-fit: cover; }
.rand-cos .nume { font-weight: 600; font-size: 0.98rem; }
.rand-cos .cantitate { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.25rem; }
.rand-cos .cantitate button {
  width: 1.6rem; height: 1.6rem; border-radius: 5px;
  border: 1px solid rgba(110, 75, 49, 0.4);
  background: none; cursor: pointer; font-size: 1rem; color: var(--cerneala);
}
.rand-cos .scoate { border: none; background: none; color: var(--lemn); cursor: pointer; font-size: 0.82rem; text-decoration: underline; }
.sertar-cos footer { padding: 1.2rem 1.4rem 1.5rem; border-top: 1px dashed rgba(110, 75, 49, 0.4); }
.sertar-cos .total { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 1rem; }
.sertar-cos .total .suma { font-family: var(--display); font-size: 1.3rem; color: var(--rosu-ie); }
.sertar-cos .buton { width: 100%; text-align: center; }
.sertar-cos .gol { text-align: center; color: var(--lemn); padding: 3rem 1rem; }
.sertar-cos .eroare { color: var(--rosu-adanc); font-size: 0.9rem; margin-top: 0.7rem; text-align: center; }

/* ------- formulare (admin) ------- */

.camp { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1.1rem; }
.camp label { font-weight: 600; font-size: 0.92rem; }
.camp input, .camp textarea, .camp select {
  font: inherit;
  padding: 0.65rem 0.85rem;
  border: 1px solid rgba(110, 75, 49, 0.45);
  border-radius: 7px;
  background: #fffdf7;
  color: var(--cerneala);
}
.camp input:focus, .camp textarea:focus, .camp select:focus {
  outline: 2px solid var(--indigo);
  outline-offset: 1px;
}

.tabel { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tabel th, .tabel td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid rgba(110, 75, 49, 0.22); }
.tabel th { font-weight: 600; font-size: 0.85rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--lemn); }

.insigna {
  display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600;
}
.insigna.platita { background: rgba(198, 154, 67, 0.22); color: #7a5a1a; }
.insigna.expediata { background: rgba(44, 64, 121, 0.15); color: var(--indigo); }
.insigna.anulata { background: rgba(179, 32, 44, 0.14); color: var(--rosu-adanc); }

/* ------- subsol ------- */

.subsol { background: var(--cerneala); color: var(--in-ivoriu); margin-top: clamp(3rem, 8vw, 6rem); }
.subsol .banda-motiv { filter: brightness(1.15); }
.subsol .continut {
  max-width: 1180px; margin-inline: auto;
  padding: 3rem clamp(1.2rem, 5vw, 3rem) 2.2rem;
  display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; align-items: flex-start;
}
.subsol a { color: var(--in-ivoriu); opacity: 0.85; }
.subsol a:hover { color: var(--fir-auriu); opacity: 1; }
.subsol .semnatura { font-family: var(--display); font-size: 1.3rem; }
.subsol .marunt { font-size: 0.85rem; opacity: 0.6; margin-top: 0.6rem; }
.subsol .social { display: flex; gap: 0.9rem; }
.subsol .social svg { width: 22px; height: 22px; fill: currentColor; }

/* ------- utilitare de apariție ------- */

.apare { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.apare.vazut { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .apare { opacity: 1; transform: none; transition: none; }
  .separator-cusut path, .separator-cusut rect { stroke-dashoffset: 0; transition: none; }
  .card-produs, .buton { transition: none; }
}
