:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-deep: #1e3a8a;
  --blue-soft: #dbeafe;
  --orange: #f97316;
  --orange-dark: #ea580c;
  --orange-soft: #ffedd5;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-700: #475569;
  --gray-900: #0f172a;
  --red-600: #dc2626;
  --on-accent: #ffffff;
  --bg-soft: #f8fbff;
  --topbar-bg: rgba(255, 255, 255, 0.9);
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
  --radius: 1.1rem;
}

:root[data-theme='dark'] {
  --blue: #60a5fa;
  --blue-dark: #3b82f6;
  --blue-deep: #93c5fd;
  --blue-soft: #1e3a8a;
  --orange: #fb923c;
  --orange-dark: #fbbf24;
  --orange-soft: #431407;
  --white: #0f172a;
  --gray-50: #0f172a;
  --gray-100: #1e293b;
  --gray-200: #334155;
  --gray-300: #475569;
  --gray-700: #cbd5e1;
  --gray-900: #f1f5f9;
  --red-600: #f87171;
  --on-accent: #ffffff;
  --bg-soft: #0b1220;
  --topbar-bg: rgba(11, 18, 32, 0.85);
  --shadow-sm: 0 10px 24px rgba(0, 0, 0, 0.35);
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--gray-900);
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--white) 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  width: 100%;
  object-fit: cover;
}

.container {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

/* ---------- Header ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--topbar-bg);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 0;
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--blue), var(--blue-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links,
.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-links a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.nav-links a.active {
  background: var(--blue);
  color: var(--on-accent);
}

/* ---------- Buttons ---------- */

.btn,
.cart-btn {
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.4rem;
}

.btn:hover,
.cart-btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--on-accent);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.btn-dark {
  background: #0a0a0a;
  color: var(--on-accent);
  box-shadow: 0 12px 24px rgba(10, 10, 10, 0.22);
}

.btn-dark:hover {
  filter: brightness(1.18);
}

.btn-danger {
  background: var(--red-600);
  color: var(--on-accent);
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.24);
}

.btn-danger:hover {
  filter: brightness(1.06);
}

.btn-sm {
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.cart-btn {
  background: var(--blue);
  color: var(--on-accent);
  padding: 0.72rem 1.1rem;
}

.cart-btn span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-left: 0.4rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--orange);
  font-size: 0.8rem;
}

/* ---------- Hero ---------- */

.hero {
  padding: 1.5rem 0 3rem;
}

/* Navigation bar: always visible now, Login button shown for guests */
.topbar {
  display: block;
}

/* Nav links and Orders hidden until signed in */
body:not(.signed-in) .nav-links,
body:not(.signed-in) .cart-btn {
  display: none;
}

/* Login text button (guests) */
.login-text-btn {
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--blue);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.login-text-btn:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--on-accent);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

/* Dark / light mode toggle (right of Login button) */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--orange);
  color: var(--orange);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

.theme-toggle .icon-moon {
  display: block;
}

.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}

/* Search bar: only visible once signed in */
.search-bar {
  max-width: 520px;
  margin: 0 auto 1.6rem;
  position: relative;
  display: none;
}

body.signed-in .search-bar {
  display: block;
}

.search-bar input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.7rem;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  color: var(--gray-900);
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 1rem center;
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-bar input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.hero-copy,
.hero-carousel {
  min-width: 0;
}

