/* Sky Furniture — production styles (Tailwind CDN + theme) */

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.font-display {
  font-family: "Cormorant Garamond", Georgia, serif;
}

/* =========================================================
   MOBILE NAV ONLY (< 768px)
   Desktop/PC header stays as deployed.
   Phone: logo left · open middle · icons glued to far right
   ========================================================= */
@media screen and (max-width: 767.98px) {
  /* Full-bleed bar so icons can sit on the screen edge */
  .site-header > .max-w-7xl {
    max-width: none !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 10px !important;
    padding-right: 2px !important; /* almost flush right */
  }

  /* Logo left; capped so middle stays open */
  .site-header .header-logo {
    font-size: 1.5rem !important;
    max-width: 42% !important;
    margin-right: auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.1 !important;
    position: relative;
    z-index: 1;
  }

  /* Row: pin icons to extreme right; empty middle after logo */
  .site-header > .max-w-7xl > .flex.items-center.justify-between {
    position: relative !important;
    display: flex !important;
    width: 100% !important;
    justify-content: flex-start !important;
    gap: 0 !important;
  }

  /* Icon pack: glued together + far right edge */
  .site-header .header-icons {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    gap: 0 !important;
    column-gap: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    z-index: 2;
  }

  /* Search form already hidden under sm; keep it out of the pack */
  .site-header .header-icons > form {
    display: none !important;
  }

  /* Tap-friendly but tight: 34px targets pulled together */
  .site-header .header-icons > button,
  .site-header .header-icons > a,
  .site-header .header-icons > [data-auth-slot] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 -3px !important; /* pull icons closer */
    padding: 0 !important;
    width: 34px !important;
    height: 36px !important;
    min-width: 34px !important;
    min-height: 36px !important;
    line-height: 0 !important;
    border-radius: 999px !important;
  }

  .site-header .header-icons > *:first-child {
    margin-left: 0 !important;
  }

  .site-header .header-icons > [data-auth-slot] {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 36px !important;
    margin: 0 -2px !important;
    padding: 0 !important;
  }

  /* Icon glyph size stays readable */
  .site-header .header-icons svg {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
  }

  .site-header .header-icons #mobile-menu-btn {
    margin-right: 0 !important;
    padding-right: 0 !important;
  }

  .site-header .header-icons #mobile-menu-btn svg {
    width: 22px !important;
    height: 22px !important;
  }

  /* Theme toggle: ONE icon only */
  .site-header .header-icons [data-theme-toggle] {
    position: relative !important;
  }

  .site-header .header-icons [data-theme-toggle] svg {
    width: 20px !important;
    height: 20px !important;
  }

  html:not(.dark) .site-header .header-icons [data-theme-toggle] .icon-moon {
    display: none !important;
  }
  html:not(.dark) .site-header .header-icons [data-theme-toggle] .icon-sun {
    display: block !important;
  }
  html.dark .site-header .header-icons [data-theme-toggle] .icon-sun {
    display: none !important;
  }
  html.dark .site-header .header-icons [data-theme-toggle] .icon-moon {
    display: block !important;
  }

  .site-header .header-icons [data-auth-slot] a,
  .site-header .header-icons a[href="login.html"] {
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 0 8px !important;
    height: 30px !important;
    line-height: 30px !important;
    width: auto !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    border: 1px solid #e8e0d5 !important;
    border-radius: 999px !important;
  }

  .site-header .header-icons a[href="signup.html"] {
    display: none !important;
  }

  .site-header .header-icons .user-menu-btn {
    gap: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 34px !important;
    height: 36px !important;
  }

  .site-header .header-icons .user-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 11px !important;
  }

  .site-header .header-icons .user-menu-btn span:not(.user-avatar),
  .site-header .header-icons .user-menu-btn > svg {
    display: none !important;
  }

  .site-header .header-icons [data-cart-count] {
    width: 15px !important;
    height: 15px !important;
    font-size: 9px !important;
  }
}

/* ---------- Dark mode (class on <html>) ---------- */
html.dark body {
  background-color: #161412 !important;
  color: #f3efe9 !important;
}

html.dark .bg-cream,
html.dark .bg-cream\/95 {
  background-color: #161412 !important;
}

html.dark header.bg-cream\/95,
html.dark .bg-cream\/95 {
  background-color: rgba(22, 20, 18, 0.92) !important;
}

html.dark .bg-white {
  background-color: #221f1c !important;
}

html.dark .bg-sand,
html.dark .bg-sand\/40,
html.dark .bg-sand\/50 {
  background-color: #2a2622 !important;
}

html.dark .bg-cream\/40,
html.dark .bg-cream\/50 {
  background-color: #1e1b18 !important;
}

