@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@300;400;500;600&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
  /* Earthy Color Palette - Warmed up for cozy ambiance */
  --primary: #6c785c; /* Muted olive/sage green */
  --primary-dark: #4a543e;
  --secondary: #907661; /* Warm mocha brown */
  --secondary-light: #bbaa9c;
  --accent: #d2bba0; /* Soft beige/sand */
  --bg: #faf7f2; /* Warm cream background */
  --bg-secondary: #f3ede2; /* Warm sand secondary background */
  --text: #332d29; /* Dark brown/black for text */
  --text-light: #706863;
  --surface: #ffffff;
  
  /* Utilities */
  --radius: 16px;
  --radius-sm: 8px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: 1px solid rgba(255, 255, 255, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Quicksand', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  position: relative;
}

/* Tactile Paper/Linen Texture Overlay */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  opacity: 0.035;
  z-index: 99999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Cozy Crochet Wavy Loop Divider */
.crochet-divider {
  width: 100%;
  max-width: 1200px;
  height: 24px;
  margin: 3.5rem auto;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,5 C5,9 10,9 15,5 C20,1 25,1 30,5 C35,9 40,9 45,5 C50,1 55,1 60,5 C65,9 70,9 75,5 C80,1 85,1 90,5 C95,9 100,9 105,5' fill='none' stroke='%236c785c' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 80px 24px;
  opacity: 0.35;
  border: none;
}

/* Rolling Yarn Ball Toast Animation */
@keyframes yarnRoll {
  0% {
    transform: translateX(-50px) rotate(0deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateX(0) rotate(360deg);
    opacity: 1;
  }
}

.toast-yarn-ball {
  animation: yarnRoll 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  flex-shrink: 0;
  transform-origin: center;
}
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Quicksand', sans-serif;
  font-weight: 500;
  color: var(--text);
}

h2 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
}
@media (max-width: 600px) {
  h2 {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
  }
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

/* === Navbar === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: var(--glass-border);
  box-shadow: var(--shadow-sm);
  transition: padding 0.3s ease;
}

.navbar.scrolled {
  padding: 1rem 5%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--primary-dark);
}

.logo img {
  height: 96px;
  width: 96px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.logo-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.logo-leaf {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
  fill: var(--primary);
  fill-opacity: 0.25;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  transition: transform 0.3s ease, fill-opacity 0.3s ease;
  flex-shrink: 0;
}

.logo:hover .logo-leaf,
.footer-logo:hover .logo-leaf {
  transform: rotate(14deg) scale(1.15);
  fill-opacity: 0.45;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  font-size: 1rem;
  position: relative;
}

.nav-links a.active {
  color: var(--primary);
}

/* Dropdown Menu Setup */
.dropdown {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.dropdown-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  background-color: var(--surface);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  z-index: 2000; /* High z-index to overlay above all content */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--glass-border);
  padding: 0.5rem 0;
  top: 100%; /* Positioned directly below the button to prevent hover gaps */
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

/* Hover support on desktop viewports */
@media (hover: hover) {
  .dropdown:hover .dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.dropdown-content a {
  padding: 0.8rem 1.5rem;
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  font-family: 'Quicksand', sans-serif;
}

.dropdown-content a::after {
  content: none;
}

.dropdown-content a:hover {
  background-color: rgba(108, 120, 92, 0.1);
  color: var(--primary-dark);
}

.dropdown-content.show {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.nav-links a.dropbtn::after {
  display: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.cart-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  transition: stroke 0.3s ease;
}

.cart-btn:hover svg {
  stroke: var(--primary);
}

.cart-badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background-color: var(--secondary);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.8rem 1.8rem;
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Quicksand', sans-serif;
  border: transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 10px rgba(108, 120, 92, 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(108, 120, 92, 0.4);
}

.btn-secondary {
  background-color: transparent;
  color: var(--secondary);
  border: 1px solid var(--secondary);
}

.btn-secondary:hover {
  background-color: var(--secondary);
  color: white;
}

/* === Layout/Containers === */
.main-wrapper {
  margin-top: 140px; /* To account for fixed navbar */
  min-height: calc(100vh - 140px - 200px); /* Adjust based on footer */
}
@media (max-width: 1024px) {
  .main-wrapper {
    margin-top: 110px;
    min-height: calc(100vh - 110px - 200px);
  }
}
@media (max-width: 768px) {
  .main-wrapper {
    margin-top: 90px;
    min-height: calc(100vh - 90px - 200px);
  }
}
@media (max-width: 600px) {
  .main-wrapper {
    margin-top: 65px;
    min-height: calc(100vh - 65px - 200px);
  }
}

section {
  padding: 5rem 5%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
}

@media (max-width: 600px) {
  .glass-panel {
    padding: 1.5rem 1.2rem !important;
  }
}

/* === Responsive Utility Grid Layouts === */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.receipt-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.order-details-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.8rem;
  gap: 1rem;
}

@media (max-width: 600px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .receipt-grid-2 {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .order-details-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .product-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  #zoom-toggle-btn {
    align-self: flex-start;
  }
}

/* ===  Category Filter Chips (mobile scroll) === */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 2rem;
}

/* === Footer === */
footer {
  background-color: var(--bg-secondary);
  padding: 3rem 5%;
  text-align: center;
  color: var(--text-light);
  border-top: 1px solid rgba(0,0,0,0.05);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--primary-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.social-links a:hover {
  transform: translateY(-3px);
  background: var(--primary);
  color: white;
}

/* Mobile footer stacking */
@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.2rem;
  }
}

