/* ============================================================
   POPUPS — basket drawer + auth modal
   Depends on design tokens in style.css
   ============================================================ */


/* ── Shared popup shell ──────────────────────────────────── */
.sf-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 800;
}

.sf-popup.is-open { display: block; }

.sf-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: sfFadeIn .22s ease;
}

@keyframes sfFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ============================================================
   BASKET POPUP — right-side drawer
   ============================================================ */
.basket-popup__panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: #161616;
  border-left: 1px solid rgba(255, 255, 255, .07);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.32, 0, .67, 0);
  z-index: 1;
}

.sf-popup.is-open .basket-popup__panel {
  transform: translateX(0);
  transition: transform .35s cubic-bezier(.33, 1, .68, 1);
}

/* Header */
.basket-popup__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  flex-shrink: 0;
}

.basket-popup__title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: .03em;
  color: var(--c-white);
}

.basket-popup__count {
  font-size: 13px;
  color: rgba(255, 255, 255, .35);
  font-family: var(--font-body);
  margin-left: 8px;
  font-weight: 400;
}

.basket-popup__close {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}

.basket-popup__close:hover {
  background: rgba(255, 255, 255, .12);
  color: var(--c-white);
}

.basket-popup__close svg { width: 18px; height: 18px; }

/* Body */
.basket-popup__body {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .08) transparent;
}

/* Items list */
.basket-popup__items { padding: 16px 24px; }
.basket-popup__items:empty { display: none; }

/* Empty state */
.basket-popup__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 28px;
  min-height: 320px;
}

.basket-popup__empty-icon {
  color: rgba(255, 255, 255, .1);
  margin-bottom: 24px;
}

.basket-popup__empty-title {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: .02em;
  color: var(--c-white);
  margin-bottom: 10px;
}

.basket-popup__empty-text {
  font-size: 14px;
  color: rgba(255, 255, 255, .4);
  line-height: 1.55;
  margin-bottom: 28px;
  max-width: 260px;
}

/* Footer (checkout bar — hidden until items present) */
.basket-popup__footer {
  padding: 18px 24px 24px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  flex-shrink: 0;
  display: none;
}

.basket-popup__footer.is-visible { display: block; }

.basket-popup__total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.basket-popup__total-label {
  font-size: 13px;
  color: rgba(255, 255, 255, .4);
}

.basket-popup__total-price {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--c-green);
  line-height: 1;
}


/* ============================================================
   AUTH POPUP — centered modal
   ============================================================ */
.auth-popup__wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1;
}

.auth-popup__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: #161616;
  border: 1px solid rgba(255, 255, 255, .1);
  padding: 36px 36px 32px;
  opacity: 0;
  transform: scale(.95) translateY(12px);
  transition: opacity .25s ease, transform .28s cubic-bezier(.34, 1.4, .64, 1);
}

.sf-popup.is-open .auth-popup__panel {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.auth-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, .06);
  border: none;
  color: rgba(255, 255, 255, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.auth-popup__close:hover {
  background: rgba(255, 255, 255, .1);
  color: var(--c-white);
}

.auth-popup__close svg { width: 16px; height: 16px; }

/* Logo */
.auth-popup__logo { margin-bottom: 24px; }
.auth-popup__logo img { height: 26px; display: block; }

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  margin-bottom: 26px;
}

.auth-tab {
  flex: 1;
  padding: 10px 0 11px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .04em;
  color: rgba(255, 255, 255, .35);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}

.auth-tab:hover { color: rgba(255, 255, 255, .65); }

.auth-tab.is-active {
  color: var(--c-white);
  border-bottom-color: var(--c-green);
}

/* Forms */
.auth-form { display: none; }
.auth-form.is-active { display: block; }

/* Field */
.auth-field { margin-bottom: 14px; }

.auth-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .38);
  margin-bottom: 7px;
}

.auth-input {
  width: 100%;
  height: 46px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--c-white);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 0 14px;
  outline: none;
  transition: border-color .2s, background .2s;
}

