/* Base variables and theme tokens (from your original CSS) */
:root {
  --primary-color-dark: #94a3b8; /* slate-400 */
  --primary-hover-color-dark: #cbd5e1; /* slate-300 */
  --text-dark-dark: #f1f5f9; /* slate-100 */
  --text-medium-dark: #cbd5e1; /* slate-300 */
  --text-light-dark: #94a3b8; /* slate-400 */
  --bg-dark-dark: #0f172a; /* slate-900 */
  --bg-medium-dark: #1e293b; /* slate-800 */
  --bg-light-dark: #334155; /* slate-700 */
  --border-dark-dark: #475569; /* slate-600 */
  --border-medium-dark: #334155; /* slate-700 */
  --error-color-dark: #f87171; /* red-400 */
  --error-border-color-dark: #ef4444; /* red-500 */
  --status-active-bg-dark: #22c55e; /* green-500 */
  --status-active-text-dark: white;
  --status-archived-bg-dark: #6b7280; /* gray-500 */
  --status-archived-text-dark: #f3f4f6; /* gray-100 */
}

/* Light Theme Variables */
.light-theme {
  --primary-color: #3b82f6; /* blue-500 */
  --primary-hover-color: #2563eb; /* blue-600 */
  --text-dark: #1e3a8a; /* blue-900 */
  --text-medium: #1d4ed8; /* blue-700 */
  --text-light: #3b82f6; /* blue-500 */
  --bg-dark: #ffffff; /* white */
  --bg-medium: #f9fafb; /* gray-50 */
  --bg-light: #f3f4f6; /* gray-100 */
  --border-dark: #d1d5db; /* gray-300 */
  --border-medium: #e5e7eb; /* gray-200 */
  --error-color: #ef4444; /* red-500 */
  --error-border-color: #dc2626; /* red-600 */
  --status-active-bg: #10b981; /* emerald-500 */
  --status-active-text: white;
  --status-archived-bg: #a1a1aa; /* zinc-400 */
  --status-archived-text: #27272a; /* zinc-800 */

  /* Override dark tokens so "dark-theme" switch is clean */
  --primary-color-dark: var(--primary-color);
  --primary-hover-color-dark: var(--primary-hover-color);
  --text-dark-dark: var(--text-dark);
  --text-medium-dark: var(--text-medium);
  --text-light-dark: var(--text-light);
  --bg-dark-dark: var(--bg-dark);
  --bg-medium-dark: var(--bg-medium);
  --bg-light-dark: var(--bg-light);
  --border-dark-dark: var(--border-dark);
  --border-medium-dark: var(--border-medium);
  --error-color-dark: var(--error-color);
  --error-border-color-dark: var(--error-border-color);
  --status-active-bg-dark: var(--status-active-bg);
  --status-active-text-dark: var(--status-active-text);
  --status-archived-bg-dark: var(--status-archived-bg);
  --status-archived-text-dark: var(--status-archived-text);
}

/* Dark Theme (apply .dark-theme on body) */
.dark-theme {
  --primary-color: var(--primary-color-dark);
  --primary-hover-color: var(--primary-hover-color-dark);
  --text-dark: var(--text-dark-dark);
  --text-medium: var(--text-medium-dark);
  --text-light: var(--text-light-dark);
  --bg-dark: var(--bg-dark-dark);
  --bg-medium: var(--bg-medium-dark);
  --bg-light: var(--bg-light-dark);
  --border-dark: var(--border-dark-dark);
  --border-medium: var(--border-medium-dark);
  --error-color: var(--error-color-dark);
  --error-border-color: var(--error-border-color-dark);
  --status-active-bg: var(--status-active-bg-dark);
  --status-active-text: var(--status-active-text-dark);
  --status-archived-bg: var(--status-archived-bg-dark);
  --status-archived-text: var(--status-archived-text-dark);
}

/* Default to light theme */
body:not(.dark-theme) {
  --primary-color: #3b82f6;
  --primary-hover-color: #2563eb;
  --text-dark: #1e3a8a;
  --text-medium: #1d4ed8;
  --text-light: #3b82f6;
  --bg-dark: #ffffff;
  --bg-medium: #f9fafb;
  --bg-light: #f3f4f6;
  --border-dark: #d1d5db;
  --border-medium: #e5e7eb;
  --error-color: #ef4444;
  --error-border-color: #dc2626;
  --status-active-bg: #10b981;
  --status-active-text: white;
  --status-archived-bg: #a1a1aa;
  --status-archived-text: #27272a;
}

