:root {
  /* EMBERS PALETTE PRO */
  --bg-body: #1F2036;
  /* Deep Navy */
  --bg-surface: #2b2d4e;
  /* Slightly lighter navy */
  --bg-glass: rgba(43, 45, 78, 0.7);
  /* Glassy Surface */

  --primary: #F64668;
  /* Pink - Main Action */
  --primary-hover: #ff5e7d;
  --secondary: #FE9677;
  /* Peach - Accents */
  --accent: #984063;
  /* Plum */

  --txt-main: #ffffff;
  --txt-muted: #d0d2e2;
  --txt-light: #9ea1bf;

  --line: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.1);

  --accent-red: #ef4444;
  --accent-green: #10b981;

  /* SHADOWS (Neon/Cyber) */
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(246, 70, 104, 0.25);

  /* DIMENSIONS */
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;
  --r-full: 9999px;

  /* ANIMATIONS */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 200ms;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--txt-main);
  background: var(--bg-body);
  /* Mesh Gradient Pulse */
  background-image:
    radial-gradient(circle at 15% 25%, rgba(246, 70, 104, 0.15), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(254, 150, 119, 0.15), transparent 45%);
  background-attachment: fixed;
  background-size: 150% 150%;
  animation: bgPulse 10s ease-in-out infinite alternate;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

body::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: url('logo.png') no-repeat center center;
  background-size: contain;
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}

@keyframes bgPulse {
  0% {
    background-position: 0% 0%;
  }

  100% {
    background-position: 100% 100%;
  }
}

/* Scroll Polish */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-surface);
  border-radius: 4px;
  border: 1px solid var(--line);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* NAVBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: rgba(31, 32, 54, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.brand-text {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

/* Nav Links */
.navlinks {
  display: flex;
  gap: 24px;
}

.navlinks a {
  color: var(--txt-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s;
  position: relative;
}

.navlinks a:hover {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* Auth Buttons */
.auth-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Mobile-only elements hidden on Desktop by default */
.mobile-nav-only,
.menu-toggle {
  display: none !important;
}

/* Hamburger Menu Toggle */
.menu-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  position: relative;
  justify-content: center;
  align-items: center;
  margin-left: 8px;
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.menu-icon::before {
  transform: translateY(-7px);
}

.menu-icon::after {
  transform: translateY(7px);
}

/* Toggle Active State */
.menu-toggle.active .menu-icon {
  background: transparent;
}

.menu-toggle.active .menu-icon::before {
  transform: rotate(45deg) translateY(0);
}

.menu-toggle.active .menu-icon::after {
  transform: rotate(-45deg) translateY(0);
}

@media (max-width: 992px) {
  .topbar {
    padding: 0 20px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex !important;
  }

  .navlinks {
    position: fixed;
    top: 72px;
    left: -100%;
    width: 280px;
    height: calc(100vh - 72px);
    background: #1F2036;
    flex-direction: column;
    padding: 40px 24px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 999;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.6);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    gap: 20px;
  }

  .navlinks.active {
    left: 0;
  }

  .navlinks a {
    font-size: 17px;
    padding: 12px 0;
    width: 100%;
    color: #fff;
    opacity: 0.8;
  }

  .navlinks a:hover {
    opacity: 1;
    color: var(--primary);
  }
}

.user-badge {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* BUTTONS */
.btn {
  border: none;
  cursor: pointer;
  padding: 12px 24px;
  border-radius: var(--r-full);
  font-weight: 600;
  font-size: 15px;
  transition: all var(--dur-fast) var(--ease-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.3px;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #fe7688);
  color: #fff;
  box-shadow: 0 4px 15px rgba(246, 70, 104, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(246, 70, 104, 0.5);
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.15);
}

.btn-primary:disabled {
  background: var(--bg-surface);
  color: var(--txt-muted);
  box-shadow: none;
  cursor: not-allowed;
  border: 1px solid var(--line);
}

.btn-ghost {
  background: transparent;
  color: var(--txt-main);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* LAYOUT */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.page {
  margin-top: 32px;
  min-height: 80vh;
  padding-bottom: 60px;
}

.hidden {
  display: none !important;
}

/* HERO */
.hero {
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  padding: 80px 40px;
  padding: 80px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  margin-bottom: 50px;
  border: 1px solid var(--card-border);
  position: relative;
  overflow: hidden;
  background: rgba(31, 32, 54, 0.4);
  backdrop-filter: blur(20px);
}

.hero h1 {
  background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Abstract Shapes in Hero Bg */
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(246, 70, 104, 0.15), transparent 70%);
  filter: blur(60px);
  opacity: 0.8;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(254, 150, 119, 0.1), transparent 70%);
  filter: blur(50px);
  opacity: 0.8;
}

.hero h1 {
  font-size: 56px;
  color: #fff;
  margin: 0 0 20px 0;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.hero .badge {
  background: rgba(246, 70, 104, 0.15);
  color: #ff8fa3;
  border-color: rgba(246, 70, 104, 0.3);
  box-shadow: 0 0 15px rgba(246, 70, 104, 0.15);
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  margin-bottom: 20px;
}

.hero p.muted {
  font-size: 18px;
  color: var(--txt-muted);
  max-width: 600px;
  margin: 0 auto 36px auto;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 13px;
  font-weight: 700;
  background: rgba(254, 150, 119, 0.15);
  color: var(--secondary);
  border: 1px solid rgba(254, 150, 119, 0.2);
}

.badge.out {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* SEARCH BOX */
.search-container {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  display: flex;
  gap: 12px;
  z-index: 2;
}

.search-box {
  flex: 1;
  padding: 16px 28px;
  font-size: 17px;
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  outline: none;
  background: rgba(31, 32, 54, 0.6);
  color: #fff;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}

.search-box:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  background: rgba(31, 32, 54, 0.9);
}

.search-btn-hero {
  border-radius: var(--r-full);
  padding: 0 32px;
  background: var(--secondary);
  /* Orange Search Button */
  color: #1F2036;
}

.search-btn-hero:hover {
  background: #ffe0d6;
  color: #1F2036;
  box-shadow: 0 0 20px rgba(254, 150, 119, 0.5);
  box-shadow: 0 0 20px rgba(254, 150, 119, 0.5);
}

/* ADMIN MODE RESTRICTIONS */
body.is-admin .navlinks,
body.is-admin #btnCart,
body.is-admin .cart-badge,
body.is-admin [data-add-cart] {
  display: none !important;
}

body.is-admin [data-add-cart] {
  display: none !important;
}

/* PRODUCT IMAGES */
.card.product-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.card.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2) !important;
}

.card-img-wrapper img {
  transition: transform 0.3s;
}

.card.product-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.modal-card {
  background: rgba(30, 32, 55, 0.95);
  border: 1px solid var(--line);
  padding: 30px;
  border-radius: var(--r-md);
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.modal-card h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--accent);
}

/* DASHBOARD & ADMIN REFINEMENTS */
.dashboard-admin-mode .panel {
  display: none !important;
  /* Hide all panels by default in admin mode */
}

.dashboard-admin-mode #adminPanel,
.dashboard-admin-mode #adminPanel .panel {
  display: block !important;
  /* Show only admin panel */
  grid-column: 1 / -1;
  /* Full width */
}

.dashboard-admin-mode #panel-profile {
  display: none !important;
}

.stat-card {
  flex: 1;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  padding: 20px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.05);
}

