/* site.css — shared styling for all pages */

/* ---------- Tokens ---------- */
:root {
  --linen: #F9F6EE;
  --olive: #8B956D;
  --walnut: #A67856;
  --charcoal: #343434;
  --ink60: #5B5B5B;
  --mist: #EDE9DF;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  --space: clamp(24px, 4vw, 48px);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--charcoal);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
a:focus, button:focus {
  outline: 3px solid color-mix(in oklab, var(--olive) 70%, white 30%);
  outline-offset: 2px;
}
.container {
  max-width: 1152px;
  margin-inline: auto;
  padding: 0 var(--space);
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(1.1) blur(6px);
  background: color-mix(in oklab, var(--linen) 88%, white 12%);
  border-bottom: 1px solid var(--mist);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand svg { height: 56px; width: auto; }
.menu {
  display: flex;
  gap: 20px;
  font-size: 15px;
  color: var(--ink60);
}
.menu a {
  padding: 8px 10px;
  border-radius: 10px;
}
.menu a:hover { background: var(--mist); color: var(--charcoal); }
.menu a.active { background: var(--olive); color: #fff; }
.actions { 
  display: flex; 
  gap: 8px; 
  align-items: center;
}
/* Icon buttons - can be easily reverted by removing .icon-btn class */
.btn.icon-btn {
  padding: 10px;
  min-width: 40px;
  width: 40px;
  height: 40px;
  position: relative; /* For cart count badge positioning */
}
.btn.icon-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  display: block; /* Ensure SVG is visible */
  flex-shrink: 0;
}
.btn.icon-btn .btn-text {
  display: none !important; /* Hide text when using icons - force with !important */
}
/* Revert to text: remove .icon-btn class and uncomment below */
/* .btn.icon-btn .btn-text { display: inline; } */
/* .btn.icon-btn svg { display: none; } */

/* Account dropdown */
.account-dropdown {
  position: relative;
}
.account-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  padding: 8px 0;
  display: none;
  z-index: 100;
}
.account-dropdown.open .account-dropdown-menu {
  display: block;
}
.account-dropdown-item {
  display: block;
  padding: 12px 16px;
  color: var(--charcoal);
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}
.account-dropdown-item:hover {
  background: var(--linen);
}
.account-dropdown-divider {
  height: 1px;
  background: var(--mist);
  margin: 8px 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--mist);
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
  cursor: pointer;
}
.btn-olive {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  border-color: var(--mist);
}

/* ---------- Hero (home) ---------- */
.hero {
  padding: calc(var(--space) * 1) 0;
  text-align: center;
}
.hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--mist);
  color: var(--ink60);
}
.hero .kicker i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--olive);
  display: inline-block;
}
.hero h1 {
  font-family: Poppins, Inter, sans-serif;
  font-weight: 600;
  font-size: clamp(28px, 4vw, 40px);
  margin: 12px 0 8px;
}
.hero .sub {
  color: var(--ink60);
  max-width: 720px;
  margin: 0 auto;
}
.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

/* ---------- Category tiles (home) ---------- */
.cats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 22px;
  margin: 40px auto;
  max-width: 960px;
}
.cat {
  width: 210px;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cat:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}
.cat-title {
  font-family: Poppins, Inter, sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--mist);
  text-align: left;
}
.cat-thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  border-radius: 0 0 12px 12px;
}
@media (max-width: 1100px) {
  .cat { width: 200px; }
}
@media (max-width: 820px) {
  .cat { width: 46%; }
}
@media (max-width: 560px) {
  .cat { width: 100%; }
  .cat-thumb { height: 140px; }
}