:root {
  /* Common (not theme-specific) */
  --smooth-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --slider-interval: 3000ms;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-dark);
  color: var(--text-medium);
}
body.dark-theme {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%231e293b' fill-opacity='0.3' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
}
body.light-theme {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23d1d5db' fill-opacity='0.2'%3E%3Cpath d='M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41zM20 18.6l2.83-2.83 1.41 1.41L21.41 20l2.83 2.83-1.41 1.41L20 21.41l-2.83 2.83-1.41-1.41L18.59 20l-2.83-2.83 1.41-1.41L20 18.59z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Reserve space for the mobile bottom bar on small screens */
@media (max-width: 767px) {
  body.has-bottom-bar {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

body.modal-open,
body.lightbox-open,
body.mobile-menu-open,
body.cart-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-display {
  font-weight: 700;
  color: var(--text-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-medium);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 10px;
  border: 2px solid var(--bg-medium);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes fadeInModal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes scaleInModal {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes slideOutRight {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(100%);
  }
}
@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.7s var(--smooth-ease), transform 0.7s var(--smooth-ease);
}
.animation-fade-up {
  transform: translateY(20px);
}
.animation-scale-up {
  transform: scale(0.95);
}
.is-visible,
.in-view {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll,
  .product-card,
  .btn,
  .modal,
  .modal-content,
  .auto-slider-slide,
  .lightbox,
  .cart-flyout,
  .floating-sofa {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .product-card:hover {
    transform: none;
    box-shadow: none;
  }
  .product-card:hover img {
    transform: none;
  }
  .btn:hover {
    transform: none;
    box-shadow: none;
  }
}

/* Utility colors */
.text-primary {
  color: var(--primary-color);
}
.bg-primary {
  background-color: var(--primary-color);
}
.border-primary {
  border-color: var(--primary-color);
}
.ring-primary {
  --tw-ring-color: var(--primary-color);
}

/* Header */
header {
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-medium);
  transition: background-color 0.3s var(--smooth-ease);
}
.dark-theme header {
  background-color: rgba(15, 23, 42, 0.85);
}
.light-theme header {
  background-color: rgba(255, 255, 255, 0.85);
}

.nav-link {
  position: relative;
  transition: color 0.3s var(--smooth-ease);
  color: var(--text-medium);
  font-weight: 500;
}
.nav-link:hover {
  color: var(--text-dark);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.35s var(--smooth-ease);
}
.nav-link:hover::after,
.nav-link-active::after {
  width: 100%;
}
.nav-link-active {
  color: var(--text-dark);
  font-weight: 600;
}

/* Product Card */
.product-card {
  background-color: var(--bg-medium);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.35s var(--smooth-ease),
    box-shadow 0.35s var(--smooth-ease), border-color 0.35s var(--smooth-ease);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border-color: var(--primary-color);
}
.light-theme .product-card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
}

.auto-slider-wrapper {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-light);
  cursor: pointer;
}
.auto-slider-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  z-index: 1;
}
.auto-slider-slide.visible {
  opacity: 1;
  z-index: 2;
}
.auto-slider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.9) contrast(1.05);
  transition: transform 0.5s var(--smooth-ease), filter 0.5s ease;
}
.product-card:hover .auto-slider-slide img {
  transform: scale(1.05);
  filter: brightness(1) contrast(1);
}

.auto-slider-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s var(--smooth-ease);
  z-index: 5;
  pointer-events: none;
}
.dark-theme .auto-slider-wrapper::after {
  background: linear-gradient(to top, rgba(30, 41, 59, 0.3), transparent 60%);
}
.light-theme .auto-slider-wrapper::after {
  background: linear-gradient(
    to top,
    rgba(200, 200, 200, 0.2),
    transparent 60%
  );
}
.product-card:hover .auto-slider-wrapper::after {
  opacity: 1;
}

