:root {
  --yellow: #f2a922;
  --yellow-dark: #d98c10;
  --purple: #6b3fa0;
  --purple-dark: #4a2c76;
  --pink: #ef5da8;
  --pink-light: #fdecf4;
  --cream: #fffaf0;
  --cream-dark: #fbeed9;
  --ink: #2b2130;
  --ink-soft: #6b5f72;
  --line: #ecdcc4;
  --green: #3f8f5f;
  --danger: #d1425a;
  --rainbow: linear-gradient(90deg, #ef5350, #f2a922, #ffe066, #4caf7d, #4a90d9, #8e5fd1, #ef5da8);
  --font: "Georgia", "Iowan Old Style", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--font);
  font-weight: 700;
  margin: 0 0 0.5em;
  color: var(--purple-dark);
}

a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.rainbow-bar { height: 6px; background: var(--rainbow); }

/* ---------- Header ---------- */

.site-header {
  background: var(--purple);
  color: #fff;
  padding: 18px 0;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.site-header .brand {
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
}

.site-header .brand em { color: var(--yellow); font-style: normal; }

.site-header nav {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}

.site-header nav a {
  color: #f6e9d8;
  font-size: 0.95rem;
  font-weight: 600;
}
.site-header nav a:hover { color: var(--yellow); text-decoration: none; }

.cart-link {
  border: 2px solid var(--yellow);
  color: var(--yellow) !important;
  padding: 6px 16px;
  border-radius: 100px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 90px 0 70px;
  color: #fff;
  background: linear-gradient(180deg, rgba(43,33,48,0.55), rgba(43,33,48,0.78)),
    url('/img/brand/mural-tienda.jpg') center 25% / cover no-repeat;
  overflow: hidden;
}

.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
  color: var(--yellow);
  font-weight: 700;
}

.hero h1 {
  font-size: 2.6rem;
  max-width: 640px;
  color: #fff;
}

.hero p {
  max-width: 560px;
  color: #f3e9de;
  font-size: 1.08rem;
}

.hero-actions { margin-top: 24px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { background: #d84088; text-decoration: none; }

.btn-outline { background: transparent; border-color: #fff; color: #fff; }
.btn-outline:hover { background: #fff; color: var(--purple-dark); text-decoration: none; }

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ---------- Sections ---------- */

section { padding: 56px 0; }
section h2 { font-size: 1.8rem; }
.section-intro { color: var(--ink-soft); max-width: 620px; margin-bottom: 28px; }

.section-alt { background: var(--pink-light); }
.section-purple { background: var(--purple); color: #f3e9de; }
.section-purple h2, .section-purple h3 { color: #fff; }
.section-purple .section-intro { color: #ddc9e6; }

/* ---------- Como funciona ---------- */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.step { border-top: 4px solid var(--yellow); padding-top: 14px; }
.step:nth-child(2) { border-top-color: var(--pink); }
.step:nth-child(3) { border-top-color: var(--purple); }
.step-num { font-family: var(--font); font-size: 1.8rem; font-weight: 700; color: var(--purple); }

/* ---------- Rows / lists (no boxed cards) ---------- */

.row-list { border-top: 1px solid var(--line); }

.row-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}

.row-item img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  background: var(--cream-dark);
  border-radius: 14px;
  flex-shrink: 0;
}

.row-item .row-body { flex: 1; min-width: 0; }
.row-item .row-title { font-size: 1.1rem; margin-bottom: 4px; font-weight: 700; color: var(--ink); }
.row-item .row-meta { color: var(--ink-soft); font-size: 0.9rem; }
.row-item .row-price { font-weight: 700; color: var(--pink); white-space: nowrap; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
}

.grid-item { border-top: 4px solid var(--yellow); padding-top: 16px; }
.grid-item:nth-child(4n+2) { border-top-color: var(--pink); }
.grid-item:nth-child(4n+3) { border-top-color: var(--purple); }
.grid-item:nth-child(4n+4) { border-top-color: var(--green); }
.grid-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--cream-dark); margin-bottom: 12px; border-radius: 16px; }
.grid-item .row-title { color: var(--ink); }
.grid-item .price { color: var(--pink); font-weight: 700; }
.grid-item .stock-low { color: var(--danger); font-size: 0.85rem; }

/* ---------- Filters ---------- */

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.filters a {
  padding: 7px 16px;
  border: 2px solid var(--line);
  border-radius: 100px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}
.filters a.active { border-color: var(--pink); color: var(--pink); }

/* ---------- Product / workshop detail ---------- */

.product-detail { display: flex; gap: 40px; flex-wrap: wrap; align-items: center; }
.product-detail img { width: 380px; max-width: 100%; aspect-ratio: 4 / 5; max-height: 460px; object-fit: cover; background: var(--cream-dark); border-radius: 20px; }
.product-detail .info { flex: 1; min-width: 260px; }
.product-detail .price { font-size: 1.6rem; color: var(--pink); font-weight: 700; margin: 10px 0; }
.product-detail .stock { color: var(--ink-soft); margin-bottom: 20px; }
.qty-input { width: 70px; padding: 8px; border: 2px solid var(--line); border-radius: 10px; margin-right: 10px; }

/* ---------- Forms ---------- */

form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
label { font-weight: 700; font-size: 0.9rem; display: block; margin-bottom: 6px; color: var(--purple-dark); }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"],
input[type="password"], input[type="datetime-local"], textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 12px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--pink); }
textarea { min-height: 100px; resize: vertical; }
.field-error { color: var(--danger); font-size: 0.85rem; margin-top: -6px; }
.form-error-box { background: #fbe2e8; border: 2px solid var(--danger); color: var(--danger); padding: 12px 16px; margin-bottom: 16px; border-radius: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* ---------- Cart ---------- */

.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); gap: 16px; }
.cart-item .name { font-weight: 700; }
.cart-total { display: flex; justify-content: space-between; font-size: 1.25rem; font-weight: 700; padding: 16px 0; color: var(--purple-dark); }
.remove-link { color: var(--danger); font-size: 0.85rem; }

