/**
 * Front-office styles for EU legal guarantee notice & GARAN label.
 * Colours follow Reg. (EU) 2025/1960: EU blue #003399 / #034ea2, yellow #FFED00 / #fff200.
 */

/* Notice trigger — visual tokens come from BO (inline CSS in header) */
.garan-notice-trigger {
  display: inline;
  margin: 0.25rem 0;
}

.garan-notice-trigger__link {
  /* font-size / weight / etc. come from BO inline CSS — do not use font shorthand here */
  cursor: pointer;
  text-underline-offset: 2px;
  box-sizing: border-box;
  border-style: solid;
}

.garan-notice-trigger__logo {
  /* height from BO inline CSS */
  display: block;
  width: auto;
  max-width: 8rem;
  object-fit: contain;
  flex: 0 0 auto;
}

.garan-notice-trigger__text {
  min-width: 0;
}

.garan-notice-trigger--header {
  margin: 0 0.5rem;
}

.garan-notice-block {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 2px solid #003399;
  background: #fff;
}

.garan-notice-block__title {
  margin: 0 0 0.5rem;
  color: #003399;
  font-size: 1.1rem;
}

.garan-notice-block__img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
}

/* Modal */
.garan-modal[hidden] {
  display: none !important;
}

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

.garan-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.garan-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border: 3px solid #003399;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.garan-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #003399;
  color: #fff;
}

.garan-modal__title {
  margin: 0;
  font-size: 1.05rem;
}

.garan-modal__close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.garan-modal__body {
  padding: 1rem;
}

.garan-modal--label .garan-modal__dialog {
  width: min(520px, 100%);
}

.garan-modal--label .garan-label__full-img {
  display: block;
  width: min(360px, 100%);
  height: auto;
  margin: 0 auto;
}

.garan-modal--label .garan-label__portal,
.garan-modal--label .garan-label__statement {
  margin-top: 0.85rem;
}

.garan-modal__img {
  display: block;
  width: 100%;
  height: auto;
}

.garan-modal__link,
.garan-notice-block__link,
.garan-label__portal {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.garan-modal__link a,
.garan-notice-block__link a,
.garan-label__portal a {
  color: #003399;
  text-decoration: underline;
}

/* GARAN label — nested strip as <img> (official SVG, theme-proof) */
.garan-label {
  margin: 0.75rem 0;
  max-width: 100%;
}

.garan-label__nested {
  appearance: none;
  -webkit-appearance: none;
  /* border / radius / max-width from BO inline CSS */
  border-style: solid;
  background: #fff;
  color: #231f20;
  padding: 0;
  cursor: pointer;
  display: inline-block;
  width: auto;
  max-width: 100%;
  line-height: 0;
  vertical-align: top;
  box-sizing: border-box;
}

/* hover/focus outline is set by BO-injected #garan-label-css (default: no outline) */

.garan-label__nested-img {
  /* fills the bordered button; max-width is on .garan-label__nested */
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Cart product row — under the line price */
.garan-label--cart {
  margin: 0.4rem 0 0;
}

.product-line__item--prices .garan-label,
.product-line__item-price-block .garan-label,
.product-line__item .garan-label,
.cart-item .garan-label {
  max-width: 100%;
}

.product-line__item-price-block {
  margin-top: 0.35rem;
  width: 100%;
}

.garan-label__panel[hidden] {
  display: none !important;
}

.garan-label__panel {
  /* padding / border / radius / bg / max-width from BO inline CSS */
  margin-top: 0.75rem;
  border-style: solid;
  box-sizing: border-box;
}

.garan-label--mode-full .garan-label__panel {
  margin-top: 0;
}

.garan-label__full {
  overflow: auto;
}

.garan-label__full-img {
  /* width from BO inline CSS */
  display: block;
  height: auto;
  max-width: 100%;
}

.garan-statement {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #231f20;
}

.garan-statement h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  color: #034ea2;
}

.garan-statement__reminder,
.garan-statement__producer {
  margin: 0 0 0.65rem;
}

.garan-statement__details {
  margin: 0 0 0.35rem;
  border: 1px solid #d7dee3;
  border-radius: 3px;
  background: #fafbfc;
}

.garan-statement__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  color: #034ea2;
  user-select: none;
}

.garan-statement__summary::-webkit-details-marker {
  display: none;
}

.garan-statement__summary::after {
  content: '';
  flex: 0 0 auto;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  opacity: 0.85;
}

.garan-statement__details[open] > .garan-statement__summary::after {
  transform: rotate(-135deg);
  margin-top: 0.2rem;
}

.garan-statement__summary:hover {
  background: rgba(3, 78, 162, 0.04);
}

.garan-statement__body {
  padding: 0 0.75rem 0.75rem;
  border-top: 1px solid #e6ebef;
}

.garan-statement__body > :first-child {
  margin-top: 0.65rem;
}

.garan-statement__body > :last-child {
  margin-bottom: 0;
}

.garan-statement__block {
  margin: 0 0 0.65rem;
}

.garan-statement__block strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #034ea2;
}

.garan-checkout {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px dashed #003399;
  background: #f7f9fc;
}

.garan-checkout .garan-notice-trigger {
  margin: 0 0 0.75rem;
}

/* Visually hidden accessible text */
.garan-label .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 575px) {
  .garan-modal__dialog {
    max-height: 96vh;
  }

}

