/* Flash sale page and block. Colours follow the D7 look: orange block,
   white-on-dark price notes, green for the sale price. */

/* The theme's product teaser is a Bootstrap grid column (col-md-3: float left,
   25% wide, padded) whose image is absolutely positioned. Outside a grid that
   spills out of its container, so wherever we use a teaser the container is the
   column: same fix as the used-guns timeline (arnzen-used-timeline.css). */
.rando-guns-block,
.rando-guns-current {
  display: flow-root;
}

.rando-guns-block .product-teaser,
.rando-guns-missed-card .product-teaser {
  float: none;
  width: auto;
  padding: 0;
  margin-bottom: 0;
}

.rando-guns-block .product-teaser.mb-60,
.rando-guns-missed-card .product-teaser.mb-60 {
  margin-bottom: 0;
}

.rando-guns-block .post-prev-img,
.rando-guns-missed-card .post-prev-img {
  position: relative;
  background: #fff;
}

.rando-guns-countdown {
  font-size: 1.2em;
  font-weight: bold;
  color: darkorange;
}

.rando-guns-stock {
  font-size: 1.3em;
  font-style: italic;
  font-weight: bold;
  line-height: 1.5em;
}

/* Contrast (WCAG): the theme's #777 text on darkorange was 1.9:1. On this lighter
   orange, the near-black text is 11.5:1, the navy countdown 11.8:1 and the dark
   link blue 9:1. */
.rando-guns-block {
  box-sizing: border-box;
  max-width: 400px;
  margin: 0 auto;
  padding: 10px;
  background: #ffd08a;
  color: #1f1f1f;
  text-align: center;
  cursor: pointer;
}

.rando-guns-block a {
  color: #0b2e6f;
  text-decoration: underline;
}

/* The teaser's own text is grey from the theme; darken it inside the block.
   :where() keeps this from out-ranking the more specific colours below. */
.rando-guns-block .product-teaser,
.rando-guns-block .product-teaser :where(div, span, a, p, h3, strong, del, em) {
  color: #1f1f1f;
}

.rando-guns-block .product-teaser .post-prev-title a {
  text-decoration: none;
}

/* The pickup badge is an inline-styled #d35400 (2.9:1 here); the struck-through
   regular price is red. Darken both for this background. */
.rando-guns-block .pickup-only-badge {
  color: #7a2f00 !important;
}

.rando-guns-block .commerce-product-field-commerce-price strike,
.rando-guns-block .commerce-product-field-commerce-price s {
  color: #9b1c14;
}

.rando-guns-block .rando-guns-notice,
.rando-guns-block .rando-guns-link {
  display: block;
  margin: 0 0 10px;
}

.rando-guns-block .rando-guns-countdown {
  color: #000072;
  font-size: 24px;
}

.rando-guns-block .rando-guns-stock {
  margin-top: 10px;
  text-align: center;
}

/* Missed guns: a grid of bordered cards that fills the width, as on the
   used-guns timeline. Each card is the teaser, then the unlock offer in a
   column beside it, vertically centred. */
.rando-guns-page {
  max-width: 1300px;
  margin: 0 auto;
}

.rando-guns-missed-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr));
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rando-guns-missed-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e3e3e3;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  list-style: none;
}

.rando-guns-missed-teaser {
  min-width: 0;
  text-align: center;
}

.rando-guns-missed-teaser .product-teaser {
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.rando-guns-unlock-offer {
  min-width: 0;
}

.rando-guns-unlock-offer p {
  margin: 0 0 4px;
}

/* "Sale price:" on a row of its own; then every price and the % off in one
   inline run, each piece kept whole so a wrap falls between pieces. */
.rando-guns-sale-label {
  font-weight: bold;
}

.rando-guns-prices {
  margin-bottom: 10px !important;
}

.rando-guns-prices > * {
  display: inline-block;
  white-space: nowrap;
  margin-right: 4px;
}

.rando-guns-sale {
  color: #00a000;
  font-size: 1.15em;
}

.rando-guns-percent-off {
  font-size: 0.9em;
}

.rando-guns-unlock-offer .form-actions {
  margin: 0 !important;
  width: 100%;
}

/* The theme's button has wide letter-spacing and padding; keep the label inside
   the column (the card clips overflow). The unlock control is a link styled as
   the theme's button. */
.rando-guns-unlock-offer a.rando-guns-unlock,
.rando-guns-unlock-offer input.rando-guns-unlock {
  display: block;
  text-align: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding-left: 6px;
  padding-right: 6px;
  letter-spacing: 0.05em;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 560px) {
  .rando-guns-missed-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rando-guns-title {
  margin-top: 0;
}

/* Corner ribbon on an unlocked card, top right: the mirror of the used-guns
   timeline's SOLD ribbon (arnzen-used-timeline.css). The card clips it. */
.rando-guns-ribbon {
  position: absolute;
  z-index: 5;
  top: 28px;
  right: -52px;
  width: 200px;
  padding: 6px 0;
  text-align: center;
  transform: rotate(45deg);
  background: #1e7e34;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* Confirmation page. */
.rando-guns-confirm-product {
  max-width: 1000px;
  margin: 30px auto 20px;
}

.rando-guns-confirm-details {
  max-width: 1000px;
  margin: 0 auto 20px;
  padding: 0;
  list-style: none;
  font-weight: bold;
}

#rando-guns-confirm-unlock-form .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

/* Sold out: the same corner ribbon in red, and a red note where the unlock
   button would be. The picture is dulled as on the used-guns timeline. */
.rando-guns-ribbon--sold {
  background: #b3261e;
}

.rando-guns-missed-card--sold .post-prev-img {
  filter: grayscale(0.6);
  opacity: 0.8;
}

.rando-guns-missed-it {
  margin: 0;
  color: #b3261e;
  font-size: 1.15em;
  font-weight: bold;
  text-align: center;
}

/* Not enough SWAG: same button, greyed out and not clickable. */
.rando-guns-unlock-offer .rando-guns-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rando-guns-insufficient {
  color: #b3261e;
}

/* "Picking the next flash sale gun..." while a pick is a few seconds late. */
.rando-guns-picking {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2em;
  font-weight: bold;
  color: #000072;
}

.rando-guns-block .rando-guns-picking {
  justify-content: center;
}

.rando-guns-spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: rando-guns-spin 0.9s linear infinite;
}

.rando-guns-dots span {
  animation: rando-guns-blink 1.2s infinite both;
}

.rando-guns-dots span:nth-child(2) { animation-delay: 0.2s; }
.rando-guns-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes rando-guns-spin {
  to { transform: rotate(360deg); }
}

@keyframes rando-guns-blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

/* The block's placeholder, shown in the cached page until js/flash-sale.js has
   fetched the gun: a shimmering rectangle about the size of the card. */
.rando-guns-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  margin: 10px 0;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0.25) 100%);
  background-size: 200% 100%;
  animation: rando-guns-shimmer 1.6s linear infinite;
}

@keyframes rando-guns-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rando-guns-spinner,
  .rando-guns-dots span,
  .rando-guns-skeleton {
    animation: none;
  }
}
