/* ════════════════════════════════════════════════════════════════
   PICHEL — Global Design System
   ★  Edit only :root to retheme. Zero hardcoded values elsewhere.
   ════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── 1. Design Tokens ──────────────────────────────────────────── */
:root {
  /* Palette */
  --clr-bg:             #EDE8DC;
  --clr-surface:        #F5F1E8;
  --clr-surface-2:      #E3DDD1;
  --clr-border:         #C8BFAC;
  --clr-accent:         #3B5E45;
  --clr-accent-hover:   #2A4533;
  --clr-accent-muted:   rgba(59, 94, 69, .09);
  --clr-text:           #1E3028;
  --clr-text-muted:     #7A7060;
  --clr-text-on-accent: #F5F1E8;
  --clr-white:          #FFFFFF;
  --clr-error:          #A84232;
  --clr-error-bg:       rgba(168, 66, 50, .09);
  --clr-error-border:   rgba(168, 66, 50, .25);
  --clr-error-hover:    rgba(168, 66, 50, .18);
  --clr-success:        #4A7A5A;
  --clr-success-bg:     rgba(74, 122, 90, .12);
  --clr-warning:        #8B6914;
  --clr-warning-bg:     #FEF3C7;
  --clr-warning-text:   #92400E;
  --clr-whatsapp:       #25D366;
  --clr-whatsapp-hover: #1DA851;
  --clr-overlay:        rgba(30, 48, 40, .45);
  --clr-bg-alpha:       rgba(237, 232, 220, .92);
  --clr-surface-alpha:  rgba(245, 241, 232, .90);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --text-xs:    .72rem;
  --text-sm:    .855rem;
  --text-base:  1rem;
  --text-lg:    1.1rem;
  --text-xl:    1.3rem;
  --text-2xl:   1.6rem;
  --text-hero:  clamp(2rem, 6vw, 3.5rem);
  --text-icon:  2rem;
  --fw-normal:   400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --lh-tight:  1.1;
  --lh-snug:   1.3;
  --lh-normal: 1.5;

  /* Spacing */
  --sp-1:  .25rem;
  --sp-2:  .5rem;
  --sp-3:  .75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-7:  1.75rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Borders & radii */
  --border:      1px solid var(--clr-border);
  --border-thick: 2px solid var(--clr-border);
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px  rgba(30, 48, 40, .07);
  --shadow-md: 0 4px 12px rgba(30, 48, 40, .09);
  --shadow-lg: 0 8px 28px rgba(30, 48, 40, .13);

  /* Layout */
  --nav-height:       60px;
  --sidebar-width:    220px;
  --container-max:    1100px;
  --container-prose:  860px;
  --container-narrow: 680px;
  --container-wide:   960px;
  --form-max-width:   400px;
  --form-edit-max:    520px;
  --form-col-fixed:   160px;
  --td-items-max:     200px;

  /* Components */
  --fab-size:        56px;
  --badge-size:      20px;
  --badge-offset:    4px;
  --badge-border:    2px;
  --icon-btn-sm:     24px;
  --icon-btn-md:     32px;
  --icon-btn-lg:     40px;
  --thumb-size:      44px;
  --spinner-size:    14px;
  --spinner-border:  2px;
  --select-multi-h:  160px;
  --cart-max-height: 88vh;

  /* Motion */
  --ease:      .15s ease;
  --ease-slow: .25s ease;
}


/* ── 2. Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }


/* ── 3. Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-normal);
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
}

a { color: inherit; }


/* ── 4. Layout variants ────────────────────────────────────────── */
body.layout-admin { display: flex; }

body.layout-auth {
  display: grid;
  place-items: center;
  padding: var(--sp-4);
}


/* ── 5. Public navigation (mobile-first) ───────────────────────── */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--clr-bg-alpha);
  backdrop-filter: blur(12px);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  gap: var(--sp-4);
}

.topnav-links {
  display: none;
  list-style: none;
  margin-left: auto;
}
.topnav-links a {
  color: var(--clr-text-muted);
  text-decoration: none;
  font-size: var(--text-xs);
  transition: color var(--ease);
}
.topnav-links a:hover { color: var(--clr-text); }