.hero-copy {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.hero h1,
.section-heading h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero-copy h1 {
  font-weight: 800;
}

.hero-copy p {
  color: var(--gray-700);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 1.4rem 0 1.6rem;
}

.hero-masonry {
  max-height: 640px;
  overflow-y: auto;
  border-radius: 1.5rem;
}

/* Signed-in: landing hero is for guests only, shop grid takes over */
body.signed-in .hero {
  display: none;
}

body:not(.signed-in) .shop-section {
  display: none;
}

/* ---------- Hero product carousel ---------- */

.hero-carousel {
  position: relative;
  margin-top: 0.5rem;
}

.carousel-viewport {
  overflow: hidden;
  min-width: 0;
}

.carousel-track {
  display: flex;
  gap: 1.2rem;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-cell {
  flex-shrink: 0;
  min-width: 0;
}

.carousel-cell .product-card {
  height: 100%;
}

.carousel-card {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.carousel-card:hover {
  transform: translateY(-3px);
}

.carousel-cell .product-card img {
  height: 230px;
  cursor: pointer;
}

.carousel-nav,
.carousel-arrow {
  display: none;
}

.masonry {
  columns: 3;
  column-gap: 0.75rem;
}

.masonry-tile {
  display: block;
  position: relative;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
  border-radius: 0.9rem;
  overflow: hidden;
  cursor: pointer;
  break-inside: avoid;
  background: var(--gray-100);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.masonry-tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.masonry-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.masonry-tile-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6rem 0.8rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  color: var(--on-accent);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.78) 100%);
}

.masonry-tile-info strong {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.masonry-tile-info em {
  font-style: normal;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--orange);
}

/* ---------- Sections & Cards ---------- */

.section {
  padding: 2.6rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.05), rgba(249, 115, 22, 0.05));
}

.section-heading {
  margin-bottom: 1.4rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.product-card img {
  height: 200px;
  cursor: pointer;
  transition: transform 0.4s ease;
}

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

.product-info {
  padding: 1rem;
}

.product-info h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.product-info p {
  margin: 0 0 0.9rem;
  color: var(--gray-700);
  font-size: 0.92rem;
}

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

.product-meta span {
  font-weight: 700;
  color: var(--blue-deep);
}

.add-btn {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  background: var(--orange);
  color: var(--on-accent);
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.add-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
}

.tab-button {
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tab-button:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.tab-button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--on-accent);
}

.tab-panels .tab-panel {
  display: none;
}

.tab-panels .tab-panel.active {
  display: block;
}

.account-tabs {
  margin-top: 1.5rem;
}

.account-panels {
  margin-top: 1.5rem;
}

/* ---------- Account ---------- */

.account-status {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-900);
  font-weight: 700;
  font-size: 0.95rem;
}

/* ---------- Cart ---------- */

.cart-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-checkbox {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex: 1;
  cursor: pointer;
}

.cart-checkbox input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--blue);
}

.cart-item-details {
  display: grid;
  gap: 0.2rem;
}

.cart-item-details strong {
  font-size: 0.95rem;
}

.cart-item-details span {
  color: var(--gray-700);
}

.cart-item-thumb {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--gray-100);
  border: 1px solid var(--gray-100);
}