.footer-policy-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  font-size: 0.88rem;
}

.footer-policy-links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.footer-policy-links a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.footer-policy-links .policy-dot {
  color: rgba(0, 0, 0, 0.25);
  user-select: none;
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .footer-policy-links {
    gap: 0.8rem;
    font-size: 0.82rem;
  }
  .footer-policy-links .policy-dot {
    display: none;
  }
}

/* Base animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* === Embedded Videos === */
.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  background-color: var(--surface);
}
.video-container.short {
  max-width: 350px;
  aspect-ratio: 9 / 16;
}
.video-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* === Product Gallery === */
.product-gallery {
  display: flex;
  flex-direction: row;
  align-items: start;
  gap: 1.5rem;
}

.main-image-container {
  flex: 1;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  background-color: var(--surface);
  max-height: 500px;
}

.main-image-container img {
  width: 100%;
  height: 100%;
  max-height: 500px;
  object-fit: contain;
  display: block;
  transition: transform 0.1s ease-out;
  transform-origin: center center;
}

.thumbnails {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  max-height: 500px;
  padding-right: 0.5rem;
  scrollbar-width: none;
}
.thumbnails::-webkit-scrollbar { 
  display: none; 
}

.thumbnail {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  background-color: var(--surface);
  flex-shrink: 0;
}

.thumbnail:hover, .thumbnail.active {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.thumbnail.active {
  box-shadow: var(--shadow-md);
}

/* Product gallery flips to vertical (image on top, thumbnails below) on mobile */
@media (max-width: 600px) {
  .product-gallery {
    flex-direction: column;
  }

  .main-image-container {
    max-height: 320px;
    border-radius: 14px;
  }

  .main-image-container img {
    max-height: 320px;
  }

  .thumbnails {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding-right: 0;
    padding-bottom: 0.25rem;
    gap: 0.7rem;
  }

  .thumbnail {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
  }
}

/* Global Search */
.search-input-expand {
  width: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: width 0.4s ease, padding 0.4s ease, border 0.3s ease;
  border-radius: 20px;
}

.search-input-expand.active {
  width: 220px;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(108, 120, 92, 0.3);
  background: var(--glass-bg);
}

.search-results-dropdown {
  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  min-width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  padding: 0.5rem 0;
}

.search-results-dropdown.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: rgba(108, 120, 92, 0.1);
}

.search-result-item img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.search-result-info {
  display: flex;
  flex-direction: column;
}

.search-result-info .result-name {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
}

.search-result-info .result-price {
  font-size: 0.85rem;
  color: var(--primary-dark);
  font-weight: 600;
}

.search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* === User Auth Button (Navbar) === */
.user-btn {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  transition: background 0.3s ease, color 0.3s ease;
  color: var(--text);
  font-family: 'Quicksand', sans-serif;
}

.user-btn:hover {
  background: rgba(108, 120, 92, 0.1);
  color: var(--primary);
}

.user-btn-label {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.user-auth-container {
  position: relative;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 130%;
  right: 0;
  min-width: 220px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  overflow: hidden;
  animation: fadeIn 0.25s ease;
}

.user-dropdown.show {
  display: block;
}

.user-dropdown-header {
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.user-dropdown-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
}

.user-dropdown-email {
  font-size: 0.8rem;
  color: var(--text-light);
  word-break: break-all;
}

.user-dropdown-divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
}

