/* Newsletter signup (the About page's window) and the cart checkbox */

.newsletter-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  color: var(--ui-color, #fff);
  font-size: 0.9rem;
  margin-top: 2rem;
}

/* the field's label is read by screen readers only (see the placeholder) */
.newsletter-field {
  display: block;
  width: 100%;
}

.newsletter-privacy {
  color: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
}

/* boxed field: border all around (same 1.5px as the button border), horizontal padding */
.newsletter-email {
  display: block;
  width: min(100%, 14rem);
  margin: 0 auto;
  box-sizing: border-box;
  background: none;
  /* a CSS border snaps to whole pixels (1.5px shows as 1px on normal screens);
     an inset shadow keeps the exact 1.5px of the button's SVG border */
  border: 0;
  box-shadow: inset 0 0 0 1.5px currentColor;
  border-radius: 0;
  color: inherit;
  font: inherit;
  padding: 0.6rem 1rem;
  text-align: left;
}

.newsletter-email::placeholder { color: inherit; opacity: 0.6; }

/* focus: the border stays as it is (no second line, no heavier border); the text cursor shows where you type */
.newsletter-email:focus-visible {
  outline: none;
}

.newsletter-btn {
  color: var(--ui-color, #fff);
  font: inherit;
  background: none;
  cursor: pointer;
}

.newsletter-btn:hover {
  color: var(--pi-bg);
}

.newsletter-btn:hover .btn-border path {
  fill: var(--ui-color, #fff);
  stroke: var(--ui-color, #fff);
}

.newsletter-btn:disabled { opacity: 0.5; cursor: default; }

.newsletter-msg {
  min-height: 1.2em;
  margin: 0;
  text-align: center;
}

/* honeypot: off-screen, not display:none (some bots skip those) */
.newsletter-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

body.has-black-text .newsletter-form { color: var(--ui-color, #000); }
body.has-black-text .newsletter-btn { color: var(--ui-color, #000); }


/* Cart checkbox: own row under the checkout controls */
.cart-newsletter {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.cart-overlay .cart-newsletter {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.cart-checkout-form { flex-wrap: wrap; }

/* ── About page: the "Newsletter" pill opens a small window ───────────────── */

.about-newsletter-btn {
  background: none;
  font: inherit;
  cursor: pointer;
}

.about-newsletter-mobile { display: none; }

@media only screen and (max-width: 800px) {
  .about-newsletter-mobile {
    display: flex;
    justify-content: center;
    /* the Email / Instagram row above has a 2rem margin: pull the pill up to the same 0.8rem gap the pills have between them */
    margin: -1.2rem 0 2rem;
  }
}

.newsletter-dialog {
  /* the site's global reset removes the browser's centring of a modal <dialog> */
  position: fixed;
  inset: 0;
  margin: auto;
  height: fit-content;
  width: min(24rem, calc(100vw - 2rem));
  padding: 1.6rem 1.6rem 1.8rem;
  border: 1px solid #000;
  background: #fff;
  color: #000;
}

.newsletter-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.newsletter-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.newsletter-dialog-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.newsletter-dialog-close {
  display: flex;
  padding: 0.3rem;
  margin: -0.3rem -0.3rem -0.3rem 0;   /* the drawn cross lines up with the right edge of the field */
  background: none;
  border: 0;
  color: #000;
  cursor: pointer;
}

/* the form inside the window: black on white (the "body" selectors win over
   the black-text mode rule above, which would colour the form with --ui-color) */
body .newsletter-dialog .newsletter-form {
  margin-top: 1.4rem;
  color: #000;
}

body .newsletter-dialog .newsletter-email {
  width: 100%;
}

body .newsletter-dialog .newsletter-btn {
  color: #000;
}

body .newsletter-dialog .newsletter-btn:hover {
  color: #fff;
}

body .newsletter-dialog .newsletter-btn:hover .btn-border path {
  fill: #000;
  stroke: #000;
}

body .newsletter-dialog .btn-border path {
  stroke: #000;
}

/* no empty line under the button while there is no message */
.newsletter-dialog .newsletter-msg {
  min-height: 0;
}