.nav-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-brand img {
  display: block;
}

.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--sp-2);
  flex-shrink: 0;
}

.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: var(--sp-2);
  border-radius: var(--radius-md);
  color: var(--clr-text-muted);
  text-decoration: none;
  transition: color var(--ease);
  flex-shrink: 0;
}
.nav-cart:hover { color: var(--clr-text); }

.nav-cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: var(--radius-pill);
  background: var(--clr-error);
  color: #fff;
  font-size: 0.6rem;
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--clr-text);
  border-radius: var(--radius-sm);
  transition: transform var(--ease), opacity var(--ease);
}

.topnav.open .topnav-links {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--clr-bg-alpha);
  backdrop-filter: blur(12px);
  border-bottom: var(--border);
  padding: var(--sp-3) var(--sp-4);
  gap: 0;
  z-index: 99;
}
.topnav.open .topnav-links a {
  display: block;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-base);
  border-radius: var(--radius-md);
}


/* ── 6. Hamburger / menu toggle (mobile-first: visible) ────────── */
.hamburger,
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--sp-1);
  flex-shrink: 0;
}
.hamburger span,
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--clr-text);
  border-radius: var(--radius-sm);
  transition: transform var(--ease), opacity var(--ease);
}


/* ── 7. Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease),
              border-color var(--ease), opacity var(--ease);
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--clr-accent); color: var(--clr-text-on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--clr-accent-hover); }

.btn-ghost { background: transparent; border: var(--border); color: var(--clr-text); }
.btn-ghost:hover:not(:disabled) { background: var(--clr-surface-2); }

.btn-danger {
  background: var(--clr-error-bg);
  color: var(--clr-error);
  border: 1px solid var(--clr-error-border);
}
.btn-danger:hover:not(:disabled) { background: var(--clr-error-hover); }

.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: var(--text-sm); }
.topbar-action { margin-left: auto; font-size: var(--text-sm); }

.btn-login {
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--clr-accent);
  background: transparent;
  color: var(--clr-accent);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ease), color var(--ease);
}
.btn-login:hover { background: var(--clr-accent); color: var(--clr-text-on-accent); }

.btn-logout {
  width: 100%;
  padding: var(--sp-2);
  background: transparent;
  border: var(--border);
  color: var(--clr-text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  transition: border-color var(--ease), color var(--ease);
}
.btn-logout:hover { border-color: var(--clr-error); color: var(--clr-error); }


/* ── 8. Hero (mobile-first) ────────────────────────────────────── */
.hero {
  padding: var(--sp-10) var(--sp-4) var(--sp-8);
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--fw-bold);
  letter-spacing: -.5px;
  line-height: var(--lh-tight);
}
.hero h1 span { color: var(--clr-accent); font-style: italic; }
.hero p {
  margin-top: var(--sp-3);
  color: var(--clr-text-muted);
  font-size: var(--text-lg);
  max-width: var(--container-narrow);
  margin-inline: auto;
}


/* ── 9. Section header (mobile-first) ──────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 0 var(--sp-4);
  margin-bottom: var(--sp-5);
  max-width: var(--container-max);
  margin-inline: auto;
  width: 100%;
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
}
.section-header span { font-size: var(--text-sm); color: var(--clr-text-muted); }
.section-header--flush { padding: 0; margin-bottom: var(--sp-4); }


/* ── 10. Products grid (mobile-first: 2 col) ───────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  padding: 0 var(--sp-4) var(--sp-16);
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}


/* ── 11. Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--ease), border-color var(--ease), box-shadow var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--clr-accent);
  box-shadow: var(--shadow-md);
}

.card-form {
  width: 100%;
  max-width: var(--form-max-width);
  overflow: visible;
  padding: var(--sp-8);
  border-radius: var(--radius-lg);
}
.card-form:hover { transform: none; border-color: var(--clr-border); box-shadow: none; }

.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--clr-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text-muted);
  font-size: var(--text-icon);
}

.card-body {
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;
}

.card-name {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--clr-accent);
  margin-top: auto;
}


/* ── 12. Forms ─────────────────────────────────────────────────── */
.brand {
  display: block;
  text-align: center;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--clr-accent);
  letter-spacing: .06em;
  text-decoration: none;
  margin-bottom: var(--sp-2);
}

