/* Side Menu */
.menu {
  position: fixed;
  top: 0;
  right: -270px;
  width: 270px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 70px;
  background-color: rgba(75, 0, 130, 0.4);   /* semi-transparent purple */
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -6px 0 30px rgba(0, 0, 0, 0.4);
  transition: right 0.3s ease;
  z-index: 5000;
  overflow-y: auto;
}

/* Side Menu Open State */
.menu.open {
  right: 0;
}

/* Close Button */
.menu .close-btn {
  font-size: 30px;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

/* Side Menu Links */
.menu a {
  color: white;
  padding: 20px;
  text-decoration: none;
  text-align: center;
  font-size: 1.2rem;
  display: block;
}

/* Improve hit area + visuals for menu items (edge-to-edge highlight) */
.menu a,
.menu [role="menuitem"] {
  position: relative;
  display: block;
  border-radius: 0;          /* no rounded pill */
  margin: 0;                 /* remove side gaps so background fills width */
  padding: 14px 22px;        /* comfortable text padding */
  left: 0;                   /* override any earlier offset */
  transition: background-color .2s, transform .08s ease;
}

/* Visible highlight on hover + keyboard focus (full width, no box outline) */
.menu a:hover,
.menu a:focus-visible,
.menu a.is-hover,
.menu [role="menuitem"]:hover,
.menu [role="menuitem"]:focus-visible,
.menu [role="menuitem"].is-hover {
  background-color: rgba(255, 255, 255, 0.18);
  box-shadow: none;
  outline: none;
}

/* Active (current page) state — also full width */
.menu a.is-active {
  background: rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

/* Subtle press feedback */
.menu a:active,
.menu [role="menuitem"]:active {
  transform: translateY(1px);
}

/* ✅ Prevent page scroll when menu is open (script toggles this) */
body.no-scroll {
  overflow: hidden;
}

/* =========================
   Side Menu overlay + mobile sizing (wheel page)
   ========================= */
.menu-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 4990; /* just under .menu (z-index:5000) */
}

.menu.open + .menu-overlay {
  opacity: 1;
  pointer-events: auto;
}

body.no-scroll{
  overflow: hidden;
}

/* ✅ Logged-out header buttons — match homepage sizing (no forced widths) */
#loggedOutHeaderGroup{
  display: flex;
  align-items: center;
  gap: 4px;
}

#loggedOutHeaderGroup .header-auth-btn{
  /* normalise <a> and <button> so they size the same */
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* match your base button styling */
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;

  /* 🔥 kill the “big button” behaviour from earlier rules */
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;

  white-space: nowrap;
  line-height: 1;
}

/* Extra safety in case --info has any weird overrides elsewhere */
#loggedOutHeaderGroup .header-auth-btn--info {
  width: 160px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  flex: 0 0 160px !important;
  padding: 6px 12px !important;
}



@media (max-width: 900px) {
  .menu {
    width: 55vw;
    max-width: 340px;
    right: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;

    /* purple glass that fades off at the bottom */
    background: linear-gradient(
      180deg,
      rgba(75, 0, 130, 0.42) 0%,
      rgba(75, 0, 130, 0.26) 65%,
      rgba(75, 0, 130, 0.00) 100%
    );

    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
  }

  .menu.open {
    transform: translateX(0);
  }

  .menu.closing {
    transform: translateX(100%);
  }
}

/* 🎁 Signup offer modal (wheel page) */
.modal-offer{
  max-width: 420px;
  text-align: center;
}
.modal-offer .offer-text{
  margin: 8px 0 14px;
  font-size: 0.98rem;
  opacity: 0.92;
}
.modal-offer .offer-text strong{
  color: var(--green);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.35);
}
@media (max-width: 600px){
  .modal-offer{ max-width: 340px; }
}


/* =========================
   MODALS — checkout visual style
========================= */

/* ✅ GLOBAL MODAL BACKDROP (matches checkout behaviour) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65); /* strong, consistent dark layer */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);

  z-index: 9998;
  opacity: 0;
  pointer-events: none;

  transition: opacity 0.25s ease;
}

