@tailwind base;
@tailwind components;
@tailwind utilities;

/* =====================================================
   GLOBAL DESIGN TOKENS — Dark Reader Style (Slightly Darker)
   ===================================================== */

:root {
  /* Dark Reader inspired - Slightly darker */
  --color-bg: #1a1d1e;           /* Slightly darker than #282c2e */
  --color-bg-darker: #101213;    /* Slightly darker than #222526 */
  --color-card: #1e2122;         /* Slightly darker than #2c3031 */
  --color-card-hover: #242728;   /* Slightly darker than #303437 */
  --color-card-light: #232627;   /* Slightly darker than #2f3335 */
  
  --color-accent: #4e7226;       /* Dark Reader output for #59802e */
  --color-accent-hover: #446721; /* Dark Reader output for #4a6d26 */
  --color-accent-text: #a4cf76;  /* Dark Reader output for #a0cb71 */
  --color-accent-bg: rgba(78, 114, 38, 0.15);
  --color-accent-bg-light: rgba(78, 114, 38, 0.25);
  
  --color-gold: #72471d;         /* Dark Reader output for #7b4f23 */
  --color-gold-text: #dba979;    /* Dark Reader output for #d8a777 */
  --color-gold-bg: rgba(114, 71, 29, 0.2);
  
  --color-title: #d6d2cc;        /* Slightly darker than #dddad4 */
  --color-text: #b0a89f;         /* Slightly darker than #bab2a9 */
  --color-text-muted: #9e968b;   /* Slightly darker than #aba398 */
  --color-text-light: #9e968b;   /* Slightly darker than #aba398 */
  
  --color-border: #5c554a;       /* Slightly darker than #665e53 */
  --color-border-light: #635c50; /* Slightly darker than #6d6559 */
  --color-border-dark: #6d6558;  /* Slightly darker than #7a7163 */
  --color-border-input: #645d52; /* Slightly darker than #71685c */
  
  --color-danger: #672121;       /* Dark Reader output for #6d2626 */
  --color-danger-hover: #732727; /* Dark Reader output for #822f2f */
  --color-danger-text: #fc6a6a;  /* Dark Reader output for #f87171 */
  
  --shadow-color: rgba(0, 0, 0, 0.5);
}

/* ============ BASE ============ */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* Always reserve space for the vertical scrollbar so pages whose content
   height changes (e.g. loading -> loaded states) don't shift width as the
   scrollbar appears/disappears. Fixes admin-order.html "width keeps
   changing" jumpiness. Both axes are set explicitly (rather than just
   overflow-x) because setting only one axis forces browsers to silently
   compute the other as "auto", which turns html into an unwanted second
   scroll container and breaks sticky/fixed positioning across the site. */
html {
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Sticky footer: navbar/footer stay fixed height, main grows to fill space */
#global-navbar {
  flex-shrink: 0;
}

body > main {
  flex: 1 0 auto;
  width: 100%;
}

#global-footer {
  flex-shrink: 0;
  margin-top: auto;
}

h1, h2, h3, h4, h5, .font-serif-heading {
  font-family: 'Playfair Display', serif;
  color: var(--color-title);
}

p, span, label, td, th, li, input, select, textarea, button {
  font-family: 'Inter', sans-serif;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: #2a2e2f; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* ============ CARDS & MODULES ============ */
.admin-card, .card-dark {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
}

/* ============ TEXT COLORS ============ */
.text-\[\#6b6b6b\] {
  color: var(--color-text-muted) !important;
}

.text-\[\#aaa\], .text-\[\#aaaaaa\], .text-\[\#888\], .text-\[\#888888\] {
  color: var(--color-text-light) !important;
}

.text-\[\#b3b3b3\] {
  color: var(--color-text) !important;
}

.text-\[\#ffffff\], .text-white {
  color: var(--color-title) !important;
}

.text-\[\#6a9739\] {
  color: var(--color-accent-text) !important;
}

.text-\[\#d4a373\] {
  color: var(--color-gold-text) !important;
}

/* ============ BORDER COLORS ============ */
.border-\[\#2d2d2d\] {
  border-color: var(--color-border) !important;
}

.border-\[\#1a1a1a\] {
  border-color: var(--color-card-light) !important;
}

.border-\[\#0d0d0d\] {
  border-color: var(--color-bg-darker) !important;
}

.border-\[\#e5e7eb\] {
  border-color: var(--color-border-dark) !important;
}

/* ============ BACKGROUND COLORS ============ */
.bg-\[\#0d0d0d\] {
  background-color: var(--color-bg-darker) !important;
}

.bg-\[\#1a1a1a\] {
  background-color: var(--color-card-light) !important;
}

.bg-\[\#111111\] {
  background-color: var(--color-bg) !important;
}

.bg-\[\#1b1b1b\] {
  background-color: var(--color-card) !important;
}

.bg-\[\#222222\] {
  background-color: var(--color-card-hover) !important;
}

.bg-\[\#2d2d2d\] {
  background-color: var(--color-border) !important;
}

/* ============ INPUT DARK ============ */
.input-dark {
  background-color: var(--color-card);
  border: 1px solid var(--color-border-input);
  color: var(--color-title);
  font-family: 'Inter', sans-serif;
}

.input-dark::placeholder {
  color: var(--color-text-muted);
}

.input-dark:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(78, 114, 38, 0.25);
}