.product-card .info {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.product-card .title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}
.product-card .description {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.5;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-card .price-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
.product-card .price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  font-size: 0.9rem;
}
.btn-primary {
  background-color: var(--primary-color);
  color: var(--bg-dark);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.light-theme .btn-primary {
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.btn-primary:hover {
  background-color: var(--primary-hover-color);
  box-shadow: 0 7px 15px rgba(148, 163, 184, 0.2);
  transform: translateY(-2px);
}
.light-theme .btn-primary:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-outline {
  border-color: var(--border-dark);
  color: var(--text-light);
  background: transparent;
}
.btn-outline:hover {
  background-color: rgba(148, 163, 184, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}
.light-theme .btn-outline:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.btn-add-to-cart {
  background: var(--bg-light);
  color: var(--text-medium);
  border-color: var(--border-dark);
}
.btn-add-to-cart:hover:not(:disabled) {
  background: var(--border-dark);
  color: var(--text-dark);
  transform: translateY(-1px);
}
.btn-add-to-cart.added {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
}
.light-theme .btn-add-to-cart.added {
  background: #10b981;
  border-color: #059669;
}
.btn-add-to-cart:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Section headings */
.section-heading {
  position: relative;
  display: inline-block;
  padding-bottom: 0.75rem;
  margin-bottom: 3rem;
  color: var(--text-dark);
}
@media (min-width: 768px) {
  .section-heading {
    padding-bottom: 1rem;
    margin-bottom: 4rem;
  }
}
.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
  transition: width 0.4s var(--smooth-ease);
}
.section-heading:hover::after {
  width: 70px;
}

/* Mobile menu */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s var(--smooth-ease);
  background: var(--bg-medium);
  box-shadow: -10px 0 25px rgba(0, 0, 0, 0.2);
}
.light-theme .mobile-menu {
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}
.mobile-menu-open .mobile-menu {
  transform: translateX(0);
}
.menu-icon-lines span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
  border-radius: 1px;
}
.mobile-menu-open .menu-icon-lines span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-open .menu-icon-lines span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-menu-open .menu-icon-lines span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  padding: 1rem;
  animation: fadeInModal 0.3s ease-out forwards;
  overflow-y: auto;
}
.dark-theme .modal {
  background-color: rgba(0, 0, 0, 0.85);
}
.light-theme .modal {
  background-color: rgba(50, 50, 50, 0.7);
}
.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-medium);
  color: var(--text-medium);
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border-dark);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  max-width: 95%;
  width: 100%;
  position: relative;
  animation: scaleInModal 0.3s var(--smooth-ease) forwards;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.light-theme .modal-content {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}
@media (min-width: 768px) {
  .modal-content {
    max-width: 700px;
  }
}
@media (min-width: 1024px) {
  .modal-content {
    max-width: 850px;
  }
}

.modal-close-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border: 1px solid var(--border-dark);
  color: var(--text-light);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 110;
  line-height: 1;
}
.dark-theme .modal-close-button {
  background: rgba(15, 23, 42, 0.6);
}
.light-theme .modal-close-button {
  background: rgba(230, 230, 230, 0.7);
}
.modal-close-button:hover {
  color: var(--text-dark);
  transform: scale(1.1);
}
.dark-theme .modal-close-button:hover {
  background: rgba(15, 23, 42, 0.9);
}
.light-theme .modal-close-button:hover {
  background: rgba(200, 200, 200, 0.9);
}

.modal-body {
  padding: 1.5rem 1.5rem 1rem;
  overflow-y: auto;
  flex-grow: 1;
  min-height: 0;
}
@media (min-width: 640px) {
  .modal-body {
    padding: 1.5rem 2rem 1rem;
  }
}
.modal-title {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
  padding-right: 3rem;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .modal-title {
    font-size: 1.6rem;
  }
}
.modal-description {
  margin-bottom: 1.5rem;
}
.modal-description p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
  font-size: 0.9rem;
  color: var(--text-medium);
}
.modal-description strong {
  color: var(--text-dark);
  font-weight: 600;
}

.modal-order-section {
  margin-top: auto;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border-dark);
  background: var(--bg-medium);
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 11px;
  text-align: right;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .modal-order-section {
    padding: 1rem 2rem 1.5rem;
  }
}
.modal-order-section span {
  font-size: 1.1rem;
  color: var(--text-dark);
}
@media (min-width: 640px) {
  .modal-order-section span {
    font-size: 1.25rem;
  }
}
.modal-order-section button {
  padding: 0.6rem 1.1rem;
}
@media (min-width: 640px) {
  .modal-order-section button {
    padding: 0.65rem 1.3rem;
  }
}