.stat-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}

.stat-info .num {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
}

.stat-info .label {
  font-size: 13px;
  color: var(--t-muted);
}

/* CATEGORY GRID */
.cat-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  position: relative;
  z-index: 2;
}

.cat-item {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: center;
  font-weight: 600;
  color: var(--txt-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.cat-item:hover {
  border-color: var(--primary);
  color: #fff;
  background: var(--bg-glass);
  transform: translateY(-6px);
  box-shadow: 0 8px 30px rgba(246, 70, 104, 0.15);
}

/* CARDS & RESULTS */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.05),
      transparent);
  transition: left 0.5s ease;
}

.card:hover::before {
  left: 100%;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(246, 70, 104, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.result-item {
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.result-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary);
  background: var(--bg-subtle);
}

.result-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

/* FORMS */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 480px;
  margin: 0 auto;
}

label {
  font-weight: 500;
  font-size: 14px;
  color: var(--txt-muted);
  margin-bottom: 6px;
  display: block;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 15px;
  outline: none;
  background: rgba(0, 0, 0, 0.2);
  /* Dark Input */
  color: #fff;
  transition: all 0.2s;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: var(--shadow-input);
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  cursor: pointer;
  font-size: 16px;
  user-select: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toggle-password:hover {
  opacity: 1;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* UTILS */
.row {
  display: flex;
  align-items: center;
}

.rowline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.muted {
  color: var(--txt-muted);
}

.tiny {
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

/* RESPONSIVE GRID OVERRIDES */
.about-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.features-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.contact-grid {
  grid-template-columns: 1fr 1.2fr;
}

@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {

  .about-grid,
  .features-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* SPECIFIC PANELS */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

#panel-myorders {
  grid-column: 1 / -1;
}

.panel h3 {
  color: #fff;
  margin-top: 0;
}

.order-card,
.cart-item {
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 16px;
  transition: all 0.2s;
  flex: 1 1 300px;
  /* Allow growing and wrapping */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#myOrdersBox {
  display: flex !important;
  flex-wrap: wrap;
  gap: 16px;
  /* Ensure it takes full width for wrapping to work */
  width: 100%;
}

#adminOrdersBox {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.order-card:hover {
  border-color: var(--secondary);
  background: rgba(254, 150, 119, 0.05);
}

/* TOAST */
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), #FF8E9E);
  color: #fff;
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 700;
  box-shadow: var(--shadow-glow);
  z-index: 1000;
  letter-spacing: 0.5px;
}