.input-dark:disabled {
  background-color: var(--color-bg-darker);
  opacity: 0.6;
  cursor: not-allowed;
}

select.input-dark option {
  background-color: var(--color-card);
  color: var(--color-title);
}

/* ============ RICH TEXT EDITOR (Admin product description) ============ */
.rte-toolbar {
  background-color: var(--color-bg-darker, #161616);
}

.rte-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: transparent;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.rte-btn:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--color-title);
  border-color: var(--color-border);
}

.rte-btn.italic em {
  font-style: italic;
}

.rte-block-select {
  height: 28px;
}

.rte-editor {
  min-height: 160px;
  max-height: 360px;
  overflow-y: auto;
  cursor: text;
}

.rte-editor:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(78, 114, 38, 0.25);
}

.rte-editor:empty::before {
  content: "Write your detailed product description here. Select text to format it with the toolbar above.";
  color: var(--color-text-muted);
}

.rte-editor a {
  color: var(--color-accent-text, #8fbf5a);
  text-decoration: underline;
}

/* ============ BUTTONS ============ */
.btn-organic {
  background-color: var(--color-accent);
  color: #ffffff;
  transition: 0.2s ease-in-out;
  font-weight: 600;
}

.btn-organic:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-1px);
}

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

.btn-outline-organic {
  background-color: transparent;
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent-text);
  transition: 0.2s ease-in-out;
  font-weight: 600;
}

.btn-outline-organic:hover {
  background-color: var(--color-accent);
  color: #ffffff;
}

.btn-gold {
  background-color: var(--color-gold);
  color: #ffffff;
  transition: 0.2s ease-in-out;
  font-weight: 600;
}

.btn-gold:hover {
  background-color: #6b4219;
}

.btn-danger {
  background-color: var(--color-danger);
  color: #ffffff;
  transition: 0.2s ease-in-out;
}

.btn-danger:hover {
  background-color: var(--color-danger-hover);
}

/* ============ NAV & LINKS ============ */
.nav-link {
  color: var(--color-text);
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-accent-text);
}

/* ============ ADMIN SIDEBAR ============ */
.sidebar-tab {
  color: var(--color-text);
  background-color: transparent;
  transition: all 0.2s ease;
}

.sidebar-tab:hover {
  background-color: var(--color-card);
  color: var(--color-title);
}

.sidebar-tab.active {
  background-color: var(--color-accent);
  color: #ffffff;
}

aside.bg-\[\#0d0d0d\] {
  background-color: var(--color-bg-darker) !important;
}

/* ============ TABLES ============ */
.admin-card table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.15s ease;
}

.admin-card table tbody tr:hover {
  background-color: var(--color-card-hover);
}

.admin-card table tbody tr:last-child {
  border-bottom: none;
}

.admin-card table thead tr {
  border-bottom: 1px solid var(--color-border);
}

.admin-card table thead th {
  color: var(--color-text-muted) !important;
}

/* ============ FOOTER ============ */
#global-footer footer {
  width: 100%;
}

#global-footer .grid {
  text-align: left;
}

@media (max-width: 767px) {
  #global-footer footer {
    padding-top: 4px;
  }

  #global-footer .max-w-7xl {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    gap: 2rem;
  }

  #global-footer .grid {
    text-align: center;
    gap: 1.75rem;
  }

  #global-footer .grid > div {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #global-footer ul {
    width: 100%;
  }

  #global-footer h4 {
    margin-bottom: 0.5rem;
  }

  #global-footer p {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ============ HEADER ============ */
