:root {
  --primary: #0a3f8a;
  --primary-dark: #062d62;
  --primary-soft: rgba(10, 63, 138, 0.1);
  --secondary: #e3000f;
  --secondary-soft: rgba(227, 0, 15, 0.12);
  --text: #1f2a37;
  --muted: #586779;
  --surface: #f6f8fc;
  --white: #ffffff;
  --border: rgba(14, 31, 60, 0.12);
  --shadow: 0 20px 50px rgba(14, 31, 60, 0.1);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

.container {
  width: min(var(--max-width), calc(100% - 32px));
  margin-inline: auto;
}

.section {
  padding: 104px 0;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 0.76rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--primary);
}

.eyebrow.accent {
  color: var(--secondary);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.6rem, 4vw, 5rem);
  line-height: 1.08;
  letter-spacing: -0.06em;
  margin-bottom: 18px;
}

h2 {
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.05em;
  margin-bottom: 20px;
}

p {
  color: var(--muted);
  font-size: 1.05rem;
}

.primary-btn,
.secondary-btn,
.mini-btn,
.lang-btn,
.spec-tab,
.nav-cta {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.primary-btn,
.nav-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 0.9rem 1.6rem;
  font-weight: 700;
  box-shadow: 0 14px 28px rgba(10, 63, 138, 0.22);
}

.secondary-btn,
.mini-btn,
.lang-btn,
.spec-tab {
  background: rgba(10, 63, 138, 0.06);
  border: 1px solid rgba(10, 63, 138, 0.12);
  color: var(--primary);
  padding: 0.8rem 1.2rem;
  font-weight: 700;
}

.primary-btn:hover,
.secondary-btn:hover,
.mini-btn:hover,
.lang-btn:hover,
.spec-tab:hover,
.nav-cta:hover {
  transform: translateY(-1px);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(10, 63, 138, 0.1);
  box-shadow: 0 8px 26px rgba(14, 31, 60, 0.045);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
}

.brand img {
  width: 100%;
  max-width: 140px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 600;
  color: var(--primary-dark);
}

.main-nav a {
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: var(--secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-actions .nav-cta {
  padding: 0.75rem 1.15rem;
  box-shadow: 0 8px 20px rgba(10, 63, 138, 0.17);
}

.cart-button {
  border: 1px solid rgba(10, 63, 138, 0.16);
  background: #fff;
  color: var(--primary-dark);
  box-shadow: none !important;
}

#cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--secondary);
  color: #fff;
  font-size: 0.76rem;
}

.header-account-menu {
  position: relative;
}

.header-account-menu summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid rgba(10, 63, 138, 0.16);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  color: var(--primary-dark);
  font-weight: 700;
  white-space: nowrap;
}

.header-account-menu summary::-webkit-details-marker {
  display: none;
}

.header-account-menu summary::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 0.5rem;
  color: var(--secondary);
  border-right: 2px solid var(--secondary);
  border-bottom: 2px solid var(--secondary);
  transform: translateY(-2px) rotate(45deg);
}

.header-account-links {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  display: grid;
  min-width: 190px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.header-account-links a,
.header-account-links button {
  border: 0;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}

.header-account-links a:hover,
.header-account-links button:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 82% 55%, rgba(32, 102, 191, 0.27), transparent 38%),
    linear-gradient(120deg, #f6f9ff 0%, #fff 58%, #f8faff 100%);
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -140px -180px auto;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10, 63, 138, 0.14), transparent 65%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 36px;
  min-height: 680px;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy p {
  max-width: 620px;
  margin-bottom: 28px;
  font-size: 1.12rem;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.hero-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  color: var(--primary-dark);
  font-weight: 600;
}

.hero-points li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-points li::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--secondary);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(227, 0, 15, 0.12);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
}

.hero-visual::before,
.hero-visual::after {
  content: "";
  position: absolute;
  width: min(76%, 390px);
  aspect-ratio: 1;
  border: 1px solid rgba(10, 63, 138, 0.12);
  border-radius: 50%;
  animation: orbit-pulse 7s ease-in-out infinite;
}

