@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@900&display=swap');

:root {
  --font-heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --black: #000000;
  --dark: #0b0c10;
  --surface: #15171e;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --accent-red: #ef4444;
  --accent-green: #10b981;
}

/* Page Transition and Smooth Scroll */
html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  width: 100%;
  max-width: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--gray-900);
  background-color: #fafafa;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  opacity: 0;
  animation: pageFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#side-menu {
  touch-action: pan-y;
}

#side-menu .mobile-nav-link {
  color: #737373 !important;
}

#side-menu .mobile-nav-link[aria-current="page"] {
  border-radius: 2px;
  background-color: transparent;
  color: #000000 !important;
}

#side-menu .mobile-nav-link:not([aria-current="page"]):hover {
  color: #000000 !important;
}

main, section, header, footer {
  min-width: 0;
}

img, video, iframe {
  max-width: 100%;
}

.grid > * {
  min-width: 0;
}

table {
  max-width: 100%;
}

@media (max-width: 640px) {
  .max-w-screen-2xl, .max-w-7xl {
    max-width: 100%;
  }

  #despar-toast-container {
    right: 12px;
    width: calc(100vw - 24px);
  }
}

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

.page-transition-out {
  opacity: 0 !important;
  transition: opacity 0.25s ease !important;
}

footer button.newsletter-subscribe-button {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  box-shadow: none;
}

footer button.newsletter-subscribe-button:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

.header-brand,
.brand-wordmark {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #888;
}

/* Consistent feedback for interactive controls */
a, button, input, select, textarea {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

@media (hover: hover) {
  button:not(:disabled):hover {
    filter: brightness(0.96);
  }

  button:not(:disabled):active {
    filter: brightness(0.9);
  }
}

/* Reveal major page sections and cards as they enter the viewport */
.motion-ready .motion-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.motion-ready .motion-reveal.motion-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Smooth Image Hover Zooms */
.product-card img, .wishlist-card img {
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.3s ease;
}

.product-card:hover img, .wishlist-card:hover img {
  transform: scale(1.05);
}

/* Subtle Card Elevation */
.product-card {
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}
.product-card:hover {
  transform: translateY(-3px);
}

/* Active Wishlist Heart */
.wishlist-btn:not(.active) i {
  color: #9ca3af !important;
}

.wishlist-btn.active {
  background-color: #ffffff !important;
}

.product-card .wishlist-btn:not(.active) {
  background-color: #ffffff !important;
  color: #FFFFFF !important;
}

.wishlist-btn.active i, .wishlist-btn.text-red-600 i {
  color: #ef4444 !important;
  font-weight: 900 !important;
}

/* Cart Add Button Active State Feedback */
.cart-add-btn:hover i {
  color: #9ca3af !important;
}

.cart-add-btn.active i {
  color: #9ca3af !important;
  transform: scale(1.15);
}
.cart-add-btn i {
  transition: transform 0.2s ease, color 0.2s ease;
}

/* Toast Notification System */
#despar-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 90vw;
  width: 360px;
}

