/* ============================================================
   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: 16px;
  z-index: 1;
}

.auth-popup__panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--cs-bg-card, #0D1018);
  border: 1px solid rgba(245, 34, 45, 0.22);
  border-radius: 16px;
  padding: 40px 40px 36px;
  opacity: 0;
  transform: scale(.95) translateY(12px);
  transition: opacity .25s ease, transform .28s cubic-bezier(.34, 1.4, .64, 1);
  overflow: hidden;
  box-shadow:
    0 0 60px rgba(245, 34, 45, 0.10),
    0 0 120px rgba(245, 34, 45, 0.05),
    0 24px 80px rgba(0, 0, 0, .65);
}

/* Top red accent glow line */
.auth-popup__panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 34, 45, 0.75), transparent);
  pointer-events: none;
}

.sf-popup.is-open .auth-popup__panel {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.auth-popup__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  color: rgba(255, 255, 255, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  z-index: 2;
}

.auth-popup__close:hover {
  background: rgba(245, 34, 45, .15);
  color: var(--cs-red, #F5222D);
  border-color: rgba(245, 34, 45, .3);
}

.auth-popup__close svg { width: 16px; height: 16px; }

/* Logo */
.auth-popup__logo { margin-bottom: 28px; }
.auth-popup__logo img { height: 26px; display: block; }

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 10px 0 12px;
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .04em;
  color: var(--cs-txt2, rgba(255, 255, 255, .4));
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color .2s, border-color .2s;
}

.auth-tab:hover { color: var(--cs-txt, #F0F2F8); }

.auth-tab.is-active {
  color: var(--c-white);
  border-bottom-color: var(--cs-red, #F5222D);
}

/* Forms */
.auth-form { display: none; }

.auth-form.is-active {
  display: flex;
  flex-direction: column;
}

/* Steam (primary CTA) floated to top via flex order */
.auth-form .auth-steam   { order: -10; margin-bottom: 20px; margin-top: 0; }
.auth-form .auth-divider { order: -9;  }
.auth-form .auth-field   { order: 0;   }
.auth-form .auth-forgot  { order: 1;   }
.auth-form .auth-submit  { order: 2;   }

/* Field */
.auth-field { margin-bottom: 14px; }

.auth-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cs-txt2, rgba(255, 255, 255, .38));
  margin-bottom: 7px;
}

.auth-input {
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  color: var(--cs-txt, #F0F2F8);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 0 14px;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
}

.auth-input::placeholder { color: var(--cs-txt3, rgba(255, 255, 255, .22)); }

.auth-input:focus {
  border-color: rgba(245, 34, 45, .5);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(245, 34, 45, .1);
}

.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: var(--cs-txt2, rgba(255, 255, 255, .32));
  text-decoration: none;
  margin-top: -4px;
  margin-bottom: 20px;
  transition: color .2s;
}

.auth-forgot:hover { color: var(--cs-red, #F5222D); }

/* Submit — secondary CTA (ghost style) */
.auth-submit {
  width: 100%;
  height: 48px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  color: var(--c-white);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: .06em;
  clip-path: none;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  margin-bottom: 0;
  margin-top: 0;
}

.auth-submit:hover {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .22);
}

.auth-submit:active { transform: scale(.98); }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--cs-txt3, rgba(255, 255, 255, .22));
  margin-bottom: 18px;
  margin-top: 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, .06);
}

/* Steam — PRIMARY CTA (red-orange gradient, angular clip) */
.auth-steam {
  width: 100%;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--cs-red, #F5222D) 0%, var(--cs-orange, #FF6B00) 100%);
  border: none;
  color: var(--c-white);
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: .05em;
  clip-path: var(--clip-lg);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: filter .2s ease, transform .15s ease;
}

/* Shine sweep on hover */
.auth-steam::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .14) 50%, transparent 60%);
  transform: translateX(-110%);
  transition: transform .55s ease;
  pointer-events: none;
}

.auth-steam:hover::before { transform: translateX(110%); }

.auth-steam:hover {
  filter: brightness(1.08) drop-shadow(0 0 18px rgba(245, 34, 45, .45));
}

.auth-steam:active { transform: scale(.97); }

/* ============================================================
   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;
    border-radius: 12px;
    max-width: 100%;
  }
  .auth-steam {
    height: 50px;
    font-size: 18px;
  }
  .auth-submit {
    height: 46px;
    font-size: 16px;
  }
  .basket-popup__empty { padding: 48px 20px; }
}