.user-dropdown-logout {
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.95rem;
  color: var(--secondary);
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.user-dropdown-logout:hover {
  background: rgba(144, 118, 97, 0.1);
  color: var(--primary-dark);
}

.user-dropdown-item {
  width: 100%;
  padding: 0.9rem 1.2rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.95rem;
  color: var(--text);
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  display: block;
  text-decoration: none;
}

.user-dropdown-item:hover {
  background: rgba(108, 120, 92, 0.08);
  color: var(--primary-dark);
}

/* === Auth Page === */
.auth-section {
  width: 100%;
  max-width: 480px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  position: relative;
}

.auth-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.auth-bg-orb-1 {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: -80px;
  left: -100px;
}

.auth-bg-orb-2 {
  width: 250px;
  height: 250px;
  background: var(--accent);
  bottom: -60px;
  right: -80px;
}

.auth-container {
  padding: 3rem 2.5rem;
  border-radius: 24px;
  position: relative;
  overflow: hidden;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
}

.auth-header h1 {
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 0.3rem;
  transition: all 0.3s ease;
}

.auth-header p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Auth Form */
.auth-form .form-group {
  margin-bottom: 1.3rem;
}

.auth-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-light);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke 0.3s ease;
}

.input-wrapper input {
  width: 100%;
  padding: 0.85rem 2.8rem 0.85rem 2.8rem;
  border-radius: 12px;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  background: var(--surface);
  font-size: 0.95rem;
  color: var(--text);
  font-family: 'Quicksand', sans-serif;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Toggle Password Visibility Button */
.toggle-password-btn {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: color 0.2s ease;
}

.toggle-password-btn:hover {
  color: var(--primary);
}

.toggle-password-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-wrapper input:focus {
  border-color: rgba(108, 120, 92, 0.5);
  box-shadow: 0 0 0 3px rgba(108, 120, 92, 0.1);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
  stroke: var(--primary);
}

.input-wrapper input::placeholder {
  color: var(--text-light);
  opacity: 0.6;
}

.auth-submit-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1.05rem;
  border-radius: 14px;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-toggle {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.auth-toggle a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.auth-toggle a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Auth Toast */
.auth-toast {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 0.9rem 1.8rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Quicksand', sans-serif;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
}

.auth-toast.success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.auth-toast.error {
  background: #fbe9e7;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ====================================================
   Comprehensive Responsive Design (Desktop, Tablet, Mobile)
   ==================================================== */

/* Mobile Hamburger Toggle Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text);
  z-index: 1001;
}

.mobile-menu-btn svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 0.3s ease;
}

/* Tablet Layout (max-width: 1024px) */
@media (max-width: 1024px) {
  .navbar {
    padding: 1.2rem 4%;
  }
  .navbar.scrolled {
    padding: 0.8rem 4%;
  }
  .nav-links {
    gap: 1.5rem;
  }
  .container {
    padding-left: 4% !important;
    padding-right: 4% !important;
  }
  #product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 1.6rem !important;
  }
  section {
    padding: 4rem 4%;
  }
}

/* Small Tablet / Large Phone (max-width: 768px) */
@media (max-width: 768px) {
  #product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.2rem !important;
  }

  .product-card.glass-panel {
    padding: 1rem !important;
  }

  section {
    padding: 3rem 4%;
  }

  .collection-note {
    padding: 1rem 1.2rem;
    font-size: 0.88rem;
    margin-bottom: 2rem;
  }

  .collection-note-title {
    font-size: 1rem;
  }

  h1[style*="font-size: 3rem"] {
    font-size: 2.2rem !important;
  }
}

/* Mobile & Small Tablet Navigation Drawer (max-width: 850px) */
@media (max-width: 850px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem 6%;
    gap: 1.2rem;
    box-shadow: var(--shadow-lg);
    border-bottom: var(--glass-border);
    animation: slideDownNav 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.15rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .dropdown {
    width: 100%;
  }

  .dropdown-content {
    position: static;
    visibility: visible;
    opacity: 1;
    display: none;
    box-shadow: none;
    border: none;
    background: rgba(108, 120, 92, 0.06);
    transform: none;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
  }

  .dropdown-content.show {
    display: block;
    transform: none !important;
  }

  .dropdown-content a {
    padding: 0.75rem 1rem;
    font-size: 1.12rem;
    border-bottom: none;
    color: var(--text) !important;
  }

  .search-input-expand.active {
    width: 160px;
  }

  .search-results-dropdown {
    min-width: 260px;
    right: 0;
  }
}

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

/* Mobile Screens (max-width: 600px) */
@media (max-width: 600px) {
  .navbar {
    padding: 0.75rem 4%;
  }

  .logo {
    font-size: 1.2rem;
    gap: 0.5rem;
  }

  .logo img {
    width: 38px !important;
    height: 38px !important;
  }

  .logo-leaf {
    width: 18px;
    height: 18px;
  }

  .nav-actions {
    gap: 0.5rem;
  }

  /* Show "Sign In" text on mobile for clear navigation */
  .user-btn-label {
    display: inline !important;
    font-size: 0.92rem;
  }

  .user-btn {
    padding: 0.5rem 0.85rem !important;
    border: 1px solid rgba(108, 120, 92, 0.25);
    border-radius: 20px;
    gap: 0.4rem !important;
  }

  h1 {
    font-size: clamp(1.6rem, 6.5vw, 2.2rem) !important;
  }

  section {
    padding: 2.5rem 4%;
  }

  /* Collections: 2-column grid on mobile */
  #product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .product-card {
    max-width: 100%;
  }

  /* Tighter card padding on mobile */
  .product-card.glass-panel {
    padding: 0.85rem !important;
  }

  /* Smaller text in product cards */
  .product-card h3 {
    font-size: 0.95rem !important;
  }

  .product-card p[style*="font-weight: 600"] {
    font-size: 0.95rem !important;
  }

  /* Slightly smaller Add to Cart button on mobile cards */
  .product-card .btn {
    font-size: 0.82rem !important;
    padding: 0.55rem 0.5rem !important;
  }

  /* Make image container aspect ratio tighter on very small cards */
  .product-image-container {
    margin-bottom: 0.8rem !important;
  }

  /* Scale prices down to fit mobile cards */
  .product-card p {
    font-size: 0.88rem !important;
    gap: 0.35rem !important;
  }
  .product-card p span {
    font-size: 0.8rem !important;
  }
  .product-card p .discount-price {
    font-size: 0.92rem !important;
  }

  /* Disable hover transitions on touchscreens to prevent stickiness */
  .product-card:hover {
    transform: none !important;
  }
  .product-card:hover img {
    transform: none !important;
  }

  /* Collection note compact on mobile */
  .collection-note {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    text-align: left;
  }

  .collection-note-title {
    font-size: 0.95rem;
  }

  /* Product Details Page Responsive */
  .product-action-bar-responsive {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1.2rem !important;
    padding: 1.2rem !important;
  }

  .product-action-bar-responsive > div {
    justify-content: center !important;
  }

  .product-action-bar-responsive button {
    width: 100% !important;
  }

  /* Checkout & Auth Layouts */
  .checkout-container,
  .auth-container {
    padding: 1.5rem 1.2rem !important;
    border-radius: 16px;
  }

  .auth-bg-orb-1,
  .auth-bg-orb-2 {
    display: none;
  }

  /* Hero product images responsive height */
  .featured .product-card img[style*="height: 380px"],
  .featured img {
    height: 200px !important;
    object-fit: cover !important;
  }

  /* Main wrapper top offset adjustment for smaller navbar */
  .main-wrapper {
    margin-top: 65px;
  }

  .search-results-dropdown {
    min-width: unset !important;
    width: 280px;
    right: -10px;
  }
}