header.bg-\[\#0d0d0d\] {
  background-color: var(--color-bg-darker) !important;
}

header .border-b {
  border-color: var(--color-border) !important;
}

/* ============ STATUS PILLS ============ */
.status-pending { color: var(--color-text); }
.status-approved { color: var(--color-gold-text); }
.status-printing { color: var(--color-gold-text); }
.status-shipped { color: var(--color-accent-text); }
.status-delivered { color: var(--color-accent-text); }

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.pending { background: rgba(255, 255, 255, 0.05); color: var(--color-text); }
.status-badge.approved { background: rgba(114, 71, 29, 0.2); color: var(--color-gold-text); }
.status-badge.printing { background: rgba(114, 71, 29, 0.2); color: var(--color-gold-text); }
.status-badge.shipped { background: rgba(78, 114, 38, 0.15); color: var(--color-accent-text); }
.status-badge.delivered { background: rgba(78, 114, 38, 0.15); color: var(--color-accent-text); }
.status-badge.cancelled { background: rgba(103, 33, 33, 0.2); color: var(--color-danger-text); }

/* ============ ORDER FILTER BUTTONS ============ */
.order-filter-btn.active-filter {
  background-color: rgba(78, 114, 38, 0.25) !important;
  color: var(--color-accent-text) !important;
  border-color: rgba(78, 114, 38, 0.3) !important;
}

.order-filter-btn {
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.order-filter-btn:hover {
  border-color: var(--color-accent);
}

/* ============ TOGGLE SWITCHES ============ */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg);
  transition: border-color 0.2s ease;
}

.toggle-row:hover {
  border-color: var(--color-border-light);
}

.toggle-row .toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-title);
  cursor: pointer;
}

.toggle-row .toggle-desc {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: #2a2e2f;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  transition: 0.25s ease;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #5a5550;
  border-radius: 50%;
  transition: 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
  background: rgba(78, 114, 38, 0.25);
  border-color: var(--color-accent);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: var(--color-accent);
}

.toggle-switch input:focus + .toggle-slider {
  box-shadow: 0 0 0 3px rgba(78, 114, 38, 0.2);
}

/* ============ MODAL OVERLAY ============ */
.modal-overlay {
  background-color: rgba(16, 18, 19, 0.85);
  backdrop-filter: blur(2px);
}

/* ============ MISC ============ */
.text-organic { color: var(--color-accent-text); }
.text-gold { color: var(--color-gold-text); }
.border-organic { border-color: var(--color-accent); }
.bg-organic { background-color: var(--color-accent); }
.bg-card { background-color: var(--color-card); }
.bg-charcoal { background-color: var(--color-bg); }

/* ============ THEMED RANGE SLIDER (e.g. Infill Density) ============ */
.range-organic {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--color-accent) 0%,
    var(--color-accent) var(--range-progress, 20%),
    var(--color-border) var(--range-progress, 20%),
    var(--color-border) 100%
  );
  outline: none;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.range-organic::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent-text);
  border: 3px solid var(--color-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-top: -7px;
}

.range-organic::-webkit-slider-thumb:hover,
.range-organic::-webkit-slider-thumb:active {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(78, 114, 38, 0.25);
}

.range-organic::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--color-border);
}

.range-organic::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--color-accent);
}

.range-organic::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-accent-text);
  border: 3px solid var(--color-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.range-organic::-moz-range-thumb:hover {
  transform: scale(1.15);
}

.range-organic:focus-visible {
  box-shadow: 0 0 0 3px rgba(78, 114, 38, 0.3);
  border-radius: 999px;
}

/* ============ QUOTE RESULT CARD ============ */
.quote-result-card {
  background: linear-gradient(180deg, var(--color-accent-bg-light) 0%, var(--color-accent-bg) 100%);
  border: 1px solid var(--color-accent);
  border-radius: 0.875rem;
  position: relative;
  overflow: hidden;
}

.quote-result-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-text), var(--color-accent));
}

.quote-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.quote-stat:last-child { border-bottom: none; }

.quote-stat-label {
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quote-stat-value {
  color: var(--color-title);
  font-weight: 600;
}

.quote-floor-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--color-gold-bg);
  color: var(--color-gold-text);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-top: 0.5rem;
}

