/* ============================================================
   AINODE — Shop Page Styles (Obsidian Theme)
   Product grid, product detail modal, cart components.
   Uses existing Obsidian design tokens from style.css.
   ============================================================ */

/* ── Product Grid ─────────────────────────────────────────── */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 40px;
}

/* ── Product Card ─────────────────────────────────────────── */

.shop-product-card {
  background: #0D0D0D;
  border: 3px solid #FFFFFF;
  padding: 0;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  overflow: hidden;
}

.shop-product-card:hover {
  transform: translate(-4px, -4px);
  box-shadow: 4px 4px 0 #FFE500;
}

.shop-product-card__image-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shop-product-card__image-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Gradient fallback when no image */
.shop-product-card__image-wrap--glasses { background: linear-gradient(135deg, #1a1a3e 0%, #2d1b4e 100%); }
.shop-product-card__image-wrap--watch   { background: linear-gradient(135deg, #0d2b1a 0%, #1a3a3e 100%); }
.shop-product-card__image-wrap--audio   { background: linear-gradient(135deg, #2b1a0d 0%, #3e1a1a 100%); }
.shop-product-card__image-wrap--ring    { background: linear-gradient(135deg, #2d1b4e 0%, #3e1a3a 100%); }
.shop-product-card__image-wrap--accessory { background: linear-gradient(135deg, #2b2b0d 0%, #1a3a1a 100%); }

.shop-product-card__image-wrap--no-image::after {
  content: attr(data-name);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  padding: 16px;
}

.shop-product-card__body {
  padding: 20px;
}

.shop-product-card__brand {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}

.shop-product-card__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.shop-product-card__description {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.6);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-product-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.shop-product-card__price {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 20px;
  font-weight: 700;
  color: #FFE500;
}

.shop-product-card__audit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 2px solid;
}

.shop-product-card__audit-badge--pass {
  color: #22c55e;
  border-color: #22c55e;
}

.shop-product-card__audit-badge--fail {
  color: #FF3333;
  border-color: #FF3333;
}

.shop-product-card__audit-badge--investigate {
  color: #FFBE0B;
  border-color: #FFBE0B;
}

.shop-product-card__audit-badge--pending {
  color: rgba(255,255,255,0.4);
  border-color: rgba(255,255,255,0.2);
}

/* ── Category Filter ──────────────────────────────────────── */

.shop-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.shop-filter-btn {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: transparent;
  color: rgba(255,255,255,0.5);
  border: 2px solid rgba(255,255,255,0.2);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-filter-btn:hover {
  color: #FFFFFF;
  border-color: #FFFFFF;
}

.shop-filter-btn.active {
  color: #0D0D0D;
  background: #FFE500;
  border-color: #FFE500;
}

/* ── Product Detail Modal ─────────────────────────────────── */

.shop-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  padding: 24px;
}

.shop-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.shop-modal {
  background: #0D0D0D;
  border: 3px solid #FFFFFF;
  max-width: 720px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.shop-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.3);
  color: #FFFFFF;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: border-color 0.2s;
}

.shop-modal__close:hover {
  border-color: #FFE500;
}

.shop-modal__image {
  max-width: 100%;
  max-height: 400px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  background: #1a1a1a;
}

.shop-modal__image-fallback {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: rgba(255,255,255,0.15);
  text-transform: uppercase;
  letter-spacing: 4px;
}

.shop-modal__body {
  padding: 32px;
}

.shop-modal__brand {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}

.shop-modal__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
}

.shop-modal__description {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
  margin-bottom: 24px;
}

.shop-modal__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.shop-modal__spec-tag {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 10px;
}

/* ── Variant Picker ── */

.shop-modal__variants:empty {
  display: none;
}

.shop-modal__option-group {
  margin-bottom: 16px;
}

.shop-modal__option-label {
  font-family: var(--font-colt-mono, 'SF Mono'), SFMono-Regular, monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(0,0,0,0.5);
  display: block;
  margin-bottom: 8px;
}

.shop-modal__option-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-modal__option-btn {
  font-family: var(--font-colt-body, 'Space Grotesk'), sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.2);
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.shop-modal__option-btn:hover {
  border-color: rgba(0,0,0,0.5);
  color: #111;
}

.shop-modal__option-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

.shop-modal__add-btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shop-modal__add-btn--disabled:hover {
  transform: none;
  box-shadow: none;
}

.shop-modal__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.shop-modal__price {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 28px;
  font-weight: 700;
  color: #FFE500;
}

.shop-modal__add-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #FFFFFF;
  color: #0D0D0D;
  border: none;
  padding: 14px 32px;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-modal__add-btn:hover {
  background: #FFE500;
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 #FFFFFF;
}

.shop-modal__audit-info {
  margin-top: 24px;
  padding: 16px;
  border: 2px solid rgba(255,255,255,0.1);
}

.shop-modal__audit-label {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
}

.shop-modal__audit-verdict {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.shop-modal__audit-verdict--pass { color: #22c55e; }
.shop-modal__audit-verdict--investigate { color: #FFBE0B; }
.shop-modal__audit-verdict--fail { color: #FF3333; }

.shop-modal__report-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  background: transparent;
  border: 2px solid var(--accent, #FFBE0B);
  color: var(--accent, #FFBE0B);
  font-family: var(--font-mono, 'SF Mono', monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.shop-modal__report-btn:hover {
  background: var(--accent, #FFBE0B);
  color: #0D0D0D;
}

/* ── Loading State ────────────────────────────────────────── */

.shop-loading {
  text-align: center;
  padding: 80px 24px;
  color: rgba(255,255,255,0.4);
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.shop-empty {
  text-align: center;
  padding: 80px 24px;
  color: rgba(255,255,255,0.3);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
}

/* ── Cart Badge (Navbar) ──────────────────────────────────── */

.nav-cart-btn {
  background: transparent;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  position: relative;
  padding: 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.nav-cart-btn:hover {
  color: #FFE500;
}

.nav-cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #FFE500;
  color: #0D0D0D;
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Cart Overlay ─────────────────────────────────────────── */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.cart-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ── Cart Drawer ──────────────────────────────────────────── */

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100vw;
  height: 100vh;
  background: #0D0D0D;
  border-left: 3px solid #FFFFFF;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.cart-drawer__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.cart-drawer__close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 2px solid rgba(255,255,255,0.3);
  color: #FFFFFF;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.cart-drawer__close:hover {
  border-color: #FFE500;
}

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.cart-drawer__empty {
  text-align: center;
  color: rgba(255,255,255,0.3);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  padding: 40px 0;
}

/* ── Cart Item ────────────────────────────────────────────── */

.cart-item {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.cart-item__image {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.1);
}

.cart-item__image--empty {
  background: #1a1a1a;
}

.cart-item__title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.cart-item__variant {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 4px;
}

.cart-item__qty-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.cart-item__qty-btn {
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #FFFFFF;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
}

.cart-item__qty-btn:hover {
  border-color: #FFE500;
}

.cart-item__qty {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 13px;
  min-width: 20px;
  text-align: center;
}

.cart-item__price {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 14px;
  font-weight: 700;
  color: #FFE500;
  white-space: nowrap;
}

.cart-item__remove {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.cart-item__remove:hover {
  color: #FF3333;
}

/* ── Cart Footer ──────────────────────────────────────────── */

.cart-drawer__footer {
  padding: 24px;
  border-top: 3px solid #FFFFFF;
}

.cart-drawer__subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cart-drawer__subtotal-label {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

.cart-drawer__subtotal-value {
  font-family: 'SF Mono', SFMono-Regular, monospace;
  font-size: 20px;
  font-weight: 700;
  color: #FFE500;
}

.cart-drawer__checkout {
  width: 100%;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: #FFFFFF;
  color: #0D0D0D;
  border: none;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.cart-drawer__checkout:hover:not(:disabled) {
  background: #FFE500;
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 #FFFFFF;
}

.cart-drawer__checkout:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Responsive ───────────────────────────────────────────── */

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

  .shop-modal {
    margin: 0;
    max-height: 100vh;
    border: none;
    border-top: 3px solid #FFFFFF;
  }

  .shop-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .shop-modal__body {
    padding: 24px;
  }
}

/* ── Light Mode Overrides ────────────────────────────────── */

body[data-theme="light"] .shop-product-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

body[data-theme="light"] .shop-product-card:hover {
  box-shadow: 4px 4px 0 var(--accent, #14b8a6);
}

body[data-theme="light"] .shop-product-card__image-wrap {
  background: #f1f5f9;
}

body[data-theme="light"] .shop-product-card__brand {
  color: #64748b;
}

body[data-theme="light"] .shop-product-card__title {
  color: #0f172a;
}

body[data-theme="light"] .shop-product-card__description {
  color: #475569;
}

body[data-theme="light"] .shop-product-card__price {
  color: var(--accent, #14b8a6);
}

body[data-theme="light"] .shop-product-card__audit-badge--pending {
  color: #94a3b8;
  border-color: #cbd5e1;
}

body[data-theme="light"] .shop-filter-btn {
  color: #64748b;
  border-color: #e2e8f0;
}

body[data-theme="light"] .shop-filter-btn:hover {
  color: #0f172a;
  border-color: #0f172a;
}

body[data-theme="light"] .shop-filter-btn.active {
  color: #ffffff;
  background: var(--accent, #14b8a6);
  border-color: var(--accent, #14b8a6);
}

body[data-theme="light"] .shop-modal {
  background: #ffffff;
  border-color: #e2e8f0;
}

body[data-theme="light"] .shop-modal__close {
  color: #0f172a;
  border-color: #cbd5e1;
}

body[data-theme="light"] .shop-modal__close:hover {
  border-color: var(--accent, #14b8a6);
}

body[data-theme="light"] .shop-modal__image {
  background: #f1f5f9;
}

body[data-theme="light"] .shop-modal__brand {
  color: #64748b;
}

body[data-theme="light"] .shop-modal__title {
  color: #0f172a;
}

body[data-theme="light"] .shop-modal__description {
  color: #475569;
}

body[data-theme="light"] .shop-modal__spec-tag {
  color: #475569;
  border-color: #e2e8f0;
}


body[data-theme="light"] .shop-modal__price-row {
  border-top-color: #e2e8f0;
}

body[data-theme="light"] .shop-modal__price {
  color: var(--accent, #14b8a6);
}

body[data-theme="light"] .shop-modal__add-btn {
  background: #0f172a;
  color: #ffffff;
}

body[data-theme="light"] .shop-modal__add-btn:hover {
  background: var(--accent, #14b8a6);
  box-shadow: 2px 2px 0 #0f172a;
}

body[data-theme="light"] .shop-modal__audit-info {
  border-color: #e2e8f0;
}

body[data-theme="light"] .shop-modal__audit-label {
  color: #64748b;
}

body[data-theme="light"] .shop-modal__report-btn {
  border-color: #0f172a;
  color: #0f172a;
}

body[data-theme="light"] .shop-modal__report-btn:hover {
  background: #0f172a;
  color: #ffffff;
}

body[data-theme="light"] .shop-loading,
body[data-theme="light"] .shop-empty {
  color: #94a3b8;
}

body[data-theme="light"] .shop-modal-overlay {
  background: rgba(0, 0, 0, 0.5);
}