/* ---------- Product/grid cards (shared) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.card, .bundle, .note, .tile, .cat {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card, .bundle {
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover, .bundle:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}
.card {
  cursor: pointer;
}
.card button[data-add],
.card a {
  cursor: pointer;
}
.ph {
  aspect-ratio: 4/3;
  background: linear-gradient(180deg, color-mix(in oklab, var(--linen) 80%, white 20%), #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink60);
}
.body { 
  padding: 14px 16px; 
  display: flex;
  flex-direction: column;
  flex: 1;
}
.desc {
  color: var(--ink60);
  font-size: 14px;
  margin: 4px 0 0;
  min-height: 2.8em; /* ~2 lines of text for alignment */
  line-height: 1.4;
}
.card .body > p.muted {
  min-height: 2.8em;
  line-height: 1.4;
}
.price {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  min-height: 28px; /* Ensure consistent height */
}
.badge {
  font-size: 11px;
  color: #fff;
  background: var(--walnut);
  padding: 4px 8px;
  border-radius: 999px;
}
.muted { color: var(--ink60); font-size: 14px; }
.card-actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quantity-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.quantity-selector label {
  font-size: 12px;
  color: var(--ink60);
  font-weight: 500;
}
.quantity-selector select {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--mist);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}
.quantity-selector select:focus {
  outline: 2px solid color-mix(in oklab, var(--olive) 70%, white 30%);
  outline-offset: 2px;
  border-color: var(--olive);
}
.quantity-selector select,
.quantity-selector label {
  position: relative;
  z-index: 3;
}
.add { width: 100%; position: relative; z-index: 3; }
.wishlist-btn {
  position: relative;
  z-index: 4 !important; /* Above stretched link (z-index: 1) and add button (z-index: 2) */
  background: #fff;
  border: 1px solid var(--mist);
  color: var(--ink60);
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s;
  padding: 10px 12px;
  min-width: 44px;
  pointer-events: auto;
}
.wishlist-btn:hover {
  background: var(--linen);
  border-color: var(--olive);
  color: #d32f2f;
}
.wishlist-btn.in-wishlist {
  color: #d32f2f;
  border-color: #d32f2f;
}
.wishlist-btn.in-wishlist .wishlist-icon {
  color: #d32f2f;
}
.wishlist-icon {
  display: inline-block;
  transition: transform 0.2s;
}
.wishlist-btn:hover .wishlist-icon {
  transform: scale(1.1);
}