/* ============ CART ICON "ADDED" ANIMATION ============ */
@keyframes cartIconBump {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.25) rotate(-8deg); }
  55%  { transform: scale(0.95) rotate(4deg); }
  75%  { transform: scale(1.12) rotate(-2deg); }
  100% { transform: scale(1) rotate(0); }
}

#nav-cart-btn.cart-icon-bump {
  animation: cartIconBump 0.55s ease;
}

#nav-cart-btn.cart-icon-bump svg {
  animation: cartIconGlow 0.55s ease;
}

@keyframes cartIconGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(164, 207, 118, 0)); }
  40% { filter: drop-shadow(0 0 6px rgba(164, 207, 118, 0.9)); }
}

#nav-cart-btn.cart-icon-bump #cart-count-badge {
  animation: cartBadgePop 0.55s ease;
}

@keyframes cartBadgePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5); background-color: var(--color-accent-text); }
  100% { transform: scale(1); }
}

/* ============ SIDE CART DRAWER ============ */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 18, 19, 0.6);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.cart-drawer-overlay.cart-drawer-open { opacity: 1; }

.cart-drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(160deg, #1b1b1b, #131313);
  border-left: 1px solid var(--color-border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}

.cart-drawer-panel.cart-drawer-open {
  transform: translateX(0);
}

.cart-drawer-item-added {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
/* ============ ADMIN: CUSTOM ASSETS BADGE (collapsed order row) ============ */
.custom-assets-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--color-gold-bg);
  color: var(--color-gold-text);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(114, 71, 29, 0.4);
  white-space: nowrap;
  cursor: help;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.custom-assets-badge:hover {
  background: rgba(114, 71, 29, 0.35);
  border-color: rgba(114, 71, 29, 0.7);
}

.custom-assets-badge-hint {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  display: block;
  background: #101213;
  color: var(--color-gold-text);
  font-size: 10px;
  font-weight: 500;
  padding: 5px 9px;
  border-radius: 6px;
  border: 1px solid rgba(114, 71, 29, 0.4);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}

.custom-assets-badge-hint::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #101213;
}

.custom-assets-badge:hover .custom-assets-badge-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ ADMIN: ORDER ITEM CARDS (expanded order row) ============ */
.order-item-card {
  background: #161616;
  border: 1px solid #2d2d2d;
  border-radius: 10px;
  padding: 10px 12px;
}

.order-item-card-custom {
  background: rgba(78, 114, 38, 0.06);
  border-color: rgba(164, 207, 118, 0.25);
}

.order-item-index {
  display: inline-block;
  background: rgba(164, 207, 118, 0.15);
  color: #a4cf76;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  vertical-align: middle;
}

.order-item-print-details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(164, 207, 118, 0.2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.order-item-file-link {
  font-size: 12px;
  color: #a4cf76;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
}

.order-item-file-link:hover { text-decoration: underline; }

.order-item-file-link-gold { color: #dba979; }

.order-item-spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.order-item-spec-pill {
  font-size: 10.5px;
  color: #aba398;
  background: #1e1e1e;
  border: 1px solid #2d2d2d;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
/* ============ 3D MODEL PREVIEW THUMBNAIL ============ */
.model-preview-tile {
  background: var(--color-bg-darker);
  border-radius: 0.75rem;
  position: relative;
}

.model-preview-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(16, 18, 19, 0.85);
  color: var(--color-accent-text);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--color-accent);
  z-index: 2;
}

/* ============ SPINNER ============ */
.spinner {
  border: 3px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
}

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

/* ============ FADE IN ============ */
.fade-in {
  animation: fadeIn 0.35s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ STEPPER ============ */
.stepper-container {
  padding: 2rem 0;
}

.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-border);
  transform: translateY(-50%);
  z-index: 0;
}

.stepper-progress {
  position: absolute;
  top: 50%;
  left: 0;
  height: 3px;
  background: var(--color-accent);
  transform: translateY(-50%);
  z-index: 1;
  transition: width 0.6s ease;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
  cursor: default;
}

.step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  background: var(--color-border);
  color: var(--color-text-muted);
  border: 3px solid var(--color-border);
  transition: all 0.4s ease;
  position: relative;
}

.step-circle.completed {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
}

.step-circle.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #ffffff;
  box-shadow: 0 0 0 6px rgba(78, 114, 38, 0.25);
  animation: pulse-step 2s infinite;
}