.modal-slider {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-dark);
  border-top-left-radius: 11px;
  border-top-right-radius: 11px;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .modal-slider {
    aspect-ratio: 16/9;
  }
}
.modal-slider .slider-wrapper {
  display: flex;
  height: 100%;
  transition: transform 0.4s var(--smooth-ease);
}
.modal-slider .slider-slide {
  flex: 0 0 100%;
  height: 100%;
  cursor: zoom-in;
}
.modal-slider .slider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal-slider .slider-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-medium);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  z-index: 10;
}
.dark-theme .modal-slider .slider-button {
  background-color: rgba(15, 23, 42, 0.5);
}
.light-theme .modal-slider .slider-button {
  background-color: rgba(220, 220, 220, 0.6);
}
@media (min-width: 640px) {
  .modal-slider .slider-button {
    width: 36px;
    height: 36px;
  }
}
.modal-slider .slider-button:hover {
  color: var(--text-dark);
}
.dark-theme .modal-slider .slider-button:hover {
  background-color: rgba(15, 23, 42, 0.8);
}
.light-theme .modal-slider .slider-button:hover {
  background-color: rgba(190, 190, 190, 0.9);
}
.modal-slider .slider-button.prev {
  left: 10px;
}
.modal-slider .slider-button.next {
  right: 10px;
}
@media (min-width: 640px) {
  .modal-slider .slider-button.prev {
    left: 15px;
  }
  .modal-slider .slider-button.next {
    right: 15px;
  }
}
.modal-slider .slider-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 10;
}
@media (min-width: 640px) {
  .modal-slider .slider-dots {
    bottom: 15px;
    gap: 8px;
  }
}
.modal-slider .slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.light-theme .modal-slider .slider-dot {
  background-color: rgba(0, 0, 0, 0.2);
}
@media (min-width: 640px) {
  .modal-slider .slider-dot {
    width: 10px;
    height: 10px;
  }
}
.modal-slider .slider-dot.active {
  background-color: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
}
.light-theme .modal-slider .slider-dot.active {
  background-color: rgba(0, 0, 0, 0.6);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  animation: fadeInModal 0.3s ease-out forwards;
}
.dark-theme .lightbox {
  background-color: rgba(0, 0, 0, 0.9);
}
.light-theme .lightbox {
  background-color: rgba(30, 30, 30, 0.85);
}
.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-content {
  position: relative;
  width: 95%;
  height: 95%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.lightbox-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-medium);
  border: 1px solid var(--border-dark);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.4rem;
}
.dark-theme .lightbox-button {
  background-color: rgba(30, 41, 59, 0.6);
}
.light-theme .lightbox-button {
  background-color: rgba(200, 200, 200, 0.5);
  color: #333;
}
@media (min-width: 768px) {
  .lightbox-button {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
}
.lightbox-button:hover {
  color: var(--text-dark);
}
.dark-theme .lightbox-button:hover {
  background-color: rgba(30, 41, 59, 0.9);
}
.light-theme .lightbox-button:hover {
  background-color: rgba(180, 180, 180, 0.8);
  color: #000;
}
.lightbox-button.prev {
  left: 0.5rem;
}
.lightbox-button.next {
  right: 0.5rem;
}
@media (min-width: 768px) {
  .lightbox-button.prev {
    left: 1rem;
  }
  .lightbox-button.next {
    right: 1rem;
  }
}
.lightbox-close-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: var(--text-medium);
  border: 1px solid var(--border-dark);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.6rem;
  line-height: 1;
  z-index: 210;
}
.dark-theme .lightbox-close-button {
  background-color: rgba(30, 41, 59, 0.6);
}
.light-theme .lightbox-close-button {
  background-color: rgba(200, 200, 200, 0.5);
  color: #333;
}
@media (min-width: 768px) {
  .lightbox-close-button {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.8rem;
  }
}
.lightbox-close-button:hover {
  color: var(--text-dark);
  transform: rotate(90deg);
}
.dark-theme .lightbox-close-button:hover {
  background-color: rgba(30, 41, 59, 0.9);
}
.light-theme .lightbox-close-button:hover {
  background-color: rgba(180, 180, 180, 0.8);
  color: #000;
}