.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 9999;
  overflow: auto;
  padding: 0;
}

.modal.hidden {
  display: none !important;
}

.modal .modal-content {
  position: relative;
  margin: 10% auto;
  width: 90%;
  max-width: 400px;
  padding: 30px;
  color: #fff;
  text-align: center;
  border-radius: 14px;
  overflow: hidden;
  animation: fadeIn 0.3s ease-in-out;
  will-change: opacity, transform;

  background:
    linear-gradient(
      135deg,
      rgba(170, 120, 255, 0.18) 0%,
      rgba(130, 70, 255, 0.22) 35%,
      rgba(90, 20, 180, 0.30) 100%
    );

  border: 1px solid rgba(255, 255, 255, 0.24);

  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.52),
    0 0 36px rgba(140, 90, 255, 0.35),
    0 0 12px rgba(180, 130, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);

  backdrop-filter: blur(28px) saturate(130%);
  -webkit-backdrop-filter: blur(28px) saturate(130%);
  background-blend-mode: overlay;
}

#loginModal .modal-content::before,
#registerModal .modal-content::before,
#forgotPasswordModal .modal-content::before,
#logoutConfirmModal .modal-content.modal-confirm::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  background:
    radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.16),
      transparent 34%
    ),
    radial-gradient(
      circle at top right,
      rgba(200, 150, 255, 0.24),
      transparent 30%
    ),
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.10) 0%,
      rgba(255, 255, 255, 0.04) 45%,
      rgba(255, 255, 255, 0.025) 100%
    );
}

#loginModal .modal-content::after,
#registerModal .modal-content::after,
#forgotPasswordModal .modal-content::after,
#logoutConfirmModal .modal-content.modal-confirm::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.03);
}

.modal .close {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 0 0 0;

  color: #2f2206;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
  font-family: Arial, sans-serif;

  cursor: pointer;
  z-index: 10;
  border-radius: 10px;

  background:
    linear-gradient(
      180deg,
      rgba(214, 182, 102, 0.30) 0%,
      rgba(168, 132, 48, 0.26) 52%,
      rgba(110, 80, 20, 0.30) 100%
    );

  border: 1px solid rgba(255, 245, 210, 0.20);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(255, 214, 92, 0.05),
    0 8px 18px rgba(0, 0, 0, 0.22),
    0 0 12px rgba(255, 214, 92, 0.08);

  backdrop-filter: blur(12px) saturate(120%);
  -webkit-backdrop-filter: blur(12px) saturate(120%);

  transition:
    color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}

.modal .close:hover {
  color: #1f1604;

  background:
    linear-gradient(
      180deg,
      rgba(232, 200, 116, 0.40) 0%,
      rgba(188, 148, 58, 0.34) 50%,
      rgba(126, 92, 26, 0.38) 100%
    );

  border-color: rgba(255, 245, 210, 0.28);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 1px rgba(255, 222, 89, 0.07),
    0 0 14px rgba(255, 222, 89, 0.10),
    0 10px 22px rgba(0, 0, 0, 0.26);

  transform: translateY(-2px);
}

.modal .close:active {
  transform: translateY(-1px);
}

.modal .modal-content h2 {
  margin-top: 0;
  margin-bottom: 14px;
  color: #ffffff;

  text-shadow:
    0 0 12px rgba(155, 136, 255, 0.30),
    0 0 24px rgba(75, 0, 130, 0.18);
}

.modal .modal-content p {
  color: rgba(255, 255, 255, 0.88);
}

