/* Trustix - Apple-inspired premium e-commerce (Archetype 4: Swiss + High-Contrast) */

:root {
  --bg: #FBFBFD;
  --bg-alt: #FFFFFF;
  --text: #1D1D1F;
  --text-2: #86868B;
  --text-3: #d2d2d7;
  --accent: #000000;
  --accent-hover: #333336;
  --success: #34C759;
  --danger: #FF3B30;
  --border: rgba(0, 0, 0, 0.08);
  --glass: rgba(255, 255, 255, 0.75);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --container: 1280px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.7; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* Typography */
h1, h2, h3, h4 { font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, sans-serif; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.1; font-weight: 600; }
h3 { font-size: 1.5rem; line-height: 1.2; font-weight: 600; }
.muted { color: var(--text-2); }
.small { font-size: 0.875rem; color: var(--text-2); }

/* Layout */
.container { max-width: var(--container); margin: 0 auto; padding: 0 max(1.25rem, 5vw); }
.section { padding: 6rem 0; }
.section-sm { padding: 3rem 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 980px; font-weight: 500; font-size: 0.95rem;
  transition: transform 0.2s var(--ease), background 0.2s ease, opacity 0.2s ease;
  white-space: nowrap; border: 1px solid transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); transform: scale(1.02); opacity: 1; }
.btn-secondary { background: rgba(0,0,0,0.05); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: rgba(0,0,0,0.08); opacity: 1; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover:not(:disabled) { background: rgba(0,0,0,0.03); opacity: 1; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 16px 32px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* Navigation - glassmorphism sticky */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; }
.brand { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.01em; }
.brand span { font-weight: 400; color: var(--text-2); }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-size: 0.9rem; font-weight: 400; }
.nav-links a.active { font-weight: 600; }
.nav-actions { display: flex; gap: 0.75rem; align-items: center; }
.nav-cart {
  position: relative; padding: 8px 16px; border-radius: 980px;
  background: rgba(0,0,0,0.05); font-size: 0.85rem; font-weight: 500;
  transition: background 0.2s ease;
}
.nav-cart:hover { background: rgba(0,0,0,0.08); opacity: 1; }
.cart-badge {
  position: absolute; top: -4px; right: -4px; background: var(--accent); color: #fff;
  font-size: 0.7rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; min-width: 18px; text-align: center;
}
.nav-toggle { display: none; background: rgba(0,0,0,0.05); padding: 8px 12px; border-radius: 980px; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-links.open {
    display: flex; position: absolute; top: 100%; right: 1rem; left: 1rem;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 1rem; flex-direction: column; gap: 0.75rem; box-shadow: 0 12px 48px rgba(0,0,0,0.08);
  }
}

/* Hero */
.hero {
  padding: 6rem 0 5rem; background: radial-gradient(1200px 600px at 50% -100px, rgba(0,0,0,0.04), transparent 60%);
  text-align: center;
  animation: rise 0.8s var(--ease) both;
}
.hero-eyebrow { font-size: 0.85rem; color: var(--text-2); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }
.hero h1 { max-width: 960px; margin: 0 auto 1.5rem; }
.hero p { color: var(--text-2); font-size: 1.125rem; max-width: 640px; margin: 0 auto 2.5rem; }
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-image { margin-top: 4rem; border-radius: var(--radius-lg); overflow: hidden; max-width: 1040px; margin-left: auto; margin-right: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.08); }

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

