/* What is proper to the public components (docs/18, section 2.3): the offer card, its badges, the foot of a list and the states. It is loaded after ofertops-brand.css of Front.Theme, which has the colours and the prices. */
:root {
  --ui-ink: #1f1b2d;
  --ui-muted: #6b6580;
  --ui-line: #ebe5f3;
  --ui-mist: #f6f1fc;
}

/* Offer card */
.offer-card { border-radius: 1rem; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.offer-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.5rem -.25rem rgba(31, 27, 45, .16) !important; }
.offer-media { position: relative; height: 190px; display: flex; align-items: center; justify-content: center; padding: 1rem 1.5rem; }
.offer-media.level-normal { background: var(--of-bg-normal); }
.offer-media.level-buena { background: var(--of-bg-buena); }
.offer-media.level-oferton { background: var(--of-bg-oferton); }
.offer-media img { max-height: 150px; max-width: 100%; object-fit: contain; }
.offer-title { font-size: .95rem; line-height: 1.35; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; color: var(--ui-ink); }
.btn-buy { background: var(--of-pink-dark); border-color: var(--of-pink-dark); color: #fff; font-weight: 700; }
.btn-buy:hover, .btn-buy:focus { background: #c4145a; border-color: #c4145a; color: #fff; }

/* Badges on the photo */
.discount-badge { position: absolute; top: .75rem; right: .75rem; width: 62px; height: 62px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; color: #fff; }
.discount-badge.star { width: 74px; height: 74px; border-radius: 0; top: .4rem; right: .4rem;
  clip-path: polygon(50% 0%, 59% 17%, 75% 7%, 75% 25%, 93% 25%, 83% 41%, 100% 50%, 83% 59%, 93% 75%, 75% 75%, 75% 93%, 59% 83%, 50% 100%, 41% 83%, 25% 93%, 25% 75%, 7% 75%, 17% 59%, 0% 50%, 17% 41%, 7% 25%, 25% 25%, 25% 7%, 41% 17%); }
.level-pill { position: absolute; left: .75rem; bottom: .75rem; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-radius: 1rem; padding: .3rem .7rem; color: #fff; }

/* History facts under a card */
.history-facts { font-size: .75rem; color: var(--ui-muted); }
.history-facts strong { color: var(--ui-ink); }

/* Foot of a list: plain links, so it works without JavaScript */
.ui-pager { display: flex; justify-content: center; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; }
.ui-pager a { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1.5px solid var(--ui-line); color: var(--ui-ink); font-weight: 700; padding: 0 .9rem; text-decoration: none; }
.ui-pager a:hover { border-color: var(--of-purple); color: var(--of-purple); }
.ui-pager a.on { background: var(--of-purple); border-color: var(--of-purple); color: #fff; }
.ui-pager-gap { min-width: 24px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--ui-muted); }
@media (max-width: 575.98px) {
  /* On the phone only the current page between the steps. */
  .ui-pager-number:not(.on) { display: none; }
  .ui-pager-gap { display: none; }
}

/* States: nothing to show, a failure */
.ui-state { text-align: center; padding: 3rem 1rem; border: 2px dashed var(--ui-line); border-radius: 22px; }
.ui-state-icon { width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%; background: var(--ui-mist); color: var(--of-purple); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.ui-state-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.ui-state-error { border-color: #f3c8c8; }
.ui-state-error .ui-state-icon { background: #fde8e8; color: #b42318; }
.ui-btn { display: inline-flex; align-items: center; justify-content: center; background: var(--of-purple); color: #fff; font-weight: 800; border-radius: 12px; padding: .8rem 1.4rem; border: 0; text-decoration: none; }
.ui-btn:hover, .ui-btn:focus { background: #42107a; color: #fff; }

/* Loading: grey cards of the shape of an offer card */
.ui-loading { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.ui-loading-screen { min-height: 100vh; align-content: start; }
.ui-skel-card { border: 1px solid var(--ui-line); border-radius: 1rem; padding: 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.ui-skel { background: linear-gradient(90deg, #f1edf7 25%, #f8f5fc 50%, #f1edf7 75%); background-size: 200% 100%; border-radius: 10px; animation: ui-skel 1.4s infinite; }
.ui-skel-media { height: 150px; }
.ui-skel-line { height: 16px; }
.ui-skel-line.short { width: 40%; height: 14px; }
.ui-skel-line.long { width: 80%; }
.ui-skel-price { height: 34px; width: 55%; }
@keyframes ui-skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .ui-skel { animation: none; }
  .offer-card { transition: none; }
}

/* Price history chart (SVG). The mini one (Compact) goes in the cards: only the line and the dot. */
.chart-full { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--ui-line); }
.chart-label { font-size: 11px; fill: var(--ui-muted); }
.chart-area { fill: #f6effc; }
.chart-line { fill: none; stroke: var(--of-purple); stroke-width: 2; }
.chart-ref { stroke: var(--of-pink-dark); stroke-dasharray: 5 4; }
.chart-ref-label { font-size: 11px; font-weight: 600; fill: var(--of-pink-dark); stroke: #fff; stroke-width: 4px; paint-order: stroke; }
.chart-dot { fill: var(--of-pink); stroke: #fff; stroke-width: 2; }
.chart-compact .chart-line { stroke-width: 2.5; stroke-linejoin: round; }
.chart-compact .chart-dot { stroke-width: 1.5; }
