/* ============================================================
   PrintCraft — Shop Stylesheet
   assets/css/shop.css
   Nav, hero, products, cart, modals, checkout, account, toasts
   Note: buttons/forms are in forms.css
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --ink:        #1a1a2e;
  --ink2:       #2d2d4a;
  --paper:      #f8f5f0;
  --paper2:     #f0ece4;
  --paper3:     #e8e3d8;
  --sand:       #d4ccc0;
  --gold:       #c8a96e;
  --gold2:      #e8c98e;
  --forest:     #2d5a3d;
  --forest2:    #3d7a55;
  --terracotta: #c4624a;
  --text:       #1a1a2e;
  --text2:      #5a5a7a;
  --text3:      #8a8aaa;
  --radius:     12px;
  --radius-lg:  20px;
  --shadow-sm:  0 2px 8px rgba(26,26,46,0.08);
  --shadow:     0 8px 32px rgba(26,26,46,0.12);
  --shadow-lg:  0 24px 64px rgba(26,26,46,0.18);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-top-h:  64px;
  --nav-bot-h:  40px; 
} 


/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cabinet Grotesk', system-ui, sans-serif;
  background: var(--paper);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img    { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
a      { text-decoration: none; color: inherit; }
input, select, textarea { font-family: inherit; }
h1, h2, h3, h4 { font-family: 'Fraunces', Georgia, serif; line-height: 1.15; }

/* ── Layout ──────────────────────────────────────────────── */
.container  { max-width: 1160px; margin: 0 auto; padding: 0 2rem; }
.section-gap { padding-top: 3rem; padding-bottom: 3rem; }


/* ─────────────────────────────────────────────────────────────
   HERO
   ─────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: center;
  background: var(--ink);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1160px;
  margin: 0 auto;
  padding: 3.5rem 2rem;
}
.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 0.75rem;
}
.hero-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.05;
  color: var(--paper);
  margin-bottom: 1rem;
}
.hero-title em { color: var(--gold2); font-style: italic; }
.hero-sub { font-size: 1.05rem; color: rgba(248,245,240,0.7); max-width: 480px; }
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(200,169,110,0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(45,90,61,0.2) 0%, transparent 50%);
}

/* ─────────────────────────────────────────────────────────────
   CATALOG & PRODUCTS
   ─────────────────────────────────────────────────────────── */

.catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.catalog-title { font-size: 1.75rem; font-weight: 700; }
.catalog-sub   { font-size: 0.85rem; color: var(--text2); margin-top: 0.2rem; }
.catalog-controls { display: flex; gap: 0.75rem; align-items: center; }

.btn-refresh {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-refresh:hover { background: var(--paper3); color: var(--ink); }
.btn-refresh.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--paper3);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sand); }
.product-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.product-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--paper2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .product-img img { transform: scale(1.05); }

