/* ============================================
   PREMIUM MONOCHROME THEME - SENSAVIA
   ============================================ */

/* Color Token System */
:root {
  --black-primary: #0B0B0B;
  --black-soft: #111111;
  --white: #FFFFFF;
  --bg-soft: #FAFAFA;
  --bg-softer: #F7F7F7;
  --border: #E5E7EB;
  --text: #111827;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-strong: 0 8px 40px rgba(0, 0, 0, 0.15);
}

/* ============================================
   GLOBAL RESET & BASE STYLES
   ============================================ */

html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  background-color: var(--white);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  color: var(--text);
  line-height: 1.7;
}

/* Section spacing utility */
.section-spacing {
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .section-spacing {
    padding: 5rem 0;
  }
}

/* Alternating section backgrounds */
.section-soft {
  background-color: var(--bg-soft);
}

.section-softer {
  background-color: var(--bg-softer);
}

.section-white {
  background-color: var(--white);
}

/* ============================================
   HEADER - PREMIUM GLASSMORPHISM
   ============================================ */

header {
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.5s ease-out;
  box-shadow: var(--shadow-medium);
  position: sticky;
  top: 0;
  z-index: 50;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Nav links with monochrome underline animation */
nav a {
  position: relative;
  color: var(--text);
  transition: color 0.3s ease;
  font-weight: 500;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--black-primary);
  transition: width 0.3s ease;
}

nav a:hover {
  color: var(--black-primary);
}

nav a:hover::after {
  width: 100%;
}

/* Cart badge - premium styling */
.cart-badge {
  background-color: var(--black-primary);
  color: var(--white);
  font-weight: 600;
  border-radius: 10px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  box-shadow: var(--shadow-soft);
  animation: pulse 0.3s ease-out;
}

.cart-badge.pulse-once {
  animation: pulse-once 0.6s ease-out;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes pulse-once {
  0%, 100% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.2);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Mobile menu slide-in */
#mobile-menu {
  animation: slideIn 0.3s ease-out;
  background-color: var(--white);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   BUTTON SYSTEM - PREMIUM MONOCHROME
   ============================================ */

.btn-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: var(--black-primary);
  color: var(--white);
  border-radius: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-medium);
  border: none;
  cursor: pointer;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--shadow-strong);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary:focus {
  outline: 2px solid var(--black-primary);
  outline-offset: 2px;
}

.btn-secondary {
  position: relative;
  transition: all 0.3s ease;
  background: var(--white);
  color: var(--text);
  border: 2px solid var(--black-primary);
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: var(--black-primary);
  color: var(--white);
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--shadow-medium);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

/* Loading spinner for buttons */
.btn-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Ripple effect for buttons */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  top: 50%;
  left: 50%;
  animation: ripple 0.6s ease-out;
  pointer-events: none;
}

/* ============================================
   CARD SYSTEM - PREMIUM MONOCHROME
   ============================================ */

.product-card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-medium);
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-strong);
  border-color: var(--black-soft);
}

/* Product image zoom on hover */
.product-image-container {
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-soft);
}

.product-image-container img {
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .product-image-container img {
  transform: scale(1.03);
}

/* Feature cards - softer background */
.feature-card {
  transition: all 0.3s ease;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-strong);
  border-color: var(--black-soft);
}

/* Trust badge pills */
.trust-badge {
  padding: 1rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50px;
  transition: all 0.3s ease;
  animation: float 3s ease-in-out infinite;
}

.trust-badge:hover {
  border-color: var(--black-primary);
  box-shadow: var(--shadow-medium);
}

.trust-badge:nth-child(1) { animation-delay: 0s; }
.trust-badge:nth-child(2) { animation-delay: 0.5s; }
.trust-badge:nth-child(3) { animation-delay: 1s; }
.trust-badge:nth-child(4) { animation-delay: 1.5s; }
.trust-badge:nth-child(5) { animation-delay: 2s; }
.trust-badge:nth-child(6) { animation-delay: 2.5s; }

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUp 0.6s ease-out forwards;
  opacity: 0;
}

.animate-fade-up-delay-1 {
  animation: fadeUp 0.6s ease-out 0.1s forwards;
  opacity: 0;
}

.animate-fade-up-delay-2 {
  animation: fadeUp 0.6s ease-out 0.2s forwards;
  opacity: 0;
}

.animate-fade-up-delay-3 {
  animation: fadeUp 0.6s ease-out 0.3s forwards;
  opacity: 0;
}