.cart-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-remove-btn {
  flex-basis: 100%;
  align-self: flex-end;
  width: auto;
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  color: var(--red-600);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cart-remove-btn:hover {
  background: #fef2f2;
  border-color: var(--red-600);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.cart-total strong {
  color: var(--blue-deep);
}

/* ---------- Overlay & Modals ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 20;
}

.hidden {
  display: none !important;
}

#signInModal {
  z-index: 40;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  width: min(520px, calc(100% - 2rem));
}

.modal-card {
  background: var(--white);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
  padding: 1.6rem;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--gray-700);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--gray-900);
}

/* ---------- Product modal ---------- */

.modal--product {
  width: min(920px, calc(100% - 2rem));
}

.product-modal-content {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.product-modal-image {
  width: 100%;
  border-radius: 0.9rem;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.product-modal-price {
  display: block;
  margin-top: 0.75rem;
  font-size: 1.25rem;
}

.product-modal-body h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.product-modal-body p {
  margin: 0 0 1rem;
  color: var(--gray-700);
}

.product-modal-actions {
  display: flex;
  gap: 1rem;
}

.product-modal-actions .btn {
  flex: 1;
}

@media (min-width: 681px) {

  .modal--product .modal-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .modal--product .product-modal-content {
    flex: 1;
    min-height: 0;
  }

  .product-modal-content {
    flex-direction: row;
    align-items: stretch;
    gap: 2rem;
  }

  .product-modal-media {
    flex: 0 0 46%;
    max-width: 46%;
    display: flex;
    flex-direction: column;
  }

  .product-modal-media .product-modal-image {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 55vh;
    width: 100%;
    border-radius: 1rem;
    object-fit: cover;
  }

  .product-modal-media .product-modal-price {
    margin-top: 1rem;
    font-size: 1.5rem;
    text-align: center;
  }

  .product-modal-body {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .product-modal-body h2 {
    font-size: 1.8rem;
  }

  .product-modal-body p {
    flex: 1;
    min-height: 0;
    margin-bottom: 0;
    overflow-y: auto;
    font-size: 1.05rem;
  }

  .product-modal-actions {
    margin-top: auto;
  }
}

/* ---------- Confirm dialog ---------- */

.confirm-card {
  text-align: center;
  display: grid;
  gap: 1rem;
  justify-items: center;
}

.confirm-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fef2f2;
  color: var(--red-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon svg {
  width: 28px;
  height: 28px;
}

.confirm-title {
  font-size: 1.15rem;
  color: var(--gray-900);
  margin: 0;
}

.confirm-message {
  color: var(--gray-700);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.confirm-actions .btn {
  flex: 1;
}

.confirm-cancel {
  background: var(--gray-100);
  color: var(--gray-900);
}

.confirm-ok {
  background: var(--red-600);
  color: var(--on-accent);
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.24);
}

.confirm-ok:hover {
  filter: brightness(1.06);
}

.confirm-ok:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.cancel-reason-select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-900);
  font-size: 0.95rem;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cancel-reason-select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon svg {
  width: 28px;
  height: 28px;
}

.success-ok {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--on-accent);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.24);
}

.success-ok:hover {
  filter: brightness(1.06);
}

.form-card {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.oauth-section {
  margin-top: 1.1rem;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--white);
  color: var(--gray-900);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-google:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
  box-shadow: var(--shadow-sm);
}

.btn-google--blue {
  border-color: var(--blue);
  background: linear-gradient(120deg, var(--blue), var(--blue-deep));
  color: var(--on-accent);
}

.btn-google--blue:hover {
  border-color: var(--blue-dark);
  background: linear-gradient(120deg, var(--blue-dark), var(--blue-deep));
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

.btn-google--orange {
  border-color: var(--orange);
  background: linear-gradient(120deg, var(--orange), var(--orange-dark));
  color: var(--on-accent);
}

.btn-google--orange:hover {
  border-color: var(--orange-dark);
  background: linear-gradient(120deg, var(--orange-dark), #c2410c);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}

.google-icon {
  flex-shrink: 0;
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1rem 0;
  color: var(--gray-700);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.form-card label {
  display: grid;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--gray-900);
}

.form-card label span {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--gray-700);
}

.form-card input,
.form-card select {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-900);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-card input:focus,
.form-card select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.form-card input:read-only {
  background: var(--gray-100);
  color: var(--gray-700);
}

.form-card select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23475569' stroke-width='1.5' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 1rem center;
  background-repeat: no-repeat;
  background-size: 0.75rem 0.75rem;
}

.modal-note {
  margin-top: 1rem;
  color: var(--gray-700);
  font-size: 0.92rem;
}

.modal-link {
  background: none;
  border: none;
  padding: 0;
  margin-top: 1rem;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: underline;
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.auth-logo {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--blue), var(--blue-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.password-input-wrap {
  position: relative;
}

.password-input-wrap input {
  padding-right: 4.5rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  border: none;
  background: var(--gray-100);
  color: var(--gray-700);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.6rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.auth-row {
  display: flex;
  justify-content: flex-end;
}

.forgot-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.form-error {
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--red-600);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
}

.form-error.form-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

/* ---------- Credentials ---------- */

.credential-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 0.95rem;
  padding: 0.85rem;
}

.credential-left {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.credential-left input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  accent-color: var(--blue);
}

.credential-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.credential-details strong {
  font-size: 0.95rem;
  color: var(--gray-900);
}

.credential-details span {
  font-size: 0.88rem;
  color: var(--gray-700);
}

.credential-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.credential-actions .btn {
  background: transparent;
  border: 1px solid var(--gray-100);
  padding: 0.4rem 0.7rem;
  border-radius: 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.credential-actions .credential-edit-btn {
  color: var(--blue);
}

.credential-actions .credential-delete-btn {
  color: var(--red-600);
}

.add-credential-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 1rem;
  padding: 1.25rem;
}

.add-credential-box label {
  font-weight: 500;
  font-size: 0.9rem;
}

.add-credential-box input {
  background: var(--white);
}

.add-credential-box #addCredentialBtn {
  width: 100%;
  margin-top: 0.5rem;
}

/* ---------- Orders ---------- */

.orders-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

.order-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 1rem;
  padding: 1rem;
  display: grid;
  gap: 0.6rem;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.order-header strong {
  color: var(--gray-900);
  font-size: 0.95rem;
}

.order-status {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
  background: var(--gray-100);
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  color: var(--gray-700);
  font-size: 0.88rem;
}

.order-meta span:last-child {
  font-weight: 700;
  color: var(--gray-900);
}

.order-items {
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.5;
}

/* ---------- Empty state ---------- */

.empty-state {
  margin: 0;
  padding: 1.5rem 0;
  color: var(--gray-700);
  text-align: center;
  grid-column: 1 / -1;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--gray-100);
  padding: 1.6rem 0 2.8rem;
  margin-top: 1.6rem;
}

.orders-page main {
  min-height: calc(100vh - 10rem);
}

.orders-page .footer {
  margin-top: 5rem;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--gray-700);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--blue);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-contact-title {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--gray-900);
}

.footer-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--gray-700);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-contact-item:hover {
  color: var(--blue);
}

