:root {
  --max-width: 980px;
  --gap: 20px;
  --accent: #5aa6e9ff;
  --bar-height: 20px;
}

body {
  font-family: Arial, sans-serif;
  max-width: var(--max-width);
  margin: 20px auto;
  padding: 0 16px 40px;
  font-size: 16px;
  line-height: 1.5;
  color: #222;
}

h1 {
  text-align: center;
  margin-bottom: 6px;
}
h2 {
  font-size: 20px;
  margin: 18px 0 8px;
  color: #222;
  text-align: left;
}
h3 {
  font-size: 16px;
  margin: 8px 0;
}

/*         a {
            display: inline-block;
            margin-top: 20px;
            font-size: 18px;
            padding: 12px 20px;
            background: #4CAF50;
            color: white;
            text-decoration: none;
            border-radius: 6px;
        }
        a:hover {
            background: #45a049;
        } */

.item-wrap {
  margin-bottom: 28px;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
}

/* Two-column layout for price / size results */
.results-container {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap; /* stacks on small screens */
  margin-top: 6px;
}

.result-column {
  flex: 1 1 320px; /* grow, shrink, base width */
  min-width: 260px;
  text-align: left;
}

.no-sizes {
  color: #666;
  font-size: 14px;
  padding-top: 6px;
}

.bar {
  height: var(--bar-height);
  background: #eee;
  border-radius: 6px;
  margin: 6px 0 10px;
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  text-align: right;
  padding-right: 8px;
  color: white;
  white-space: nowrap;
  border-radius: 6px 0 0 6px;
  box-sizing: border-box;
  font-size: 13px;
  line-height: var(--bar-height);
}

.totals {
  font-weight: 700;
  margin-top: 6px;
}

.comment-box {
  background: #fbfbfb;
  border: 1px solid #ddd;
  padding: 10px;
  margin: 8px 0;
  border-radius: 6px;
  white-space: pre-wrap;
}

.top-links {
  text-align: center;
  margin-bottom: 12px;
}

.btn {
  display: inline-block;
  font-size: 16px;
  padding: 10px 18px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  margin: 6px;
}
.btn:hover {
  background: #1533c9ff;
}

.warning {
  background: #ff4c4cff;
}

/* Small screen tweaks */
@media (max-width: 640px) {
  body {
    font-size: 17px;
    padding: 0 12px 30px;
  }
  .result-column {
    min-width: 100%;
  }
  .bar-fill {
    font-size: 12px;
  }
}
fieldset {
  margin-bottom: 20px;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
}
legend {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #333;
}

.border {
  border: 1px solid black;
  border-radius: 10px;
}
dl {
  width: 40vw;
}
dt,
.selections {
  padding: 3px;
  display: flex;
  gap: 10px;
  /*   width: 100px; */
  color: grey;
  font-style: italic;
}
dd {
  padding: 3px;
  border: 1px solid grey;
  border-radius: 5px;
}
li {
  list-style: none;
}
.item-details {
  display: block;
  margin-bottom: 20px;
}
.item-details dt {
  font-weight: bold;
  margin-top: 10px;
}
.item-image {
  max-width: 150px;
  margin-top: 40px;
  /*  margin: 20px 0; */
  height: auto;
  margin-top: 8px;
  border: 1px solid grey;
  border-radius: 10px;
}
.stock-list {
  display: flex;
}
.stock-element {
  width: 100px;
  border: 1px solid black;
  padding: 3px;
}

.red {
  background-color: crimson;
  color: aliceblue;
}
.green {
  background-color: hwb(90 36% 3% / 0.987);
  color: rgb(6, 6, 6);
}

nav {
  padding: 10px;
}
nav button {
  margin: 0 5px;
  width: 85px;
  height: 30px;
  background-color: cornflowerblue;
  color: aliceblue;
  border-radius: 5px;
}

.form-group {
  margin-bottom: 12px;
  align-items: center;
  padding: 10px;
}

input[type='text'],
textarea {
  width: 100px;
  padding: 6px;
  font-size: 16px;
}

input[type='number'] {
  width: 100px;
  padding: 6px;
  font-size: 16px;
}

label {
  font-weight: lighter;
  font-size: 14px;
  color: rgb(96, 78, 78);
  font-style: italic;
  display: block;
  margin-bottom: 4px;
}
.container {
  display: inline-block;
  padding: 10px;
  /* margin:0 auto; */
  /*     width: 200px; */
}
.container-flex {
  display: block;
  padding: 10px;
  margin: 0 auto;
  justify-content: center;
  width: 60vw;
}
@media (min-width: 900px) {
  .container-flex {
    display: flex;
  }
}
/* ===== Poll Item Layout ===== */
.poll-item {
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}
.poll-item legend {
    font-weight: bold;
    font-size: 1.2em;
    padding: 0 5px;
}
.poll-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}
/* Poll Options */
.poll-options {
    flex: 1;
}

/* Merchandise Image */
.poll-image {
    max-width: 150px;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .poll-content {
        flex-direction: column-reverse; /* image on top of options */
    }
}

/* ===== Poll Options Container ===== */
.poll-options {
  flex: 1; /* takes remaining space next to image */
}

.poll-options h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.5em; /* larger, bold title */
}

.poll-options h3 {
  margin-bottom: 8px;
  font-size: 1.2em;
}