/* ---------- Footer ---------- */

.site-footer { background: var(--purple-dark); color: #e3d3ea; padding: 40px 0; margin-top: 0; font-size: 0.9rem; }
.site-footer a { color: var(--yellow); }
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.site-footer strong { color: #fff; }

/* ---------- Admin ---------- */

.admin-shell { display: flex; min-height: 100vh; }
.admin-nav { width: 220px; background: var(--purple-dark); color: #f2e9dc; padding: 24px 0; flex-shrink: 0; }
.admin-nav .brand { font-family: var(--font); padding: 0 20px 20px; font-size: 1.1rem; border-bottom: 1px solid #5a3e78; margin-bottom: 12px; color: #fff; }
.admin-nav a { display: block; padding: 10px 20px; color: #e7dcc9; font-size: 0.92rem; }
.admin-nav a:hover, .admin-nav a.active { background: #5a3e78; text-decoration: none; }
.admin-main { flex: 1; padding: 36px 40px; max-width: 1000px; }

.stat-row { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 32px; }
.stat { border-top: 3px solid var(--pink); padding-top: 8px; min-width: 140px; }
.stat .num { font-size: 2rem; font-weight: 700; color: var(--purple-dark); }
.stat .label { color: var(--ink-soft); font-size: 0.85rem; }

table.admin-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
table.admin-table th, table.admin-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
table.admin-table th { color: var(--ink-soft); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.4px; }
table.admin-table tr:hover td { background: var(--pink-light); }

.badge { display: inline-block; padding: 3px 12px; font-size: 0.78rem; border-radius: 100px; font-weight: 700; }
.badge-pendiente { background: #fdecd2; color: #8a5a00; }
.badge-preparado { background: #dbe8f5; color: #1a4a7a; }
.badge-recogido, .badge-confirmada { background: #e0ecdd; color: var(--green); }
.badge-cancelado, .badge-cancelada { background: #f5dede; color: var(--danger); }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }

.inline-form { display: inline; }

.notice { padding: 10px 16px; background: var(--pink-light); border-left: 4px solid var(--pink); margin-bottom: 20px; font-size: 0.9rem; border-radius: 0 12px 12px 0; }

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .admin-nav { width: 100%; }
  .admin-main { padding: 24px; }
  .product-detail img { width: 100%; }
  .hero h1 { font-size: 2rem; }
}
