﻿/* ============================================================
   Silueta · components.css
   Tarjetas, buscador, calendario, precios, estadísticas,
   ficha de prenda, hojas y formularios
   ============================================================ */

/* ---------- Cabeceras de vista ---------- */
.view{ animation:none; }
.h1{ font-size:26px; font-weight:600; letter-spacing:-.035em; line-height:1.15; }
.lede{ font-size:13.5px; color:var(--muted); margin-top:5px; font-weight:400; }
.section-head{ display:flex; align-items:baseline; justify-content:space-between; margin:24px 0 12px; }
.section-head h2{ font-size:16px; font-weight:600; letter-spacing:-.02em; }
.section-head button{ font-size:12.5px; color:var(--primary-2); font-weight:500; }
[data-theme="dark"] .section-head button{ color:var(--primary); }

/* ---------- Buscador ---------- */
.search{
  margin-top:18px; display:flex; align-items:center; gap:10px;
  background:var(--surface); border:1px solid var(--line);
  border-radius:18px; padding:0 14px; height:50px;
  box-shadow:var(--shadow-sm);
}
.search svg{ width:18px; height:18px; stroke:var(--muted); stroke-width:1.9; fill:none; stroke-linecap:round; }
.search input{ flex:1; border:0; background:none; outline:none; font-size:14.5px; }
.search input::placeholder{ color:var(--muted); }

/* ---------- Chips de categoría ---------- */
.chips-wrap{ position:relative; margin:0 -20px; }
.chips-wrap::after{
  content:""; position:absolute; top:0; bottom:2px; right:0; width:36px;
  background:linear-gradient(90deg, transparent, var(--bg));
  pointer-events:none;
}
.chips{ display:flex; gap:8px; overflow-x:auto; padding:14px 20px 2px; scrollbar-width:none; }
.chip{
  flex:0 0 auto; height:36px; padding:0 16px; border-radius:999px;
  background:var(--surface); border:1px solid var(--line);
  font-size:13px; font-weight:500; color:var(--ink-soft);
  box-shadow:var(--shadow-sm);
  transition:all .18s ease;
}
.chip.active{
  background:var(--ink); color:var(--bg); border-color:var(--ink);
  box-shadow:0 8px 20px rgba(33,28,43,.22);
}
[data-theme="dark"] .chip.active{
  background:var(--primary); color:#17131F; border-color:var(--primary);
  box-shadow:0 8px 20px rgba(180,155,255,.25);
}

/* ---------- Rejilla de outfits ---------- */
.grid{ display:grid; grid-template-columns:1fr 1fr; gap:13px; }
.card{
  background:var(--surface); border-radius:var(--r-md); cursor:pointer;
  padding:8px 8px 10px; border:1px solid var(--line);
  box-shadow:var(--shadow-sm);
  text-align:left; position:relative;
  transition:transform .18s ease;
}
.card:active{ transform:scale(.98); }