.hero-visual::after {
  width: min(94%, 490px);
  border-color: rgba(227, 0, 15, 0.09);
  animation-delay: -3.5s;
}

.device-frame {
  position: relative;
  width: min(100%, 540px);
  aspect-ratio: 1.15;
  display: grid;
  place-items: center;
  animation: device-float 6s ease-in-out infinite;
  z-index: 1;
}

.device-shadow {
  position: absolute;
  inset: 42% 12% 10% 12%;
  border-radius: 30px;
  background: rgba(10, 63, 138, 0.12);
  filter: blur(32px);
}

.device-body {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary) 0%, #0a3f8a 100%);
  box-shadow: 0 36px 80px rgba(10, 42, 87, 0.28);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transform: perspective(1000px) rotateY(-7deg) rotateX(3deg);
  transition: transform 450ms ease;
}

.device-frame:hover .device-body {
  transform: perspective(1000px) rotateY(0) rotateX(0) scale(1.025);
}

.device-body::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04));
}

.device-logo-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.device-logo-wrap img {
  width: min(75%, 420px);
  filter: brightness(1.06);
}

.antenna {
  position: absolute;
  left: 14%;
  bottom: 10%;
  width: 72px;
  height: 86px;
  border-radius: 26px 26px 0 0;
  background: rgba(255, 255, 255, 0.12);
  transform: rotate(-12deg);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.antenna::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -14px;
  width: 28px;
  height: 28px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
  animation: signal-ping 2.8s ease-out infinite;
}

.hdmi-port {
  position: absolute;
  right: 9%;
  top: 18%;
  width: 118px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 700;
}

.usb-port {
  position: absolute;
  left: 48%;
  bottom: 20%;
  width: 92px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.68rem;
  font-weight: 700;
}

.split-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 42px;
  align-items: center;
}

.feature-list {
  display: grid;
  gap: 20px;
  margin-top: 30px;
}

.feature-list div {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  background: rgba(10, 63, 138, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.feature-list strong {
  color: var(--primary-dark);
}

.feature-list span {
  color: var(--muted);
}

.about-visual {
  position: relative;
  display: grid;
  gap: 16px;
  justify-items: center;
  perspective: 1000px;
}

.visual-card {
  width: min(100%, 500px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.visual-card-lg {
  position: relative;
  height: 440px;
  background: linear-gradient(135deg, rgba(10, 63, 138, 0.96), rgba(10, 63, 138, 0.78));
  overflow: hidden;
  display: grid;
  place-items: center;
  isolation: isolate;
  animation: card-float 7s ease-in-out infinite;
}

.visual-card-lg::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
}

.about-product-image {
  position: relative;
  z-index: 1;
  width: min(76%, 340px);
  filter: drop-shadow(0 24px 32px rgba(0, 0, 0, 0.24));
  animation: image-float 5s ease-in-out infinite;
}

.visual-label {
  position: absolute;
  z-index: 2;
  bottom: 28px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.signal-lines {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.035), 0 0 0 58px rgba(255, 255, 255, 0.025);
  animation: orbit-pulse 6s ease-in-out infinite;
}

.visual-card-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 240px;
  padding: 20px 18px;
  background: rgba(227, 0, 15, 0.08);
  border: 1px solid rgba(227, 0, 15, 0.14);
  color: var(--secondary);
  font-weight: 700;
  text-align: center;
  animation: badge-float 5s ease-in-out infinite;
}

.signal-indicator {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #16a36a;
  box-shadow: 0 0 0 5px rgba(22, 163, 106, 0.12);
}

.section-heading {
  margin-bottom: 38px;
}

.section-heading.center {
  text-align: center;
}

.spec-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.spec-tab {
  min-width: 120px;
}

.spec-tab.active,
.lang-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  box-shadow: 0 12px 24px rgba(10, 63, 138, 0.18);
}

.spec-table-wrap {
  background: linear-gradient(180deg, rgba(10,63,138,0.04), rgba(10,63,138,0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
}

.spec-table td {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(10, 63, 138, 0.08);
}

.spec-table tr:last-child td {
  border-bottom: none;
}

.spec-table td:first-child {
  width: 42%;
  color: var(--primary-dark);
  font-weight: 700;
  background: rgba(10,63,138,0.02);
}

.language-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.tutorial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.tutorial-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px rgba(16, 27, 40, 0.06);
}

.video-frame {
  aspect-ratio: 16/9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #0d1630;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.tutorial-copy {
  padding: 18px 20px 20px;
}

.lang-tag {
  display: inline-flex;
  padding: 0.35rem 0.6rem;
  background: var(--primary-soft);
  border-radius: 999px;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.buy-layout {
  display: grid;
  place-items: center;
}

.buy-card {
  width: min(100%, 1000px);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  background: linear-gradient(135deg, rgba(10, 63, 138, 0.04), rgba(255,255,255,0.6));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 30px;
  padding: 28px;
  gap: 22px;
}

.buy-image-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.98) 0 23%, transparent 24%),
    radial-gradient(circle at 50% 50%, rgba(10, 63, 138, 0.1), transparent 68%),
    linear-gradient(135deg, rgba(10, 63, 138, 0.09), rgba(10, 63, 138, 0.025));
  border-radius: 24px;
  min-height: 420px;
}

