/* Tridea E-Commerce - Main Stylesheet */
/* Import theme variables */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --background: oklch(1.0000 0 0);
  --foreground: oklch(0.1800 0 0);
  --card: oklch(0.9900 0 0);
  --card-foreground: oklch(0.1800 0 0);
  --popover: oklch(1.0000 0 0);
  --popover-foreground: oklch(0.1800 0 0);
  --primary: oklch(0.4200 0.1200 220.0000);
  --primary-foreground: oklch(1.0000 0 0);
  --secondary: oklch(0.9600 0 0);
  --secondary-foreground: oklch(0.1800 0 0);
  --muted: oklch(0.9700 0 0);
  --muted-foreground: oklch(0.5000 0 0);
  --accent: oklch(0.4200 0.1200 220.0000);
  --accent-foreground: oklch(1.0000 0 0);
  --destructive: oklch(0.6200 0.2000 25.0000);
  --destructive-foreground: oklch(1.0000 0 0);
  --border: oklch(0.9200 0 0);
  --input: oklch(0.9800 0 0);
  --ring: oklch(0.4200 0.1200 220.0000);
  --tridea-teal: oklch(0.4200 0.1200 220.0000);
  --tridea-charcoal: oklch(0.1800 0 0);
  --tridea-orange: oklch(0.7000 0.1500 50.0000);
  --gradient-primary: linear-gradient(135deg, var(--tridea-teal) 0%, oklch(0.5000 0.1400 210.0000) 100%);
  --gradient-subtle: linear-gradient(135deg, oklch(0.9900 0 0) 0%, oklch(0.9700 0 0) 100%);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 0.75rem;
  --shadow-sm: 0 1px 3px 0 hsl(0 0% 0% / 0.10), 0 1px 2px -1px hsl(0 0% 0% / 0.10);
  --shadow-md: 0 4px 6px -1px hsl(0 0% 0% / 0.10), 0 2px 4px -2px hsl(0 0% 0% / 0.10);
  --shadow-lg: 0 10px 15px -3px hsl(0 0% 0% / 0.10), 0 4px 6px -4px hsl(0 0% 0% / 0.10);
  --shadow-xl: 0 20px 25px -5px hsl(0 0% 0% / 0.10), 0 8px 10px -6px hsl(0 0% 0% / 0.10);
}

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

body {
  font-family: var(--font-sans) !important;
  background: var(--background) !important;
  color: var(--foreground) !important;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header Styles */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-icons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  transition: all 0.2s;
  position: relative;
}

.icon-btn:hover {
  background: var(--secondary);
}

.cart-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--tridea-orange);
  color: white;
  border-radius: 9999px;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

/* Product Customizer Section */
.product-section {
  padding: 3rem 0;
}

.section-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 2rem;
  line-height: 1.1;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

/* 3D Viewer Card */
.viewer-card {
  background: var(--card);
  border-radius: calc(var(--radius) * 1.5);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.viewer-container {
  aspect-ratio: 4/3;
  background: var(--gradient-subtle);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--border);
}

.placeholder-3d {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  color: var(--muted-foreground);
}

.draggable-hole {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--tridea-orange);
  border: 3px solid white;
  border-radius: 50%;
  cursor: move;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s;
}

.draggable-hole:hover {
  transform: scale(1.2);
}

.low-fi-toggle {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

/* Customization Controls Card */
.controls-card {
  background: var(--card);
  border-radius: calc(var(--radius) * 1.5);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.control-section {
  margin-bottom: 2rem;
}

.control-section:last-child {
  margin-bottom: 0;
}

.control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--tridea-teal);
  color: white;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
}

/* Size Selection */
.size-options {
  display: flex;
  gap: 0.75rem;
}

.size-btn {
  flex: 1;
  padding: 0.75rem;
  border: 2px solid var(--border);
  background: white;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.size-btn:hover {
  border-color: var(--tridea-teal);
}

.size-btn.active {
  border-color: var(--tridea-teal);
  background: var(--tridea-teal);
  color: white;
}

/* Color Palette */
.color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
}