.modal .modal-content input,
.modal .modal-content select,
.modal .modal-content textarea {
  width: 100%;
  max-width: 300px;

  padding: 10px 12px;
  margin: 10px auto;

  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;

  font-size: 1rem;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;

  display: block;
  box-sizing: border-box;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 2px 10px rgba(0, 0, 0, 0.12);

  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.modal .modal-content input:focus,
.modal .modal-content select:focus,
.modal .modal-content textarea:focus {
  outline: none;
  border-color: rgba(179, 155, 255, 0.55);
  background: rgba(255, 255, 255, 0.13);

  box-shadow:
    0 0 0 3px rgba(155, 136, 255, 0.16),
    0 0 16px rgba(155, 136, 255, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ====================================================
   REGISTER FIELD ERROR HIGHLIGHT
   - Used by JS when a specific registration field fails
   - Makes the failed field obvious in Microsoft Clarity recordings
==================================================== */

#registerForm .pu-field-error {
  border-color: rgba(255, 78, 112, 0.98) !important;
  background: rgba(255, 78, 112, 0.16) !important;
  color: #fff !important;

  box-shadow:
    0 0 0 3px rgba(255, 78, 112, 0.24),
    0 0 18px rgba(255, 78, 112, 0.65),
    0 0 34px rgba(255, 78, 112, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;

  animation: puFieldErrorFlash 0.85s ease-in-out 0s 2;
}

#registerForm .pu-field-error:focus {
  border-color: rgba(255, 120, 150, 1) !important;

  box-shadow:
    0 0 0 4px rgba(255, 78, 112, 0.28),
    0 0 22px rgba(255, 78, 112, 0.78),
    0 0 42px rgba(255, 78, 112, 0.34) !important;
}

#registerForm .pu-field-error::placeholder {
  color: rgba(255, 225, 232, 0.9);
}

@keyframes puFieldErrorFlash {
  0% {
    transform: translateX(0);
    filter: brightness(1);
  }

  18% {
    transform: translateX(-4px);
    filter: brightness(1.18);
  }

  36% {
    transform: translateX(4px);
  }

  54% {
    transform: translateX(-3px);
  }

  72% {
    transform: translateX(3px);
  }

  100% {
    transform: translateX(0);
    filter: brightness(1);
  }
}

.modal .modal-content input::placeholder,
.modal .modal-content textarea::placeholder {
  color: rgba(255, 255, 255, 0.76);
  opacity: 1;
}

.modal-content button {
  width: 100%;
  max-width: 300px;

  padding: 10px;
  margin: 10px auto;

  background:
    linear-gradient(
      180deg,
      rgba(52, 42, 82, 0.96) 0%,
      rgba(28, 22, 48, 0.98) 55%,
      rgba(16, 12, 28, 1) 100%
    );

  color: #f8f5ff;
  font-weight: bold;
  font-size: 16px;

  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;

  cursor: pointer;
  display: block;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.28),
    0 0 16px rgba(155, 136, 255, 0.10);

  transition:
    color 0.3s ease,
    text-shadow 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.18s ease;
}

/* ====================================================
   LOGOUT CONFIRM MODAL — HOMEPAGE LAYOUT
==================================================== */

.modal-confirm {
  max-width: 360px;
  text-align: center;
}

.modal-confirm h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

/* Exact homepage spacing between message and first button */
#logoutConfirmModal .modal-confirm p {
  margin: 0 0 18px;
  font-size: 0.95rem;
  opacity: 0.9;
}

#logoutConfirmModal .modal-confirm-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 0;
}

.modal-confirm-actions button {
  width: 100%;
  max-width: 300px;
  margin: 0;
}

.modal-content button:hover {
  color: #8fd8ff;
  text-shadow: 0 0 10px rgba(143, 216, 255, 0.45);

  background:
    linear-gradient(
      180deg,
      rgba(70, 56, 108, 0.98) 0%,
      rgba(38, 28, 64, 1) 55%,
      rgba(20, 14, 34, 1) 100%
    );

  border-color: rgba(143, 216, 255, 0.22);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(143, 216, 255, 0.06),
    0 0 18px rgba(143, 216, 255, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.30);

  transform: translateY(-1px);
}

.modal-content button:active {
  transform: translateY(0);
}

.modal-sub-btn,
.modal-alt-btn,
.modal-switch-btn {
  flex: 1;
  padding: 8px 10px;

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.03) 100%
    );

  color: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;

  font-size: 14px;
  font-weight: bold;
  cursor: pointer;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 6px 14px rgba(0, 0, 0, 0.16);

  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.18s ease;
}

