/* ============================================================
   popup.css – HJMC Popup (Hjørgunn raffinert)
   - ID-scopet: #modular-booking-popup
   - Matcher kalenderens rene uttrykk + Hjørgunn-farger
   - Fikser wrapper rundt "Hele uken" (duration-option)
============================================================ */

#modular-booking-popup.hidden { display: none; }

/* Root overlay */
#modular-booking-popup{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  font-family: "Inter", "Nunito", Arial, sans-serif;
}

/* Viktig: når aria-hidden true skal overlay ikke kunne blokkere klikk */
#modular-booking-popup[aria-hidden="true"]{
  display: none;
  pointer-events: none;
}

/* Scrim */
#modular-booking-popup .popup-scrim{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.38);
  cursor: pointer;
}

/* Sheet */
#modular-booking-popup .popup-sheet{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: 92vw;
  background: #fffefb;
  border-radius: 16px;
  box-shadow: 0 14px 44px rgba(0,0,0,0.22);
  overflow: hidden;
}

/* Header */
#modular-booking-popup .popup-header{
  padding: 16px 20px;
  border-bottom: 1px solid #eadfce;
  background: #fdf7ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#modular-booking-popup .popup-title{
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: #5a4a39;
}

#modular-booking-popup #modular-popup-close{
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: #5a4a39;
  padding: 6px 8px;
  border-radius: 10px;
}
#modular-booking-popup #modular-popup-close:hover{
  background: rgba(90,74,57,0.08);
}

/* Body */
#modular-booking-popup .popup-body{
  padding: 20px;
}

/* Valg-liste */
#modular-booking-popup .duration-row{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  background: none !important;
  box-shadow: none !important;
}

/* Standard-knapp */
#modular-booking-popup .duration-btn{
  width: 100%;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid #eadfce;
  background: #fbf6ed;
  color: #4e4030;
  font-weight: 650;
  font-size: 15px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

#modular-booking-popup .duration-btn:hover:not(.disabled):not(.active){
  background: #ffdf8a;
  color: #1a140d;
  border-color: #f5cf6b;
}

/* Aktiv */
#modular-booking-popup .duration-btn.active{
  background: #ffc325 !important;
  border-color: #e5a900 !important;
  color: #1a140d !important;
  font-weight: 750;
  box-shadow: 0 4px 12px rgba(255,195,37,0.28);
}

/* Disabled */
#modular-booking-popup .duration-btn.disabled{
  opacity: .35;
  cursor: not-allowed;
}

/* ------------------------------------------------------------
   "Hele uken" wrapper fix
   Markup: <div class="duration-option week-option">...</div>
   Vi gjør wrapperen helt transparent og lar knappen være 100% normal.
------------------------------------------------------------ */
#modular-booking-popup .duration-option{
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  display: block;
}

#modular-booking-popup .week-option{
  position: relative;
}

/* Badge (tomt innhold = skjul automatisk hvis JS ikke setter tekst) */
#modular-booking-popup .week-saving-badge{
  position: absolute;
  top: -10px;
  right: 14px;
  background: #d83a3a;
  color: #fff;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,0.16);
  display: none; /* vises kun når den har tekst */
}

/* Hvis badge får tekst, vis den */
#modular-booking-popup .week-saving-badge:not(:empty){
  display: inline-block;
}

/* Footer */
#modular-booking-popup .popup-footer{
  padding: 14px 20px;
  background: #f9f6f2;
  border-top: 1px solid #e0d5c2;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

#modular-booking-popup .popup-btn{
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  transition: 0.18s;
  font-weight: 700;
}

/* Avbryt */
#modular-booking-popup .popup-btn.cancel{
  background: #fff;
  border: 1px solid #ded2c4;
  color: #5a4a39;
}
#modular-booking-popup .popup-btn.cancel:hover{
  background: #f1ece4;
}

/* Bekreft */
#modular-booking-popup .popup-btn.confirm{
  background: #ffc325;
  color: #1f1a12;
  border: 1px solid #e5a900;
  box-shadow: 0 2px 10px rgba(255,195,37,0.25);
}
#modular-booking-popup .popup-btn.confirm:hover{
  background: #ffd147;
}

/* Disabled confirm */
#modular-booking-popup .popup-btn.confirm:disabled{
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Summary (nederst i sheet) */
#modular-booking-popup .popup-summary{
  padding: 12px 20px 18px;
  background: #fffefb;
  border-top: 1px solid #eadfce;
  color: #5a4a39;
  font-size: 14px;
}
#modular-booking-popup .popup-summary p{
  margin: 4px 0;
}
#modular-booking-popup .popup-summary strong{
  color: #1a140d;
}

/* Mobil: bottom sheet */
@media (max-width: 640px){
  #modular-booking-popup .popup-sheet{
    top: auto;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }
}