.auth-subtitle {
  text-align: center;
  font-size: var(--text-base);
  font-weight: var(--fw-medium);
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-8);
}

.field { margin-bottom: var(--sp-5); }

label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-muted);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: .07em;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-bg);
  border: var(--border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
textarea:focus {
  border-color: var(--clr-accent);
  box-shadow: 0 0 0 3px var(--clr-accent-muted);
}
input::placeholder,
textarea::placeholder { color: var(--clr-border); }
textarea { resize: none; }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--clr-bg) inset;
  -webkit-text-fill-color: var(--clr-text);
  transition: background-color 5000s ease-in-out 0s;
}

.form-card {
  background: var(--clr-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-6);
}
.form-card--edit { max-width: var(--form-edit-max); }

.form-stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.form-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.form-title { font-family: var(--font-display); font-size: var(--text-xl); margin-bottom: var(--sp-5); }
.form-label-note { font-weight: var(--fw-normal); color: var(--clr-text-muted); }
.img-preview { width: 100px; height: 100px; object-fit: cover; border-radius: var(--radius-sm); display: block; margin-bottom: var(--sp-2); }

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
  align-items: end;
}

.form-field label {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--clr-text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: var(--sp-1);
}

.form-select {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: var(--clr-bg);
  border: var(--border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  outline: none;
  cursor: pointer;
  transition: border-color var(--ease);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A7060' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: var(--sp-8);
}
.form-select:focus { border-color: var(--clr-accent); box-shadow: 0 0 0 3px var(--clr-accent-muted); }
select[multiple] { appearance: auto; background-image: none; padding-right: var(--sp-3); }
.select-multi { height: var(--select-multi-h); }

.form-2col {
  border: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--sp-6);
}
.form-2col-row { display: block; border-bottom: var(--border); }
.form-2col-row:last-child { border-bottom: none; }
.form-2col-field { padding: var(--sp-4) var(--sp-5); background: var(--clr-surface); }
.form-2col-hint { display: none; }


/* ── 13. Error / feedback ──────────────────────────────────────── */
.error-msg {
  display: none;
  background: var(--clr-error-bg);
  border: 1px solid var(--clr-error-border);
  color: var(--clr-error);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  margin-bottom: var(--sp-4);
}
.error-msg.show { display: block; }

.footer-link {
  text-align: center;
  margin-top: var(--sp-6);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
}
.footer-link a { color: var(--clr-accent); text-decoration: none; }
.footer-link a:hover { text-decoration: underline; }


/* ── 14. State messages ────────────────────────────────────────── */
.state-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-16) var(--sp-4);
  color: var(--clr-text-muted);
}
.state-msg .icon { font-size: var(--text-icon); margin-bottom: var(--sp-2); }


/* ── 15. Spinner ───────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: var(--spinner-size);
  height: var(--spinner-size);
  border: var(--spinner-border) solid var(--clr-surface-2);
  border-top-color: var(--clr-text-on-accent);
  border-radius: var(--radius-pill);
  animation: spin .6s linear infinite;
  vertical-align: middle;
  margin-right: var(--sp-2);
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ── 16. Skeleton ──────────────────────────────────────────────── */
.skeleton { animation: pulse 1.4s ease-in-out infinite; }
.skeleton .card-img   { background: var(--clr-surface-2); }
.skeleton .card-name  { height: 14px; background: var(--clr-surface-2); border-radius: var(--radius-sm); }
.skeleton .card-price { height: 18px; width: 60px; background: var(--clr-surface-2); border-radius: var(--radius-sm); margin-top: var(--sp-2); }
.skeleton .btn-add    { background: var(--clr-surface-2); color: transparent; pointer-events: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}


