/* AliPromocje (redesign 2026) - komponenty stron promocji AliExpress.
   Ladowany PO tokens.css + app.css; korzysta z tych samych tokenow (light/dark). */

/* ---------- okruszki ---------- */
.ap-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 14px 0 0; }
.ap-crumbs a { color: var(--muted); text-decoration: none; }
.ap-crumbs a:hover { color: var(--accent-text); }
.ap-crumbs [aria-current] { color: var(--fg); font-weight: 600; }

/* ---------- pasek wydarzenia (status + odliczanie) ---------- */
.ap-eventbar { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; box-shadow: 0 8px 24px -16px var(--shadow); }
.ap-eventbar__ic { flex: none; width: 44px; height: 44px; border-radius: 13px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; }
.ap-eventbar__body { flex: 1; min-width: 200px; }
.ap-eventbar__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ap-eventbar__cd { font-family: var(--font-display); font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.25; }
.ap-eventbar__dates { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ap-eventbar .ap-btn { flex: none; }

/* ---------- karty wyroznien ---------- */
.ap-hl { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 600px) { .ap-hl { grid-template-columns: repeat(3, 1fr); } }
.ap-hl__card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent-2);
  border-radius: var(--r-md); padding: 13px 14px; display: flex; flex-direction: column; gap: 5px; }
.ap-hl__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ap-hl__text { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.ap-hl__text a { color: var(--accent-text); }

/* ---------- naglowek sekcji z linkiem "wszystkie" ---------- */
.ap-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ap-section__head .ap-section__title { margin: 0; }
.ap-section__link { font-size: 13px; font-weight: 600; color: var(--accent-text); text-decoration: none; white-space: nowrap; }
.ap-section__link:hover { text-decoration: underline; }

/* ---------- karuzela kuponow (strona glowna promocji) ---------- */
.ap-carousel { position: relative; }
.ap-carousel__track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ap-carousel__track::-webkit-scrollbar { display: none; }
.ap-carousel__track > * { scroll-snap-align: start; }

/* kompaktowy wariant kuponu w karuzeli: pasek wartosci na gorze, tresc pod spodem */
.ap-carousel .ap-cpn { flex: none; width: min(300px, 80vw); flex-direction: column; }
.ap-carousel .ap-cpn__value { width: 100%; flex-direction: row; justify-content: center; align-items: baseline; gap: 8px;
  border-right: none; border-bottom: 2px dashed var(--field-line); padding: 12px 10px; }
.ap-carousel .ap-cpn__value .v { font-size: 26px; }
.ap-carousel .ap-cpn__body { flex: 1; }
.ap-carousel .ap-cpn__title { font-size: 13.5px; }
.ap-carousel .ap-cpn__code { flex: 1 1 100%; text-align: center; }
.ap-carousel .ap-cpn__row .ap-btn { flex: 1 1 auto; padding: 0 10px; font-size: 12px; }
.ap-carousel .ap-cpn__meta { margin-top: auto; }

/* karta koncowa "zobacz wszystkie" */
.ap-carousel__more { flex: none; width: min(200px, 56vw); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; background: var(--accent-soft); border: 1.5px dashed var(--accent);
  border-radius: var(--r-lg); color: var(--accent-text); text-decoration: none; font-family: var(--font-display);
  font-weight: 700; font-size: 14px; text-align: center; padding: 16px; }
.ap-carousel__more:hover { filter: brightness(1.03); }

/* strzalki (tylko desktop; na mobile przewijanie palcem) */
.ap-carousel__btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--fg); display: none;
  align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 6px 16px -8px var(--shadow); }
.ap-carousel__btn:hover { border-color: var(--field-line); }
.ap-carousel__btn:disabled { opacity: .35; cursor: default; }
.ap-carousel__btn--prev { left: -16px; }
.ap-carousel__btn--next { right: -16px; }
@media (min-width: 1024px) { .ap-carousel__btn { display: flex; } }