.product-info { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.product-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.product-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 20px;
  background: var(--paper2);
  color: var(--text2);
  font-weight: 600;
  border: 1px solid var(--paper3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.product-name  { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 700; margin-bottom: 0.4rem; line-height: 1.3; }
.product-desc  { font-size: 0.83rem; color: var(--text2); line-height: 1.6; flex: 1; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-footer { display: flex; align-items: center; justify-content: space-between; }
.product-price { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 700; color: var(--forest); }
.product-price small { font-size: 0.75rem; color: var(--text2); font-weight: 400; }

.btn-add {
  background: var(--ink);
  color: white;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-add:hover { background: var(--ink2); transform: scale(1.03); }

/* States */
.loading-state, .empty-state, .error-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--paper3);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.empty-icon { font-size: 3.5rem; }
.empty-state h3, .error-state h3 { font-size: 1.15rem; color: var(--text); }

/* ─────────────────────────────────────────────────────────────
   MODALS
   ─────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26,26,46,0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.modal-overlay[hidden] { display: none; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  position: relative;
  animation: slideUp 0.25s ease;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal.modal-wide { max-width: 680px; }
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--paper3); color: var(--ink); }
.modal-title { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }

/* ─────────────────────────────────────────────────────────────
   CART DRAWER
   ─────────────────────────────────────────────────────────── */

.drawer-overlay { position: fixed; inset: 0; background: rgba(26,26,46,0.4); z-index: 150; }
.drawer-overlay[hidden] { display: none; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 420px;
  z-index: 160;
  background: white;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 40px rgba(26,26,46,0.15);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer[hidden] { display: flex; transform: translateX(100%); pointer-events: none; }

.drawer-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--paper3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.drawer-title { font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 700; }
.drawer-body  { flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem; display: flex; flex-direction: column; }

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--paper3);
  align-items: start;
}
.cart-item:last-of-type { border-bottom: none; }
.cart-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--paper2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-name    { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.2rem; line-height: 1.3; }
.cart-item-variant { font-size: 0.78rem; color: var(--text2); margin-bottom: 0.6rem; }
.cart-item-row     { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.qty-stepper       { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.qty-btn:hover { background: var(--paper3); }
.qty-num        { font-weight: 700; font-size: 0.9rem; min-width: 20px; text-align: center; }
.cart-item-price { font-family: 'Fraunces', serif; font-weight: 700; color: var(--forest); }
.btn-remove { font-size: 0.75rem; color: var(--text3); transition: color var(--transition); cursor: pointer; }
.btn-remove:hover { color: var(--terracotta); }

.cart-empty { text-align: center; padding: 3rem 1rem; color: var(--text2); }
.cart-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.cart-empty h3   { font-size: 1.1rem; color: var(--text); margin-bottom: 0.5rem; }

.cart-footer { margin-top: auto; padding-top: 1rem; border-top: 2px solid var(--paper3); }
.cart-totals { margin-bottom: 1.25rem; }
.cart-total-row { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.9rem; color: var(--text2); }
.cart-total-row.grand {
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--paper3);
  margin-top: 0.25rem;
}
.cart-total-row.grand span:last-child { font-family: 'Fraunces', serif; font-size: 1.2rem; color: var(--forest); }

/* ─────────────────────────────────────────────────────────────
   CHECKOUT
   ─────────────────────────────────────────────────────────── */

.checkout-steps { display: flex; margin-bottom: 2rem; }
.checkout-step {
  flex: 1;
  text-align: center;
  padding: 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text3);
  border-bottom: 3px solid var(--paper3);
  transition: all var(--transition);
}
.checkout-step.active { color: var(--ink); border-bottom-color: var(--ink); }
.checkout-step.done   { color: var(--forest); border-bottom-color: var(--forest); }

.section-title-sm { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }

.order-summary-box { background: var(--paper2); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.order-summary-item { display: flex; justify-content: space-between; padding: 0.4rem 0; font-size: 0.88rem; border-bottom: 1px solid var(--paper3); }
.order-summary-item:last-child { border-bottom: none; }
.summary-totals { margin-top: 0.75rem; }
.summary-row { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.88rem; color: var(--text2); }
.summary-row.grand {
  font-weight: 800;
  color: var(--text);
  font-size: 1.05rem;
  padding-top: 0.6rem;
  margin-top: 0.25rem;
  border-top: 2px solid var(--sand);
}
.summary-row.grand span:last-child { font-family: 'Fraunces', serif; color: var(--forest); }

.stripe-element-wrapper {
  border: 2px solid var(--paper3);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  background: white;
  margin-bottom: 1rem;
  transition: border-color var(--transition);
}
.stripe-element-wrapper.focused { border-color: var(--ink2); }
.stripe-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
  color: var(--text3);
  font-size: 0.78rem;
  margin-top: 0.75rem;
}
.stripe-badge svg { color: #635bff; }

/* ─────────────────────────────────────────────────────────────
   ORDER CONFIRMED
   ─────────────────────────────────────────────────────────── */

.order-confirmed { text-align: center; padding: 2rem 1rem; }
.order-confirmed-icon {
  font-size: 5rem;
  margin-bottom: 1.5rem;
  animation: popIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.order-confirmed h2 { font-family: 'Fraunces', serif; font-size: 2rem; margin-bottom: 0.75rem; }
.order-confirmed p  { color: var(--text2); margin-bottom: 0.5rem; }
.order-id-badge {
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  font-family: monospace;
  font-size: 0.9rem;
  color: var(--forest);
  margin: 1.5rem auto;
  display: inline-block;
}

/* ─────────────────────────────────────────────────────────────
   PRODUCT DETAIL MODAL
   ─────────────────────────────────────────────────────────── */

.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.product-detail-img {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper2);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
}
.product-detail-img img { width: 100%; height: 100%; object-fit: cover; }
.product-detail-name  { font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.2; }
.product-detail-price { font-family: 'Fraunces', serif; font-size: 1.75rem; font-weight: 700; color: var(--forest); margin-bottom: 1.25rem; }
.product-detail-desc  { font-size: 0.88rem; color: var(--text2); line-height: 1.7; margin-bottom: 1.5rem; }

.variant-group   { margin-bottom: 1.25rem; }
.variant-label   { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text2); margin-bottom: 0.5rem; display: block; }
.variant-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.variant-opt {
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: 2px solid var(--paper3);
  background: white;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}
.variant-opt:hover    { border-color: var(--sand); }
.variant-opt.selected { border-color: var(--ink); background: var(--ink); color: white; }

.detail-qty { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.detail-qty-label   { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text2); }
.detail-qty-stepper { display: flex; align-items: center; gap: 0.75rem; }
.detail-qty-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--paper2);
  border: 2px solid var(--paper3);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.detail-qty-btn:hover { background: var(--paper3); }
.detail-qty-val { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 700; min-width: 30px; text-align: center; }

/* ─────────────────────────────────────────────────────────────
   ACCOUNT & ORDERS
   ─────────────────────────────────────────────────────────── */

.account-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: white;
  border: 1px solid var(--paper3);
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}
.account-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--forest), var(--gold));
  color: white;
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.account-name  { font-family: 'Fraunces', serif; font-size: 1.25rem; font-weight: 700; }
.account-email { font-size: 0.85rem; color: var(--text2); }
.orders-title  { font-family: 'Fraunces', serif; font-size: 1.3rem; font-weight: 700; margin-bottom: 1.25rem; }