/* ── 17. Sidebar (mobile-first: hidden) ────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--clr-surface);
  border-right: var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  transform: translateX(-100%);
  transition: transform var(--ease-slow);
}
.sidebar.open { transform: translateX(0); }

.sidebar-brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--clr-accent);
  padding: 0 var(--sp-5) var(--sp-6);
  border-bottom: var(--border);
  text-decoration: none;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.sidebar-brand small {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  background: var(--clr-accent);
  color: var(--clr-text-on-accent);
  border-radius: var(--radius-sm);
  padding: 1px var(--sp-2);
  letter-spacing: .04em;
}

nav.sidebar-nav {
  position: static;
  height: auto;
  background: transparent;
  backdrop-filter: none;
  border-bottom: none;
  display: block;
  padding: var(--sp-4) 0;
  gap: 0;
  flex: 1;
}

.nav-section {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--clr-text-muted);
  padding: var(--sp-3) var(--sp-5) var(--sp-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  color: var(--clr-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  border-left: 3px solid transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
  cursor: pointer;
}
.nav-item:hover  { background: var(--clr-surface-2); color: var(--clr-text); }
.nav-item.active { color: var(--clr-accent); border-left-color: var(--clr-accent); background: var(--clr-accent-muted); }
.nav-item .icon  { font-size: var(--text-base); width: 18px; text-align: center; }
.nav-item--push  { margin-top: auto; }

.sidebar-footer { padding: var(--sp-4) var(--sp-5); border-top: var(--border); }


/* ── 18. Main area (mobile-first: full-width) ──────────────────── */
.main {
  margin-left: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

.topbar {
  height: var(--nav-height);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-4);
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  background: var(--clr-surface-alpha);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.topbar-title { font-size: var(--text-base); font-weight: var(--fw-semibold); }
.topbar-user  { margin-left: auto; font-size: var(--text-sm); color: var(--clr-text-muted); }

.content { padding: var(--sp-4); flex: 1; }


/* ── 19. Table ─────────────────────────────────────────────────── */
.table-wrap {
  background: var(--clr-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  overflow-x: auto;
}
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
thead { background: var(--clr-surface-2); }
th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--clr-text-muted);
  font-weight: var(--fw-semibold);
}
td { padding: var(--sp-3) var(--sp-4); border-top: var(--border); vertical-align: middle; }
tr:hover td { background: var(--clr-surface-2); }

.table-empty   { padding: var(--sp-8); text-align: center; color: var(--clr-text-muted); }
.nowrap        { white-space: nowrap; }
.td-meta       { white-space: nowrap; font-size: var(--text-xs); color: var(--clr-text-muted); }
.td-items      { font-size: var(--text-xs); color: var(--clr-text-muted); max-width: var(--td-items-max); }
.td-amount     { font-weight: var(--fw-semibold); white-space: nowrap; }
.td-strong     { font-weight: var(--fw-semibold); }
.actions-wrap  { display: flex; gap: var(--sp-2); flex-wrap: wrap; }


/* ── 20. Badge ─────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
}
.badge-green     { background: var(--clr-success-bg); color: var(--clr-success); }
.badge-bulk      { background: var(--clr-accent-muted); color: var(--clr-accent); }
.badge-pkg       { background: var(--clr-surface-2); color: var(--clr-text-muted); border: var(--border); }
.badge-pending   { background: var(--clr-warning-bg); color: var(--clr-warning-text); }
.badge-closed    { background: var(--clr-success-bg); color: var(--clr-success); }
.badge-cancelled { background: var(--clr-surface-2); color: var(--clr-text-muted); border: var(--border); }


/* ── 21. Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: var(--sp-6); right: var(--sp-6);
  background: var(--clr-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-5);
  font-size: var(--text-sm);
  display: none;
  z-index: 200;
  min-width: 220px;
  box-shadow: var(--shadow-lg);
}
.toast.show    { display: block; animation: slideUp var(--ease); }
.toast.success { border-left: 3px solid var(--clr-success); }
.toast.error   { border-left: 3px solid var(--clr-error); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(var(--sp-2)); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ── 22. Public price list ─────────────────────────────────────── */
.price-list-wrap {
  max-width: var(--container-prose);
  margin: 0 auto;
  padding: 0 var(--sp-4) var(--sp-10);
  width: 100%;
}