html.dark .text-ink {
  color: #f3efe9 !important;
}

html.dark .text-stone-400 {
  color: #a8a29e !important;
}

html.dark .text-stone-500,
html.dark .text-stone-600 {
  color: #a8a29e !important;
}

html.dark .border-sand,
html.dark .border-ink\/20 {
  border-color: #3f3a36 !important;
}

html.dark .placeholder\:text-stone-400::placeholder {
  color: #78716c !important;
}

html.dark input,
html.dark select,
html.dark textarea {
  color: #f3efe9;
}

html.dark .bg-ink {
  background-color: #f3efe9 !important;
  color: #161412 !important;
}

html.dark a.bg-ink,
html.dark button.bg-ink {
  background-color: #e8e0d5 !important;
  color: #161412 !important;
}

html.dark a.bg-ink:hover,
html.dark button.bg-ink:hover {
  background-color: #fff !important;
}

html.dark .hover\:bg-ink:hover {
  background-color: #e8e0d5 !important;
  color: #161412 !important;
}

html.dark .hover\:text-ink:hover {
  color: #f3efe9 !important;
}

html.dark .text-ink.border-b {
  border-color: #f3efe9 !important;
}

html.dark #quick-view-modal .qv-panel,
html.dark #confirm-modal .confirm-panel {
  background-color: #221f1c !important;
  color: #f3efe9;
}

html.dark footer.bg-ink {
  background-color: #0c0b0a !important;
  color: #a8a29e !important;
}

/* Theme toggle: show only one icon (single button) */
html.dark .icon-sun {
  display: none !important;
}
html:not(.dark) .icon-moon {
  display: none !important;
}
html.dark .icon-moon {
  display: block !important;
}
html:not(.dark) .icon-sun {
  display: block !important;
}

/* Account dropdown (auth-header.js) */
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  color: #44403c;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.user-menu-item:hover {
  background: rgba(232, 224, 213, 0.55);
  color: #2c2926;
}

html.dark .user-menu-item {
  color: #d6d3d1;
}

html.dark .user-menu-item:hover {
  background: rgba(63, 58, 54, 0.55);
  color: #f3efe9;
}

.user-menu-item--danger {
  color: #b91c1c !important;
}

html.dark .user-menu-item--danger {
  color: #f87171 !important;
}

.user-menu-ico {
  width: 1.1rem;
  text-align: center;
  opacity: 0.65;
  font-size: 0.75rem;
}



/* ---------- Hero carousel ---------- */
.carousel-slide {
  opacity: 0;
  transition: opacity 0.7s ease-in-out;
  pointer-events: none;
}

.carousel-slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Product card polish ---------- */
.product-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-card-img {
  will-change: transform;
}

@media (hover: none) {
  .product-card .absolute.inset-x-0.bottom-0 {
    opacity: 1;
    transform: none;
    background: linear-gradient(to top, rgba(44, 41, 38, 0.55), transparent);
    padding-top: 2.5rem;
  }

  .product-card-overlay {
    opacity: 0.35;
  }
}

/* ---------- Quick view modal ---------- */
#quick-view-modal .qv-panel {
  border-radius: 2px;
}

/* ---------- Focus & forms ---------- */
:focus-visible {
  outline: 2px solid #a8a29e;
  outline-offset: 2px;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-4 {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-cart-count]:not(.hidden) {
  animation: badge-pop 0.35s ease;
}

@keyframes badge-pop {
  0% {
    transform: scale(0.5);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

.filter-btn {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease,
    box-shadow 0.25s ease, transform 0.2s ease;
}

.filter-btn:active {
  transform: scale(0.97);
}

main,
#product-grid,
#featured-grid {
  animation: fade-up 0.45s ease both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Checkout ---------- */
.field-input.border-red-400 {
  border-color: #f87171;
}

.delivery-option input[type="radio"],
.payment-option input[type="radio"] {
  flex-shrink: 0;
}

#payment-modal .animate-spin {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.confirm-panel {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ---------- Design Your Space ---------- */
.room-chip {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.15s ease;
}

.room-chip:active {
  transform: scale(0.97);
}

.room-chip.is-active {
  background-color: #2c2926;
  color: #f7f3ee;
  border-color: #2c2926;
}

html.dark .room-chip.is-active {
  background-color: #e8e0d5 !important;
  color: #161412 !important;
  border-color: #e8e0d5 !important;
}

/* ---------- Testimonials ---------- */
.testimonial-slide {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  inset: 0;
  transition: opacity 0.5s ease;
}

.testimonial-slide.active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

/* ---------- Optimized image defaults ---------- */
img {
  max-width: 100%;
  height: auto;
}

img[loading="lazy"] {
  content-visibility: auto;
}
