/**
 * siw_openingstijden — frontend styling.
 *
 * Erft bewust de kleuren en typografie van het thema (currentColor, inherit,
 * Bootstrap-classes). Geen eigen kleurenpalet, zodat de widget automatisch
 * meebeweegt met de rest van de webshop.
 *
 * Maker: Elmar van Sterk In Web
 */

/* ---------- Widget ---------- */

/* Titel bewust iets kleiner dan de omliggende blok-titels in de footer,
   zodat de widget dezelfde verhouding houdt als de vorige implementatie. */
.siw-ot-title {
  font-size: 1rem;
  margin-bottom: 8px;
}

.siw-ot-widget {
  border: 1px solid rgba(128, 128, 128, 0.3);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.siw-ot-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  margin: 0 0 4px;
}

.siw-ot-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.siw-ot-status--open {
  color: #28a745;
}

.siw-ot-status--closed {
  color: #dc3545;
}

/* Tekst na de status weer in themakleur; alleen het bolletje blijft gekleurd. */
.siw-ot-today {
  margin: 0 0 12px;
  opacity: 0.85;
}

.siw-ot-next {
  display: block;
  opacity: 0.75;
}

.siw-ot-week {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.siw-ot-week th,
.siw-ot-week td {
  padding: 3px 0;
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}

.siw-ot-week td {
  text-align: right;
  white-space: nowrap;
}

.siw-ot-week-today th,
.siw-ot-week-today td {
  font-weight: 700;
}

.siw-ot-closed {
  opacity: 0.6;
}

.siw-ot-exceptions-btn {
  display: block;
  width: 100%;
  margin-top: 4px;
}

/* ---------- Modal afwijkende dagen ---------- */

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

.siw-ot-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.siw-ot-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.siw-ot-modal-dialog {
  position: relative;
  background: #fff;
  color: #232323;
  border-radius: 6px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.siw-ot-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.siw-ot-modal-header .h5 {
  margin: 0;
}

.siw-ot-modal-close {
  background: none;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0 4px;
}

.siw-ot-modal-close:hover {
  opacity: 1;
}

.siw-ot-modal-body {
  padding: 8px 24px 24px;
  overflow-y: auto;
}

.siw-ot-exceptions {
  width: 100%;
  border-collapse: collapse;
}

.siw-ot-exceptions th,
.siw-ot-exceptions td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.siw-ot-exceptions thead th {
  font-weight: 700;
  background: rgba(0, 0, 0, 0.03);
}

.siw-ot-exception-date {
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- Topbalk-melding (oranje, zoals de winkelwagen-melding) ---------- */

.siw-ot-headerbar {
  background: #ff9a52;
  color: #1a1a1a;
  font-size: 0.8rem;
}

.siw-ot-headerbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 15px;
}

/* Slides over elkaar (grid-stacking): de balkhoogte blijft gelijk aan de
   hoogste slide, dus geen inklappen/springen tijdens het wisselen. */
.siw-ot-headerbar-slides {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}

.siw-ot-headerbar-slide {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  opacity: 0;
  visibility: hidden;
}

.siw-ot-headerbar-slide.is-active {
  opacity: 1;
  visibility: visible;
}

/* Alleen bij meerdere meldingen crossfaden; bij één melding direct zichtbaar. */
.siw-ot-headerbar--rotating .siw-ot-headerbar-slide {
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.siw-ot-headerbar--rotating .siw-ot-headerbar-slide.is-active {
  transition: opacity 0.5s ease, visibility 0s linear 0s;
}

.siw-ot-headerbar-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Datum als badge — duidelijk onderscheiden van de meldingstekst. */
.siw-ot-headerbar-period {
  flex: 0 0 auto;
  white-space: nowrap;
  background: #1a1a1a;
  color: #ff9a52;
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 999px;
}

/* Kleine teller (1/2) rechts, alleen zichtbaar bij meerdere meldingen. */
.siw-ot-headerbar-counter {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.18);
  color: #1a1a1a;
}

.siw-ot-headerbar-close {
  background: none;
  border: 0;
  color: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  flex: 0 0 auto;
  padding: 0 4px;
}

.siw-ot-headerbar-close:hover {
  opacity: 1;
}

/* ---------- Box-melding (winkelwagen, afrekenen, productpagina, ophaal-popup) ---------- */

.siw-ot-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.siw-ot-notice-icon {
  font-size: 1.2rem;
  flex: 0 0 auto;
}

.siw-ot-notice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.siw-ot-notice-period {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85em;
  opacity: 0.8;
}

.siw-ot-notice-period .material-icons {
  font-size: 1em;
}

/* Op de productpagina wat compacter, direct boven de USP's. */
.siw-ot-notice--product {
  margin-bottom: 1rem;
}

/* ---------- Responsive (tablet is een eersteklas viewport) ---------- */

@media (max-width: 1024px) {
  .siw-ot-headerbar-inner {
    align-items: flex-start;
  }
}

@media (max-width: 767px) {
  .siw-ot-exceptions th,
  .siw-ot-exceptions td {
    padding: 10px 6px;
    font-size: 0.9rem;
  }

  .siw-ot-exception-date {
    white-space: normal;
  }

  .siw-ot-modal-header,
  .siw-ot-modal-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}