.price-list { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.price-list thead th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--clr-text-muted);
  border-bottom: var(--border-thick);
}
.price-list tbody tr { border-bottom: var(--border); transition: background var(--ease); }
.price-list tr:hover td { background: unset; }
.price-list tbody:hover td { background: var(--clr-surface); }
.price-list td { padding: var(--sp-3) var(--sp-4); vertical-align: middle; }

.pl-img-cell { display: none; }

.pl-thumb {
  width: var(--thumb-size);
  height: var(--thumb-size);
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: var(--border);
  display: block;
}
.pl-thumb-empty {
  background: var(--clr-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.pl-name { font-weight: var(--fw-semibold); vertical-align: middle; }
.pl-name .pl-desc,
.pl-name .stock-badge { display: block; margin-top: var(--sp-1); }
.pl-desc  { font-size: var(--text-xs); font-weight: var(--fw-normal); color: var(--clr-text-muted); }
.pl-unit  { color: var(--clr-text-muted); font-size: var(--text-sm); }
.pl-price {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--clr-accent);
  white-space: nowrap;
  text-align: right;
}
.pl-unavailable { color: var(--clr-text-muted); }
.pl-mode        { display: inline-block; font-size: var(--text-xs); font-weight: var(--fw-semibold); padding: var(--sp-1) var(--sp-2); border-radius: var(--radius-sm); white-space: nowrap; }
.pl-mode-bulk   { background: var(--clr-accent-muted); color: var(--clr-accent); }
.pl-mode-pkg    { background: var(--clr-surface-2); color: var(--clr-text-muted); }
.pl-price-unit  { font-size: var(--text-xs); font-weight: var(--fw-normal); color: var(--clr-text-muted); }
.pl-row-variant td { border-top: none; padding-top: 0; padding-bottom: var(--sp-3); }
.pl-empty { text-align: center; padding: var(--sp-16) var(--sp-4); color: var(--clr-text-muted); }

.pl-skeleton-row {
  height: 52px;
  background: var(--clr-surface-2);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-2);
  animation: pulse 1.4s ease-in-out infinite;
}


/* ── 23. Info sections (public pages) ──────────────────────────── */
.info-section { padding: var(--sp-16) var(--sp-4); border-top: var(--border); }
.info-section--alt   { background: var(--clr-surface); }
.info-section--first { border-top: none; padding-top: var(--sp-12); }

.info-wrap { max-width: var(--container-narrow); margin: 0 auto; text-align: center; }
.info-wrap--wide { max-width: var(--container-wide); }

.info-title {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: var(--fw-bold);
  color: var(--clr-accent);
  margin-bottom: var(--sp-6);
}
.info-text {
  color: var(--clr-text-muted);
  font-size: var(--text-lg);
  line-height: var(--lh-normal);
  margin-bottom: var(--sp-4);
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-4);
  text-align: left;
  margin-bottom: var(--sp-6);
}
.policy-card { background: var(--clr-surface); border: var(--border); border-radius: var(--radius-md); padding: var(--sp-5); }
.policy-icon  { font-size: var(--text-icon); margin-bottom: var(--sp-3); line-height: 1; }
.policy-title { font-size: var(--text-base); font-weight: var(--fw-semibold); margin-bottom: var(--sp-2); }
.policy-text  { font-size: var(--text-sm); color: var(--clr-text-muted); line-height: var(--lh-normal); }
.policy-note  { display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%; gap: var(--sp-2); background: var(--clr-accent); color: var(--clr-text-on-accent); border-radius: var(--radius-md); padding: var(--sp-4) var(--sp-6); font-size: var(--text-sm); }
.policy-note-label { font-weight: var(--fw-bold); letter-spacing: .03em; }