.despar-toast {
  pointer-events: auto;
  background: rgba(17, 17, 17, 0.95);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 14px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  border-left: 3px solid #ffffff;
  transform: translateY(20px);
  opacity: 0;
  animation: toastSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.despar-toast.toast-success {
  border-left-color: #10b981;
}

.despar-toast.toast-error {
  border-left-color: #ef4444;
}

@keyframes toastSlideUp {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.despar-toast.toast-exit {
  animation: toastFadeOut 0.3s ease forwards;
}

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

/* Live Search Dropdown Preview */
#search-live-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.15);
  border: 1px solid #eaeaea;
  margin-top: 8px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

#search-live-results.show {
  display: block;
  animation: slideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Header Glassmorphism Effect on Scroll */
header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

/* Badge Pulse Animation */
.badge-pulse {
  animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Clothing Rail Bar & 3D Rail Styles */
.rail-track::-webkit-scrollbar {
  display: none;
}
.rail-track {
  scrollbar-width: none;
  cursor: grab;
  scroll-behavior: smooth;
}
.rail-track:active {
  cursor: grabbing;
}

.chrome-rail-bar {
  height: 5px;
  background: linear-gradient(90deg, #999, #fff, #666, #fff, #999);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  border-radius: 3px;
}

.rail-item {
  perspective: 1500px;
  flex: 0 0 calc((100% - (4 * 1.5rem)) / 5);
  min-width: 180px;
}

.hanger-3d-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  transform-origin: center top;
}

.hanger-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
}

.card-side {
  transform: rotateY(0deg);
  opacity: 1;
}

.card-front {
  transform: rotateY(-90deg);
  opacity: 0;
}

.rail-item:hover .hanger-3d-wrapper,
.rail-item.active .hanger-3d-wrapper {
  transform: translateY(10px) scale(1.05);
}

.rail-item:hover .card-side,
.rail-item.active .card-side {
  transform: rotateY(90deg);
  opacity: 0;
}

.rail-item:hover .card-front,
.rail-item.active .card-front {
  transform: rotateY(0deg);
  opacity: 1;
}

.product-hover-overlay {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.rail-item:hover .product-hover-overlay,
.rail-item.active .product-hover-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Horizontal Sliding Rack Layout */
.clothing-rack-section {
  width: 100%;
  max-width: 1400px;
  margin: 40px auto;
  font-family: var(--font-body);
  padding: 0 20px;
  box-sizing: border-box;
}

.rack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.rack-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.rack-controls {
  display: flex;
  gap: 10px;
}

.scroll-btn {
  background: #f0f0f0;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.scroll-btn:hover {
  background: #ddd;
  transform: scale(1.05);
}

.rack-container {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 10px;
}

.rack-container::-webkit-scrollbar {
  display: none;
}

main[class~="py-16"],
section[class~="py-16"] {
  padding-block: 2rem;
}

main[class~="py-12"],
section[class~="py-12"] {
  padding-block: 1.5rem;
}

main[class~="py-10"],
section[class~="py-10"] {
  padding-block: 1.25rem;
}

main[class~="py-8"],
section[class~="py-8"] {
  padding-block: 1rem;
}

main[class~="pt-8"],
section[class~="pt-8"] {
  padding-top: 1rem;
}

main[class*="px-"],
section[class*="px-"],
.max-w-7xl[class*="px-"],
.max-w-screen-2xl[class*="px-"],
.max-w-5xl[class*="px-"],
.max-w-4xl[class*="px-"],
.max-w-lg[class*="px-"] {
  padding-inline: 0.75rem;
}

@media (min-width: 640px) {
  main[class~="sm:py-16"],
  section[class~="sm:py-16"] {
    padding-block: 2rem;
  }

  main[class~="sm:py-12"],
  section[class~="sm:py-12"] {
    padding-block: 1.5rem;
  }

  main[class*="px-"],
  section[class*="px-"],
  .max-w-7xl[class*="px-"],
  .max-w-screen-2xl[class*="px-"],
  .max-w-5xl[class*="px-"],
  .max-w-4xl[class*="px-"],
  .max-w-lg[class*="px-"] {
    padding-inline: 1rem;
  }
}

@media (min-width: 1024px) {
  main[class*="px-"],
  section[class*="px-"],
  .max-w-7xl[class*="px-"],
  .max-w-screen-2xl[class*="px-"],
  .max-w-5xl[class*="px-"],
  .max-w-4xl[class*="px-"],
  .max-w-lg[class*="px-"] {
    padding-inline: 1.25rem;
  }
}

#homepage-section-rail > div:first-child {
  margin-bottom: 0;
}

#homepage-section-rail > .relative {
  padding-top: 0;
}

#homepage-section-rail .chrome-rail-bar {
  top: 0;
}

#clothing-rail-track {
  gap: 0;
  padding-top: 0;
  padding-bottom: 0;
}

#clothing-rail-track .rail-item {
  flex-basis: 25%;
  min-width: 180px;
}

#clothing-rail-track .rail-product-media {
  height: 240px;
}

#clothing-rail-track .rail-product-media img {
  padding-top: 0;
}