.order-card { background: white; border: 1px solid var(--paper3); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.order-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; }
.order-card-id   { font-size: 0.75rem; color: var(--text2); font-family: monospace; }
.order-card-date { font-size: 0.8rem; color: var(--text3); margin-top: 0.2rem; }
.order-status {
  font-size: 0.72rem;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.status-pending_payment { background: #fff8e6; color: #8a5c00; border: 1px solid #f4d98a; }
.status-paid            { background: #edf7f0; color: #1a5c2a; border: 1px solid #c1e8cb; }
.status-processing      { background: #e8f4fe; color: #0c4a8a; border: 1px solid #b8d9f5; }
.status-shipped         { background: #f0eeff; color: #4a2d8a; border: 1px solid #c8b8f5; }
.status-delivered       { background: #edf7f0; color: #1a5c2a; border: 1px solid #c1e8cb; }
.status-cancelled       { background: #fef0ed; color: #8b2316; border: 1px solid #f4c9c1; }
.status-refunded        { background: #f5f5f5; color: #555;    border: 1px solid #ddd; }

.order-items-list { font-size: 0.83rem; color: var(--text2); margin-bottom: 0.75rem; line-height: 1.8; }
.order-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 0.75rem; border-top: 1px solid var(--paper3); }
.order-total { font-family: 'Fraunces', serif; font-weight: 700; color: var(--forest); }

/* ─────────────────────────────────────────────────────────────
   TOASTS
   ─────────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastIn 0.3s ease forwards;
  pointer-events: auto;
}
.toast.toast-success { background: var(--forest); }
.toast.toast-error   { background: var(--terracotta); }
.toast.toast-out     { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(40px); } }

/* ─────────────────────────────────────────────────────────────
   TAB SYSTEM
   ─────────────────────────────────────────────────────────── */

.tab-section        { display: none; }
.tab-section.active { display: block; }

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
   ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .nav-top    { padding: 0 0.75rem; gap: 0.5rem; }
  .nav-bottom { padding: 0 0.75rem; }
  .nav-account-text .nav-account-hello,
  .user-chip-hello { display: none; }
  .nav-account-label,
  .user-chip-label  { font-size: 0.78rem; }
  .nav-cart-label   { display: none; }
  .nav-cart-count   { right: -2px; }
  .container        { padding: 0 1rem; }
  .hero-title       { font-size: 2rem; }
  .hero-content     { padding: 2.5rem 1rem; }
  .product-detail   { grid-template-columns: 1fr; }
  .cart-drawer      { max-width: 100%; }
  .catalog-header   { flex-direction: column; }
  .account-header   { flex-direction: column; text-align: center; }
  .catalog-controls { width: 100%; justify-content: flex-end; }
}

@media (max-width: 480px) {
  :root { --nav-top-h: 56px; }
  .logo-text { font-size: 1rem; }
  .modal     { padding: 1.25rem; }
}