.modal-sub-btn:hover,
.modal-alt-btn:hover,
.modal-switch-btn:hover {
  color: #d9eeff;
  border-color: rgba(82, 216, 255, 0.34);

  background:
    linear-gradient(
      180deg,
      rgba(82, 216, 255, 0.12) 0%,
      rgba(82, 216, 255, 0.05) 100%
    );

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 14px rgba(82, 216, 255, 0.10),
    0 8px 18px rgba(0, 0, 0, 0.18);

  transform: translateY(-1px);
}

.modal-sub-btn:active,
.modal-alt-btn:active,
.modal-switch-btn:active {
  transform: translateY(0);
}

/* ====================================================
   LOGIN MODAL SECONDARY ACTIONS
   Create Account + Forgot Password side by side
==================================================== */

#loginModal .modal-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;

  width: 100%;
  max-width: 300px;

  margin: 12px auto 0;
}

#loginModal .modal-action-buttons .modal-sub-btn {
  width: 100%;
  max-width: none;
  min-width: 0;

  margin: 0;
  padding: 10px 8px;
  box-sizing: border-box;

  line-height: 1.15;
  white-space: normal;
  text-align: center;
}

.modal-danger-btn {
  background:
    linear-gradient(
      180deg,
      rgba(58, 20, 28, 0.96) 0%,
      rgba(28, 10, 16, 0.98) 100%
    ) !important;

  border: 1px solid rgba(255, 124, 150, 0.16) !important;
}

.modal-danger-btn:hover {
  color: #ff9db1 !important;
  border-color: rgba(255, 124, 150, 0.30) !important;

  box-shadow:
    0 0 14px rgba(255, 124, 150, 0.12),
    0 8px 18px rgba(0, 0, 0, 0.28) !important;
}

/* Autofill */
.modal .modal-content input:-webkit-autofill,
.modal .modal-content input:-webkit-autofill:hover,
.modal .modal-content input:-webkit-autofill:focus,
.modal .modal-content input:-webkit-autofill:active {
  -webkit-box-shadow:
    0 0 0 1000px rgba(75, 0, 130, 0.45) inset !important;

  box-shadow:
    0 0 0 1000px rgba(75, 0, 130, 0.45) inset !important;

  -webkit-text-fill-color: #fff !important;
}

.modal .modal-content input:-moz-autofill {
  box-shadow:
    0 0 0 1000px rgba(75, 0, 130, 0.45) inset !important;

  -moz-box-shadow:
    0 0 0 1000px rgba(75, 0, 130, 0.45) inset !important;

  -moz-text-fill-color: #fff !important;
}

@media (max-width: 768px) {
  .modal .modal-content {
    margin: 12vh auto 0;
    width: calc(100% - 28px);
    max-width: 460px;
    padding: 24px 18px;
    border-radius: 14px;
  }

  .modal .close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    font-size: 22px;
  }
}

/* ====================================================
   REGISTRATION HELP SECTION
   - No wrapper box
   - No divider
   - Desktop and mobile clean
==================================================== */

#registerModal .registration-help-header {
  display: block;
  text-align: center;
  margin: 14px auto 12px;

  width: 100%;
  max-width: 320px;

  background: transparent;
  border: 0;
  box-shadow: none;
  outline: 0;
}

#registerModal .registration-help-icon {
  display: none;
}

#registerModal .registration-help-header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.15;
  color: #ffffff;
}

#registerModal .registration-help-header p {
  margin: 0 auto;
  max-width: 310px;

  font-size: 0.88rem;
  line-height: 1.45;

  color: rgba(255, 255, 255, 0.86);
}

#registerModal .registration-help-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;

  width: 100%;
  max-width: 300px;

  margin: 0 auto 8px;
  padding: 0;

  background: transparent;
  border: 0;
  box-shadow: none;
  outline: 0;
}

#registerModal .registration-help-form input {
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  margin: 0;
}