@media (min-width: 1024px) {
  #clothing-rail-track {
    gap: 0;
  }

  #clothing-rail-track .rail-item {
    flex-basis: 33.333333%;
  }

  #clothing-rail-track .rail-product-media {
    height: 360px;
  }
}

.product-detail-page main[class~="py-8"] {
  padding-block: 1rem;
}

.product-detail-page main > .grid {
  gap: 1.5rem;
}

.product-detail-page main > .grid > .min-w-0 {
  gap: 1rem;
}

.product-detail-page #pdp-title {
  margin-bottom: 0.25rem;
}

.product-detail-page #pdp-title + div {
  margin-bottom: 0.75rem;
}

.product-detail-page #pdp-price-row {
  padding-bottom: 1rem;
}

.product-detail-page #size-options-container {
  gap: 0.5rem;
}

.product-detail-page #pdp-add-to-bag-btn,
.product-detail-page #pdp-buy-now-btn {
  padding-block: 0.75rem;
}

.product-detail-page main > .grid > .min-w-0 > .grid {
  gap: 0.5rem;
  padding-block: 0.75rem;
}

.product-detail-page main > .grid > .min-w-0 > .space-y-3 {
  gap: 0.5rem;
  padding-top: 0.5rem;
}

.product-detail-page main > .grid > .min-w-0 details > summary {
  padding: 0.75rem;
}

.product-detail-page main > .grid > .min-w-0 details > div {
  padding: 0.75rem;
}

.product-detail-page main > .grid > .min-w-0 details > div.pt-0 {
  padding-top: 0;
}

.product-detail-page #related-products-section,
.product-detail-page #similar-products-section,
.product-detail-page #also-bought-products-section {
  padding-block: 1rem;
}

.product-detail-page #related-products-section > div:first-child,
.product-detail-page #similar-products-section > div:first-child,
.product-detail-page #also-bought-products-section > div:first-child {
  margin-bottom: 1rem;
}

.product-detail-page .pdp-recommendation-track {
  gap: 0.75rem;
  padding-bottom: 0.5rem;
}

@media (min-width: 1024px) {
  .product-detail-page main > .grid {
    gap: 1.5rem;
  }
}

.footer-mobile-accordion > summary::-webkit-details-marker {
  display: none;
}

.footer-mobile-accordion > summary::marker {
  content: "";
}

.footer-accordion-icon::before {
  content: "+";
  font-size: 1.25rem;
  line-height: 1;
}

.footer-mobile-accordion[open] .footer-accordion-icon::before {
  content: "\2212";
}

/* Quick Add Size Picker Modal */
.size-modal-backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

#customer-sign-in.is-ready {
  background-color: #0d45ae !important;
  color: #ffffff !important;
}