/* Small Phones (max-width: 400px) */
@media (max-width: 400px) {
  .search-input-expand.active {
    width: 100px;
  }

  .search-results-dropdown {
    min-width: unset !important;
    width: 240px;
    right: -10px;
  }

  .logo {
    font-size: 1.1rem;
  }

  .logo img {
    width: 34px !important;
    height: 34px !important;
  }

  #product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .product-card.glass-panel {
    padding: 0.7rem !important;
  }

  .product-card h3 {
    font-size: 0.85rem !important;
  }

  .product-card p {
    font-size: 0.8rem !important;
    gap: 0.25rem !important;
  }
  .product-card p span {
    font-size: 0.75rem !important;
  }
  .product-card p .discount-price {
    font-size: 0.85rem !important;
  }
}

/* Sold Out Badge */
.sold-out-badge {
  background-color: var(--secondary);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  box-shadow: var(--shadow-sm);
}

/* Collection Reorder Custom Note */
.collection-note {
  max-width: 650px;
  margin: 0 auto 3rem auto;
  padding: 1.2rem 1.8rem;
  background: rgba(144, 118, 97, 0.06);
  border-left: 4px solid var(--secondary);
  border-radius: 12px;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}

.collection-note-title {
  color: var(--secondary);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  display: block;
  margin-bottom: 0.25rem;
}