.step-circle.pending {
  background: var(--color-border);
  border-color: var(--color-border);
  color: var(--color-text-muted);
}

.step-circle .step-icon { font-size: 18px; }
.step-circle .step-number { font-size: 14px; }

.step-label {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
  max-width: 80px;
}

.step-label.active-label { color: var(--color-title); }
.step-label.completed-label { color: var(--color-accent-text); }

.step-cancelled .step-circle {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #ffffff;
}

.step-cancelled .step-label {
  color: var(--color-danger);
}

@keyframes pulse-step {
  0% { box-shadow: 0 0 0 0 rgba(78, 114, 38, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(78, 114, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(78, 114, 38, 0); }
}

/* ============ CANCELLED ORDERS ============ */
.cancelled-row {
  background-color: rgba(103, 33, 33, 0.12) !important;
  border-left: 2px solid rgba(239, 68, 68, 0.4);
}

.cancelled-row:hover {
  background-color: rgba(103, 33, 33, 0.2) !important;
}

.cancelled-row .order-id-text {
  color: var(--color-danger-text) !important;
  font-weight: 400 !important;
}

.cancelled-row .customer-name {
  color: #fca5a5 !important;
}

.cancelled-row .total-amount {
  color: var(--color-danger-text) !important;
}

.bg-red-950\/20 { background-color: rgba(103, 33, 33, 0.2); }
.bg-red-950\/30 { background-color: rgba(103, 33, 33, 0.3); }
.bg-red-950\/40 { background-color: rgba(103, 33, 33, 0.4); }
.border-red-500\/50 { border-color: rgba(220, 50, 50, 0.5); }
.border-red-600\/50 { border-color: rgba(200, 40, 40, 0.5); }
.border-red-800\/30 { border-color: rgba(180, 40, 40, 0.3); }

/* ============ SIMILAR PRODUCTS CAROUSEL ============ */
.similar-products-container {
  position: relative;
  overflow: hidden;
}

.similar-products-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0.5rem 0.25rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.similar-products-scroll::-webkit-scrollbar { display: none; }

.similar-product-card {
  flex: 0 0 280px;
  max-width: 280px;
  transition: transform 0.3s ease;
}

.similar-product-card:hover {
  transform: translateY(-4px);
}

.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(30, 33, 34, 0.9);
  border: 1px solid var(--color-border);
  color: var(--color-title);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.scroll-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.scroll-btn.left { left: -12px; }
.scroll-btn.right { right: -12px; }
.scroll-btn:disabled { opacity: 0.3; cursor: not-allowed; }

@media (max-width: 640px) {
  .similar-product-card { flex: 0 0 200px; max-width: 200px; }
  .scroll-btn { width: 32px; height: 32px; font-size: 14px; }
  .scroll-btn.left { left: -8px; }
  .scroll-btn.right { right: -8px; }
}

/* ============ LINE CLAMP ============ */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ PRODUCT DETAILS ============ */
.product-details-content {
  max-width: 100%;
}

.product-details-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-title);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.product-details-content h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-gold-text);
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.product-details-content ul {
  margin: 0.75rem 0 1rem 0;
  padding-left: 1.5rem;
  list-style: none;
}

.product-details-content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  line-height: 1.6;
}

.product-details-content ul li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--color-accent-text);
  font-weight: bold;
}

.product-details-content ol {
  margin: 0.75rem 0 1rem 0;
  padding-left: 1.5rem;
}

.product-details-content ol li {
  margin-bottom: 0.5rem;
  color: var(--color-text);
  line-height: 1.6;
}

.product-details-content strong {
  color: var(--color-title);
  font-weight: 600;
}

.product-details-content .highlight-box {
  background: rgba(30, 33, 34, 0.8);
  border: 1px solid rgba(219, 169, 121, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
}

.product-details-content .highlight-box .gold-text {
  color: var(--color-gold-text);
}

.product-details-content .divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

/* ============ CART NOTIFICATION ============ */
.slide-in-up {
  animation: slideInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.slide-out-down {
  animation: slideOutDown 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideOutDown {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(30px) scale(0.95); }
}

.checkmark-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
}

.checkmark {
  width: 56px;
  height: 56px;
  display: block;
}

.checkmark__circle {
  stroke: var(--color-accent);
  stroke-width: 3;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
  stroke: var(--color-accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: stroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) 0.3s forwards;
}

@keyframes stroke {
  100% { stroke-dashoffset: 0; }
}

.checkmark-wrapper::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(78, 114, 38, 0.15);
  animation: pulseGlow 1s ease-out forwards;
}