/* Follow the device appearance setting; the default styles remain the light theme. */
@media (prefers-color-scheme: dark) {
  body,
  body[class~="bg-gray-50"] {
    color: #ffffff !important;
    background-color: #000000 !important;
    color-scheme: dark;
  }

  [class~="bg-white"] {
    background-color: #0b0c10 !important;
  }

  header[class~="bg-white"] {
    background-color: #000000 !important;
  }

  #side-menu {
    background-color: #000000 !important;
  }

  #side-menu .mobile-nav-link[aria-current="page"] {
    background-color: #000000;
    color: #ffffff !important;
  }

  #side-menu .mobile-nav-link:not([aria-current="page"]):hover {
    color: #ffffff !important;
  }

  #customer-email-auth {
    background-color: #000000 !important;
  }

  #pdp-wishlist-btn:not(.active) i {
    color: #9ca3af !important;
  }

  #pdp-add-to-bag-btn {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  #pdp-add-to-bag-btn:hover {
    background-color: #e5e7eb !important;
  }

  #place-order-btn {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  #place-order-btn:hover {
    background-color: #e5e7eb !important;
  }

  #apply-coupon-btn,
  #checkout-btn {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #d1d5db !important;
  }

  #apply-coupon-btn:hover,
  #checkout-btn:hover {
    background-color: #f3f4f6 !important;
  }

  #checkout-btn:disabled {
    opacity: 1 !important;
  }

  #free-shipping-bar {
    background-color: #ffffff !important;
  }

  #customer-auth-email,
  #customer-auth-password,
  #login-email-input {
    background-color: #000000 !important;
    border-color: #2a2e3d !important;
  }

  #customer-auth-email:focus,
  #customer-auth-password:focus,
  #login-email-input:focus,
  #customer-auth-email:valid,
  #customer-auth-password:valid,
  #login-email-input:valid {
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    outline: none;
  }

  .payment-method-option:hover,
  .payment-method-option:focus-within,
  .payment-method-option:has(input:checked) {
    background-color: #15171e !important;
    border-color: #555d56 !important;
  }

  header .store-header-action {
    color: #ffffff !important;
  }

  header .store-header-action #cart-count-badge {
    background-color: #ffffff !important;
    color: #000000 !important;
  }

  [class~="bg-gray-50"] {
    background-color: #000000 !important;
  }

  [class~="bg-gray-100"] {
    background-color: #15171e !important;
  }

  [class~="bg-gray-200"] {
    background-color: #252830 !important;
  }

  [class~="text-black"],
  [class~="text-gray-900"],
  [class~="text-gray-800"],
  [class~="text-gray-700"] {
    color: #ffffff !important;
  }

  [class~="text-gray-600"],
  [class~="text-gray-500"],
  [class~="text-gray-400"],
  [class~="text-gray-300"] {
    color: #c4c4c4 !important;
  }

  [class~="border-black"] {
    border-color: #ffffff !important;
  }

  [class~="border-gray-100"],
  [class~="border-gray-200"],
  [class~="border-gray-300"],
  [class~="border-gray-400"] {
    border-color: #333333 !important;
  }

  header.scrolled {
    background: #000000 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  }

  #search-live-results {
    background: #0b0c10;
    border-color: #333333;
  }

  .rack-header h2 {
    color: #ffffff;
  }

  .scroll-btn {
    background: #252830;
    color: #ffffff;
  }

  .scroll-btn:hover {
    background: #333333;
  }

  input,
  select,
  textarea {
    color: #ffffff;
    accent-color: #ffffff;
  }

  input::placeholder,
  textarea::placeholder {
    color: #a3a3a3;
    opacity: 1;
  }
}

.pwa-install-banner {
  position: fixed;
  z-index: 10000;
  top: 16px;
  right: 16px;
  bottom: auto;
  left: 16px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(680px, calc(100vw - 32px));
  margin-inline: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.84);
  color: #ffffff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.pwa-install-banner[hidden] {
  display: none !important;
}

@media (min-width: 641px) {
  .pwa-install-banner {
    display: none !important;
  }
}

.pwa-install-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

footer button.newsletter-subscribe-button.has-valid-email {
  background-color: #0d45ae !important;
  color: #ffffff !important;
}

.pwa-install-banner > img {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  object-fit: cover;
}

.pwa-install-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.pwa-install-copy strong {
  font-size: 20px;
  line-height: 1.25;
}

.pwa-install-copy span {
  color: #e5e7eb;
  font-size: 14px;
  line-height: 1.35;
}

.pwa-install-action {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #0d45ae;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.pwa-install-action:hover {
  background: rgba(13, 69, 174, 0.08);
}

@media (prefers-color-scheme: dark) {
  .pwa-install-banner {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(0, 0, 0, 0.84);
    color: #ffffff;
  }

  .pwa-install-banner > img {
    border-color: rgba(255, 255, 255, 0.35);
  }

  .pwa-install-copy span {
    color: #e5e7eb;
  }

  .pwa-install-action {
    color: #8ab4f8;
  }
}

@media (max-width: 420px) {
  .pwa-install-banner {
    top: 12px;
    right: 12px;
    bottom: auto;
    left: 12px;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 8px;
    width: calc(100vw - 24px);
    padding: 12px;
  }

  .pwa-install-banner > img {
    width: 52px;
    height: 52px;
  }

  .pwa-install-copy strong { font-size: 18px; }
  .pwa-install-copy span { font-size: 12px; }

  .pwa-install-action {
    padding-inline: 8px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .motion-ready .motion-reveal,
  .motion-ready .motion-reveal.motion-visible {
    opacity: 1;
    transform: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}