@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-deep: #050511;
  --bg-surface: rgba(14, 18, 34, 0.6);
  --bg-surface-hover: rgba(22, 28, 52, 0.8);
  --card-border: rgba(255, 255, 255, 0.08);
  --glow: rgba(56, 189, 248, 0.2);
  
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-glow: rgba(56, 189, 248, 0.4);
  
  --accent: #d946ef;
  --accent-glow: rgba(217, 70, 239, 0.4);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px var(--glow);
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  
  --transition: 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(circle at 10% 40%, rgba(56, 189, 248, 0.12), transparent 50%),
    radial-gradient(circle at 90% 10%, rgba(217, 70, 239, 0.1), transparent 40%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Outfit', system-ui, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

/* Base Elements */
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.5rem, 5vw, 4rem); background: linear-gradient(to right, #fff, #94a3b8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
h2 { font-size: 1.75rem; color: var(--text-primary); }
h3 { font-size: 1.25rem; color: #fff; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.lead { color: var(--text-secondary); font-size: 1.1rem; max-width: 90%; margin: 1rem 0 1.5rem; }
.muted { color: var(--text-secondary); font-size: 0.9rem; }

/* Layout */
.page { max-width: 1300px; margin: 0 auto; padding: 2rem 1.5rem 6rem; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.5rem; margin-top: 2rem; }
.span-8 { grid-column: span 8; }
.span-4 { grid-column: span 4; }

/* Components */
.card {
  background: var(--bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), border-color var(--transition);
}
.card:hover { border-color: rgba(255,255,255,0.15); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }

.card-head { margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }

/* Hero */
.hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3rem 4rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(217, 70, 239, 0.05) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero::before { content: ''; position: absolute; inset: 0; backdrop-filter: blur(30px); z-index: -1; }
.hero__content { max-width: 600px; z-index: 1; }
.hero__actions { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }

.hero__badge { flex-shrink: 0; }
.badge-card {
  background: rgba(10, 15, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  backdrop-filter: blur(16px);
  box-shadow: inset 0 0 20px rgba(255,255,255,0.02);
}
.badge-card p.badge-title { color: #fff; font-weight: 600; margin-bottom: 0.5rem; }
.badge-card ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; margin: 1rem 0; }
.badge-card li { display: flex; align-items: center; gap: 0.75rem; font-size: 0.95rem; color: var(--text-primary); }
.badge-card li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 10px var(--primary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.8rem 1.75rem;
  border-radius: var(--radius-pill);
  font-family: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: all var(--transition);
  border: none; text-decoration: none;
}
.btn.primary { background: var(--primary); color: #020617; box-shadow: 0 4px 20px var(--primary-glow); }
.btn.primary:hover { background: var(--primary-hover); transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 25px rgba(56, 189, 248, 0.6); }
.btn.ghost { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); border: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.2); }

/* Forms & Inputs */
input, select {
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--card-border);
  color: var(--text-primary); padding: 0.8rem 1.25rem;
  border-radius: var(--radius-md); font-family: inherit; font-size: 0.95rem;
  width: 100%; transition: all var(--transition); outline: none;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-glow); background: rgba(0,0,0,0.5); }

/* Catalog */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.product {
  background: rgba(15, 23, 42, 0.4); border: 1px solid var(--card-border);
  border-radius: var(--radius-md); padding: 1rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer; display: flex; flex-direction: column; position: relative;
  overflow: hidden;
}
.product::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(56, 189, 248, 0.05), transparent); opacity: 0; transition: opacity 0.4s ease; pointer-events: none; }
.product:hover { background: rgba(30, 41, 59, 0.6); transform: translateY(-8px); border-color: rgba(56, 189, 248, 0.4); box-shadow: 0 20px 40px rgba(0,0,0,0.4), 0 0 20px var(--glow); }
.product:hover::after { opacity: 1; }

.product-image {
  width: 100%; height: 220px; border-radius: var(--radius-sm);
  background-size: cover; background-position: center; background-color: rgba(0,0,0,0.4);
  margin-bottom: 1.25rem; border: 1px solid rgba(255,255,255,0.05);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.product:hover .product-image { transform: scale(1.05); }

.product-image.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.06) 100%);
  color: var(--text-tertiary); font-size: 0.85rem; font-weight: 500;
}

.product h3 { margin: 0.25rem 0; font-size: 1.15rem; }
.product .price { color: var(--primary); font-size: 1.3rem; font-weight: 700; margin: 0.5rem 0 1rem; }
.product .btn { margin-top: auto; width: 100%; }

/* Swatches & Chips */
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; padding: 3px; background: none; cursor: pointer; transition: all var(--transition); }
.swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); }
.swatch.selected { border-color: var(--primary); transform: scale(1.15); box-shadow: 0 4px 15px var(--primary-glow); }

.tones { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; width: 100%; }
.tone { flex: 1; min-width: 80px; background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); color: var(--text-primary); padding: 1rem; border-radius: var(--radius-md); font-weight: 500; cursor: pointer; transition: all var(--transition); text-align: center; }
.tone:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); box-shadow: 0 4px 15px rgba(0,0,0,0.2); transform: translateY(-2px); }