/* Feature row */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; padding: 2rem 0; }
.feature { padding: 2rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); transition: transform 0.3s var(--ease); }
.feature:hover { transform: translateY(-4px); }
.feature-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: #000; color: #fff; border-radius: 12px; margin-bottom: 1rem; font-size: 1.25rem; }
.feature h3 { margin-bottom: 0.5rem; }
.feature p { color: var(--text-2); font-size: 0.95rem; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.75rem; }
.product-card {
  background: #fff; border: 1px solid rgba(0,0,0,0.04); border-radius: var(--radius-lg);
  overflow: hidden; transition: transform 0.3s var(--ease), box-shadow 0.3s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,0.02);
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 48px rgba(0,0,0,0.06); }
.product-card .img-wrap {
  aspect-ratio: 1 / 1; background: #f5f5f7; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-card .img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.product-card:hover .img-wrap img { transform: scale(1.05); }
.product-card .body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.product-card .badge { display: inline-block; font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(52,199,89,0.12); color: #1e7a3a; width: fit-content; }
.product-card .badge.cond { background: rgba(0,0,0,0.05); color: var(--text-2); }
.product-card .title { font-size: 1rem; font-weight: 600; line-height: 1.3; min-height: 2.5em; }
.product-card .specs { font-size: 0.85rem; color: var(--text-2); }
.product-card .price { margin-top: auto; display: flex; align-items: baseline; gap: 8px; padding-top: 0.5rem; }
.product-card .price .amount { font-size: 1.4rem; font-weight: 700; }
.product-card .price .from { color: var(--text-2); font-size: 0.85rem; }

/* Filter bar */
.filter-bar {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
  background: #fff; padding: 1.25rem; border-radius: var(--radius-md);
  border: 1px solid var(--border); margin-bottom: 2rem;
}
.input, .select {
  background: rgba(0,0,0,0.03); border: 1px solid transparent; border-radius: 12px;
  padding: 10px 14px; font-size: 0.9rem; min-width: 140px;
  transition: border 0.2s ease, background 0.2s ease;
}
.input:focus, .select:focus { outline: none; background: #fff; border-color: var(--accent); }
.search { flex: 1; min-width: 200px; }
.chip-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border-radius: 999px; background: rgba(0,0,0,0.05);
  font-size: 0.85rem; cursor: pointer; border: 1px solid transparent; transition: all 0.2s ease;
}
.chip:hover { background: rgba(0,0,0,0.08); }
.chip.active { background: var(--accent); color: #fff; }

/* Product detail */
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 4rem; padding: 2rem 0; }
@media (max-width: 860px) { .pdp { grid-template-columns: 1fr; gap: 2rem; } }
.pdp-gallery { position: sticky; top: 80px; }
.pdp-main-img { border-radius: var(--radius-lg); background: #f5f5f7; aspect-ratio: 1/1; overflow: hidden; }
.pdp-main-img img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumbs { display: flex; gap: 0.75rem; margin-top: 1rem; }
.pdp-thumbs img {
  width: 72px; height: 72px; border-radius: 12px; object-fit: cover; cursor: pointer;
  border: 2px solid transparent; transition: border 0.2s ease;
}
.pdp-thumbs img.active { border-color: var(--accent); }
.pdp-info h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); margin-bottom: 0.5rem; }
.pdp-info .price-row { display: flex; align-items: baseline; gap: 1rem; margin: 1rem 0 2rem; }
.pdp-info .price-row .big { font-size: 2.25rem; font-weight: 700; }
.pdp-info .price-row .old { color: var(--text-2); text-decoration: line-through; }
.pdp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem; margin: 2rem 0;
  padding: 1.5rem; border-radius: var(--radius-md); background: #fff; border: 1px solid var(--border); }
.pdp-meta .label { font-size: 0.8rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.pdp-meta .value { font-weight: 500; margin-top: 2px; }

/* Cart */
.cart-grid { display: grid; grid-template-columns: 1fr 380px; gap: 3rem; }
@media (max-width: 860px) { .cart-grid { grid-template-columns: 1fr; } }
.cart-item {
  display: grid; grid-template-columns: 100px 1fr auto; gap: 1.5rem; align-items: center;
  padding: 1.25rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.cart-item img { width: 100px; height: 100px; object-fit: cover; border-radius: 12px; background: #f5f5f7; }
.qty-ctrl { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.qty-ctrl button { padding: 6px 14px; font-size: 1rem; }
.qty-ctrl button:hover { background: rgba(0,0,0,0.05); }
.qty-ctrl .count { padding: 6px 10px; min-width: 32px; text-align: center; font-weight: 500; }
.cart-summary {
  position: sticky; top: 80px; background: #fff; padding: 2rem; border-radius: var(--radius-lg); border: 1px solid var(--border); height: fit-content;
}
.cart-summary .row { display: flex; justify-content: space-between; padding: 0.5rem 0; }
.cart-summary .row.total { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: 1rem; font-size: 1.25rem; font-weight: 600; }

/* Timeline */
.timeline { display: flex; justify-content: space-between; align-items: flex-start; padding: 2rem 0 1rem; position: relative; gap: 0.5rem; }
.timeline::before {
  content: ""; position: absolute; top: 30px; left: 5%; right: 5%; height: 2px; background: var(--text-3); z-index: 0;
}
.timeline-fill {
  position: absolute; top: 30px; left: 5%; height: 2px; background: var(--success); z-index: 1;
  transition: width 0.8s var(--ease);
}
.tl-step { position: relative; z-index: 2; text-align: center; flex: 1; min-width: 0; }
.tl-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--text-3); margin: 20px auto 0.75rem;
  border: 3px solid var(--bg); transition: background 0.3s ease, transform 0.3s var(--ease); }
.tl-step.active .tl-dot { background: var(--success); transform: scale(1.2); }
.tl-step.current .tl-dot { background: var(--success); box-shadow: 0 0 0 6px rgba(52,199,89,0.2); }
.tl-label { font-size: 0.75rem; color: var(--text-2); line-height: 1.3; padding: 0 4px; }
.tl-step.active .tl-label { color: var(--text); font-weight: 500; }
@media (max-width: 860px) {
  .timeline { flex-direction: column; align-items: stretch; padding-left: 1rem; }
  .timeline::before { top: 0; bottom: 0; left: 20px; right: auto; width: 2px; height: auto; }
  .timeline-fill { top: 0; left: 20px; width: 2px !important; height: var(--fill-h,0%); transition: height 0.8s var(--ease); }
  .tl-step { display: flex; align-items: center; gap: 1rem; text-align: left; padding: 0.75rem 0; }
  .tl-dot { margin: 0; }
  .tl-label { font-size: 0.9rem; }
}

/* Modal + drawer */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 1rem;
  animation: fadeIn 0.3s ease;
}
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 2.5rem; max-width: 440px; width: 100%;
  box-shadow: 0 24px 48px rgba(0,0,0,0.12); animation: rise 0.4s var(--ease) both;
}
.modal h2 { margin-bottom: 0.5rem; font-size: 1.5rem; }
.modal p { color: var(--text-2); margin-bottom: 1.5rem; }
.modal .field { margin-bottom: 1rem; }
.modal .field label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.5rem; }
.modal .field .input { width: 100%; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Footer */
footer { background: #fff; border-top: 1px solid var(--border); padding: 4rem 0 2rem; margin-top: 6rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { font-size: 0.9rem; margin-bottom: 1rem; }
.footer-grid ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-grid a { font-size: 0.9rem; color: var(--text-2); }
.footer-grid a:hover { color: var(--text); opacity: 1; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; font-size: 0.8rem; color: var(--text-2); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* Loaders */
.skeleton { background: linear-gradient(90deg, #f2f2f5, #fafafc, #f2f2f5); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }
.spinner {
  width: 24px; height: 24px; border: 2.5px solid rgba(0,0,0,0.1); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed; top: 24px; right: 24px; background: #1D1D1F; color: #fff;
  padding: 12px 20px; border-radius: 12px; font-size: 0.9rem; z-index: 500;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2); animation: toastIn 0.3s var(--ease);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* Page title */
.page-title { padding: 3rem 0 1.5rem; }
.page-title h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-title p { color: var(--text-2); margin-top: 0.5rem; font-size: 1.05rem; }

/* Admin */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat { padding: 1.5rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); }
.stat .label { font-size: 0.8rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { font-size: 1.75rem; font-weight: 700; margin-top: 0.25rem; }

.table { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.table th { background: #fafafa; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-2); }
.table tr:last-child td { border-bottom: none; }

.status-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 500; background: rgba(0,0,0,0.05); }
.status-pill.paid { background: rgba(52,199,89,0.15); color: #1e7a3a; }
.status-pill.pending { background: rgba(255,149,0,0.15); color: #a35f00; }

/* Blog */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }
.blog-card { background: #fff; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border); transition: transform 0.3s var(--ease); }
.blog-card:hover { transform: translateY(-4px); }
.blog-card img { aspect-ratio: 16/10; object-fit: cover; }
.blog-card .body { padding: 1.5rem; }
.blog-card h3 { margin-bottom: 0.5rem; font-size: 1.15rem; }

/* FAQ */
.faq-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem 1.5rem; margin-bottom: 0.75rem; cursor: pointer; transition: background 0.2s ease; }
.faq-item:hover { background: #fafafa; }
.faq-q { font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.faq-a { color: var(--text-2); padding-top: 0.75rem; display: none; line-height: 1.7; }
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-q::after { content: "+"; font-size: 1.5rem; color: var(--text-2); transition: transform 0.3s var(--ease); }

/* Utility */
.hidden { display: none !important; }
.flex { display: flex; }
.gap-sm { gap: 0.5rem; }
.gap { gap: 1rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.center { text-align: center; }
.empty {
  padding: 4rem 2rem; text-align: center; background: #fff; border: 1px dashed var(--border); border-radius: var(--radius-lg);
}
.empty .muted { margin: 0.5rem 0 1.5rem; }