/* MISC */
.badge-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg-body);
}

.radio-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-subtle);
  transition: all 0.2s;
}

.radio-label:hover {
  border-color: var(--primary);
}

.radio-label:has(input:checked) {
  background: rgba(246, 70, 104, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page:not(.hidden) {
  animation: fadeInUp 0.5s var(--ease-spring);
}

/* PAYMENT UI */
.pay-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .pay-options {
    grid-template-columns: 1fr;
  }

  .pay-card {
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px;
  }
}

.pay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
}

.pay-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.pay-card.selected {
  background: rgba(246, 70, 104, 0.15);
  /* Primary transparent */
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(246, 70, 104, 0.2) inset;
}

.pay-card input[type="radio"] {
  display: none;
  /* Hide default radio */
}

.pay-card .icon {
  font-size: 24px;
}

.pay-card .lbl {
  font-size: 13px;
  font-weight: 600;
  color: var(--txt-muted);
}

.pay-card.selected .lbl {
  color: #fff;
}

/* Pay Details Area */
.pay-details-area {
  background: rgba(0, 0, 0, 0.2);
  padding: 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  min-height: 150px;
}

.input-glow {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: #fff;
  transition: all 0.2s;
  font-family: monospace;
  letter-spacing: 1px;
}

.input-glow:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(246, 70, 104, 0.3);
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}

.info-box {
  padding: 16px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
  border-radius: var(--r-sm);
  text-align: center;
}

.pay-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.pay-card:not(.selected) .pay-logo {
  filter: grayscale(100%);
  opacity: 0.8;
}

.pay-card.selected .pay-logo,
.pay-card:hover .pay-logo {
  filter: none;
  opacity: 1;
  transform: scale(1.1);
}

/* --- ANIMATIONS & MODERN POLISH --- */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.page {
  will-change: transform, opacity;
}

.page:not(.hidden) {
  animation: fadeInUp 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Nav Link Modern Hover */
.navlinks a {
  position: relative;
  padding: 4px 0;
}

.navlinks a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
  border-radius: 2px;
}

.navlinks a:hover::after,
.navlinks a.active::after {
  width: 100%;
}

.navlinks a.active {
  color: #fff;
  text-shadow: 0 0 10px rgba(246, 70, 104, 0.4);
}

/* Extra Interaction Polish */
.btn:active,
.pay-card:active {
  transform: scale(0.94);
}

/* FOOTER */
.footer {
  background: #111;
  /* Very dark/black */
  color: #798da3;
  /* Muted blue-grey text like reference */
  padding: 30px 20px;
  text-align: center;
  font-size: 14px;
  border-top: 1px solid #222;
  margin-top: auto;
}

.footer span {
  display: inline-block;
}

.footer-link {
  color: #798da3;
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.2s;
}

.footer-link:hover {
  color: #fff;
}

/* --- Premium Login Split Layout --- */
.no-padding-page {
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

.login-split-container {
  display: flex;
  min-height: calc(100vh - 80px);
  /* Adjust for header */
  width: 100%;
}

/* Left Side: Brand Hero */
.login-brand-side {
  flex: 1.2;
  background: linear-gradient(135deg, #1F2036 0%, #2b2d4e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 40px;
}

.login-brand-content {
  position: relative;
  z-index: 10;
  text-align: center;
  animation: fadeInSlideRight 1.2s var(--ease-spring);
}

.login-brand-logo-wrapper {
  width: 460px;
  height: auto;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 40px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  padding: 25px;
}

.login-hero-logo {
  width: 400px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(246, 70, 104, 0.2));
}

.premium-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(to right, #fff, var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -1px;
}

.premium-subtitle {
  font-size: 1.1rem;
  color: var(--txt-muted);
  max-width: 400px;
  line-height: 1.6;
  margin: 0 auto;
}

/* Animated Decorative Shapes */
.floating-shapes .shape {
  position: absolute;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  filter: blur(60px);
  border-radius: 50%;
  opacity: 0.15;
  z-index: 1;
}

.shape.s1 {
  width: 300px;
  height: 300px;
  top: -100px;
  left: -100px;
  animation: float 15s infinite alternate;
}

.shape.s2 {
  width: 400px;
  height: 400px;
  bottom: -150px;
  right: -50px;
  animation: float 18s infinite alternate-reverse;
}

.shape.s3 {
  width: 200px;
  height: 200px;
  top: 20%;
  right: 10%;
  animation: float 12s infinite alternate;
  opacity: 0.1;
}

/* Right Side: Form */
.login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #191a2d;
  padding: 40px;
}

