/* ============================================================
   Atelier Scoubidou — style
   Palette : crème chaleureux + accents multicolores façon fils
   ============================================================ */

:root {
  --creme:    #FBF6EE;
  --creme2:   #FFFFFF;
  --encre:    #33302B;
  --sourdine: #8A8579;
  --trait:    #EAE1D2;
  --accent:   #FF7EB6;   /* rose fil */
  --accent2:  #20C4C4;   /* turquoise fil */
  --soleil:   #FFD23F;
  --ok:       #2FBF71;
  --danger:   #E63946;
  --rayon: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1000px 500px at 90% -5%, rgba(255,126,182,.10), transparent 60%),
    radial-gradient(800px 460px at 0% 105%, rgba(32,196,196,.10), transparent 60%),
    var(--creme);
  color: var(--encre);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 16px; line-height: 1.55; min-height: 100vh;
}
a { color: #d65a93; }

/* ---------------------------------------------- barre du haut */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  max-width: 1140px; margin: 0 auto; padding: 16px 20px;
}
.brand {
  font-family: 'Baloo 2', 'Nunito', sans-serif; font-weight: 800;
  font-size: 1.7rem; text-decoration: none; color: var(--encre);
  display: inline-flex; align-items: center; gap: 10px;
}
.brand .dot { width: 16px; height: 16px; border-radius: 50%;
  background: conic-gradient(var(--accent), var(--soleil), var(--accent2), var(--accent)); }
.navlinks { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer; text-decoration: none; font: inherit; font-weight: 800;
  color: #fff; background: linear-gradient(100deg, var(--accent), #ff5aa4);
  padding: 11px 20px; border-radius: 999px; transition: transform .12s, filter .12s, box-shadow .12s;
  box-shadow: 0 6px 18px rgba(255,90,164,.28);
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn.alt { background: linear-gradient(100deg, var(--accent2), #17a8a8); box-shadow: 0 6px 18px rgba(32,196,196,.28); }
.btn.ghost { background: transparent; color: var(--encre); border: 2px solid var(--trait); box-shadow: none; }
.btn.small { padding: 7px 14px; font-size: .84rem; }
.btn.danger { background: transparent; color: var(--danger); border: 2px solid var(--danger); box-shadow: none; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

.cart-link {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; color: var(--encre); font-weight: 800;
  border: 2px solid var(--trait); border-radius: 999px; padding: 8px 15px; background: var(--creme2);
}
.cart-badge {
  background: var(--accent); color: #fff; font-size: .72rem; font-weight: 900;
  border-radius: 999px; padding: 1px 7px; min-width: 20px; text-align: center;
}

/* ---------------------------------------------- hero */
.hero { max-width: 1140px; margin: 6px auto 0; padding: 26px 20px 8px; text-align: center; }
.hero h1 {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; margin: 0;
  font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--soleil) 50%, var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--sourdine); font-size: 1.1rem; max-width: 600px; margin: 12px auto 0; font-weight: 600; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 22px 0 6px; }

/* ---------------------------------------------- sections */
.section { max-width: 1140px; margin: 30px auto; padding: 0 20px; }
.section h2 { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.9rem; margin: 0 0 4px; }
.section .sub { color: var(--sourdine); margin: 0 0 20px; font-weight: 600; }

/* ---------------------------------------------- grille produits */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.prod {
  background: var(--creme2); border: 1px solid var(--trait); border-radius: var(--rayon);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .16s, box-shadow .16s;
}
.prod:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(120,90,60,.14); }
.prod .pic {
  aspect-ratio: 1/1; background: #f4ede1 center/cover no-repeat;
  display: grid; place-items: center; position: relative;
}
.prod .pic img { width: 100%; height: 100%; object-fit: cover; }
.prod .body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.prod h3 { margin: 0; font-size: 1.08rem; font-weight: 800; }
.prod .swatches { display: flex; gap: 5px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.12); }
.prod .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.price { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 1.2rem; }
.pill-shape { font-size: .72rem; font-weight: 800; color: var(--sourdine);
  border: 1px solid var(--trait); border-radius: 999px; padding: 2px 9px; }