.buy-image-panel::before,
.buy-image-panel::after {
  content: "";
  position: absolute;
  width: min(76%, 310px);
  aspect-ratio: 1;
  border: 1px solid rgba(10, 63, 138, 0.12);
  border-radius: 50%;
  animation: orbit-pulse 7s ease-in-out infinite;
}

.buy-image-panel::after {
  width: min(95%, 390px);
  border-color: rgba(227, 0, 15, 0.1);
  animation-delay: -3.5s;
}

.product-visual {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  animation: image-float 5.5s ease-in-out infinite;
}

.product-visual img {
  filter: drop-shadow(0 20px 28px rgba(10, 63, 138, 0.2));
}

@keyframes device-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes image-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.025); }
}

@keyframes card-float {
  0%, 100% { transform: rotateY(-2deg) translateY(0); }
  50% { transform: rotateY(2deg) translateY(-8px); }
}

@keyframes badge-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes orbit-pulse {
  0%, 100% { opacity: 0.55; transform: scale(0.98); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes signal-ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45); }
  70%, 100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
}

.buy-info {
  padding: 12px 8px;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 600;
}

.rating {
  color: #f3ad1d;
}

.price-block {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  margin: 18px 0 20px;
}

.currency {
  font-size: 1.6rem;
  color: var(--primary-dark);
  font-weight: 800;
}

.amount {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  color: var(--primary-dark);
}

.buy-button {
  width: 210px;
  max-width: 100%;
}

.stock-copy {
  margin-top: 14px;
  color: var(--secondary);
  font-weight: 700;
}

.stock-copy.in-stock {
  color: var(--secondary);
}

.stock-copy.sold-out {
  color: var(--secondary);
}

.stock-copy.disabled {
  color: gray;
}

.secondary-purchase-row {
  margin-top: 18px;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 90vw);
  height: 100vh;
  background: var(--white);
  box-shadow: -20px 0 40px rgba(24, 32, 41, 0.15);
  transform: translateX(104%);
  transition: transform 0.25s ease;
  z-index: 40;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header,
.checkout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.cart-header h3,
.checkout-header h3 {
  margin: 0;
}

.close-cart,
.modal-close {
  border: none;
  background: transparent;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--primary-dark);
}

.cart-items {
  flex: 1;
  padding: 18px 20px;
  overflow-y: auto;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item h4 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.cart-item span {
  color: var(--muted);
}

.remove-item {
  border: none;
  background: rgba(227, 0, 15, 0.08);
  color: var(--secondary);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}

.cart-summary {
  padding: 18px 20px 22px;
  border-top: 1px solid var(--border);
  background: rgba(10, 63, 138, 0.02);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  font-weight: 700;
}

.full-width {
  width: 100%;
}

.modal-overlay,
.checkout-modal,
.interest-modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 16, 31, 0.54);
  display: grid;
  place-items: center;
  z-index: 70;
  padding: 18px;
  overflow-y: auto;
}