.login-card-premium {
  width: 100%;
  max-width: 450px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 24px;
  backdrop-filter: blur(20px);
  animation: fadeInSlideUp 0.8s var(--ease-smooth) both;
}

.login-header-centered {
  text-align: center;
  margin-bottom: 35px;
}

.login-header-centered h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.login-header-centered p {
  font-size: 0.95rem;
  color: var(--txt-muted);
  line-height: 1.5;
}

.premium-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-group-premium {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-group-premium label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--txt-light);
  margin-left: 4px;
}

.input-group-premium input {
  height: 54px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0 18px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.input-group-premium input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 4px rgba(246, 70, 104, 0.15);
}

.password-wrapper-premium {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper-premium input {
  width: 100%;
  padding-right: 50px;
}

.toggle-password-premium {
  position: absolute;
  right: 18px;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.toggle-password-premium:hover {
  opacity: 1;
}

.btn-premium-login {
  height: 56px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-spring);
  background: var(--primary);
  border: none;
  color: #fff;
  cursor: pointer;
}

.btn-premium-login:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(246, 70, 104, 0.3);
}

.btn-premium-login:active {
  transform: translateY(0);
}

.btn-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.btn-premium-login:hover .btn-glow {
  opacity: 1;
}

.login-footer-centered {
  margin-top: 30px;
  text-align: center;
}

.premium-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s;
}

.premium-link:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* Animations */
@keyframes float {
  0% {
    transform: translateY(0) scale(1);
  }

  100% {
    transform: translateY(-40px) scale(1.1);
  }
}

@keyframes fadeInSlideRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive Layouts */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 42px;
  }

  .hero {
    padding: 60px 20px;
  }

  .login-split-container {
    flex-direction: column;
    min-height: auto;
  }

  .login-brand-side {
    padding: 60px 20px;
    flex: none;
  }

  .premium-title {
    font-size: 2.2rem;
  }

  .login-form-side {
    padding: 40px 20px;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }

  .hero p.muted {
    font-size: 16px;
  }

  .search-container {
    flex-direction: column;
    gap: 10px;
  }

  .search-btn-hero {
    width: 100%;
    padding: 14px;
  }

  .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  .cat-item {
    font-size: 13px;
    padding: 12px;
  }

  .auth-area .btn:not(.menu-toggle):not(#btnCart) {
    display: none;
    /* Hide complex buttons on small mobile, rely on menu */
  }

  .auth-area .btn#navDashboard,
  .auth-area .btn#navManageUsers,
  .auth-area .btn#btnLogin,
  .auth-area .btn#btnLogout,
  .user-badge {
    display: none !important;
  }

  /* Ensure these appear in the mobile menu instead, but respect .hidden */
  .mobile-nav-only:not(.hidden) {
    display: block !important;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 0 12px;
    height: 64px;
  }

  .navlinks {
    top: 64px;
    height: calc(100vh - 64px);
  }

  .auth-area {
    gap: 6px;
  }

  #btnCart {
    font-size: 13px;
    padding: 8px 12px;
    margin-right: 2px !important;
  }

  .menu-toggle {
    width: 38px;
    height: 38px;
    margin-left: 0;
  }

  .brand-text {
    font-size: 14px;
    max-width: 90px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero h1 {
    font-size: 25px;
  }

  .container {
    padding: 12px;
  }

  .panel {
    padding: 16px;
  }

  .row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .row input {
    width: 100% !important;
  }

  .row button {
    width: 100%;
  }

  .topSellingGrid {
    grid-template-columns: 1fr;
  }
}

/* --- Prescription Upload Feature --- */
.prescription-upload-area {
  margin-top: 20px;
  position: relative;
}

.upload-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.upload-drop-zone:hover {
  border-color: var(--primary);
  background: rgba(246, 70, 104, 0.05);
}

.upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
  opacity: 0.7;
}

.btn-xs {
  padding: 6px 14px;
  font-size: 13px;
  margin-top: 10px;
}

/* Scanning Animation */
.scanning-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(31, 32, 54, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.laser-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
  box-shadow: 0 0 15px var(--primary);
  animation: scanMove 2s ease-in-out infinite;
}

.scanning-text {
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  text-transform: uppercase;
  font-size: 13px;
  animation: pulseOpacity 1s ease-in-out infinite;
}

@keyframes scanMove {
  0% {
    top: 0%;
  }

  50% {
    top: 100%;
  }

  100% {
    top: 0%;
  }
}

@keyframes pulseOpacity {

  0%,
  100% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }
}