.photo{
  position:relative; aspect-ratio:1/1.18; border-radius:15px; overflow:hidden;
  display:grid; place-items:center;
  background:linear-gradient(155deg,#F8F5EF,#EDE7F8);
}
[data-theme="dark"] .photo{ background:linear-gradient(155deg,#242030,#2C2539); }
.photo svg{ width:82%; height:82%; position:relative; z-index:2; }
.photo img{ width:100%; height:100%; object-fit:cover; position:relative; z-index:2; }
.photo::after{
  content:""; position:absolute; bottom:8%; left:50%; transform:translateX(-50%);
  width:52%; height:9px; border-radius:50%; background:rgba(60,40,90,.07); filter:blur(3px);
}
.photo.hasimg::after{ display:none; }

.fav{
  position:absolute; z-index:4; top:6px; right:6px;
  width:29px; height:29px; border-radius:50%;
  display:grid; place-items:center;
  background:rgba(255,255,255,.82); backdrop-filter:blur(6px);
}
[data-theme="dark"] .fav{ background:rgba(30,26,39,.8); }
.fav svg{ width:15px; height:15px; fill:none; stroke:#7C5CD6; stroke-width:1.9; stroke-linejoin:round; }
.fav.on svg{ fill:#7C5CD6; }

.card h3{ font-size:13.5px; font-weight:600; letter-spacing:-.01em; margin:9px 0 0 2px; }
.card .cat{ font-size:11px; color:var(--muted); margin:1px 0 0 2px; }
.card .price{ font-size:13px; font-weight:600; margin:5px 0 0 2px; }

/* ---------- Calendario ---------- */
.calhead{ display:flex; align-items:center; justify-content:space-between; margin-top:18px; }
.calhead h2{ font-size:19px; font-weight:600; letter-spacing:-.03em; text-transform:capitalize; }
.calnav{ display:flex; gap:6px; }
.calnav .iconbtn{ width:34px; height:34px; border-radius:11px; }
.calnav svg{ width:16px; height:16px; }

.weekdays{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; margin:16px 0 8px; }
.weekdays span{ text-align:center; font-size:10.5px; font-weight:600; color:var(--muted); letter-spacing:.08em; }

.days{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; align-items:start; }
.day{
  position:relative; height:60px; border-radius:13px; min-width:0; width:100%;
  display:flex; flex-direction:column; align-items:center;
  padding-top:5px; gap:3px;
  font-size:11.5px; font-weight:500; color:var(--ink-soft);
  transition:background .16s ease;
}
.day:hover{ background:var(--surface); }
.day.out{ color:var(--muted); opacity:.42; }
.day.today{ background:var(--primary-soft); color:var(--primary-2); font-weight:600; }
[data-theme="dark"] .day.today{ color:var(--primary); }

.mini{
  width:26px; height:26px; border-radius:9px; overflow:hidden; display:block;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.35), 0 2px 6px rgba(60,40,90,.10);
}
.mini img{ width:100%; height:100%; object-fit:cover; display:block; }
.mini.empty{ background:transparent; box-shadow:none; }

.cal-summary{
  margin-top:22px; background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); padding:16px; display:grid;
  grid-template-columns:repeat(3,1fr); gap:10px; box-shadow:var(--shadow-sm);
}
.cal-summary div{ text-align:center; }
.cal-summary strong{ display:block; font-size:18px; font-weight:600; letter-spacing:-.02em; }
.cal-summary span{ font-size:10.5px; color:var(--muted); }
.hint{ font-size:11.5px; color:var(--muted); text-align:center; margin-top:14px; line-height:1.5; }

/* ---------- Precios ---------- */
.plist{ display:flex; flex-direction:column; gap:10px; margin-top:16px; }
.prow{
  display:flex; align-items:center; gap:16px; cursor:pointer;
  background:var(--surface); border:1px solid var(--line);
  border-radius:24px; padding:12px; box-shadow:var(--shadow-sm);
}
.pthumb{
  width:112px; height:112px; border-radius:20px; flex:0 0 auto;
  display:grid; place-items:center; overflow:hidden;
  background:linear-gradient(155deg,#F8F5EF,#EDE7F8);
}
[data-theme="dark"] .pthumb{ background:linear-gradient(155deg,#242030,#2C2539); }
.pthumb svg{ width:88%; height:88%; }
.pthumb img{ width:100%; height:100%; object-fit:cover; }
.pinfo{ flex:1; min-width:0; }
.pinfo strong{ display:block; font-size:16px; font-weight:600; letter-spacing:-.02em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pinfo span{ font-size:12px; color:var(--muted); }
.pval{ text-align:right; }
.pval strong{ display:block; font-size:16px; font-weight:600; letter-spacing:-.02em; white-space:nowrap; }
.pval span{ font-size:11.5px; color:var(--muted); }

.ptotal{
  display:flex; align-items:flex-end; justify-content:space-between;
  margin-top:18px; padding:18px 4px 0; border-top:1px dashed var(--line);
}
.ptotal span{ font-size:11.5px; color:var(--muted); display:block; letter-spacing:.02em; }
.ptotal small{ font-size:11px; color:var(--muted); }
.ptotal strong{ font-size:26px; font-weight:600; letter-spacing:-.04em; }

/* ---------- Botones ---------- */
.btn-primary{
  width:100%; height:56px; border-radius:999px; margin-top:16px;
  background:var(--btn-grad); color:#fff;
  font-size:15px; font-weight:600; letter-spacing:-.01em;
  box-shadow:0 14px 30px rgba(124,92,214,.38);
  transition:transform .18s ease, box-shadow .18s ease;
}
.btn-primary:active{ transform:scale(.98); box-shadow:0 8px 18px rgba(124,92,214,.3); }
.btn-primary[disabled]{ opacity:.5; box-shadow:none; }
.btn-ghost{
  width:100%; height:48px; border-radius:999px; margin-top:10px;
  background:var(--surface); border:1px solid var(--line);
  color:var(--ink-soft); font-size:13.5px; font-weight:500; box-shadow:var(--shadow-sm);
}
.btn-danger{ color:var(--danger); }

/* ---------- Estadísticas ---------- */
.kpis{ display:grid; grid-template-columns:1fr 1fr; gap:11px; margin-top:18px; }
.kpi{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); padding:14px; box-shadow:var(--shadow-sm);
}
.kpi span{ font-size:10.5px; color:var(--muted); letter-spacing:.02em; }
.kpi strong{ display:block; font-size:20px; font-weight:600; letter-spacing:-.035em; margin-top:6px; }
.kpi em{ font-style:normal; font-size:10.5px; color:var(--good); font-weight:500; }
.kpi.lilac{ background:var(--btn-grad); border:0; color:#fff; box-shadow:0 14px 28px rgba(124,92,214,.3); }
.kpi.lilac span, .kpi.lilac em{ color:rgba(255,255,255,.78); }

.panel{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-md); padding:16px; margin-top:13px; box-shadow:var(--shadow-sm);
}
.panel h3{ font-size:13px; font-weight:600; letter-spacing:-.01em; margin-bottom:16px; }

.bars{ display:flex; align-items:flex-end; justify-content:space-between; gap:8px; height:118px; }
.bar{ flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; gap:7px; height:100%; }
.bar i{ display:block; width:100%; max-width:22px; border-radius:8px 8px 4px 4px; background:linear-gradient(180deg,var(--primary),var(--primary-2)); min-height:6px; }
.bar.dim i{ background:var(--primary); opacity:.26; }
.bar b, .bar u{ font-size:9.5px; font-weight:500; color:var(--muted); text-decoration:none; }

.rank{ display:flex; flex-direction:column; gap:12px; }
.rank-row{ display:flex; align-items:center; gap:10px; }
.rank-n{ width:20px; font-size:11px; font-weight:600; color:var(--muted); }
.rank-body{ flex:1; }
.rank-body .t{ display:flex; justify-content:space-between; font-size:12px; font-weight:500; margin-bottom:5px; gap:12px; }
.rank-body .t span{ color:var(--muted); font-weight:400; white-space:nowrap; }
.track{ height:6px; border-radius:999px; background:var(--track); overflow:hidden; }
.track i{ display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,var(--primary),var(--primary-2)); }

.donut-wrap{ display:flex; align-items:center; gap:18px; }
.donut{ width:104px; height:104px; border-radius:50%; position:relative; flex:0 0 auto; }
.donut::after{ content:""; position:absolute; inset:18px; border-radius:50%; background:var(--surface); }
.donut b{ position:absolute; inset:0; display:grid; place-items:center; font-size:10.5px; z-index:2; color:var(--muted); font-weight:500; text-align:center; line-height:1.2; }
.legend{ display:flex; flex-direction:column; gap:9px; flex:1; }
.legend div{ display:flex; align-items:center; gap:8px; font-size:11.5px; color:var(--ink-soft); }
.legend i{ width:8px; height:8px; border-radius:3px; flex:0 0 auto; }
.legend span{ margin-left:auto; color:var(--muted); }

/* ---------- Ficha de la prenda ---------- */
.detail{ position:absolute; inset:0; z-index:55; background:var(--bg); display:flex; flex-direction:column; overflow-y:auto; }
.detail[hidden]{ display:none; }
.dphoto{
  position:relative; flex:0 0 auto; height:74%; min-height:480px;
  display:grid; place-items:center; overflow:hidden;
  background:linear-gradient(160deg,#F6F2EB,#E9E2F4);
  border-radius:0 0 38px 38px;
}
[data-theme="dark"] .dphoto{ background:linear-gradient(160deg,#262031,#181420); }
.dphoto::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(58% 46% at 50% 44%, color-mix(in srgb, var(--c1) 38%, transparent), transparent 72%);
}
.dphoto svg{ width:64%; height:64%; position:relative; z-index:2; filter:drop-shadow(0 22px 34px rgba(0,0,0,.24)); }
.dphoto img{ width:100%; height:100%; object-fit:cover; position:relative; z-index:2; }
.dphoto.hasimg::after{ display:none; }
.dbtn{
  position:absolute; z-index:4; top:18px; width:42px; height:42px; border-radius:50%;
  display:grid; place-items:center; background:rgba(255,255,255,.94);
  box-shadow:0 8px 20px rgba(20,10,40,.20);
}
.dbtn svg{ width:19px; height:19px; stroke:#3E3849; stroke-width:1.9; fill:none; stroke-linecap:round; stroke-linejoin:round; }
.dbtn.back{ left:18px; }
.dbtn.heart{ right:18px; }
.dbtn.heart.on svg{ fill:#8B5CF6; stroke:#8B5CF6; }
.dbody{ flex:1; display:flex; flex-direction:column; padding:22px 22px calc(26px + env(safe-area-inset-bottom)); }
.dhead{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; }
.dhead h2{ font-size:26px; font-weight:600; letter-spacing:-.04em; line-height:1.15; }
.dhead strong{ font-size:22px; font-weight:600; letter-spacing:-.03em; white-space:nowrap; }
.dsub{ font-size:12px; color:var(--muted); margin-top:7px; }
.dspacer{ flex:1; min-height:10px; }
.dtools{ display:flex; gap:10px; }
.dtools .btn-ghost{ margin-top:10px; }

/* ---------- Hojas inferiores ---------- */
.sheet-layer{ position:absolute; inset:0; z-index:60; display:flex; align-items:flex-end; }
.sheet-layer[hidden]{ display:none; }
.scrim{ position:absolute; inset:0; background:rgba(30,20,50,.5); backdrop-filter:blur(3px); animation:fade .2s ease both; }
@keyframes fade{ from{ opacity:0 } to{ opacity:1 } }
.sheet{
  position:relative; width:100%; max-height:86%; overflow-y:auto;
  background:var(--surface); border-radius:30px 30px 0 0;
  padding:10px 20px calc(26px + env(safe-area-inset-bottom));
  box-shadow:0 -20px 50px rgba(40,20,80,.22);
  animation:up .28s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes up{ from{ transform:translateY(100%) } to{ transform:none } }
.grab{ width:38px; height:4px; border-radius:99px; background:var(--line); margin:0 auto 16px; }
.sheet h3{ font-size:18px; font-weight:600; letter-spacing:-.03em; }
.sheet p.sub{ font-size:12.5px; color:var(--muted); margin-top:3px; }
.sheet .close{ position:absolute; top:16px; right:16px; width:30px; height:30px; border-radius:50%; background:var(--surface-2); display:grid; place-items:center; font-size:15px; color:var(--muted); }

/* ---------- Hoja del día ---------- */
.picker{ display:flex; gap:11px; overflow-x:auto; padding:16px 0 6px; margin:0 -20px; padding-left:20px; padding-right:20px; }
.pick{ flex:0 0 auto; width:96px; text-align:center; }
.pick .photo{ aspect-ratio:1/1.15; border-radius:15px; }
.pick span{ display:block; font-size:10.5px; font-weight:500; margin-top:6px; color:var(--ink-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pick.on .photo{ outline:2px solid var(--primary); outline-offset:2px; }

/* ---------- Formularios ---------- */
.field{ display:block; margin-top:14px; }
.field span{ display:block; font-size:11.5px; color:var(--muted); margin-bottom:6px; font-weight:500; }
.field input, .field select, .field textarea{
  width:100%; border-radius:14px; border:1px solid var(--line);
  background:var(--surface-2); padding:13px 14px; font-size:14px; outline:none;
  transition:border-color .15s ease, background .15s ease;
}
.field textarea{ resize:vertical; min-height:76px; line-height:1.5; }
.field input:focus, .field select:focus, .field textarea:focus{ border-color:var(--primary); background:var(--surface); }
.row2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.upload{
  margin-top:14px; border:1.5px dashed var(--line); border-radius:18px;
  padding:18px; text-align:center; background:var(--surface-2); cursor:pointer;
  transition:border-color .15s ease;
}
.upload:hover{ border-color:var(--primary); }
.upload strong{ display:block; font-size:12.5px; font-weight:600; }
.upload span{ font-size:11px; color:var(--muted); }
.upload svg{ width:24px; height:24px; stroke:var(--primary-2); fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; margin-bottom:6px; }
.upload img{ width:100%; max-height:190px; object-fit:cover; border-radius:12px; display:block; }

/* ---------- Selector de tema ---------- */
.segmented{ display:grid; grid-template-columns:repeat(3,1fr); gap:6px; background:var(--surface-2); padding:5px; border-radius:16px; margin-top:6px; }
.segmented button{ height:40px; border-radius:12px; font-size:12.5px; font-weight:500; color:var(--muted); display:flex; align-items:center; justify-content:center; gap:6px; }
.segmented button.on{ background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm); }
.segmented svg{ width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

/* ---------- Filas de ajustes ---------- */
.setrow{
  display:flex; align-items:center; gap:12px; width:100%;
  padding:14px 2px; border-bottom:1px solid var(--line); text-align:left;
}
.setrow:last-child{ border-bottom:0; }
.setrow .ic{ width:34px; height:34px; border-radius:11px; background:var(--surface-2); display:grid; place-items:center; flex:0 0 auto; }
.setrow .ic svg{ width:17px; height:17px; stroke:var(--ink-soft); fill:none; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.setrow div{ flex:1; min-width:0; }
.setrow strong{ display:block; font-size:13.5px; font-weight:600; }
.setrow span{ font-size:11.5px; color:var(--muted); }
.setrow small{ font-size:10.5px; color:var(--muted); }

/* ---------- Estado vacío ---------- */
.empty{ text-align:center; padding:54px 20px; }
.empty .blob{
  width:86px; height:86px; margin:0 auto 18px; border-radius:28px;
  background:var(--primary-soft); display:grid; place-items:center;
}
.empty .blob svg{ width:38px; height:38px; stroke:var(--primary-2); fill:none; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
[data-theme="dark"] .empty .blob svg{ stroke:var(--primary); }
.empty h2{ font-size:17px; font-weight:600; letter-spacing:-.02em; }
.empty p{ font-size:12.5px; color:var(--muted); margin-top:6px; line-height:1.6; }
.empty .btn-primary{ max-width:240px; margin:18px auto 0; }

/* ---------- Aviso ---------- */
.toast{
  position:absolute; left:50%; bottom:96px; transform:translate(-50%,20px);
  z-index:80; background:var(--ink); color:var(--bg);
  font-size:12px; font-weight:500; padding:10px 18px; border-radius:999px;
  opacity:0; pointer-events:none; transition:all .25s ease; white-space:nowrap;
  max-width:88%; overflow:hidden; text-overflow:ellipsis;
}
.toast.show{ opacity:1; transform:translate(-50%,0); }
[data-theme="dark"] .toast{ background:var(--primary); color:#17131F; }