.color-option {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: var(--tridea-charcoal);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--tridea-charcoal);
}

/* Quantity Control */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.qty-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.2s;
}

.qty-btn:hover {
  border-color: var(--tridea-teal);
  background: var(--tridea-teal);
  color: white;
}

.qty-display {
  font-size: 1.25rem;
  font-weight: 600;
  min-width: 40px;
  text-align: center;
}

/* Warning Message */
.warning-message {
  background: #FFF4E6;
  border: 1px solid #FFB020;
  color: #8B5000;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Pricing Card */
.pricing-card {
  background: var(--card);
  border-radius: calc(var(--radius) * 1.5);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border);
}

.pricing-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.pricing-row.total {
  font-size: 1.5rem;
  font-weight: 700;
  padding-top: 1rem;
  border-top: 2px solid var(--border);
  margin-top: 1rem;
}

.discount {
  color: var(--tridea-orange);
}

.add-to-cart-btn {
  width: 100%;
  padding: 1.25rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all 0.3s;
  box-shadow: var(--shadow-md);
}

.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

/* Cart Sidebar */
.cart-sidebar {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  max-width: 450px;
  height: 100vh;
  background: white;
  box-shadow: var(--shadow-2xl);
  z-index: 1000;
  transition: right 0.3s ease-out;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.open {
  right: 0;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.close-cart-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  background: var(--secondary);
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.cart-item-specs {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.cart-item-price {
  font-weight: 700;
  color: var(--tridea-teal);
}

.cart-item-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--muted-foreground);
  transition: all 0.2s ease;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  height: fit-content;
}

.cart-item-remove:hover {
  background: var(--destructive);
  color: white;
  transform: scale(1.1);
}

.cart-item-remove:active {
  transform: scale(0.95);
}

.cart-footer {
  padding: 1.5rem;
  border-top: 2px solid var(--border);
  background: var(--secondary);
}

.cart-subtotal, .cart-shipping, .cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.cart-total {
  font-size: 1.5rem;
  font-weight: 700;
  padding-top: 0.75rem;
  border-top: 2px solid var(--border);
  margin-top: 0.75rem;
}

.checkout-btn {
  width: 100%;
  padding: 1.25rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.3s;
}

.checkout-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Cart Overlay */
.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.cart-overlay.active {
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 2.5rem;
  }

  .color-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .pricing-card {
    margin-top: 2rem;
  }
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--border);
  border-top-color: var(--tridea-teal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 1.5rem;
  color: var(--muted-foreground);
  font-size: 1.1rem;
}

.low-fi-switch-btn {
  margin-top: 2rem;
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.low-fi-switch-btn:hover {
  border-color: var(--tridea-teal);
  background: var(--tridea-teal);
  color: white;
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-slide-in {
  animation: slideInRight 0.4s ease-out;
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Part Tabs for Multi-Color Selection */
.part-tab {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.85rem;
}

.part-tab:hover {
    border-color: var(--tridea-teal);
}

.part-tab.active {
    border-color: var(--tridea-teal);
    background: var(--tridea-teal);
    color: white;
}

/* Hide the old draggable hole marker */
.draggable-hole {
    display: none !important;
}

/* Place Hole button hover */
.place-hole-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Model Selector dropdown */
#modelSelector:hover {
    border-color: var(--tridea-teal);
}

#modelSelector:focus {
    outline: none;
    border-color: var(--tridea-teal);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Custom Design Card */
.custom-design-card {
    background: var(--card);
    border-radius: calc(var(--radius) * 1.5);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--border);
    margin-top: 2rem;
    scroll-margin-top: 100px;
}

/* Custom Design Link Hover */
a[href="#customDesign"]:hover {
    color: var(--tridea-orange);
    text-decoration: underline;
}

/* Form input hover/focus */
input[type="text"]:hover,
input[type="email"]:hover,
input[type="file"]:hover,
textarea:hover {
    border-color: var(--tridea-teal);
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--tridea-teal);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}