.symbols-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-4);
  text-align: left;
}
.symbol-card { background: var(--clr-bg); border: var(--border); border-radius: var(--radius-md); padding: var(--sp-4) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-2); }
.symbol-icon-lg { font-size: 2.2rem; line-height: 1; }
.symbol-card strong { font-size: var(--text-sm); font-weight: var(--fw-semibold); }
.symbol-card p { font-size: var(--text-xs); color: var(--clr-text-muted); line-height: var(--lh-normal); margin: 0; }

.pl-symbols { display: block; margin-top: var(--sp-1); }
.pl-sym {
  display: inline-block;
  font-size: var(--text-base);
  cursor: default;
  position: relative;
  line-height: 1;
}
.pl-sym::after {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% + var(--sp-1));
  left: 50%;
  transform: translateX(-50%);
  background: var(--clr-text);
  color: var(--clr-bg);
  padding: 3px var(--sp-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
  z-index: 10;
}
.pl-sym:hover::after { opacity: 1; }

.symbol-icon { font-size: var(--text-base); }

.contact-buttons {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.contact-btn { padding: var(--sp-3) var(--sp-6); font-size: var(--text-base); }

.btn-whatsapp { background: var(--clr-whatsapp); color: var(--clr-white); border: none; }
.btn-whatsapp:hover:not(:disabled) { background: var(--clr-whatsapp-hover); }

.social-links { display: flex; gap: var(--sp-4); justify-content: center; margin-top: var(--sp-2); }
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-btn-lg);
  height: var(--icon-btn-lg);
  border-radius: var(--radius-pill);
  border: var(--border);
  color: var(--clr-text-muted);
  text-decoration: none;
  transition: color var(--ease), border-color var(--ease), background var(--ease);
}
.social-link:hover { color: var(--clr-accent); border-color: var(--clr-accent); background: var(--clr-accent-muted); }

.list-updated      { font-size: var(--text-xs); color: var(--clr-text-muted); margin-top: var(--sp-1); }
.text-right        { text-align: right; }
.text-muted        { font-size: var(--text-sm); color: var(--clr-text-muted); }
.fw-semibold       { font-weight: var(--fw-semibold); }
.btn-block         { width: 100%; padding: var(--sp-3); font-size: var(--text-base); margin-top: var(--sp-2); }
.info-text--spaced { margin-bottom: var(--sp-8); }


/* ── 24. Pagination ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  justify-content: center;
  padding: var(--sp-5) var(--sp-4);
  flex-wrap: wrap;
}
.pagination-btn {
  padding: var(--sp-2) var(--sp-4);
  border: var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease);
}
.pagination-btn:disabled { opacity: .4; cursor: not-allowed; }
.pagination-btn:not(:disabled):hover { background: var(--clr-surface-2); border-color: var(--clr-accent); }
.pagination-info { font-size: var(--text-sm); color: var(--clr-text-muted); }


/* ── 25. Footer ────────────────────────────────────────────────── */
footer {
  border-top: var(--border);
  padding: var(--sp-6);
  text-align: center;
  color: var(--clr-text-muted);
  font-size: var(--text-xs);
  letter-spacing: .04em;
}


/* ── 26. Product cards ─────────────────────────────────────────── */
.product-card {
  background: var(--clr-surface);
  border: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.product-card:hover { border-color: var(--clr-accent); box-shadow: var(--shadow-sm); }

.pc-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--clr-surface-2);
}
.pc-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-icon);
  aspect-ratio: 1;
  background: var(--clr-surface-2);
}

.pc-body {
  padding: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;
}