@keyframes pulseGlow {
  0% { transform: scale(0.5); opacity: 0; }
  50% { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

#cart-added-notification {
  background: rgba(16, 18, 19, 0.75);
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .step-label { font-size: 9px; max-width: 50px; }
  .step-circle { width: 32px; height: 32px; font-size: 11px; }
  .step-circle .step-icon { font-size: 14px; }
}

/* ============ SQUARE IMAGE CONTAINER ============ */
.square-img-container {
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  background-color: var(--color-card-light);
}

.square-img-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* For product cards - maintain square ratio */
.product-img-square {
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  background-color: var(--color-card-light);
}

.product-img-square img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Product description formatting */
.product-details-content p {
    margin-bottom: 0.75rem;
    line-height: 1.7;
    color: var(--color-text);
}

.product-details-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-title);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.product-details-content h3:first-child {
    margin-top: 0;
}

.product-details-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-gold-text);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.product-details-content ul {
    margin: 0.5rem 0 1rem 0;
    padding-left: 1.5rem;
    list-style: none;
}

.product-details-content ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    line-height: 1.6;
}

.product-details-content ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--color-accent-text);
    font-weight: bold;
}

.product-details-content ol {
    margin: 0.5rem 0 1rem 0;
    padding-left: 1.5rem;
}

.product-details-content ol li {
    margin-bottom: 0.5rem;
    color: var(--color-text);
    line-height: 1.6;
}

.product-details-content strong {
    color: var(--color-title);
    font-weight: 600;
}

.product-details-content .highlight-box {
    background: rgba(30, 33, 34, 0.8);
    border: 1px solid rgba(219, 169, 121, 0.2);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
}

.product-details-content .highlight-box .gold-text {
    color: var(--color-gold-text);
}

.product-details-content .divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1.5rem 0;
}








  .active-tab { 
    background: rgba(124,158,110,0.15) !important; 
    color: white !important; 
  }
  
  /* Order table styles */
  .order-row {
    transition: background-color 0.15s ease;
  }
  
  .expand-row {
    background-color: #141414;
  }
  
  .expand-content {
    transition: max-height 0.4s ease, opacity 0.3s ease;
  }
  
  /* Status badge styles */
  .status-badge.shipped {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
  }
  .status-badge.delivered {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 10px;
  }
  .status-badge.pending {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
    border-radius: 10px;
  }
  .status-badge.processing {
    background: rgba(168, 85, 247, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
  }
  .status-badge.printing {
    background: rgba(168, 85, 247, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
  }
  .status-badge.cancelled {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
  }
  
  /* Table header */
  .card-dark table thead {
    background-color: #0d0d0d;
  }


/* ===================== MEDIA LIBRARY ===================== */
.delivery-type-option.selected {
  border-color: var(--organic) !important;
  background: rgba(106, 151, 57, 0.05);
}
.delivery-type-option[data-type="store_pickup"].selected {
  border-color: var(--gold) !important;
  background: rgba(201, 168, 76, 0.05);
}
/* ===================== CHECKOUT - STORE PICKUP ===================== */
.delivery-type-option {
  transition: all 0.25s ease;
}

.delivery-type-option.selected {
  border-color: #4e7226 !important;
  background: rgba(78, 114, 38, 0.06);
}

.delivery-type-option[data-type="store_pickup"].selected {
  border-color: #dba979 !important;
  background: rgba(219, 169, 121, 0.06);
}

.delivery-type-option:not(.selected):hover {
  border-color: rgba(78, 114, 38, 0.4);
}

.delivery-type-option[data-type="store_pickup"]:not(.selected):hover {
  border-color: rgba(219, 169, 121, 0.4);
}

#store-pickup-info {
  border-color: rgba(219, 169, 121, 0.3);
  animation: fadeIn 0.3s ease;
}

#store-address-block .grid-display {
  display: grid;
  grid-template-columns: 85px 1fr;
  gap: 4px 16px;
  font-size: 13px;
}

#store-address-block .grid-display .label {
  color: #6b6b6b;
}

#store-address-block .grid-display .value {
  color: #b0a89f;
}

