/* =========================
   Natural Soap Outpost — Global Theme
   ========================= */

/* Design tokens */
:root{
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ea;
  --text: #1f2a24;
  --muted: #5b6b60;

  --brand: #2f6b4f;
  --brand-2: #1f4f3b;
  --accent: #c7a46b;

  --danger: #b42318;
  --border: rgba(31,42,36,.12);

  --shadow: 0 10px 30px rgba(31,42,36,.08);
  --shadow-sm: 0 6px 16px rgba(31,42,36,.08);

  --radius: 18px;
  --radius-sm: 12px;

  --container: 1200px;
}

/* Base reset */
*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height:1.55;
  color: var(--text);
  background:
    radial-gradient(1000px 400px at 20% -10%, rgba(47,107,79,.12), transparent 60%),
    radial-gradient(900px 420px at 90% 0%, rgba(199,164,107,.12), transparent 55%),
    var(--bg);
}

img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration:none; }
a:hover{ text-decoration:none; }

/* Layout helpers */
.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================
   Header / Nav
   ========================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251,250,247,.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 240px;
}

.brand-mark {
  width: 100px;
  height: 100px;
  background: rgba(251,250,247,.75);
  display: grid;
  place-items: center;
}

.brand-mark__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title{
  display:flex;
  flex-direction:column;
  line-height:1.2;
}
.brand-title strong{
  font-size: 1.05rem;
  letter-spacing:.2px;
}
.brand-subtitle{
  font-size: .86rem;
  color: var(--muted);
}

.nav{
  display:flex;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content:flex-end;
}

.nav-link{
  font-size: .95rem;
  color: rgba(31,42,36,.86);
  padding: 10px 12px;
  border-radius: 12px;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
  border: 1px solid transparent;
}
.nav-link:hover{
  background: rgba(47,107,79,.08);
  border-color: rgba(47,107,79,.14);
  transform: translateY(-1px);
}

.nav-cta{
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 10px 24px rgba(47,107,79,.18);
}
.nav-cta:hover{
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
}

/* Mobile toggle */
.nav-toggle{ display:none; }
.nav-toggle-btn{
  display:none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.65);
  box-shadow: var(--shadow-sm);
  cursor:pointer;
  font-weight: 700;
}

@media (max-width: 820px){
  .brand{ min-width:auto; }
  .nav{ display:none; width:100%; justify-content:flex-start; }
  .nav-toggle-btn{ display:inline-flex; align-items:center; gap:8px; }
  .nav-toggle:checked ~ .nav{ display:flex; }
  .nav-link{ width:100%; }
}

/* =========================
   Main / Footer
   ========================= */
.site-main{
  min-height: calc(100vh - 220px);
  padding: 34px 0 50px;
}

.site-footer{
  margin-top: 40px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.55);
}

.footer-inner{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
}
.footer-inner p{ margin: 0; }
.footer-note{ opacity: .9; }

/* =========================
   Messages (Django)
   ========================= */
.messages{
  list-style:none;
  margin: 16px auto 0;
  padding: 0;
  display:grid;
  gap: 10px;
}
.message{
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.75);
  box-shadow: var(--shadow-sm);
}

.message.success{
  border-color: rgba(47,107,79,.25);
  background: rgba(47,107,79,.08);
}
.message.error{
  border-color: rgba(180,35,24,.28);
  background: rgba(180,35,24,.08);
}
.message.warning{
  border-color: rgba(199,164,107,.35);
  background: rgba(199,164,107,.12);
}

/* =========================
   Buttons
   ========================= */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor:pointer;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: .2px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  text-decoration:none;
  user-select:none;
}

.btn:active{ transform: translateY(0); }

.btn-primary{
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 14px 30px rgba(47,107,79,.20);
  border-color: rgba(255,255,255,.12);
}
.btn-primary:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(47,107,79,.24);
}

.btn-outline{
  background: rgba(255,255,255,.65);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover{
  transform: translateY(-1px);
  border-color: rgba(47,107,79,.25);
  background: rgba(47,107,79,.06);
}

.btn-danger{
  background: rgba(180,35,24,.10);
  border-color: rgba(180,35,24,.20);
  color: var(--danger);
}
.btn-danger:hover{
  background: rgba(180,35,24,.14);
  transform: translateY(-1px);
}

/* Backward-compat for your earlier templates */
.btn-success{
  background: rgba(47,107,79,.10);
  border-color: rgba(47,107,79,.20);
  color: var(--brand-2);
}
.btn-success:hover{
  background: rgba(47,107,79,.14);
  transform: translateY(-1px);
}

/* =========================
   Cards / Grid (Products)
   ========================= */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
  margin-top: 22px;
}

.card{
  background: rgba(255,255,255,.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover{
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(47,107,79,.18);
}

.card-media{
  position:relative;
  height: 200px;
  background: linear-gradient(135deg, rgba(47,107,79,.18), rgba(199,164,107,.18));
}
.card-media img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.card-body{ padding: 16px 16px 18px; }
.card-title{
  font-size: 1.08rem;
  margin: 2px 0 8px;
  letter-spacing:.2px;
}
.card-text{
  color: var(--muted);
  margin: 0 0 14px;
  font-size: .95rem;
}

.price{
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing:.2px;
  color: var(--brand-2);
}

/* =========================
   Forms
   ========================= */
label{
  display:block;
  margin: 0 0 6px;
  font-weight: 700;
  color: rgba(31,42,36,.92);
  font-size: .92rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
  font-size: .95rem;
  transition: box-shadow .15s ease, border-color .15s ease;
  outline: none;
}

textarea{ min-height: 120px; resize: vertical; }

input:focus,
select:focus,
textarea:focus{
  border-color: rgba(47,107,79,.35);
  box-shadow: 0 0 0 4px rgba(47,107,79,.12);
}

.help-text{
  font-size: .88rem;
  color: var(--muted);
  margin-top: 6px;
}

/* =========================
   Tables (Orders, etc.)
   ========================= */
table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(255,255,255,.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow-sm);
}

thead th{
  background: rgba(47,107,79,.07);
  color: rgba(31,42,36,.92);
  font-weight: 800;
  font-size: .92rem;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
}

tbody td{
  padding: 14px 14px;
  border-bottom: 1px solid rgba(31,42,36,.08);
  color: rgba(31,42,36,.92);
  vertical-align: middle;
}

tbody tr:last-child td{ border-bottom:none; }

/* =========================
   Small utilities
   ========================= */
.row{ display:flex; gap: 12px; align-items:center; flex-wrap:wrap; }
.stack{ display:flex; flex-direction:column; gap: 12px; }
.muted{ color: var(--muted); }