.pc-name {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-desc {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pc-symbols { display: flex; flex-wrap: wrap; gap: var(--sp-1); }

.pc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  flex-wrap: wrap;
  margin-top: auto;
}

.pc-price {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  color: var(--clr-accent);
  white-space: nowrap;
}

.btn-cart-add {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: var(--clr-accent);
  color: var(--clr-text-on-accent);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: background var(--ease);
}
.btn-cart-add:hover { background: var(--clr-accent-hover); }

.btn-cart-remove {
  width: 100%;
  padding: var(--sp-1) var(--sp-3);
  background: transparent;
  color: var(--clr-error);
  border: 1px solid var(--clr-error-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: background var(--ease);
}
.btn-cart-remove:hover { background: var(--clr-error-bg); }


/* ── 27. Quantity stepper ──────────────────────────────────────── */
.qty-stepper {
  display: none;
  align-items: center;
  gap: var(--sp-1);
  width: 100%;
}

.qty-btn {
  width: var(--icon-btn-md);
  height: var(--icon-btn-md);
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--clr-bg);
  color: var(--clr-text);
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--ease), border-color var(--ease);
  line-height: 1;
  padding: 0;
}
.qty-btn:hover { background: var(--clr-surface-2); border-color: var(--clr-accent); }

.qty-input {
  width: 100%;
  min-width: 0;
  padding: var(--sp-1) var(--sp-2);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  border: var(--border);
  border-radius: var(--radius-sm);
  background: var(--clr-bg);
  color: var(--clr-text);
}
.qty-input:focus { border-color: var(--clr-accent); box-shadow: 0 0 0 var(--sp-1) var(--clr-accent-muted); }
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.qty-input[type=number] { appearance: textfield; -moz-appearance: textfield; }

.qty-unit     { font-size: var(--text-xs); color: var(--clr-text-muted); flex-shrink: 0; }
.qty-hint     { font-size: var(--text-xs); color: var(--clr-text-muted); display: none; }
.qty-subtotal { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--clr-accent); display: none; }


/* ── 28. Cart FAB ──────────────────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: calc(var(--sp-6) + env(safe-area-inset-bottom, 0px));
  right: var(--sp-6);
  z-index: 200;
  width: var(--fab-size);
  height: var(--fab-size);
  border-radius: var(--radius-pill);
  background: var(--clr-accent);
  color: var(--clr-text-on-accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: background var(--ease), transform var(--ease);
}
.cart-fab:hover  { background: var(--clr-accent-hover); transform: scale(1.05); }
.cart-fab:active { transform: scale(.97); }

.cart-fab-badge {
  position: absolute;
  top: calc(-1 * var(--badge-offset));
  right: calc(-1 * var(--badge-offset));
  min-width: var(--badge-size);
  height: var(--badge-size);
  padding: 0 var(--sp-1);
  border-radius: var(--radius-pill);
  background: var(--clr-error);
  color: var(--clr-white);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  display: none;
  align-items: center;
  justify-content: center;
  border: var(--badge-border) solid var(--clr-surface);
  line-height: 1;
}


/* ── 29. Cart overlay + drawer ─────────────────────────────────── */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: var(--clr-overlay);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease-slow);
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 300;
  background: var(--clr-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: var(--cart-max-height);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform var(--ease-slow);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.cart-drawer.open { transform: translateY(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  border-bottom: var(--border);
  flex-shrink: 0;
}
.cart-drawer-header h3 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--fw-semibold); }

.cart-close {
  width: var(--icon-btn-md);
  height: var(--icon-btn-md);
  border: var(--border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--clr-text-muted);
  font-size: var(--text-base);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease), color var(--ease);
}
.cart-close:hover { background: var(--clr-surface-2); color: var(--clr-text); }

.cart-alert {
  margin: var(--sp-3) var(--sp-5) 0;
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-warning-bg);
  color: var(--clr-warning-text);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  line-height: var(--lh-normal);
}

.cart-items { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-5); }

.cart-empty { text-align: center; padding: var(--sp-12) var(--sp-4); color: var(--clr-text-muted); font-size: var(--text-sm); }

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: var(--border);
}
.cart-item:last-child { border-bottom: none; }