#registerModal .registration-help-form button {
  width: 100%;
  max-width: 300px;

  padding: 10px;
  margin: 0 auto;
  white-space: nowrap;

  appearance: none;
  -webkit-appearance: none;

  background:
    linear-gradient(
      180deg,
      rgba(52, 42, 82, 0.96) 0%,
      rgba(28, 22, 48, 0.98) 55%,
      rgba(16, 12, 28, 1) 100%
    );

  color: #f8f5ff;
  font-weight: bold;
  font-size: 16px;

  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;

  cursor: pointer;
  display: block;

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.28),
    0 0 16px rgba(155, 136, 255, 0.10);

  transition:
    color 0.3s ease,
    text-shadow 0.3s ease,
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.18s ease;
}

#registerModal .registration-help-form button:hover {
  color: #8fd8ff;
  text-shadow: 0 0 10px rgba(143, 216, 255, 0.45);

  background:
    linear-gradient(
      180deg,
      rgba(70, 56, 108, 0.98) 0%,
      rgba(38, 28, 64, 1) 55%,
      rgba(20, 14, 34, 1) 100%
    );

  border-color: rgba(143, 216, 255, 0.22);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 0 1px rgba(143, 216, 255, 0.06),
    0 0 18px rgba(143, 216, 255, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.30);

  transform: translateY(-1px);
}

#registerModal .registration-help-form button:active {
  transform: translateY(0);
}

#registerModal .registration-help-form button.button--busy {
  opacity: 0.6;
  pointer-events: none;
  filter: grayscale(10%);
}

/* 🏆 Win Modal tweaks — centered prize modal */
#prizeWinModal .modal-content {
  max-width: 520px;
  text-align: center;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: center;
  justify-items: center;
}

#prizeWinModal #winModalTitle {
  grid-column: 1 / -1;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

#prizeWinModal .win-media {
  grid-column: 1 / -1;
  justify-self: center;
}

#prizeWinModal #winItemImage {
  width: 190px;
  height: 190px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}

#prizeWinModal .win-meta {
  grid-column: 1 / -1;
  width: 100%;
  line-height: 1.35;
  text-align: center;
}

#prizeWinModal #winItemTitle {
  font-size: 1.15rem;
  margin: 0 0 6px 0;
  text-align: center;
}

#prizeWinModal #winItemValue {
  font-weight: 700;
  opacity: 0.95;
  text-align: center;
}

#prizeWinModal .win-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

/* Action buttons inside win modal */
#winAddToCartBtn,
#winCashBackBtn {
  flex: 1;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(17, 17, 17, 0.9);
  color: #f5f5f5;
  cursor: pointer;
  transition:
    transform 0.08s ease,
    background-color 0.25s ease,
    border-color 0.25s ease;
}

#winAddToCartBtn:hover,
#winCashBackBtn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(34, 34, 34, 0.95);
}

#winAddToCartBtn {
  box-shadow: inset 0 0 0 1px rgba(255, 204, 0, 0.25);
}

#winAddToCartBtn:hover {
  box-shadow: inset 0 0 0 1px rgba(255, 204, 0, 0.6);
}

#winCashBackBtn {
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.25);
}

#winCashBackBtn:hover {
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.6);
}

/* ====================================================
   💵 Cashback button loading and click lock
==================================================== */

#winCashBackBtn.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  cursor: wait;
  pointer-events: none;

  transform: none;
  opacity: 0.88;

  background: rgba(20, 83, 45, 0.82);
  border-color: rgba(74, 222, 128, 0.58);

  box-shadow:
    inset 0 0 0 1px rgba(74, 222, 128, 0.4),
    0 0 12px rgba(34, 197, 94, 0.22);
}

/* Small spinner before the loading text */
#winCashBackBtn.is-loading::before {
  content: "";

  width: 14px;
  height: 14px;
  flex: 0 0 14px;

  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #ffffff;
  border-radius: 50%;

  animation: puCashbackButtonSpin 0.7s linear infinite;
}