#store-address-block .grid-display .value-highlight {
  color: #d6d2cc;
  font-weight: 600;
}

/* =====================================================
   ORDER HISTORY (profile.html)
   Desktop = original table, completely untouched.
   Mobile  = a dedicated, purpose-built card list
   (separate markup, not a CSS reflow of the table).
   ===================================================== */

/* View switching */
.orders-mobile-view {
  display: none;
}

@media (max-width: 768px) {
  .orders-desktop-view {
    display: none !important;
  }
  .orders-mobile-view {
    display: block;
  }
}

/* ---- Card shell ---- */
.m-order-card {
  background: var(--color-card, #1e2122);
  border: 1px solid var(--color-border, #5c554a);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
}

.m-order-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 14px 16px;
  cursor: pointer;
  font-family: inherit;
}

.m-order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.m-order-id {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-title, #d6d2cc);
}

.m-order-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-text-muted, #9e968b);
}

.m-order-dot {
  opacity: 0.5;
}

.m-order-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.m-order-total {
  font-weight: 700;
  font-size: 16px;
  color: #a4cf76;
}

.m-order-chevron {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #9e968b);
}

.m-chev {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 10px;
}

.m-order-chevron.m-chev-open .m-chev {
  transform: rotate(180deg);
}

/* ---- Expand panel ---- */
.m-order-expand {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  border-top: 1px solid var(--color-border, #5c554a);
}

.m-order-expand.m-order-expand-open {
  max-height: 4000px;
  opacity: 1;
}

.m-block {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.m-block:last-child {
  border-bottom: none;
}

.m-block-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #9e968b);
  margin-bottom: 8px;
}

.m-block-danger {
  background: rgba(239, 68, 68, 0.08);
}

.m-block-history {
  background-color: #1112129c;
  border-radius: 10px;
  margin: 0 2px;
}

.m-cancel-title {
  color: #f87171;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.m-cancel-reason {
  color: var(--color-text-muted, #9e968b);
  font-size: 13px;
}

/* key/value rows used across blocks */
.m-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}

.m-kv span:first-child {
  color: var(--color-text-muted, #9e968b);
  flex-shrink: 0;
}

.m-kv span:last-child {
  color: var(--color-title, #d6d2cc);
  text-align: right;
  font-weight: 500;
}

.m-free {
  color: #a4cf76 !important;
}

.m-discount {
  color: #dba979 !important;
}

.m-grand-total {
  border-top: 1px solid var(--color-border, #5c554a);
  margin-top: 6px;
  padding-top: 8px;
}

.m-grand-total span:first-child {
  color: var(--color-title, #d6d2cc);
  font-weight: 700;
}

.m-grand-total span:last-child {
  color: #a4cf76;
  font-weight: 700;
  font-size: 16px;
}

.m-totals {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.m-track-num {
  font-family: 'SF Mono', 'Menlo', monospace;
  color: #a4cf76 !important;
}

/* addresses */
.m-addr-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-title, #d6d2cc);
  margin-bottom: 2px;
}

.m-addr-line {
  font-size: 12px;
  color: var(--color-text-muted, #9e968b);
  line-height: 1.5;
}

.m-addr-hours {
  font-size: 11px;
  color: #b5993a;
  margin-top: 3px;
}

.m-maps-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: #4a90d9;
  text-decoration: none;
}

/* items */
.m-item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.m-item-row:last-of-type {
  border-bottom: none;
}

.m-item-name {
  grid-column: 1 / 2;
  font-size: 13px;
  color: var(--color-title, #d6d2cc);
}

.m-item-total {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-title, #d6d2cc);
  text-align: right;
}

.m-item-calc {
  grid-column: 1 / 2;
  font-size: 12px;
  color: var(--color-text-muted, #9e968b);
}

/* history timeline */
.m-history-row {
  display: flex;
  gap: 10px;
  padding: 6px 0;
}

.m-history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.m-history-text {
  flex: 1;
  min-width: 0;
}

.m-history-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.m-history-status {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (max-width: 767px) {
  .m-history-status {
    font-size: 10px;
  }
}

.m-history-date {
  font-size: 11px;
  color: var(--color-text-muted, #9e968b);
  white-space: nowrap;
}

.m-history-comment {
  font-size: 12px;
  color: var(--color-text-muted, #9e968b);
  margin-top: 2px;
}