.footer-contact-item svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  stroke: var(--orange);
  fill: none;
}

/* ---------- User dropdown ---------- */

.user-menu {
  position: relative;
}

.dropdown {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 0.8rem;
  padding: 0.5rem;
  box-shadow: var(--shadow);
  z-index: 100;
  min-width: 120px;
}

.dropdown button {
  background: none;
  border: none;
  color: var(--red-600);
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 1rem;
  width: 100%;
  text-align: left;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.dropdown button:hover {
  background: var(--gray-50);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .carousel-cell .product-card img {
    height: 200px;
  }
}

@media (max-width: 680px) {
  .nav-wrap {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem 0;
  }

  .brand {
    order: 1;
    font-size: 1.1rem;
  }

  .nav-actions {
    order: 2;
    width: auto;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .nav-links {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .account-status,
  .cart-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }

  .hero {
    padding-top: 0.75rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .product-card img {
    height: 140px;
  }

  .product-info {
    padding: 0.75rem;
  }

  .product-info h3 {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .product-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .add-btn {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.85rem;
  }

  .tabs {
    justify-content: center;
  }

  .tab-button {
    flex: 1 1 calc(50% - 0.75rem);
    text-align: center;
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  .credential-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .credential-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .footer-wrap {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 400px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card img {
    height: 200px;
  }

  .product-meta {
    flex-direction: row;
    align-items: center;
  }

  .add-btn {
    width: auto;
  }
}

/* ---------- Toast notifications ---------- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(120deg, var(--blue), var(--blue-deep));
  color: var(--on-accent);
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--orange);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 480px) {
  .toast {
    white-space: normal;
    text-align: center;
    max-width: calc(100vw - 32px);
  }
}
