/* ========================================
   CustomTee — Main Frontend Styles
   Aesthetic: Bold editorial, dark-accented
   ======================================== */

:root {
  --ink: #0f0f0f;
  --white: #fafaf8;
  --accent: #ff6b35;
  --accent2: #1e3a5f;
  --grey: #6b7280;
  --grey-light: #f3f4f1;
  --grey-border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 6px;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

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

img { max-width: 100%; display: block; }

/* ---- HEADER ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,250,248,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--grey-border);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a { font-size: .9rem; font-weight: 500; color: var(--grey); transition: color .2s; }
.main-nav a:hover { color: var(--ink); }
.btn-nav {
  background: var(--ink); color: var(--white) !important;
  padding: .5rem 1.25rem; border-radius: 999px;
  font-weight: 600 !important; transition: background .2s, transform .1s !important;
}
.btn-nav:hover { background: var(--accent) !important; transform: translateY(-1px); }

/* ---- HERO ---- */
.hero {
  max-width: 1280px; margin: 0 auto;
  padding: 5rem 2rem 4rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center;
}
.hero-badge {
  display: inline-block;
  background: var(--grey-light); color: var(--grey);
  font-size: .8rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  padding: .35rem .9rem; border-radius: 999px; margin-bottom: 1.5rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800; line-height: 1.05;
  letter-spacing: -0.03em; margin-bottom: 1.25rem;
}
.hero-title em { color: var(--accent); font-style: normal; }
.hero-sub { font-size: 1.1rem; color: var(--grey); max-width: 42ch; margin-bottom: 2rem; line-height: 1.7; }
.hero-cta {
  display: inline-block;
  background: var(--ink); color: var(--white);
  padding: .85rem 2.25rem; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(15,15,15,0.2);
}
.hero-cta:hover { background: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(255,107,53,0.35); }

.hero-visual { display: flex; justify-content: center; }
.hero-tshirt-preview {
  position: relative; width: 320px;
}
.hero-svg { width: 100%; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.18)); }
.floating-badge {
  position: absolute;
  background: var(--white); color: var(--ink);
  font-size: .75rem; font-weight: 600;
  padding: .4rem .9rem; border-radius: 999px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  animation: floatBadge 3s ease-in-out infinite;
}
.badge-1 { top: 20%; left: -30px; animation-delay: 0s; }
.badge-2 { top: 50%; right: -20px; animation-delay: 1s; }
.badge-3 { bottom: 18%; left: -10px; animation-delay: 2s; }
@keyframes floatBadge {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---- FEATURES STRIP ---- */
.features-strip {
  background: var(--ink); color: var(--white);
  padding: 1.5rem 2rem;
  display: flex; justify-content: center; gap: 4rem; flex-wrap: wrap;
}
.feature { display: flex; align-items: center; gap: .75rem; }
.feature span { font-size: 1.5rem; }
.feature p { font-size: .85rem; line-height: 1.3; }

/* ---- CATALOG ---- */
.catalog { max-width: 1280px; margin: 0 auto; padding: 5rem 2rem; }
.catalog-header { margin-bottom: 2.5rem; }
.catalog-header h2 {
  font-family: var(--font-display);
  font-size: 2.25rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .5rem;
}
.catalog-header p { color: var(--grey); }

.type-tabs { display: flex; gap: .5rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.type-tab {
  background: none; border: 1.5px solid var(--grey-border);
  padding: .45rem 1.1rem; border-radius: 999px;
  font-family: var(--font-body); font-size: .875rem; font-weight: 500; cursor: pointer;
  transition: all .2s; color: var(--grey);
}
.type-tab.active, .type-tab:hover {
  background: var(--ink); color: var(--white); border-color: var(--ink);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.template-card {
  background: var(--white);
  border: 1.5px solid var(--grey-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.template-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-4px); }

.card-visual {
  position: relative;
  background: var(--grey-light);
  padding: 1.5rem; display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.template-svg-wrap { width: 120px; }
.template-svg-wrap .garment-svg { width: 100%; }
.garment-body { fill: #d1d5db; }
.garment-collar { fill: none; stroke: #9ca3af; }
.garment-seam { stroke: #9ca3af; }
.garment-detail { fill: #9ca3af; stroke: #9ca3af; }

.card-badge {
  position: absolute; top: .75rem; right: .75rem;
  background: var(--white); color: var(--ink);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .25rem .65rem; border-radius: 999px;
}
.card-info { padding: 1.25rem; }
.card-info h3 { font-family: var(--font-display); font-weight: 700; margin-bottom: .4rem; }
.card-info p { font-size: .875rem; color: var(--grey); margin-bottom: 1rem; line-height: 1.5; }
.card-footer { display: flex; align-items: center; justify-content: space-between; }
.price { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.btn-customize {
  background: var(--accent); color: var(--white);
  padding: .45rem 1rem; border-radius: 999px;
  font-weight: 600; font-size: .875rem;
  transition: background .2s, transform .15s;
}
.btn-customize:hover { background: #e5521f; transform: scale(1.04); }

.empty-state { grid-column: 1/-1; text-align: center; color: var(--grey); padding: 3rem; }

/* ---- HOW IT WORKS ---- */
.how-it-works {
  background: var(--grey-light);
  padding: 5rem 2rem; text-align: center;
}
.how-it-works h2 {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 800; letter-spacing: -.02em;
  margin-bottom: 3rem;
}
.steps {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 1rem; flex-wrap: wrap; max-width: 860px; margin: 0 auto;
}
.step { max-width: 220px; }
.step-num {
  font-family: var(--font-display); font-size: 3rem; font-weight: 800;
  color: var(--grey-border); line-height: 1; margin-bottom: .75rem;
}
.step h4 { font-family: var(--font-display); font-weight: 700; margin-bottom: .5rem; }
.step p { font-size: .875rem; color: var(--grey); }
.step-arrow { font-size: 1.5rem; color: var(--accent); margin-top: 1rem; }

/* ---- FOOTER ---- */
.site-footer { background: var(--ink); color: var(--white); text-align: center; padding: 3rem 2rem; }
.logo-small { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; margin-bottom: .5rem; }
.logo-small span { color: var(--accent); }
.site-footer p { color: rgba(255,255,255,0.5); font-size: .875rem; margin-top: .35rem; }
.footer-copy { margin-top: 1.5rem !important; }

/* ========================================
   CUSTOMIZER PAGE
   ======================================== */
.customizer-wrap {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 64px);
}

/* Sidebar */
.customizer-sidebar {
  border-right: 1.5px solid var(--grey-border);
  padding: 1.5rem;
  overflow-y: auto;
  max-height: calc(100vh - 64px);
  position: sticky; top: 64px;
  background: var(--white);
}
.back-link { font-size: .8rem; color: var(--grey); display: block; margin-bottom: 1rem; }
.back-link:hover { color: var(--ink); }
.sidebar-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.sidebar-type { font-size: .8rem; color: var(--grey); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1.25rem; }

.sidebar-section { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--grey-border); }
.section-label {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--grey); margin-bottom: .75rem;
  display: flex; align-items: center; gap: .5rem;
}
.step-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 800;
}

/* Color swatches */
.color-swatches { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s, border-color .15s;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: var(--accent); transform: scale(1.15); }
.selected-color-label { font-size: .8rem; color: var(--grey); }

/* Side toggle */
.side-toggle { display: flex; gap: .5rem; }
.side-btn {
  flex: 1; padding: .5rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--grey-border); background: none; cursor: pointer;
  font-weight: 600; font-size: .875rem; transition: all .2s;
}
.side-btn.active { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Add tabs */
.add-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; }
.add-tab {
  flex: 1; padding: .4rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--grey-border); background: none; cursor: pointer;
  font-size: .8rem; font-weight: 600; transition: all .2s; color: var(--grey);
}
.add-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Add panels */
.add-panel { display: none; }
.add-panel.active { display: block; }

.add-panel textarea {
  width: 100%; border: 1.5px solid var(--grey-border); border-radius: var(--radius-sm);
  padding: .6rem; font-family: var(--font-body); font-size: .9rem; resize: vertical;
  margin-bottom: .5rem;
}
.add-panel textarea:focus { outline: none; border-color: var(--accent); }

.text-controls { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.text-controls select, .text-controls input[type=number] {
  border: 1.5px solid var(--grey-border); border-radius: var(--radius-sm);
  padding: .3rem .4rem; font-size: .8rem; background: var(--white);
}
.text-controls select { flex: 1; }
.text-controls input[type=number] { width: 55px; }
.text-controls input[type=color] { width: 34px; height: 30px; border: 1.5px solid var(--grey-border); border-radius: var(--radius-sm); cursor: pointer; padding: 1px; }
.fmt-btn {
  width: 30px; height: 30px; border: 1.5px solid var(--grey-border); border-radius: var(--radius-sm);
  background: none; cursor: pointer; font-size: .9rem; transition: all .2s;
}
.fmt-btn.active, .fmt-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

.btn-add {
  width: 100%; padding: .6rem;
  background: var(--ink); color: var(--white);
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; font-size: .875rem; transition: background .2s;
}
.btn-add:hover { background: var(--accent); }
.btn-add small { font-weight: 400; opacity: .8; }

/* Logo grid */
.panel-hint { font-size: .78rem; color: var(--grey); margin-bottom: .5rem; }
.price-hint { margin-top: .5rem; color: var(--accent); font-weight: 600; }
.logo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; max-height: 200px; overflow-y: auto; margin-bottom: .5rem; }
.logo-item {
  border: 1.5px solid var(--grey-border); border-radius: var(--radius-sm);
  background: var(--grey-light); padding: .4rem; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  transition: border-color .15s;
}
.logo-item:hover, .logo-item.active { border-color: var(--accent); }
.logo-item img { width: 36px; height: 36px; object-fit: contain; }
.logo-item span { font-size: .65rem; color: var(--grey); text-align: center; line-height: 1.2; }
.empty-logos { font-size: .8rem; color: var(--grey); padding: .5rem; }

/* Upload drop */
.upload-drop {
  display: flex; flex-direction: column; align-items: center;
  border: 2px dashed var(--grey-border); border-radius: var(--radius-sm);
  padding: 1.5rem; cursor: pointer; text-align: center; transition: border-color .2s, background .2s;
}
.upload-drop:hover { border-color: var(--accent); background: #fff5f0; }
.upload-drop p { font-size: .875rem; font-weight: 500; margin: .5rem 0 .25rem; }
.upload-drop small { font-size: .75rem; color: var(--grey); }
.upload-progress { margin-top: .5rem; }
.progress-bar { height: 4px; background: var(--grey-border); border-radius: 999px; overflow: hidden; margin-bottom: .25rem; }
.progress-fill { height: 100%; background: var(--accent); width: 0; animation: progressAnim 1.5s ease infinite; }
@keyframes progressAnim { 0%{width:0} 60%{width:80%} 100%{width:100%} }

/* Layer list */
.badge-count {
  background: var(--accent); color: #fff;
  font-size: .7rem; padding: .15rem .45rem; border-radius: 999px;
}
.layer-list { display: flex; flex-direction: column; gap: .3rem; }
.layer-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .6rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--grey-border); cursor: pointer;
  transition: border-color .15s; font-size: .8rem;
}
.layer-item:hover, .layer-item.selected { border-color: var(--accent); background: #fff5f0; }
.layer-type { font-size: .7rem; text-transform: uppercase; font-weight: 700; color: var(--grey); }
.layer-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-del { background: none; border: none; cursor: pointer; color: var(--grey); padding: .1rem .3rem; border-radius: 3px; }
.layer-del:hover { background: #fee2e2; color: #dc2626; }

/* Price summary */
.price-summary {
  background: var(--grey-light); border-radius: var(--radius-sm);
  padding: .9rem; margin-bottom: 1rem; margin-top: .5rem;
}
.price-row { display: flex; justify-content: space-between; font-size: .875rem; padding: .2rem 0; }
.price-row.total { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; border-top: 1.5px solid var(--grey-border); margin-top: .4rem; padding-top: .5rem; }

.btn-order {
  width: 100%; padding: .85rem;
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  transition: background .2s, transform .1s;
}
.btn-order:hover { background: #e5521f; transform: translateY(-1px); }

/* Canvas area */
.customizer-canvas-area {
  display: flex; flex-direction: column; align-items: center;
  padding: 2rem; background: #f8f7f5;
}
.canvas-toolbar {
  display: flex; align-items: center; gap: .75rem;
  background: var(--white); border: 1.5px solid var(--grey-border);
  border-radius: var(--radius); padding: .5rem 1rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.tool-btn {
  background: none; border: 1.5px solid var(--grey-border); border-radius: var(--radius-sm);
  padding: .35rem .8rem; font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .2s;
}
.tool-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.canvas-hint { font-size: .78rem; color: var(--grey); flex: 1; text-align: center; }

.canvas-container {
  position: relative;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
#tshirtCanvas { display: block; cursor: default; }
.canvas-overlay-label {
  position: absolute; top: .75rem; right: .75rem;
  background: rgba(0,0,0,0.5); color: #fff;
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  padding: .2rem .6rem; border-radius: 999px;
}
.canvas-meta { margin-top: .75rem; font-size: .78rem; color: var(--grey); }

/* ORDER MODAL */
.modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(15,15,15,0.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--white); border-radius: var(--radius);
  padding: 2.5rem; max-width: 480px; width: 100%;
  position: relative; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--grey);
}
.modal h2 { font-family: var(--font-display); font-weight: 800; margin-bottom: 1.25rem; }
.modal-preview { display: flex; justify-content: center; margin-bottom: 1.5rem; }
#previewCanvas { border-radius: var(--radius-sm); border: 1.5px solid var(--grey-border); }

.order-form label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .9rem; }
.order-form input, .order-form textarea {
  display: block; width: 100%; margin-top: .3rem;
  border: 1.5px solid var(--grey-border); border-radius: var(--radius-sm);
  padding: .55rem .75rem; font-family: var(--font-body); font-size: .9rem;
}
.order-form input:focus, .order-form textarea:focus { outline: none; border-color: var(--accent); }
.modal-total { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; margin: 1rem 0; }
.btn-confirm {
  width: 100%; padding: .85rem; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: background .2s;
}
.btn-confirm:hover { background: #e5521f; }

.order-success { text-align: center; padding: 1.5rem 0; }
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #d1fae5; color: #059669;
  font-size: 1.75rem; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
}
.order-success h3 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; margin-bottom: .5rem; }
.order-success p { color: var(--grey); margin-bottom: .4rem; }
.btn-back-home {
  display: inline-block; margin-top: 1.25rem;
  background: var(--ink); color: #fff;
  padding: .6rem 1.5rem; border-radius: 999px; font-weight: 600;
}

@media (max-width: 900px) {
  .customizer-wrap { grid-template-columns: 1fr; }
  .customizer-sidebar { position: static; max-height: none; border-right: none; border-bottom: 1.5px solid var(--grey-border); }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
}