/* Stagger animation for lists */
.stagger-item {
  opacity: 0;
  animation: fadeUp 0.5s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   INPUT SYSTEM - PREMIUM MONOCHROME
   ============================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  transition: all 0.3s ease;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: var(--white);
  color: var(--text);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--black-primary);
  box-shadow: 0 0 0 3px rgba(11, 11, 11, 0.1);
  outline: none;
}

/* Floating label effect */
.input-group {
  position: relative;
}

.input-group label {
  position: absolute;
  top: 12px;
  left: 12px;
  color: var(--text-muted);
  transition: all 0.3s ease;
  pointer-events: none;
  background: var(--white);
  padding: 0 4px;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
  top: -10px;
  left: 8px;
  font-size: 0.75rem;
  color: var(--black-primary);
  font-weight: 600;
}

/* Error shake animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.input-error {
  animation: shake 0.5s ease;
  border-color: var(--text-muted) !important;
}

.input-error:focus {
  border-color: var(--black-primary) !important;
}

/* Success state */
.input-success {
  border-color: var(--black-primary) !important;
  box-shadow: 0 0 0 3px rgba(11, 11, 11, 0.1) !important;
}

/* ============================================
   PRODUCT GRID ANIMATIONS
   ============================================ */

.products-grid {
  display: grid;
  gap: 2rem;
}

.product-item {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  animation: productReveal 0.5s ease-out forwards;
}

@keyframes productReveal {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Stagger product reveal */
.product-item:nth-child(1) { animation-delay: 0.05s; }
.product-item:nth-child(2) { animation-delay: 0.1s; }
.product-item:nth-child(3) { animation-delay: 0.15s; }
.product-item:nth-child(4) { animation-delay: 0.2s; }
.product-item:nth-child(5) { animation-delay: 0.25s; }
.product-item:nth-child(6) { animation-delay: 0.3s; }
.product-item:nth-child(7) { animation-delay: 0.35s; }
.product-item:nth-child(8) { animation-delay: 0.4s; }
.product-item:nth-child(9) { animation-delay: 0.45s; }
.product-item:nth-child(10) { animation-delay: 0.5s; }
.product-item:nth-child(11) { animation-delay: 0.55s; }
.product-item:nth-child(12) { animation-delay: 0.6s; }

/* Smooth grid reflow */
.products-grid.reflowing {
  transition: grid-template-columns 0.3s ease;
}

/* ============================================
   PRODUCT DETAIL ANIMATIONS
   ============================================ */

.product-main-image {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.product-main-image.fade-out {
  opacity: 0;
  transform: scale(0.98);
}

.product-main-image.fade-in {
  opacity: 1;
  transform: scale(1);
}

/* Thumbnail active state */
.thumbnail {
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
}

.thumbnail:hover {
  border-color: var(--border);
  transform: scale(1.05);
}

.thumbnail.active {
  border-color: var(--black-primary);
  box-shadow: 0 0 0 3px rgba(11, 11, 11, 0.1);
}

/* Quantity selector animation */
.qty-btn {
  transition: all 0.2s ease;
  border-radius: 8px;
}

.qty-btn:hover {
  background: var(--bg-soft);
  transform: scale(1.1);
}

.qty-btn:active {
  transform: scale(0.95);
}

.qty-value {
  transition: transform 0.2s ease;
}

.qty-value.updating {
  transform: scale(1.2);
  color: var(--black-primary);
  font-weight: 600;
}

/* ============================================
   CART ANIMATIONS
   ============================================ */

.cart-item {
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInRight 0.4s ease-out forwards;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}

.cart-item:hover {
  background-color: var(--bg-soft);
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cart-item:nth-child(1) { animation-delay: 0.1s; }
.cart-item:nth-child(2) { animation-delay: 0.2s; }
.cart-item:nth-child(3) { animation-delay: 0.3s; }
.cart-item:nth-child(4) { animation-delay: 0.4s; }
.cart-item:nth-child(5) { animation-delay: 0.5s; }

.cart-item.removing {
  animation: slideOutRight 0.4s ease-out forwards;
}

@keyframes slideOutRight {
  to {
    opacity: 0;
    transform: translateX(100px);
    max-height: 0;
    margin: 0;
    padding: 0;
  }
}

/* Cart totals box */
.cart-totals-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
}

/* Coupon animations */
.coupon-shake {
  animation: shake 0.5s ease;
}

.coupon-success {
  animation: successGlow 0.6s ease;
}

@keyframes successGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(11, 11, 11, 0);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(11, 11, 11, 0.15);
  }
}