.ci-info { flex: 1; min-width: 0; }
.ci-name {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ci-qty-label { font-size: var(--text-xs); color: var(--clr-text-muted); }

.ci-right  { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.ci-stepper { display: flex; align-items: center; gap: var(--sp-1); }
.ci-qty-val { font-size: var(--text-xs); font-weight: var(--fw-semibold); min-width: var(--icon-btn-md); text-align: center; }
.ci-qty-input { width: 56px; padding: var(--sp-1) var(--sp-2); text-align: center; }

.ci-sub {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--clr-accent);
  min-width: 60px;
  text-align: right;
}

.ci-remove {
  width: var(--icon-btn-sm);
  height: var(--icon-btn-sm);
  border: none;
  background: transparent;
  color: var(--clr-text-muted);
  cursor: pointer;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--ease), background var(--ease);
  padding: 0;
}
.ci-remove:hover { color: var(--clr-error); background: var(--clr-error-bg); }

.cart-footer {
  flex-shrink: 0;
  border-top: var(--border);
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  background: var(--clr-surface);
}

.cart-total-row { display: flex; align-items: center; justify-content: space-between; font-size: var(--text-sm); }
.cart-total-row strong { font-family: var(--font-display); font-size: var(--text-xl); color: var(--clr-accent); }

.cart-persist-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: var(--border);
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  font-weight: var(--fw-normal);
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0;
}
.cart-persist-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--clr-accent);
  cursor: pointer;
}
.cart-persist-row strong { display: block; color: var(--clr-text); font-weight: var(--fw-semibold); margin-bottom: var(--sp-1); }
.cart-persist-row small  { display: block; }

.cart-form { display: flex; flex-direction: column; gap: var(--sp-3); }

.cart-wpp-note {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  background: var(--clr-surface-2);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  line-height: var(--lh-normal);
}
.cart-wpp-note-icon { font-size: var(--text-lg); flex-shrink: 0; line-height: 1.3; }
input.input-error:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
  border-color: var(--clr-error);
  box-shadow: 0 0 0 3px var(--clr-error-bg);
}
.field-error { display: block; margin-top: var(--sp-1); font-size: var(--text-sm); color: var(--clr-error); }

.btn-wpp-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--clr-whatsapp);
  color: var(--clr-white);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background var(--ease), opacity var(--ease);
}
.btn-wpp-submit:hover:not(:disabled) { background: var(--clr-whatsapp-hover); }
.btn-wpp-submit:disabled { opacity: .5; cursor: not-allowed; }


/* ── 30. Desktop overrides ─────────────────────────────────────── */
@media (min-width: 768px) {
  /* Public nav */
  .topnav { padding: 0 var(--sp-6); gap: var(--sp-6); }
  .nav-hamburger { display: none; }
  .topnav-links { display: flex; gap: var(--sp-5); }
  .topnav-links a { font-size: var(--text-sm); }
  .nav-cart { margin-left: 0; }

  /* Policy note */
  .policy-note { flex-direction: row; width: auto; text-align: left; }

  /* Contact buttons */
  .contact-buttons { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center; }

  /* Hero */
  .hero { padding: var(--sp-16) var(--sp-6) var(--sp-12); }

  /* Section header */
  .section-header { padding: 0 var(--sp-6); }

  /* Price list */
  .price-list-wrap { padding: 0 var(--sp-6) var(--sp-16); }
  .pl-img-cell { display: table-cell; width: calc(var(--thumb-size) + var(--sp-2)); padding-right: 0; }
  .price-list thead th:first-child { display: table-cell; }

  /* Products grid */
  .products-grid { grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); padding: 0 var(--sp-6) var(--sp-16); }

  /* Admin sidebar */
  .sidebar { transform: none; }
  .menu-toggle { display: none; }

  /* Admin main */
  .main { margin-left: var(--sidebar-width); }
  .topbar { padding: 0 var(--sp-7); }
  .content { padding: var(--sp-7); }

  /* Admin forms */
  .form-row { grid-template-columns: 1fr var(--form-col-fixed) auto; }
  .form-2col-row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: var(--border); }
  .form-2col-hint {
    display: block;
    padding: var(--sp-4) var(--sp-5);
    background: var(--clr-bg);
    border-left: var(--border);
    font-size: var(--text-sm);
    color: var(--clr-text-muted);
    line-height: var(--lh-normal);
  }
  .form-2col-hint strong { display: block; color: var(--clr-text); margin-bottom: var(--sp-1); }
}