/* === Smooth Layout Transitions === */
.navbar,
.main-wrapper,
section,
.logo,
.logo img,
.product-card,
.btn,
.nav-links,
.hero-product-img {
  transition: padding 0.3s ease, margin 0.3s ease, height 0.3s ease, font-size 0.3s ease, gap 0.3s ease, grid-template-columns 0.3s ease;
}

/* === Home Page Main Wrapper margin settings === */
.home-page-main {
  /* Inherits responsive margin-top from .main-wrapper */
}

/* === Mobile Menu Scrollbar Fix === */
@media (max-width: 850px) {
  .nav-links {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* === Phone Landscape Optimizations (max-height: 500px) === */
@media (max-height: 500px) and (orientation: landscape) {
  .navbar {
    padding: 0.5rem 4% !important;
  }
  
  .logo {
    font-size: 1.3rem !important;
  }
  
  .logo img {
    width: 32px !important;
    height: 32px !important;
  }
  
  .main-wrapper {
    margin-top: 55px !important;
  }
  
  .home-page-main {
    margin-top: 55px !important;
  }
  
  .nav-links {
    max-height: calc(100vh - 55px) !important;
  }
  
  section {
    padding: 2rem 4% !important;
  }
  
  h1 {
    font-size: 1.8rem !important;
    margin-bottom: 1.2rem !important;
  }
  
  h2 {
    font-size: 1.6rem !important;
    margin-bottom: 1.5rem !important;
  }
  
  .hero-product-img {
    height: 180px !important;
  }
  
  /* Optimize product details page gallery in landscape */
  .product-gallery {
    flex-direction: row !important;
    gap: 1rem !important;
    align-items: center !important;
  }
  
  .main-image-container {
    max-height: 240px !important;
  }
  
  .main-image-container img {
    max-height: 240px !important;
  }
  
  .thumbnails {
    max-height: 240px !important;
    flex-direction: column !important;
  }
  
  .thumbnail {
    width: 60px !important;
    height: 60px !important;
  }
  
  /* Adjust margins and font sizes of headings/stories in landscape */
  .product-bio-wrapper {
    padding: 1.5rem 0 !important;
  }
  
  .story-text {
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
    margin-bottom: 1.5rem !important;
  }
  
  /* Grid sizes adjustments in landscape */
  #product-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 1rem !important;
  }
}

/* Animated Cozy Cat in welcome banner */
@keyframes catBob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@keyframes catBlink {
  0%, 90%, 100% {
    transform: scaleY(1);
  }
  95% {
    transform: scaleY(0.1);
  }
}

.welcome-cozy-cat {
  animation: catBob 2.5s ease-in-out infinite;
  transform-origin: bottom center;
}

.welcome-cozy-cat .cat-eye-left,
.welcome-cozy-cat .cat-eye-right,
.welcome-cozy-cat .cat-eye-shine-left,
.welcome-cozy-cat .cat-eye-shine-right {
  animation: catBlink 4s ease-in-out infinite;
  transform-origin: center 52px;
}

/* Wishlist Favorites Heart Button */
.wishlist-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  outline: none;
  padding: 0;
}

.wishlist-btn:hover {
  transform: scale(1.12);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
  border-color: rgba(108, 120, 92, 0.25);
}

.wishlist-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(144, 118, 97, 0.45);
  border-color: var(--secondary);
}

.wishlist-btn svg {
  width: 18px;
  height: 18px;
  stroke: var(--text);
  fill: none;
  stroke-width: 2.2;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wishlist-btn.active svg {
  stroke: #e05a47;
  fill: #e05a47;
  transform: scale(1.15);
}

/* Loading spinner feedback during cloud database sync */
.wishlist-btn.loading svg {
  opacity: 0.15;
}

.wishlist-btn.loading::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(144, 118, 97, 0.25);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: wishlistSpin 0.6s linear infinite;
}

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

/* Ensure the product card supports relative positioning */
.product-card {
  position: relative;
}