.poll-options label {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  cursor: pointer;
}

/* ===== Comment Box ===== */
.poll-comment {
  width: 100%;
  max-width: 600px;
  min-height: 120px;
  font-size: 16px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #ccc;
  resize: vertical;
  box-sizing: border-box;
  margin-top: 10px;
}

/* ===== Submit Button ===== */
.poll-submit {
  font-size: 18px;
  padding: 12px 24px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 15px;
}

.poll-submit:hover {
  background: #45a049;
}

/* ===== Responsive tweaks ===== */
@media (max-width: 600px) {
  .poll-item {
    flex-direction: column; /* stack image above options on small screens */
  }

  .poll-image {
    max-width: 100%;
  }

  .poll-comment {
    min-height: 90px;
    font-size: 14px;
  }
}

/* Mobile tweaks */
@media (max-width: 600px) {
  textarea {
    min-height: 90px; /* slightly smaller so it fits well */
    font-size: 14px; /* optional: scale text down a touch */
  }
}

/* --- Mobile-first tweaks for Shop Admin --- */
@media (max-width: 640px) {
  /* Stack navigation buttons nicely */
  nav {
    display: flex;
    flex-wrap: nowrap;      /* keep them in one row */
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 10px;
  }

  nav button {
    flex: 1;                /* share available space */
    min-width: auto;        /* no forced 85px */
    padding: 6px 4px;       /* slim padding */
    height: 36px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 4px;
    background-color: cornflowerblue;
    color: white;
  }
}

/* --- Desktop: two-column layout --- */
.container-flex.border {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Details column */
.container-flex.border > .container-flex {
  flex: 1 1 60%;
}

/* Image column */
.container-flex.border > .container {
  flex: 1 1 40%;
  text-align: center;
}

/* --- Card style for dt/dd pairs --- */
dl {
  margin: 0;
  padding: 0;
}

dl dt, dl dd {
  margin: 0 0 8px 0;
  padding: 8px 12px;
  border-radius: 8px;
}

/* Label card */
dl dt {
  background-color: #f2f2f2;
  font-weight: bold;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Value card */
dl dd {
  background-color: #ffffff;
  border: 1px solid #ccc;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Stock variants card */
.stock-list {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #999;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  margin-bottom: 8px;
}

.stock-element {
  flex: 1;
  text-align: center;
  font-weight: 500;
}

/* --- Mobile layout --- */
@media (max-width: 640px) {
  .container-flex.border {
    display: block;
  }

  .container-flex.border > .container-flex,
  .container-flex.border > .container {
    width: 100%;
    margin-bottom: 12px;
  }

  dl dt, dl dd {
    font-size: 16px;
    padding: 10px 14px;
  }

  .stock-list {
    flex-direction: row;
    gap: 6px;
    padding: 8px 10px;
  }

  .stock-element {
    font-size: 15px;
    padding: 4px 0;
  }

  .item-image {
    margin-top: 12px;
    max-width: 100%;
  }
}


/* --- Admin nav layout --- */
.admin-nav {
  margin-bottom: 16px;
}

.nav-row {
  display: flex;
  gap: 6px;
  margin: 4px 0;
}

/* Admin functions row: flexible grid */
.admin-functions {
  display: flex;
  flex-wrap: wrap;           /* allow wrapping */
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.admin-functions button {
  flex: 1 1 30%;             /* grow/shrink, about 3 per row */
  min-width: 80px;           /* don’t get too tiny */
  height: 36px;
  font-size: 14px;
}

/* Nav arrows row: always beneath */
.nav-arrows {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.nav-arrows button {
  flex: 0 0 auto;
  min-width: 100px;
  height: 36px;
  font-size: 14px;
}

/* ===== Inputs inside dl/dd cards ===== */
dl dd input[type="text"],
dl dd input[type="number"],
dl dd textarea,
dl dd select {
    width: 100%;        
    box-sizing: border-box;
    padding: 6px 8px;
    font-size: 16px;
    margin-top: 4px;
}

/* ===== Ensure dl fills container ===== */
.container-flex.border dl {
    width: 100%;          
    margin: 0;
}

dl dt, dl dd {
    display: block;       
}

/* ===== Stock variant input widths ===== */
.stock-list input[type="text"],
.stock-list input[type="number"] {
    width: calc(50% - 8px); 
}

/* ===== Spacing tweaks ===== */
dl dd {
    padding: 8px 12px; 
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 12px;
}

/* ===== Action Buttons Row ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;      /* wrap if screen is narrow */
    gap: 8px;
    margin-top: 12px;
}

.action-buttons .btn,
.action-buttons form > .btn {  /* include buttons inside inline forms */
    flex: 1 1 0;          /* share available space */
    min-width: 120px;     /* don’t shrink too small */
    height: 36px;
    font-size: 14px;
    text-align: center;
    border-radius: 5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;      /* ensures full text shows */
}

/* Green button */
.btn.green {
    background-color: #4CAF50;
    color: white;
}
.btn.green:hover {
    background-color: #45a049;
}

/* Red button */
.btn.red {
    background-color: #ff4c4c;
    color: white;
}
.btn.red:hover {
    background-color: #e04343;
}

/* Default blue */
.btn {
    background-color: cornflowerblue;
    color: white;
}
.btn:hover {
    background-color: #1533c9ff;
}