.sold-tag {
  position: absolute; top: 10px; left: 10px; background: var(--encre); color: #fff;
  font-size: .72rem; font-weight: 900; padding: 3px 10px; border-radius: 999px;
}
.scoub { display: block; }

.empty { grid-column: 1/-1; text-align: center; color: var(--sourdine);
  padding: 50px 20px; border: 2px dashed var(--trait); border-radius: var(--rayon); }
.empty .big { font-size: 2.6rem; }

/* ---------------------------------------------- atelier de création */
.studio { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
@media (max-width: 780px) { .studio { grid-template-columns: 1fr; } }
.studio-preview {
  background: var(--creme2); border: 1px solid var(--trait); border-radius: 22px;
  padding: 24px; text-align: center; position: sticky; top: 16px;
}
.studio-preview .stage {
  background: radial-gradient(circle at 50% 40%, #fff, #f4ede1);
  border-radius: 18px; padding: 20px; display: grid; place-items: center; min-height: 260px;
}
.studio-preview .price-live { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 2rem; margin-top: 14px; }
.studio-panel { background: var(--creme2); border: 1px solid var(--trait); border-radius: 22px; padding: 22px; }
.field { margin-bottom: 22px; }
.field > label.h { display: block; font-weight: 800; margin-bottom: 4px; font-size: 1.05rem; }
.field .hint { color: var(--sourdine); font-size: .85rem; margin-bottom: 12px; }

.shape-opts { display: flex; gap: 12px; }
.shape-opt {
  flex: 1; cursor: pointer; border: 2px solid var(--trait); border-radius: 14px;
  padding: 14px; text-align: center; font-weight: 800; transition: all .14s; background: var(--creme);
}
.shape-opt:hover { border-color: var(--accent2); }
.shape-opt input { position: absolute; opacity: 0; }
.shape-opt .demo { width: 46px; height: 46px; margin: 0 auto 8px; border: 4px solid var(--accent2); }
.shape-opt .demo.carre { border-radius: 6px; }
.shape-opt .demo.rond { border-radius: 50%; }
.shape-opt .demo-svg { display: block; margin: 0 auto 6px; }
.shape-opt:has(input:checked) { border-color: var(--accent2); background: color-mix(in srgb, var(--accent2) 12%, transparent); }
.shape-opt .extra { color: var(--sourdine); font-size: .78rem; font-weight: 700; }

/* Choix du style de tressage (admin) */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.price-cell {
  display: flex; flex-direction: column; gap: 6px;
  border: 1.5px solid var(--trait); border-radius: 12px; padding: 10px 12px; background: var(--creme);
  font-weight: 700; font-size: .84rem;
}
.price-cell .euro-input { display: flex; align-items: center; gap: 6px; font-weight: 800; }
.price-cell .euro-input input[type=text] { width: 100%; flex: 1 1 auto; min-width: 0; text-align: right; }
.price-cell .euro-input .eur { flex: none; }
.style-opt {
  cursor: pointer; border: 2px solid var(--trait); border-radius: 14px; padding: 10px 6px;
  text-align: center; font-weight: 800; font-size: .78rem; transition: all .14s; background: var(--creme);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.style-opt input { position: absolute; opacity: 0; }
.style-opt .style-demo { display: block; }
.style-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.color-opt {
  cursor: pointer; border: 2px solid var(--trait); border-radius: 14px; padding: 10px 6px;
  text-align: center; font-weight: 800; font-size: .8rem; transition: all .14s; background: var(--creme);
  position: relative;
}
.color-opt input { position: absolute; opacity: 0; }
.color-opt .chip { width: 34px; height: 34px; border-radius: 50%; margin: 0 auto 6px;
  border: 2px solid rgba(0,0,0,.12); box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.color-opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.color-opt:has(input:checked)::after {
  content: "✓"; position: absolute; top: 5px; right: 8px; color: var(--accent); font-weight: 900;
}
.color-opt.disabled { opacity: .4; cursor: not-allowed; }
.count-note { margin-top: 10px; font-weight: 700; color: var(--sourdine); font-size: .88rem; }
.count-note.warn { color: var(--danger); }

/* ---------------------------------------------- panier & formulaires */
.panel { max-width: 820px; margin: 24px auto; background: var(--creme2);
  border: 1px solid var(--trait); border-radius: 22px; padding: 26px; }
.panel h2 { font-family: 'Baloo 2', sans-serif; font-weight: 800; margin-top: 0; }
.cart-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--trait); }
.cart-item .thumb { width: 66px; height: 66px; flex: none; background: #f4ede1; border-radius: 12px; display: grid; place-items: center; overflow: hidden; }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .info { flex: 1; }
.cart-item .info h4 { margin: 0 0 3px; }
.cart-item .info .meta { color: var(--sourdine); font-size: .85rem; }
.cart-item .price { font-size: 1.05rem; }
.cart-total { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; font-size: 1.15rem; font-weight: 800; }
.cart-total .big { font-family: 'Baloo 2', sans-serif; font-size: 1.7rem; }

label.f { display: block; margin-bottom: 15px; font-weight: 700; font-size: .9rem; }
label.f span { display: block; margin-bottom: 5px; color: var(--sourdine); }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], select, textarea, input[type=file] {
  width: 100%; padding: 11px 14px; font: inherit; border-radius: 12px;
  border: 1px solid var(--trait); background: var(--creme); color: var(--encre);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .frow { grid-template-columns: 1fr; } }

.flash { max-width: 820px; margin: 18px auto 0; padding: 13px 18px; border-radius: 14px; font-weight: 700; }
.flash.ok  { background: color-mix(in srgb, var(--ok) 16%, transparent); border: 1px solid var(--ok); }
.flash.err { background: color-mix(in srgb, var(--danger) 16%, transparent); border: 1px solid var(--danger); }
.flash.info{ background: color-mix(in srgb, var(--accent2) 14%, transparent); border: 1px solid var(--accent2); }

.notice { background: color-mix(in srgb, var(--soleil) 22%, transparent); border: 1px solid var(--soleil);
  border-radius: 14px; padding: 14px 18px; font-weight: 600; margin: 16px 0; }

/* ---------------------------------------------- admin */
.admin-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  border-bottom: 2px solid var(--trait); padding-bottom: 0; margin-bottom: 4px;
}
.admin-tab {
  text-decoration: none; color: var(--sourdine); font-weight: 800;
  padding: 11px 18px; border-radius: 12px 12px 0 0;
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid transparent; border-bottom: none;
  position: relative; top: 2px; transition: all .14s;
}
.admin-tab:hover { color: var(--encre); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.admin-tab.active {
  color: var(--encre); background: var(--creme2);
  border-color: var(--trait); border-bottom: 2px solid var(--creme2);
}
.tab-count {
  font-size: .72rem; font-weight: 900; background: var(--trait); color: var(--encre);
  border-radius: 999px; padding: 1px 8px; min-width: 20px; text-align: center;
}
.tab-count.hot { background: var(--accent); color: #fff; }
.admin-list { max-width: 1140px; margin: 10px auto 50px; padding: 0 20px; }
table.admin { width: 100%; border-collapse: collapse; background: var(--creme2); border-radius: 16px; overflow: hidden; }
table.admin th, table.admin td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--trait); vertical-align: middle; }
table.admin th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sourdine); }
table.admin img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; }
table.admin td.actions { text-align: right; white-space: nowrap; }
.tag { font-size: .72rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.tag.new { background: color-mix(in srgb, var(--accent) 20%, transparent); color: #c23b78; }
.tag.done { background: color-mix(in srgb, var(--ok) 20%, transparent); color: #1c8b50; }

footer.site { text-align: center; color: var(--sourdine); font-size: .84rem; padding: 30px 20px 44px; }
footer.site a { color: var(--sourdine); }