/* Prevent the normal hover movement while disabled */
#winCashBackBtn.is-loading:hover,
#winCashBackBtn:disabled:hover {
  transform: none;
  background: rgba(20, 83, 45, 0.82);
  border-color: rgba(74, 222, 128, 0.58);
}

/* General disabled action-button state */
#winCashBackBtn:disabled,
#winAddToCartBtn:disabled {
  cursor: not-allowed;
}

/* Add to Cart is also temporarily locked during cashback */
#winAddToCartBtn.is-action-locked {
  opacity: 0.52;
  pointer-events: none;
  transform: none;
}

@keyframes puCashbackButtonSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Respect reduced-motion accessibility preferences */
@media (prefers-reduced-motion: reduce) {
  #winCashBackBtn.is-loading::before {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.32);
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-20px); }
}

/* Tooltip anchor to avoid intercepting clicks on icon buttons */
.tooltip-anchor {
  position: absolute;
  inset: 0;
  pointer-events: none; /* prevent capturing the click */
}

/* Logged-in button — blue icon and border only */
#loginBtn.logged-in {
  border-color: #75d7ff;
  color: #75d7ff;
  background: transparent;
  box-shadow: none;

  transition:
    border-color 1.2s ease-in-out,
    color 1.2s ease-in-out;
}

/* Keep the inside transparent while hovering or focusing */
#loginBtn.logged-in:hover,
#loginBtn.logged-in:focus-visible,
#loginBtn.logged-in:active {
  border-color: #75d7ff;
  color: #75d7ff;
  background: transparent;
  box-shadow: none;
}

/* Image-based login icon */
#loginBtn.logged-in img {
  filter:
    brightness(0)
    saturate(100%)
    invert(76%)
    sepia(72%)
    saturate(1168%)
    hue-rotate(168deg)
    brightness(106%)
    contrast(103%) !important;
}

/* Also supports Lucide/inline SVG icons */
#loginBtn svg,
#loginBtn i {
  transition:
    color 1.2s ease-in-out,
    stroke 1.2s ease-in-out;
}

#loginBtn.logged-in svg,
#loginBtn.logged-in i {
  color: #75d7ff !important;
  stroke: #75d7ff !important;
}

/* Autofill tweaks — lighter purple glass like checkout cart */
.modal .modal-content input:-webkit-autofill,
.modal .modal-content input:-webkit-autofill:hover,
.modal .modal-content input:-webkit-autofill:focus,
.modal .modal-content input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgba(75, 0, 130, 0.45) inset !important;
  box-shadow: 0 0 0 1000px rgba(75, 0, 130, 0.45) inset !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
}

.modal .modal-content input:-moz-autofill {
  box-shadow: 0 0 0 1000px rgba(75, 0, 130, 0.45) inset !important;
  -moz-box-shadow: 0 0 0 1000px rgba(75, 0, 130, 0.45) inset !important;
  -moz-text-fill-color: #fff !important;
  caret-color: #fff;
}
input { background-color: var(--purple-deep); color: #fff; caret-color: #fff; }


/* Optional scrollbar theming for visual parity */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: rgba(75, 0, 130, 0.3);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(75, 0, 130, 0.8);
  border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, 0.3);
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(75, 0, 130, 1);
}
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(75, 0, 130, 0.8) rgba(75, 0, 130, 0.3);
}

/* Generic utility used by your JS to toggle visibility */
.hidden { display: none !important; }