/* Cart flyout */
.cart-flyout {
  position: fixed;
  top: 0;
  right: 0;
  width: 90%;
  max-width: 400px;
  height: 100%;
  background: var(--bg-medium);
  border-left: 1px solid var(--border-dark);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
  z-index: 150;
  transform: translateX(100%);
  transition: transform 0.4s var(--smooth-ease);
  display: flex;
  flex-direction: column;
}
.light-theme .cart-flyout {
  box-shadow: -8px 0 20px rgba(0, 0, 0, 0.1);
}
.cart-flyout.active {
  transform: translateX(0);
  animation: slideInRight 0.4s var(--smooth-ease);
}
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-dark);
  flex-shrink: 0;
}
.cart-header h3 {
  font-size: 1.3rem;
  color: var(--text-dark);
}
.cart-close-button {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0.25rem;
  line-height: 1;
}
.cart-close-button:hover {
  color: var(--text-dark);
}
.cart-items-container {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-medium);
}
.cart-item:last-child {
  border-bottom: none;
}
.cart-item img {
  width: 60px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-dark);
}
.cart-item-details {
  flex-grow: 1;
}
.cart-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  display: block;
  margin-bottom: 0.2rem;
}
.cart-item-price {
  font-size: 0.85rem;
  color: var(--text-light);
}
.cart-item-quantity {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-medium);
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.2rem;
  line-height: 1;
  transition: color 0.2s ease;
}
.cart-item-remove:hover {
  color: #ef4444;
}
.cart-empty-message {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-light);
}
.cart-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-dark);
  background: var(--bg-medium);
  flex-shrink: 0;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-dark);
}
.cart-checkout-button {
  width: 100%;
}

/* Order form */
.order-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-medium);
}
.order-form input[type='text'],
.order-form input[type='tel'] {
  background: var(--bg-light);
  border: 1px solid var(--border-dark);
  color: var(--text-dark);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.order-form input[type='text']:focus,
.order-form input[type='tel']:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-color-opacity, rgba(148, 163, 184, 0.3));
}
.dark-theme .order-form input[type='text']:focus,
.dark-theme .order-form input[type='tel']:focus {
  --primary-color-opacity: rgba(148, 163, 184, 0.3);
}
.light-theme .order-form input[type='text']:focus,
.light-theme .order-form input[type='tel']:focus {
  --primary-color-opacity: rgba(59, 130, 246, 0.2);
}

.order-form input::placeholder {
  color: var(--text-light);
  opacity: 0.7;
}
.phone-input-wrapper {
  position: relative;
}
.phone-prefix {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}
.order-form input[type='tel'] {
  padding-left: 4rem;
}
.input-error {
  border-color: var(--error-border-color) !important;
  box-shadow: 0 0 0 2px var(--error-color-opacity, rgba(239, 68, 68, 0.3)) !important;
}
.dark-theme .input-error {
  --error-color-opacity: rgba(239, 68, 68, 0.3);
}
.light-theme .input-error {
  --error-color-opacity: rgba(220, 38, 38, 0.2);
}
.error-message {
  color: var(--error-color);
  font-size: 0.8rem;
  margin-top: 0.25rem;
  display: none;
}
.error-message.visible {
  display: block;
}

/* Home section */
#home {
  position: relative;
  overflow: hidden;
  color: var(--text-dark);
}
.dark-theme #home {
  color: #f1f5f9;
}
.light-theme #home {
  background-image: linear-gradient(
    to bottom,
    var(--bg-medium),
    var(--bg-light)
  );
  color: var(--text-dark);
}

.floating-sofa {
  position: absolute;
  opacity: 0.15;
  filter: blur(2px);
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
  max-width: 45%;
  height: auto;
  z-index: 1;
}
.light-theme .floating-sofa {
  opacity: 0.1;
}
.floating-sofa-1 {
  top: 10%;
  left: -10%;
  animation-delay: 0s;
}
.floating-sofa-2 {
  bottom: 5%;
  right: -15%;
  animation-delay: 2s;
  transform: scaleX(-1);
}
@media (min-width: 768px) {
  .floating-sofa {
    max-width: 35%;
  }
  .floating-sofa-1 {
    left: -5%;
  }
  .floating-sofa-2 {
    right: -8%;
  }
}
@media (min-width: 1024px) {
  .floating-sofa {
    max-width: 30%;
    opacity: 0.1;
  }
  .dark-theme .floating-sofa {
    opacity: 0.1;
  }
  .light-theme .floating-sofa {
    opacity: 0.07;
  }
  .floating-sofa-1 {
    left: 0;
  }
  .floating-sofa-2 {
    right: -5%;
  }
}