body.modal-open {
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.modal-box,
.checkout-panel,
.interest-panel {
  position: relative;
  width: min(620px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  background: var(--white);
  border-radius: 26px;
  padding: 26px 24px 22px;
  box-shadow: var(--shadow);
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

#modal-title {
  margin-bottom: 8px;
}

.modal-confirm {
  margin-top: 18px;
}

#checkout-form,
#interest-form {
  display: grid;
  gap: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--primary-dark);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(10, 63, 138, 0.15);
  background: rgba(10, 63, 138, 0.02);
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.checkout-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

.auth-shell,
.admin-shell,
.dashboard-shell {
  max-width: 1200px;
  margin: 64px auto;
  padding: 0 20px;
}

.auth-grid,
.dashboard-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.auth-shell {
  min-height: calc(100vh - 86px);
  padding-top: 20px;
  padding-bottom: 56px;
  background:
    radial-gradient(ellipse at 8% 8%, rgba(10, 63, 138, 0.09), transparent 32%),
    radial-gradient(ellipse at 92% 84%, rgba(227, 0, 15, 0.045), transparent 28%);
}

.auth-card,
.panel,
.admin-stat,
.table-panel,
.product-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.065);
}

.auth-card,
.panel,
.product-panel {
  padding: 28px;
}

.auth-card h2,
.panel h2 {
  margin-bottom: 18px;
}

.auth-form,
.profile-form,
.address-form,
.product-form {
  display: grid;
  gap: 16px;
}