/* ---------- Reviews & Ratings ---------- */
.reviews-section {
  margin-top: 40px;
}
.reviews-header {
  margin-bottom: 32px;
}
.reviews-header h3 {
  font-family: Poppins, Inter, sans-serif;
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 16px;
}
.reviews-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.no-reviews {
  color: var(--ink60);
  font-style: italic;
  padding: 20px 0;
}
.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.review-item {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 12px;
}
.review-author {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}
.review-date {
  font-size: 13px;
  color: var(--ink60);
}
.review-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--charcoal);
}
.review-comment {
  color: var(--ink60);
  line-height: 1.6;
  white-space: pre-wrap;
}
.review-form-section {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.review-form .form-group {
  margin-bottom: 20px;
}
.review-form label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--charcoal);
}
.review-form input[type="text"],
.review-form input[type="email"],
.review-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--mist);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.review-form input:focus,
.review-form textarea:focus {
  outline: 3px solid color-mix(in oklab, var(--olive) 70%, white 30%);
  outline-offset: 2px;
  border-color: var(--olive);
}
.review-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) {
  .review-form .form-row {
    grid-template-columns: 1fr;
  }
}
.rating-input {
  display: flex;
  gap: 4px;
  flex-direction: row-reverse;
  justify-content: flex-end;
}
.rating-input input[type="radio"] {
  display: none;
}
.rating-input .star-label {
  font-size: 32px;
  color: #e5e7eb;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}
.rating-input input[type="radio"]:checked ~ .star-label,
.rating-input input[type="radio"]:checked + .star-label,
.rating-input .star-label:hover,
.rating-input .star-label:hover ~ .star-label {
  color: #fbbf24;
}
.product-rating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.review-count {
  font-size: 12px;
  color: var(--ink60);
  margin-left: 4px;
}

/* ---------- Skeleton Loaders ---------- */
.skeleton {
  background: linear-gradient(90deg, 
    color-mix(in oklab, var(--linen) 90%, white 10%) 25%, 
    color-mix(in oklab, var(--linen) 70%, white 30%) 50%, 
    color-mix(in oklab, var(--linen) 90%, white 10%) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.skeleton-image {
  aspect-ratio: 4/3;
  width: 100%;
  margin-bottom: 0;
}

.skeleton-body {
  padding: 14px 16px;
}

.skeleton-title {
  height: 20px;
  width: 70%;
  margin-bottom: 8px;
}

.skeleton-text {
  height: 14px;
  width: 90%;
  margin-bottom: 6px;
}

.skeleton-text-short {
  height: 14px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-price {
  height: 24px;
  width: 80px;
  margin-bottom: 10px;
}

.skeleton-button {
  height: 36px;
  width: 100%;
  border-radius: 8px;
}

/* ---------- Home “Calm Setup / Why Feskozy” ---------- */
.edit .edit-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0 60px;
}
.note { padding: 16px; }
@media (max-width: 820px) { .edit .edit-wrap { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
footer {
  margin-top: calc(var(--space) * 1.5);
  padding: 28px 0;
  border-top: 1px solid var(--mist);
  color: var(--ink60);
}
.fcols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
}
.small { font-size: 14px; }
@media (max-width: 560px) { .fcols { grid-template-columns: 1fr; } }

/* ---------- Drawer / Cart ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 40;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: var(--linen);
  border-left: 1px solid var(--mist);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(100%);
  transition: transform 0.25s;
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: none; }

.drawer header {
  position: sticky;
  top: 0;
  background: var(--linen);
  border-bottom: 1px solid var(--mist);
}

.drawer .inner {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
}

/* Cart list */
#cartItems {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

/* Single cart item */
.cart-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 12px;
  padding: 12px;
  width: 100%;
  box-sizing: border-box;
}

/* Left side: image + text */
.cart-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

/* Thumbnail image */
.cart-thumb,
.drawer .cart-item img {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Text stack */
.cart-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 600;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.cart-item-meta {
  font-size: 13px;
  color: var(--ink60);
}

/* Right side: qty + remove */
.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-left: 6px;
  flex-shrink: 0;
}

/* Quantity pill */
.qty-control,
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--mist);
  border-radius: 10px;
  overflow: hidden;
}

.qty-control button,
.qty button {
  background: transparent;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
}

.qty-control span,
.qty span {
  padding: 0 10px;
}

/* ---------- Search Modal ---------- */
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}
.search-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.search-modal-content {
  background: var(--linen);
  border: 1px solid var(--mist);
  border-radius: var(--radius);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
  width: min(600px, 90vw);
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-20px);
  transition: transform 0.25s;
}
.search-modal.open .search-modal-content {
  transform: translateY(0);
}
.search-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--mist);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.search-modal-header h3 {
  margin: 0;
  font-family: Poppins, Inter, sans-serif;
  font-size: 18px;
}
.search-modal-input {
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid var(--mist);
  background: #fff;
  font-size: 16px;
  width: 100%;
  outline: none;
}
.search-modal-input:focus {
  outline: 3px solid color-mix(in oklab, var(--olive) 70%, white 30%);
  outline-offset: -3px;
}
.search-modal-results {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}
.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}
.search-result-item:hover {
  background: var(--mist);
}
.search-result-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--mist);
}
.search-result-item-info {
  flex: 1;
  min-width: 0;
}
.search-result-item-title {
  font-weight: 600;
  font-size: 14px;
  margin: 0 0 4px;
}
.search-result-item-price {
  color: var(--ink60);
  font-size: 13px;
}
.search-modal-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink60);
}

/* ---------- Mobile Navigation ---------- */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 21;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  transition: all 0.3s;
  border-radius: 2px;
  pointer-events: none; /* Allow clicks to pass through to button */
}
.mobile-menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}
.mobile-menu-toggle.open span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 30;
}
.mobile-menu-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: min(320px, 85vw);
  background: var(--linen);
  border-right: 1px solid var(--mist);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
  transform: translateX(-100%);
  transition: transform 0.25s;
  z-index: 35;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-menu.open {
  transform: translateX(0);
}
.mobile-menu-header {
  padding: 16px;
  border-bottom: 1px solid var(--mist);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mobile-menu-nav {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-menu-nav a {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 16px;
  color: var(--ink60);
  transition: background 0.2s;
}
.mobile-menu-nav a:hover,
.mobile-menu-nav a.active {
  background: var(--mist);
  color: var(--charcoal);
}

/* ---------- Minor responsive tweaks ---------- */
@media (max-width: 900px) {
  .menu { display: none; }
  .mobile-menu-toggle { display: flex; }
  .actions {
    gap: 8px;
  }
}
