/* Boksalg – tillegg for bjerkreim.info */
.shop-notice {
  background: #f5f0e8;
  border-left: 5px solid #800000;
  padding: .85rem 1.2rem;
  margin: 1rem 0 2rem;
}

.shop-intro p {
  margin: 0 0 1rem;
}

.order-intro {
  margin: 0 0 1.4rem;
  line-height: 1.5;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2.5rem;
}

.book-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #d8d8d8;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.book-cover {
  aspect-ratio: 3/4;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-placeholder {
  padding: 1rem;
  text-align: center;
  color: #666;
  font-size: .9rem;
}

.book-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem;
}

.book-content h2 {
  font-size: 1.2rem;
  margin: .1rem 0 .5rem;
  line-height: 1.25;
}

.book-price {
  font-size: 1.15rem;
  font-weight: 700;
  color: #800000;
  margin: .4rem 0 1rem;
}

.book-content p {
  margin: .3rem 0 1rem;
}

.book-button {
  margin-top: auto;
  display: inline-block;
  text-align: center;
  background: #800000;
  color: #fff !important;
  padding: .7rem 1rem;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.book-button:hover,
.book-button:focus {
  background: #5d0000;
}

.book-card.is-sold-out {
  position: relative;
}

.book-card.is-sold-out::before {
  content: "Utsolgt";
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 0;
  background: #800000;
  color: #fff;
  padding: .45rem .8rem;
  font-weight: 700;
}

.book-card.is-sold-out .book-cover img {
  filter: grayscale(.50);
  opacity: .80;
}

.book-wanted {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  text-align: center;
  background: #1f1f1f;
  color: #fff !important;
  border: 0;
  padding: .7rem 1rem;
  text-decoration: none;
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.book-wanted:hover,
.book-wanted:focus {
  background: #414141;
  color: #fff !important;
}

.book-wanted[hidden],
.book-button[hidden] {
  display: none;
}

.order-section {
  max-width: 900px;
  margin: 2rem auto;
  padding: 1.25rem;
  background: #f7f7f7;
  border: 1px solid #ddd;
}

.order-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.order-field {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.order-field.full {
  grid-column: 1/-1;
}

.order-field label {
  font-weight: 600;
}

.order-field input,
.order-field select,
.order-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: .7rem;
  border: 1px solid #aaa;
  background: #fff;
  font: inherit;
}

.order-field textarea {
  min-height: 110px;
  resize: vertical;
}

.order-help {
  font-size: .9rem;
  color: #555;
}

.order-checkbox {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: .6rem;
}

.order-checkbox input {
  width: auto;
  flex: 0 0 auto;
  margin: .25rem 0 0;
}

.order-checkbox label {
  flex: 1;
  min-width: 0;
}

.order-submit {
  background: #800000;
  color: #fff;
  border: 0;
  padding: .85rem 1.4rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.order-submit:hover,
.order-submit:focus {
  background: #5d0000;
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.form-error {
  background: #fff0f0;
  border: 1px solid #aa0000;
  padding: 1rem;
  margin-bottom: 1rem;
}

@media (max-width:700px) {
  .order-grid {
    grid-template-columns: 1fr
  }

  .order-field.full {
    grid-column: auto
  }

  .book-grid {
    grid-template-columns: 1fr 1fr
  }
}


/* Bokdetaljer */
.book-open-detail {
  cursor: pointer;
}

.book-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: .6rem;
  margin-top: auto;
}

.book-actions .book-button {
  margin-top: 0;
}

.book-more {
  display: inline-block;
  text-align: center;
  background: #fff;
  color: #800000;
  border: 1px solid #800000;
  padding: .65rem .8rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.book-more:hover,
.book-more:focus {
  background: #f5f0e8;
}

.book-modal[hidden] {
  display: none;
}

.book-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.book-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
}

.book-modal-dialog {
  position: relative;
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  padding: 1.4rem;
}

.book-modal-close {
  position: absolute;
  right: .65rem;
  top: .45rem;
  border: 0;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

.book-modal-layout {
  display: grid;
  grid-template-columns: minmax(210px, 34%) 1fr;
  gap: 1.5rem;
  align-items: start;
}

.book-modal-cover {
  aspect-ratio: 3/4;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.book-modal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-modal-content h2 {
  padding-right: 2rem;
  margin-top: .2rem;
}

.book-modal-description {
  line-height: 1.6;
}

.book-modal-meta {
  margin: .25rem 0 1.15rem;
  padding: .8rem 1rem;
  background: #f5f0e8;
  border-left: 4px solid #800000;
}

.book-modal-meta > div {
  display: grid;
  grid-template-columns: minmax(80px, auto) 1fr;
  gap: .75rem;
}

.book-modal-meta dt { font-weight: 700; }
.book-modal-meta dd { margin: 0; }
.book-modal-meta [hidden] { display: none; }
.book-modal-description blockquote {
  margin: 1.25rem 0;
  padding: .1rem 0 .1rem 1rem;
  border-left: 4px solid #800000;
  font-style: italic;
}

.book-modal-actions {
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
  align-items: stretch;
}

.book-modal-actions .book-wanted {
  margin-top: 0;
  width: auto;
}

.order-steps p:first-child {
  margin-top: 0;
}

.order-steps p:last-child {
  margin-bottom: 0;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width:650px) {
  .book-modal-layout {
    grid-template-columns: 1fr
  }

  .book-modal-cover {
    max-width: 260px;
    width: 100%;
    margin: 0 auto
  }
}


/* Enkel handlekurv for flere ulike bøker */
.cart-field {
  background: #fff;
  border: 1px solid #d4d4d4;
  padding: 1rem;
}

.cart-empty {
  color: #666;
  padding: .8rem 0;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem;
  background: #f5f0e8;
  border-left: 4px solid #800000;
}

.cart-book {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.cart-book span {
  font-size: .9rem;
  color: #555;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.cart-controls label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
}

.cart-controls input {
  width: 68px;
  padding: .4rem;
}

.cart-remove {
  border: 1px solid #800000;
  background: #fff;
  color: #800000;
  padding: .45rem .65rem;
  cursor: pointer;
}

.cart-remove:hover,
.cart-remove:focus {
  background: #800000;
  color: #fff;
}

.cart-summary {
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid #ccc;
  text-align: right;
}

@media (max-width:600px) {
  .cart-row {
    align-items: flex-start;
    flex-direction: column
  }

  .cart-summary {
    text-align: left
  }
}


/* Mobiltilpasning: behold luft langs sidene som på resten av nettstedet */
/* Samme sideavstand for bokoversikten og bestillingsskjemaet */
.book-grid,
.order-section {
  box-sizing: border-box;
}

@media only screen and (max-width: 900px) {
  .boksalg-column,
  .order-column {
    padding-left: 20px;
    padding-right: 20px;
  }

  .order-section {
    margin-left: 0;
    margin-right: 0;
  }
}

@media only screen and (max-width: 700px) {
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .book-content {
    padding: .8rem;
  }

  .book-content h2 {
    font-size: 1rem;
  }

  .book-actions {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 420px) {
  .boksalg-column,
  .order-column {
    padding-left: 14px;
    padding-right: 14px;
  }

  .book-grid {
    gap: 10px;
  }
}

/* Samme sidebredde for bestillingsskjemaet som for bokoversikten */
@media only screen and (max-width: 900px) {
  .order-column {
    padding-left: 0;
    padding-right: 0;
  }
}

/* Skjul kortbeskrivelse og Les mer-knapp på mobil */
@media only screen and (max-width: 900px) {
  .book-content > p:not(.book-price),
  .book-actions > .book-more {
    display: none;
  }
}

.book-content > p:not(.book-price) {
  display: none;
}