/* Footer */
footer {
  background: var(--bg-dark);
  color: var(--text-light);
  border-top: 1px solid var(--border-medium);
}
.light-theme footer {
  background: var(--bg-light);
  color: var(--text-medium);
  border-top: 1px solid var(--border-dark);
}
footer .grid > div {
  margin-bottom: 1rem;
}
footer h3 {
  color: var(--text-dark);
}
.light-theme footer h3 {
  color: var(--text-dark);
}
footer h4 {
  color: var(--text-medium);
}
.light-theme footer h4 {
  color: var(--text-dark);
}
footer ul li {
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 768px) {
  footer ul li {
    justify-content: flex-start;
  }
}
footer ul li a:hover {
  color: var(--text-dark);
}
.light-theme footer ul li a:hover {
  color: var(--primary-color);
}
footer ul li svg,
footer ul li ion-icon {
  width: 1.1em;
  height: 1.1em;
  margin-right: 0.5rem;
  fill: currentColor;
  flex-shrink: 0;
  color: var(--primary-color);
}

/* Status badge */
.status-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
  line-height: 1.2;
}
.status-active {
  background: var(--status-active-bg);
  color: var(--status-active-text);
}
.status-archived {
  background: var(--status-archived-bg);
  color: var(--status-archived-text);
}

/* Loader (spinner) */
.loader {
  border: 4px solid var(--bg-light);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}
@keyframes spin {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Materials */
.material-item {
  background: var(--bg-light);
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.material-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.light-theme .material-item:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.07);
}
.material-item ion-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.material-item span {
  font-weight: 500;
  color: var(--text-medium);
  font-size: 0.9rem;
}

/* Theme toggle */
#theme-toggle-button {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-dark);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: background-color 0.3s var(--smooth-ease),
    color 0.3s var(--smooth-ease), transform 0.2s ease;
}
#theme-toggle-button:hover {
  transform: scale(1.1);
}
#theme-toggle-button ion-icon {
  font-size: 24px;
}
.light-theme #theme-toggle-button {
  background-color: var(--bg-dark-dark);
  color: var(--text-dark-dark);
  border-color: var(--border-dark-dark);
}

/* Tailwind overrides alignment with theme tokens */
.bg-slate-900 {
  background-color: var(--bg-dark) !important;
}
.text-slate-300 {
  color: var(--text-medium) !important;
}
.text-slate-100 {
  color: var(--text-dark) !important;
}
.text-slate-400 {
  color: var(--text-light) !important;
}
.bg-slate-800 {
  background-color: var(--bg-medium) !important;
}
.border-slate-700 {
  border-color: var(--border-medium) !important;
}
.border-slate-600 {
  border-color: var(--border-dark) !important;
}
.bg-slate-700 {
  background-color: var(--bg-light) !important;
}
.placeholder-slate-400::placeholder {
  color: var(--text-light) !important;
  opacity: 0.7;
}

.dark-theme #home.bg-gradient-to-b {
  background-image: linear-gradient(
    to bottom,
    var(--bg-medium-dark),
    var(--bg-dark-dark)
  ) !important;
}
.light-theme #home.bg-gradient-to-b {
  background-image: linear-gradient(
    to bottom,
    var(--bg-medium),
    var(--bg-light)
  ) !important;
}

header.bg-\[rgba\(15\,23\,42\,0\.85\)\] {
  background-color: var(--header-bg-color) !important;
}
.dark-theme header {
  --header-bg-color: rgba(15, 23, 42, 0.85);
}
.light-theme header {
  --header-bg-color: rgba(255, 255, 255, 0.85);
}