/* ---------- kupon (czysty HTML/CSS, bez PNG - przyjazne automatowi) ---------- */
.ap-cpnlist { display: flex; flex-direction: column; gap: 12px; }
.ap-cpn { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ap-cpn__value { flex: none; width: 108px; background: var(--accent-soft); color: var(--accent);
  border-right: 2px dashed var(--field-line); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 14px 8px; text-align: center; }
.ap-cpn__value .v { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1; letter-spacing: -.02em; }
.ap-cpn__value .m { font-size: 11px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.ap-cpn__body { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.ap-cpn__title { font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 1.3; }
.ap-cpn__meta { font-size: 12px; color: var(--muted); }
.ap-cpn__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-cpn__code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; font-weight: 700;
  background: var(--surface-2); border: 1.5px dashed var(--field-line); border-radius: 10px; padding: 8px 12px; letter-spacing: .04em; }
.ap-cpn__row .ap-btn { height: 38px; padding: 0 14px; font-size: 12.5px; }
.ap-cpn__badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 9px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; }
.ap-tag--ok { background: var(--ok-soft); color: var(--ok); }
.ap-tag--warn { background: var(--warn-soft); color: var(--warn); }
.ap-tag--info { background: var(--info-soft); color: var(--info); }
.ap-tag--muted { background: var(--surface-2); color: var(--muted); }

/* warianty stanow */
.ap-cpn--soon .ap-cpn__value { background: var(--warn-soft); color: var(--warn); }
.ap-cpn--future .ap-cpn__value { background: var(--surface-2); color: var(--muted); }
.ap-cpn--expired { opacity: .62; }
.ap-cpn--expired .ap-cpn__value { background: var(--surface-2); color: var(--muted); }
.ap-cpn--expired .ap-cpn__code { text-decoration: line-through; }

/* zwarta siatka wygaslych */
.ap-expgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .ap-expgrid { grid-template-columns: repeat(3, 1fr); } }
.ap-expgrid__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; text-align: center; }
.ap-expgrid__item s { display: block; font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--muted); }
.ap-expgrid__item small { font-size: 11.5px; color: var(--muted); }

/* ---------- oferty (siatka) ---------- */
.ap-deals { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .ap-deals { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .ap-deals { grid-template-columns: repeat(3, 1fr); } }
.ap-deal { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: inherit; }
.ap-deal:hover { border-color: var(--field-line); }
.ap-deal__imgwrap { aspect-ratio: 1 / 1; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ap-deal__imgwrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-deal__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.ap-deal__name { font-size: 13px; line-height: 1.4; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-deal__price { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--accent-text); }
.ap-deal__meta { font-size: 11.5px; color: var(--muted); margin-top: auto; }

/* ---------- spis stron promocyjnych ---------- */
.ap-promolinks { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 600px) { .ap-promolinks { grid-template-columns: repeat(2, 1fr); } }
.ap-promolinks a { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 13px; text-decoration: none; color: var(--fg); font-size: 13px; font-weight: 600; }
.ap-promolinks a:hover { border-color: var(--field-line); color: var(--accent-text); }
.ap-promolinks a svg { flex: none; }

/* ---------- FAQ ---------- */
.ap-faq details { border-bottom: 1px solid var(--line); }
.ap-faq details:last-child { border-bottom: none; }
.ap-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 13px 2px; font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.ap-faq summary::-webkit-details-marker { display: none; }
.ap-faq summary::after { content: '+'; font-size: 18px; color: var(--muted); font-weight: 600; }
.ap-faq details[open] summary::after { content: '\2212'; }
.ap-faq .a { font-size: 13.5px; color: var(--muted); line-height: 1.55; padding: 0 2px 14px; }

/* Przycisk "Kopiuj kod" po kliknięciu (promo.js): zielony z ptaszkiem przez 2,5 s */
.ap-btn.is-copied { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); gap: 6px; }
