/**
 * Clyro Promo - Front-Office Stylesheet
 * Pixel-perfect implementation matching Clyro brand styling (Graphite & Accent Lime #C7FF2E)
 */

/* ==========================================================================
   1. Price Box "Cena z kodem" (Idealnie dopasowany do szerokości buy-boxa)
   ========================================================================== */
.clyro-promo-price-box {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 12px 0 16px 0 !important;
  padding: 8px 10px 8px 16px !important;
  border-radius: 10px !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  background-color: #C7FF2E !important;
  box-shadow: 0 2px 8px rgba(199, 255, 46, 0.25);
  box-sizing: border-box !important;
}

.clyro-promo-price-box__code-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: #111417;
  white-space: nowrap;
  flex: 1;
}

.clyro-promo-price-box__label {
  font-weight: 600;
  color: #111417;
  white-space: nowrap;
}

.clyro-promo-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(17, 20, 23, 0.08);
  border: 1px dashed rgba(17, 20, 23, 0.35);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  color: #111417;
  font-family: inherit;
  white-space: nowrap;
}

.clyro-promo-copy-btn:hover {
  background: rgba(17, 20, 23, 0.16);
  border-color: #111417;
  transform: translateY(-1px);
}

.clyro-promo-copy-btn:active {
  transform: translateY(0);
}

.clyro-promo-code-name {
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
  color: #111417;
}

.clyro-promo-copy-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  flex-shrink: 0;
  color: #111417;
}

.clyro-promo-copy-icon-wrapper svg {
  display: block;
}

/* Tooltip "Skopiowano!" */
.clyro-copy-tooltip {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background-color: #111417;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

.clyro-copy-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: #111417 transparent transparent transparent;
}

.clyro-copy-tooltip.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Pigułka z przeliczoną ceną */
.clyro-promo-price-box__amount {
  background-color: #111417;
  border-radius: 8px;
  padding: 6px 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}

.clyro-promo-final-price {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.3px;
  color: #C7FF2E;
  white-space: nowrap;
}


/* ==========================================================================
   2. Description Box "Box nad opisem" (Screenshot 2)
   ========================================================================== */
.clyro-promo-desc-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 24px;
  border-radius: 12px;
  background-color: #f4f6f8;
  border: 1px solid #eef0f3;
  margin: 0 0 24px 0;
  box-sizing: border-box;
}

.clyro-promo-desc-box__icon-wrap {
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111417;
}

.clyro-promo-desc-box__icon-wrap svg {
  display: block;
}

.clyro-promo-desc-box__content {
  flex: 1;
}

.clyro-promo-desc-box__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  line-height: 1.35;
  color: #111417;
}

.clyro-promo-desc-box__body {
  font-size: 0.96rem;
  line-height: 1.55;
  color: #344054;
}

.clyro-promo-desc-box__body p:last-child {
  margin-bottom: 0;
}

.clyro-promo-desc-box__body a {
  color: #111417;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: #C7FF2E;
  text-underline-offset: 3px;
  transition: opacity 0.2s ease;
}

.clyro-promo-desc-box__body a:hover {
  opacity: 0.8;
}


/* ==========================================================================
   3. Top Bar z Licznikiem Czasu (Styl Clyro - Graphite & Accent Lime)
   ========================================================================== */
.clyro-promo-topbar {
  width: 100%;
  padding: 8px 0;
  background-color: #111417;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  z-index: 1010;
  box-sizing: border-box;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.clyro-promo-topbar--sticky {
  position: sticky;
  top: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.clyro-promo-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  position: relative;
  min-height: 32px;
}

.clyro-promo-topbar__main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px 20px;
  flex-wrap: wrap;
  text-align: center;
}

.clyro-promo-topbar__text {
  font-weight: 600;
  letter-spacing: 0.1px;
  color: #ffffff;
}

.clyro-promo-countdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.clyro-promo-countdown__label {
  font-weight: 500;
  color: #8A9096;
}

.clyro-promo-countdown__timer {
  font-weight: 800;
  color: #ffffff !important;
  letter-spacing: 0.6px;
  font-variant-numeric: tabular-nums;
}

.clyro-promo-topbar__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clyro-promo-topbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none !important;
  outline: none !important;
  border-radius: 50px;
  padding: 4px 18px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background-color: #C7FF2E !important;
  color: #111417 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(199, 255, 46, 0.35);
}

.clyro-promo-topbar__btn:hover {
  background-color: #b5ee24 !important;
  color: #000000 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(199, 255, 46, 0.5);
}

.clyro-promo-topbar__close {
  background: transparent;
  border: none;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.65;
  color: #8A9096;
  transition: opacity 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.clyro-promo-topbar__close:hover {
  opacity: 1;
  color: #ffffff;
  transform: scale(1.1);
}


/* ==========================================================================
   4. Ribbon / Badge (Wstążka zintegrowana z flagami motywu)
   ========================================================================== */
.product-flags .product-flag.clyro-promo-flag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  border-radius: 9999px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
  background-color: #C7FF2E !important;
  color: #111417 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  hyphens: none !important;
  line-height: 1.1 !important;
  width: auto !important;
  max-width: max-content !important;
  flex-shrink: 0 !important;
}


/* ==========================================================================
   5. Responsywność (Mobile / Tablet)
   ========================================================================== */
@media (max-width: 991.98px) {
  .clyro-promo-topbar {
    padding: 6px 0;
    font-size: 12.5px;
  }
  
  .clyro-promo-topbar__inner {
    gap: 8px 12px;
  }

  .clyro-promo-topbar__main {
    gap: 6px 12px;
  }

  .clyro-promo-countdown__timer {
    color: #ffffff !important;
  }

  .clyro-promo-topbar__btn {
    padding: 3px 14px;
    font-size: 12px;
  }

  .clyro-promo-price-box {
    width: 100% !important;
    margin: 10px 0 14px 0 !important;
    padding: 7px 8px 7px 12px !important;
    gap: 8px;
  }

  .clyro-promo-price-box__code-wrap {
    font-size: 13px;
  }

  .clyro-promo-price-box__amount {
    padding: 4px 12px;
  }

  .clyro-promo-final-price {
    font-size: 1.15rem;
  }

  .clyro-promo-desc-box {
    padding: 14px 16px;
    gap: 12px;
  }

  .clyro-promo-desc-box__title {
    font-size: 1.05rem;
  }

  .clyro-promo-desc-box__body {
    font-size: 0.9rem;
  }
}