.auth-input::placeholder { color: rgba(255, 255, 255, .22); }

.auth-input:focus {
  border-color: rgba(153, 238, 45, .45);
  background: rgba(255, 255, 255, .07);
}

.auth-input.has-error {
  border-color: rgba(255, 80, 80, .55);
}

/* Inline error */
.auth-error {
  display: none;
  font-size: 12px;
  color: #ff7070;
  margin-top: 5px;
  line-height: 1.3;
}

.auth-error.is-visible { display: block; }

/* Forgot password */
.auth-forgot {
  display: block;
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, .32);
  text-decoration: none;
  margin-top: -4px;
  margin-bottom: 20px;
  transition: color .2s;
}

.auth-forgot:hover { color: var(--c-green); }

/* Submit */
.auth-submit {
  width: 100%;
  height: 50px;
  background: var(--c-green);
  color: #111;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .04em;
  border: none;
  cursor: pointer;
  clip-path: var(--clip-lg);
  transition: filter .2s ease, transform .15s ease;
  margin-bottom: 18px;
  margin-top: 4px;
}

.auth-submit:hover {
  filter: drop-shadow(0 0 20px rgba(153, 238, 45, .5)) brightness(1.06);
}

.auth-submit:active { transform: scale(.97); }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .22);
  margin-bottom: 14px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .07);
}

/* Steam button */
.auth-steam {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .75);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}

.auth-steam:hover {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .18);
  color: var(--c-white);
}

/* ============================================================
   BASKET ITEMS
   ============================================================ */
.basket-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.basket-item:last-child { border-bottom: none; }

.basket-item__img-wrap {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: center;
}

.basket-item__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.basket-item__info {
  flex: 1;
  min-width: 0;
}

.basket-item__name {
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.basket-item__price {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--c-green-light);
  line-height: 1;
}

.basket-item__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.basket-item__remove {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .07);
  color: rgba(255, 255, 255, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.basket-item__remove:hover {
  background: rgba(255, 70, 70, .12);
  border-color: rgba(255, 70, 70, .3);
  color: #ff7070;
}

.basket-item__qty {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, .09);
}

.basket-item__qty-btn {
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, .5);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.basket-item__qty-btn:hover {
  background: rgba(153, 238, 45, .1);
  color: var(--c-green-light);
}

.basket-item__qty-num {
  min-width: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border-left: 1px solid rgba(255, 255, 255, .09);
  border-right: 1px solid rgba(255, 255, 255, .09);
  padding: 0 4px;
  line-height: 26px;
  display: block;
}

/* ── Flash animation on add ───────────────────────────────── */
@keyframes sfAddFlash {
  0%   { filter: brightness(1); }
  40%  { filter: brightness(1.5) drop-shadow(0 0 6px rgba(153,238,45,.6)); }
  100% { filter: brightness(1); }
}
.sf-added { animation: sfAddFlash .7s ease; }


/* ============================================================
   WISHLIST BADGE (header icon)
   ============================================================ */
.header__wish-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 17px;
  height: 17px;
  border-radius: 0;
  background: var(--c-green-light);
  color: #111;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.header__wish-badge:empty { display: none; }


/* ============================================================
   WISH BUTTON — active & pop animation
   ============================================================ */
.product-card__wish.active svg,
.product-card__wish--filled svg {
  fill: #c0392b;
}
.product-card__wish.active,
.product-card__wish--filled {
  color: #c0392b;
}

@keyframes wishPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.product-card__wish.wish-pop svg { animation: wishPop .4s cubic-bezier(.34,1.56,.64,1); }


/* ============================================================
   WISHLIST GRID (wishlist.html)
   ============================================================ */
.wishlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

@media (max-width: 480px) {
  .wishlist-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}


/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .auth-popup__panel { padding: 28px 20px 24px; }
  .basket-popup__empty { padding: 48px 20px; }
}