.totals-value {
  transition: all 0.3s ease;
}

.empty-cart {
  animation: fadeUp 0.6s ease-out;
}

/* ============================================
   CHECKOUT ANIMATIONS
   ============================================ */

.checkout-step {
  opacity: 0.5;
  transition: all 0.3s ease;
}

.checkout-step.active {
  opacity: 1;
  transform: scale(1.05);
}

/* Payment option cards */
.payment-option {
  transition: all 0.3s ease;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  background: var(--white);
  padding: 1rem;
}

.payment-option:hover {
  border-color: var(--black-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.payment-option.selected {
  border-color: var(--black-primary);
  background: var(--bg-soft);
  box-shadow: 0 0 0 3px rgba(11, 11, 11, 0.1);
}

/* Form section headers */
.form-section-title {
  color: var(--text);
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}

/* ============================================
   SUCCESS PAGE ANIMATIONS
   ============================================ */

@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.checkmark-path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark 0.6s ease-out 0.3s forwards;
  stroke: var(--black-primary);
}

/* Monochrome confetti */
.confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--black-primary);
  position: absolute;
  animation: confetti-fall 3s linear infinite;
  border-radius: 2px;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(360deg);
    opacity: 0;
  }
}

/* Order ID highlight pill */
.order-id {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-weight: 600;
  animation: highlight 1s ease-out;
}

@keyframes highlight {
  0%, 100% {
    background: var(--bg-soft);
    border-color: var(--border);
  }
  50% {
    background: var(--black-primary);
    color: var(--white);
    border-color: var(--black-primary);
  }
}

/* ============================================
   HERO SECTION - PREMIUM MONOCHROME
   ============================================ */

.hero-content h1 {
  animation: fadeUp 0.8s ease-out 0.2s forwards;
  opacity: 0;
  color: var(--text);
}

.hero-content p {
  animation: fadeUp 0.8s ease-out 0.4s forwards;
  opacity: 0;
  color: var(--text-muted);
}

.hero-content a {
  animation: fadeUp 0.8s ease-out 0.6s forwards;
  opacity: 0;
}

/* Subtle monochrome gradient background */
@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.hero-gradient {
  background: linear-gradient(180deg, rgba(236, 180, 205, 0.76) 0%, rgba(141, 202, 239, 0.76) 100%), #FFF;;
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   SECTION DIVIDERS
   ============================================ */

.section-divider {
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

@media (min-width: 768px) {
  .section-divider {
    margin: 4rem 0;
  }
}

/* ============================================
   ACCESSIBILITY & PERFORMANCE
   ============================================ */

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .scroll-reveal {
    opacity: 1;
    transform: none;
  }
}

/* Custom scrollbar - monochrome */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--black-primary);
}

/* Focus styles for accessibility */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
  outline: 2px solid var(--black-primary);
  outline-offset: 2px;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(11, 11, 11, 0.1);
  border-top-color: var(--black-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Print styles for invoice */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white;
  }
  
  @page {
    margin: 1cm;
  }
  
  * {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }
}

/* Product image styles - support both light and dark backgrounds */
.product-image-container {
  background: var(--bg-soft);
  min-height: 384px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image-container.dark-bg {
  background: var(--black-primary);
  background: linear-gradient(180deg, var(--black-soft) 0%, var(--black-primary) 100%);
}

.product-image-container.dark-bg img {
  mix-blend-mode: normal;
  padding: 2rem;
}

/* Product detail page image container */
#product-image-wrapper {
  min-height: 384px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

#product-image-wrapper.dark-bg {
  background: var(--black-primary);
  background: linear-gradient(180deg, var(--black-soft) 0%, var(--black-primary) 100%);
  border-color: var(--black-soft);
}

#product-image-wrapper.dark-bg img {
  padding: 2rem;
  object-fit: contain;
}

/* Footer - premium monochrome */
footer {
  background: var(--black-primary);
  color: var(--white);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state svg {
  color: var(--text-faint);
  margin-bottom: 1.5rem;
}

/* Filter bar styling */
.filter-bar {
  background: var(--bg-softer);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}

/* Checkout summary box */
.checkout-summary {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
  padding: 1.5rem;
}

/* Success celebration */
.success-celebration {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: var(--bg-soft);
  border: 2px solid var(--black-primary);
  border-radius: 50%;
  margin: 0 auto 2rem;
}

.success-celebration svg {
  stroke: var(--black-primary);
}