/* Layout Utilities */
.filters { display: flex; gap: 0.75rem; align-items: flex-start; flex-wrap: wrap; }
.filters .skin-chart { flex-basis: 100%; margin-top: 0; }
.chips, .color-graph { display: flex; flex-wrap: wrap; gap: 0.75rem; width: 100%; }
.skin-chart { margin-top: 1.5rem; }
.tone-chart { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 0.75rem; margin-top: 1rem; }

.tone-chip { background: rgba(0,0,0,0.3); border: 1px solid var(--card-border); border-radius: var(--radius-sm); padding: 0; overflow: hidden; cursor: pointer; transition: all var(--transition); }
.tone-chip:hover, .tone-chip.selected { border-color: var(--primary); transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 0 15px var(--glow); }
.tone-sample { display: block; height: 48px; }
.tone-label { display: block; padding: 0.5rem; font-size: 0.75rem; color: var(--text-secondary); text-align: center; font-weight: 500; }
.color-dropdown { margin-top: 1.5rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Modals & Chat Drawer */
.modal {
  position: fixed; inset: 0; background: rgba(2, 4, 10, 0.85); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal.open { opacity: 1; pointer-events: auto; }

.modal__content {
  background: rgba(14, 18, 34, 0.95); border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg); padding: 2.5rem; width: 90%; max-width: 550px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(20px) scale(0.95); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.open .modal__content { transform: translateY(0) scale(1); }
.modal__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; border-bottom: 1px solid var(--card-border); padding-bottom: 1rem; }

.chat-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 440px;
  background: rgba(10, 14, 28, 0.9); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid rgba(255,255,255,0.1); padding: 2rem 1.5rem;
  display: flex; flex-direction: column; z-index: 90;
  transform: translateX(100%); transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: -10px 0 50px rgba(0,0,0,0.6);
}
.chat-drawer.open { transform: translateX(0); }

.chat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--card-border); }
.chat-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; padding-right: 0.5rem; margin-bottom: 1.5rem; }

.bubble { padding: 1rem 1.25rem; border-radius: 1.25rem; max-width: 85%; font-size: 0.95rem; animation: slideIn 0.3s ease forwards; background: rgba(255,255,255,0.04); }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.bubble.user { background: var(--primary); color: #020617; align-self: flex-end; border-bottom-right-radius: 0.25rem; box-shadow: 0 4px 15px var(--primary-glow); font-weight: 500; }
.bubble.bot { border: 1px solid rgba(255,255,255,0.1); align-self: flex-start; border-bottom-left-radius: 0.25rem; color: #e2e8f0; }

.chat-form { display: flex; flex-direction: column; gap: 0.75rem; background: rgba(0,0,0,0.2); padding: 1.25rem; border-radius: var(--radius-lg); border: 1px solid var(--card-border); }

.file-label { display: flex; align-items: center; justify-content: center; gap: 0.5rem; background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.2); padding: 0.75rem; border-radius: var(--radius-md); cursor: pointer; transition: all var(--transition); }
.file-label:hover { background: rgba(56, 189, 248, 0.05); border-color: var(--primary); color: var(--primary); }
.file-label input { display: none; }

/* Cart */
.cart-list { max-height: 40vh; overflow-y: auto; margin: 1.5rem 0; padding-right: 0.5rem; display: flex; flex-direction: column; gap: 1rem; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-radius: var(--radius-md); background: rgba(0,0,0,0.2); border: 1px solid var(--card-border); gap: 1rem; flex-wrap: wrap; }
.cart-item-info { display: flex; gap: 1rem; align-items: center; flex: 1; }
.cart-thumb { width: 80px; height: 80px; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,0.05); background-size: cover; background-position: center; }
.cart-select-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.cart-select-row select { padding: 0.4rem 0.75rem; font-size: 0.85rem; width: auto; }
.cart-actions { display: flex; align-items: center; gap: 0.75rem; }
.cart-actions input { width: 70px; text-align: center; }
.cart-summary { font-size: 1.25rem; letter-spacing: 0.5px; }

/* Utilities */
.hidden { display: none !important; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; border: 2px solid var(--bg-deep); }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

@media (max-width: 1024px) {
  .span-8, .span-4 { grid-column: span 12; }
  .hero { flex-direction: column; text-align: center; padding: 2.5rem; }
  .hero__content { margin: 0 auto; }
  .hero__actions { justify-content: center; }
  .badge-card { display: none; }
}

@media (max-width: 640px) {
  h1 { font-size: 2.25rem; }
  .card { padding: 1.5rem; }
  .catalog { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .modal__content { padding: 1.5rem; border-radius: 20px 20px 0 0; position: absolute; bottom: 0; width: 100%; transform: translateY(100%); }
  .modal.open .modal__content { transform: translateY(0); }
  .chat-drawer { width: 100%; max-width: 100%; }
}