footer.bg-slate-900 {
  background-color: var(--bg-dark) !important;
}
footer.text-slate-400 {
  color: var(--text-light) !important;
}
footer .text-white {
  color: var(--text-dark) !important;
}
footer .text-slate-200 {
  color: var(--text-medium) !important;
}
footer.border-slate-700 {
  border-color: var(--border-medium) !important;
}
footer a.hover\:text-white:hover {
  color: var(--text-dark) !important;
}
.light-theme footer a:hover {
  color: var(--primary-color) !important;
}
footer ul li ion-icon.text-primary,
footer ul li svg.text-primary {
  color: var(--primary-color) !important;
}
.nav-link::after {
  background-color: var(--primary-color) !important;
}
.section-heading::after {
  background-color: var(--primary-color) !important;
}
ion-icon.text-primary {
  color: var(--primary-color) !important;
}
#cart-count-badge.bg-primary {
  background-color: var(--primary-color) !important;
  color: var(--bg-dark) !important;
}
.light-theme #cart-count-badge.bg-primary {
  color: #fff !important;
}

/* ---------- NEW ENHANCEMENTS (added) ---------- */

/* PRELOADER */
#app-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  transition: opacity 0.35s var(--smooth-ease),
    visibility 0.35s var(--smooth-ease);
}
#app-preloader.hidden {
  opacity: 0;
  visibility: hidden;
}
.preloader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
  background: var(--bg-medium);
  color: var(--text-dark);
  border: 1px solid var(--border-dark);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}
.preloader-logo {
  font-weight: 800;
  letter-spacing: 0.4px;
  font-size: clamp(18px, 4vw, 22px);
}
.preloader-spinner {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 3px solid var(--border-dark);
  border-top-color: var(--primary-color);
  animation: spin 0.9s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .preloader-spinner {
    animation: none;
  }
}

/* SKELETONS */
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-light);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 1.2s infinite;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton::after {
    display: none;
  }
}
.skel-card {
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.skel-img {
  aspect-ratio: 4/3;
  border-radius: 10px;
}
.skel-title {
  height: 16px;
  width: 70%;
  border-radius: 8px;
}
.skel-text {
  height: 12px;
  width: 100%;
  border-radius: 6px;
}
.skel-price {
  height: 16px;
  width: 40%;
  border-radius: 8px;
}

/* MOBILE BOTTOM BAR */
#mobile-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--bg-medium);
  border-top: 1px solid var(--border-dark);
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  padding: 4px 4px calc(8px + env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
}
#mobile-bottom-bar .tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 6px;
  border-radius: 10px;
  transition: background 0.2s, transform 0.15s;
}
#mobile-bottom-bar .tab:active {
  transform: translateY(1px);
}
#mobile-bottom-bar ion-icon {
  font-size: 22px;
  color: var(--text-medium);
}
#mobile-bottom-bar .tab span {
  font-size: 11px;
  color: var(--text-light);
}
#mobile-bottom-bar .tab.active ion-icon,
#mobile-bottom-bar .tab.active span {
  color: var(--primary-color);
}
#mobile-bottom-bar .badge {
  position: absolute;
  top: 2px;
  right: 20%;
  transform: translateX(60%);
  min-width: 18px;
  height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  background: var(--primary-color);
  color: var(--bg-dark);
}

/* TOAST */
:root {
  --toast-bg-dark: #0b1220;
  --toast-text-dark: #e2e8f0;
}
.light-theme {
  --toast-bg: #111827;
  --toast-text: #f8fafc;
}
.dark-theme {
  --toast-bg: var(--toast-bg-dark);
  --toast-text: var(--toast-text-dark);
}
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(70px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 70;
  padding: 10px 14px;
  border-radius: 9999px;
  background: var(--toast-bg);
  color: var(--toast-text);
  border: 1px solid var(--border-dark);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  font-size: 0.9rem;
  font-weight: 600;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Micro UX */
@keyframes cart-bounce {
  0% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-4px);
  }
  60% {
    transform: translateY(0);
  }
  80% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}
.cart-shake {
  animation: cart-bounce 0.6s var(--smooth-ease);
}

/* Status badge on image */
.card-status {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 6;
}

/* ---- v2 additions ---- */
/* Defer rendering of below-the-fold sections */
@supports (content-visibility: auto) {
  .section-cv { content-visibility: auto; contain-intrinsic-size: 600px 800px; }
}

/* A11y utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.auto-slider-slide picture,
.modal-slider .slider-slide picture {
  display: block;
  width: 100%;
  height: 100%;
}
.auto-slider-slide picture img,
.modal-slider .slider-slide picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