.auth-form .field-row,
.profile-form .field-row,
.address-form .field-row,
.product-form .field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-toggle {
  display: inline-flex;
  background: rgba(10, 63, 138, 0.05);
  padding: 6px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.auth-toggle button,
.tab-button {
  border: none;
  background: transparent;
  color: var(--primary-dark);
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.auth-toggle button.active,
.tab-button.active {
  background: var(--primary);
  color: #fff;
}

.account-dashboard {
  display: grid;
  gap: 24px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.history-list {
  display: grid;
  gap: 14px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(10, 63, 138, 0.02);
}

.history-item strong,
.history-item span {
  display: block;
}

.status-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  text-transform: capitalize;
  font-size: 0.76rem;
  font-weight: 800;
}

.status-processing {
  background: rgba(235, 168, 52, 0.12);
  color: #9b5f00;
}

.status-shipped {
  background: rgba(17, 94, 189, 0.12);
  color: #0f5bb8;
}

.status-completed {
  background: rgba(20, 135, 20, 0.12);
  color: #0f7d32;
}

.status-cancelled {
  background: rgba(191, 45, 45, 0.12);
  color: #9f1a1a;
}

.admin-stats,
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.admin-stat {
  padding: 22px 18px;
}

.admin-stat strong {
  display: block;
  font-size: 1.9rem;
  color: var(--primary-dark);
}

.admin-stat span {
  color: var(--muted);
  font-weight: 600;
}

.table-panel {
  overflow: hidden;
}

.table-panel h3 {
  padding: 18px 20px 0;
  margin: 0;
}

.orders-help {
  margin: 8px 20px 16px;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap th,
.table-wrap td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid rgba(10, 63, 138, 0.08);
}

.table-wrap th {
  background: rgba(10, 63, 138, 0.03);
  color: var(--primary-dark);
}

.order-status-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
select,
textarea {
  border: 1px solid rgba(10, 63, 138, 0.16);
  background: rgba(10, 63, 138, 0.02);
}

.table-btn {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  margin-right: 8px;
  cursor: pointer;
  font-weight: 700;
}

.order-save-btn {
  color: #fff;
  background: var(--primary);
  white-space: nowrap;
}

.order-save-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.edit-product {
  background: rgba(10, 63, 138, 0.08);
  color: var(--primary-dark);
}

.delete-product {
  background: rgba(227, 0, 15, 0.08);
  color: var(--secondary);
}

.user-access-status {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  color: #17653a;
  background: rgba(23, 101, 58, 0.1);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.user-access-status.is-restricted {
  color: #a91a24;
  background: rgba(227, 0, 15, 0.1);
}

.user-profile-dialog {
  width: min(900px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  color: var(--text);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(14, 31, 60, 0.28);
}

.user-profile-dialog::backdrop {
  background: rgba(10, 23, 42, 0.62);
  backdrop-filter: blur(3px);
}

.user-profile-dialog [hidden] {
  display: none !important;
}

.user-profile-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border);
}

.user-profile-dialog__header .eyebrow {
  margin-bottom: 6px;
}

.user-profile-dialog__header h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.user-profile-close {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 1.5rem;
}

.user-profile-dialog__content {
  display: grid;
  max-height: calc(100dvh - 125px);
  gap: 22px;
  overflow-y: auto;
  padding: 22px 28px 28px;
}

.user-profile-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0;
}

.user-profile-detail,
.user-profile-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.user-profile-detail dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.user-profile-detail dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.user-profile-section h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.user-profile-addresses,
.user-profile-orders {
  display: grid;
  gap: 10px;
}

.user-profile-card p {
  margin: 7px 0 0;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.user-order-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.user-order-status {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: capitalize;
}

.user-profile-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.user-order-restriction {
  padding: 18px;
  border: 1px solid rgba(227, 0, 15, 0.18);
  border-radius: 16px;
  background: rgba(227, 0, 15, 0.035);
}

.user-order-restriction > p {
  margin-bottom: 12px;
}

.user-order-restriction label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

.user-order-restriction textarea {
  width: 100%;
  min-height: 84px;
  padding: 11px 13px;
  border-radius: 10px;
  resize: vertical;
}

.user-restriction-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.user-restriction-actions button {
  padding: 0.72rem 1rem;
}

.user-restriction-actions #user-restrict-orders {
  background: var(--secondary);
}

.user-restriction-actions button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.product-form {
  margin-top: 10px;
}

@media (max-width: 980px) {
  .auth-grid,
  .dashboard-grid,
  .admin-grid,
  .admin-stats,
  .dashboard-cards {
    grid-template-columns: 1fr;
  }

  .auth-form .field-row,
  .profile-form .field-row,
  .address-form .field-row,
  .product-form .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-profile-dialog__header {
    padding: 18px 18px 14px;
  }

  .user-profile-dialog__content {
    max-height: calc(100dvh - 100px);
    padding: 18px;
  }
}

@media (max-width: 980px) {
  .hero-inner,
  .split-layout,
  .buy-card,
  .tutorial-grid {
    grid-template-columns: 1fr;
  }

  .main-nav {
    display: none;
  }

  .header-inner {
    justify-content: space-between;
  }

}

@media (max-width: 640px) {
  .section {
    padding: 72px 0;
  }

  .header-inner {
    min-height: 74px;
  }

  .brand {
    width: 120px;
  }

  .header-actions {
    gap: 7px;
  }

  .header-actions .nav-cta {
    padding: 0.65rem 0.85rem;
    font-size: 0.88rem;
  }

  .header-account-menu summary {
    padding: 0.6rem 0.8rem;
    font-size: 0.88rem;
  }

  .cart-button {
    gap: 0.35rem;
  }

  .hero-inner {
    min-height: auto;
    padding-top: 30px;
  }

  .hero-actions,
  .checkout-actions,
  .field-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .buy-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 980px) {
  .admin-site-header .header-inner {
    flex-wrap: wrap;
    padding-block: 10px;
  }

  .admin-site-header .admin-nav {
    order: 3;
    display: flex;
    justify-content: flex-start;
    width: 100%;
    gap: 22px;
    overflow-x: auto;
    padding: 8px 0 4px;
    white-space: nowrap;
    scrollbar-width: thin;
  }
}