/* ====================================================
   📱 MOBILE MODAL SIZING — MATCH HOMEPAGE
==================================================== */
@media (max-width: 768px) {
  main {
    padding-top: 68px !important;
  }

  /* Adds safe space around the modal on narrow screens */
  .modal {
    padding: 16px 12px;
    overflow-y: auto;
  }

  /*
    Keep the complete card inside the viewport.
    box-sizing is the critical missing rule.
  */
  .modal-content {
    box-sizing: border-box;
    width: 100%;
    max-width: calc(100% - 24px);
    margin: 10vh auto 0;
    padding: 16px 14px;
    border-radius: 14px;
  }

  .modal-content h2 {
    font-size: 1.1rem;
  }

  .modal-content p,
  .modal-content label {
    font-size: 0.95rem;
  }

  .modal-content input,
  .modal-content button {
    width: 100%;
    box-sizing: border-box;
    font-size: 1rem;
    padding: 8px;
  }

  /* Stack login/register/forgot buttons */
  /* Keep logout buttons centred */
  .modal-confirm-actions {
    flex-direction: column;
    align-items: center;
  }

  .modal-confirm-actions button {
    width: 100%;
    max-width: 300px;
  }

  .modal-sub-btn {
    font-size: 1rem;
    padding: 10px;
  }
}

@media (max-width: 768px) {
  #prizeWinModal {
    padding: 76px 10px 18px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #prizeWinModal .modal-content {
    box-sizing: border-box;
    width: min(92vw, 360px);
    max-width: 360px;
    max-height: calc(100dvh - 104px);
    margin: 0 auto;
    padding: 18px 16px 16px;

    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;

    text-align: center;
    align-items: center;
    justify-items: center;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #prizeWinModal #winModalTitle {
    grid-column: 1 / -1;
    margin: 0 34px 2px;
    font-size: clamp(1.25rem, 6vw, 1.65rem);
    line-height: 1.1;
  }

  #prizeWinModal .win-media {
    grid-column: 1 / -1;
    justify-self: center;
  }

  #prizeWinModal #winItemImage {
    width: clamp(125px, 42vw, 165px);
    height: clamp(125px, 42vw, 165px);
  }

  #prizeWinModal .win-meta {
    grid-column: 1 / -1;
    width: 100%;
    line-height: 1.25;
  }

  #prizeWinModal #winItemTitle {
    font-size: clamp(1rem, 4.6vw, 1.18rem);
    line-height: 1.18;
    margin: 0 0 4px;
    overflow-wrap: anywhere;
  }

  #prizeWinModal #winItemValue {
    font-size: 0.95rem;
  }

  #prizeWinModal .win-actions {
    grid-column: 1 / -1;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
  }

  #prizeWinModal .win-actions button {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 9px 10px;
    font-size: 0.98rem;
  }

  .modal-content input,
  .modal-content button {
    font-size: 1rem;
    padding: 8px;
  }

  .modal-sub-btn {
  font-size: 1rem;
  padding: 10px;
}

  .modal-sub-btn {
    font-size: 1rem;
    padding: 10px;
  }
}

@media (max-width: 380px), (max-height: 620px) {
  #prizeWinModal {
    padding-top: 66px;
  }

  #prizeWinModal .modal-content {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 84px);
    padding: 15px 13px 13px;
    gap: 8px;
  }

  #prizeWinModal .close {
    width: 30px;
    height: 30px;
    font-size: 26px;
    top: 8px;
    right: 8px;
  }

  #prizeWinModal #winItemImage {
    width: 112px;
    height: 112px;
  }

  #prizeWinModal #winModalTitle {
    font-size: 1.18rem;
  }

  #prizeWinModal #winItemTitle {
    font-size: 0.98rem;
  }

  #prizeWinModal #winItemValue {
    font-size: 0.88rem;
  }
}

.pu-toast.is-login {
  background: rgba(80, 180, 255, 0.17);
  border-color: rgba(80, 180, 255, 0.40);
}

.pu-toast.is-login .pu-toast-icon {
  background: rgba(80, 180, 255, 0.20);
  color: #9fe7ff;
}

/* ====================================================
   PERFORMANCE OVERRIDES — transform-based side menu
==================================================== */
.menu {
  right: 0 !important;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.3s ease;
  contain: layout style;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.menu.open {
  right: 0 !important;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.menu.closing {
  visibility: visible;
  transform: translate3d(100%, 0, 0);
}

.modal.show .modal-content,
.modal[style*="display: block"] .modal-content {
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .menu,
  .menu-overlay,
  .modal,
  .modal-content,
  .pu-toast {
    transition: none !important;
    animation: none !important;
  }
}
