:root {
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --color-dark: #0a0a0a;
  --color-dark-card: #1a1a1a;
  --color-primary: #8b5cf6;
  --color-secondary: #f472b6;
}

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #111827;
  background-color: #0a0a0a;
}

.section-container {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (min-width: 640px) {
  .section-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .section-container {
    padding-left: 2rem;
    padding-right: 2rem;
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

.style-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.style-card:hover {
  transform: scale(1.05);
}

.accordion-item {
  border-bottom: 1px solid #f3f4f6;
}

.accordion-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  text-align: left;
  font-size: 1.125rem;
  font-weight: 500;
  transition: color 0.2s;
  cursor: pointer;
  list-style: none;
}

.accordion-trigger:hover {
  color: #4b5563;
}

.accordion-trigger::-webkit-details-marker {
  display: none;
}

.accordion-content {
  padding-bottom: 1.5rem;
  color: #6b7280;
  overflow: hidden;
  transition: all 0.2s;
}

details[open] .accordion-icon {
  transform: rotate(45deg);
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* =========================================== */
/* FUNCTIONAL SECTION VISIBILITY               */
/* =========================================== */

.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

.decorative-section {
  display: block;
}

body.app-active .decorative-section {
  display: none;
}

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

/* =========================================== */
/* UPLOAD AREA (Hero section)                  */
/* =========================================== */

.upload-area-hero {
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-area-hero.dragover #uploadPlaceholder {
  border-color: rgba(139, 92, 246, 0.8) !important;
  background: rgba(139, 92, 246, 0.15) !important;
}

/* =========================================== */
/* PREVIEW CONTAINER                           */
/* =========================================== */

.preview-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.preview-container:hover {
  transform: scale(1.02);
}

.preview-container:hover .preview-hint {
  opacity: 1;
}

.preview-canvas {
  max-width: 400px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.2);
}

.preview-hint {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9em;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

/* =========================================== */
/* LIGHTBOX MODAL                              */
/* =========================================== */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: -10px;
  background: none;
  border: none;
  color: white;
  font-size: 2em;
  cursor: pointer;
  padding: 10px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

.lightbox-canvas {
  max-width: 100%;
  max-height: calc(90vh - 80px);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.lightbox-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.lightbox-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lightbox-btn-retry {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: white;
}

.lightbox-btn-retry:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.lightbox-btn-retry:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.lightbox-btn-close {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.lightbox-btn-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-btn .spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

/* =========================================== */
/* PRODUCT GRID (dark theme)                   */
/* =========================================== */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.product-card {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  background: #1a1a1a;
}

.product-card:hover {
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.15);
}

.product-card.selected {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.product-card h3 {
  font-size: 1.3em;
  margin: 15px 0 10px;
  color: white;
}

.product-card p {
  color: #9ca3af;
  margin-bottom: 10px;
}

.product-card .price {
  font-size: 1.5em;
  font-weight: bold;
  color: #8b5cf6;
  margin: 15px 0;
}

.product-mockup {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  position: relative;
  margin-bottom: 15px;
  border-radius: 8px;
  background: #111;
  overflow: hidden;
}

.product-mockup canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.product-card .btn {
  width: 100%;
  padding: 10px;
  margin-top: 10px;
}

/* =========================================== */
/* CART SUMMARY (dark theme)                   */
/* =========================================== */

.cart-summary {
  background: #1a1a1a;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  margin: 20px 0;
}

.cart-items {
  margin-bottom: 15px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-total {
  font-size: 1.3em;
  padding-top: 15px;
  border-top: 2px solid rgba(255, 255, 255, 0.15);
  text-align: right;
  color: white;
}

/* =========================================== */
/* CHECKOUT LAYOUT (dark theme)                */
/* =========================================== */

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 30px;
}

@media (max-width: 968px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }
}

.checkout-summary h3 {
  color: white;
}

.mockup-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.mockup-item {
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  background: #111;
}

.mockup-item canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
}

.mockup-item p {
  margin-top: 8px;
  text-align: center;
  font-size: 0.9em;
  color: #9ca3af;
}

/* =========================================== */
/* FORMS (dark theme)                          */
/* =========================================== */

.form-section {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #d1d5db;
}

.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 1em;
  transition: border-color 0.3s ease;
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.form-group input:focus {
  outline: none;
  border-color: #8b5cf6;
}

.form-group input::placeholder {
  color: #6b7280;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.card-element {
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.card-element.error {
  border-color: #ef4444;
}

.card-errors {
  color: #ef4444;
  margin-top: 10px;
  font-size: 0.9em;
}

/* =========================================== */
/* PAYMENT ERROR (dark theme)                  */
/* =========================================== */

.payment-error {
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid #ef4444;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 25px;
  display: flex;
  gap: 15px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.payment-error .error-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.payment-error .error-content {
  flex: 1;
}

.payment-error h4 {
  color: #fca5a5;
  margin-bottom: 8px;
  font-size: 1.1em;
}

.payment-error p {
  color: #d1d5db;
  margin-bottom: 12px;
  line-height: 1.5;
}

.btn-dismiss {
  background: #ef4444;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s ease;
}

.btn-dismiss:hover {
  background: #dc2626;
}

/* =========================================== */
/* BUTTONS (themed)                            */
/* =========================================== */

.btn {
  display: inline-block;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* =========================================== */
/* SPINNER                                     */
/* =========================================== */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

/* =========================================== */
/* RESPONSIVE                                  */
/* =========================================== */

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

  .mockup-gallery {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .preview-canvas {
    max-width: 100%;
  }

  .lightbox-content {
    max-width: 95vw;
  }

  .lightbox-actions {
    flex-direction: column;
    width: 100%;
  }

  .lightbox-btn {
    justify-content: center;
  }
}
