/* =========================
   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);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Use viewport height for reliable full-screen coverage */
}

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;
}

/* =========================
   banner
   ========================= */
.site-banner {
  background: linear-gradient(135deg, #2f6b4f, #3f8a65);
  color: #fff;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 12px;
  letter-spacing: .3px;
}

.site-banner span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* =========================
   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: nowrap !important;
}

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

.brand-mark {
  width: 100px;
  height: 100px;
  background: rgba(251, 250, 247, .75);
  backdrop-filter: blur(10px);
  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;
  justify-content: flex-end;
}

.nav-link {
  font-size: .95rem;
  color: rgba(31, 42, 36, .86);
  padding: 10px 12px;
  border-radius: 12px;
  transition: all .15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Dedicated fix for the long email */
.nav-logout {
  max-width: 200px; /* Adjust this to fit your specific header space */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.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%;
    flex-wrap: wrap;
  }

  .nav-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .nav-toggle:checked~.nav {
    display: flex;
  }

  .nav-link {
    width: 100%;
    max-width: none !important;
  }

  .nav-link, .nav-logout {
    width: 100%;
    max-width: none; 
  }
}

/* =========================
   Main / Footer
   ========================= */
.site-main {
  flex-grow: 1;
}

.site-footer {
  border-top: 1px solid #eee;
  background: #fff;
  padding: 1.25rem 0;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Ensure all links look the same */
.footer-links-group a {
  color: #374151;
  /* Color from your previous CSS snippet */
  text-decoration: none;
  /* Remove default underline */
}

/* Add an underline effect when hovering over a link */
.footer-links-group a:hover {
  text-decoration: underline;
}

/* Existing Grid & Alignment CSS from previous response remains the same */
.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

.footer-item:nth-child(odd) {
  justify-self: start;
  text-align: left;
}

.footer-item:nth-child(even) {
  justify-self: end;
  text-align: right;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-item:nth-child(odd),
  .footer-item:nth-child(even) {
    justify-self: center;
    text-align: center;
  }
}

/* Mobile adjustments to stack them nicely on small screens */
@media (max-width: 768px) {
  .footer-row {
    flex-direction: column;
    /* Stack left/right content on mobile */
    text-align: center;
    gap: 0.1rem;
  }

  .footer-left,
  .footer-right {
    text-align: center;
  }
}


/* =========================
   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);
}

.page {
  padding: 12px 0 40px;
}

.page-head {
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0 0 6px;
}

.page-card {
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line, #e6e6e6);
  border-radius: 16px;
  padding: 18px;
}

.page-list {
  margin: 10px 0 0 18px;
}

.blog-list {
  display: grid;
  gap: 14px;
}

.blog-item {
  padding: 12px;
  border: 1px solid var(--line, #e6e6e6);
  border-radius: 14px;
  background: #fff;
}

.blog-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.faq {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--line, #e6e6e6);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}

.faq-item>summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-body {
  margin-top: 8px;
  color: var(--muted, #6b7280);
  line-height: 1.7;
}
/* Base badge styles */
.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700bold;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

/* Rounded "pill" shape */
.badge-pill {
    padding-right: 0.6em;
    padding-left: 0.6em;
    border-radius: 10rem;
}

/* Danger (Red) color */
.badge-danger {
    background-color: #dc3545;
}