/* ===== TL Essentials — Storefront Styles ===== */
/* Extends the landing page design system */

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

:root {
  --ink: #1a1a1a;
  --paper: #f8f6f2;
  --accent: #c45d3e;
  --accent-light: #e8926f;
  --accent-hover: #b04e32;
  --muted: #8a8580;
  --border: #e2ddd7;
  --card: #ffffff;
  --success: #3a8a5c;
  --success-light: #e8f5ed;
  --home-tint: #e8efe5;
  --care-tint: #ece5f0;
  --kitchen-tint: #f0ece5;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
}

a { color: inherit; text-decoration: none; }

/* ===== NAVIGATION ===== */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.logo span { color: var(--accent); }

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.cart-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cart-count {
  background: var(--accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  transition: transform 0.2s;
}

.cart-count.bump {
  transform: scale(1.3);
}

.cart-count:empty,
.cart-count[data-count="0"] {
  display: none;
}

/* ===== PAGE HEADER ===== */
.page-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  width: 100%;
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
}

.page-header h1 em {
  font-style: normal;
  color: var(--accent);
}

.page-header .subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin-top: 0.75rem;
  max-width: 500px;
}

/* ===== CATEGORY TABS ===== */
.category-tabs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.category-tab {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  background: transparent;
  font-family: 'Space Grotesk', sans-serif;
}

.category-tab:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.category-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.product-card-image {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
}

.product-card-image.home { background: var(--home-tint); }
.product-card-image.personal-care { background: var(--care-tint); }
.product-card-image.kitchen { background: var(--kitchen-tint); }

.product-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card-category {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 0.5rem;
}

.product-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 0.4rem;
}

.product-card-name a {
  transition: color 0.2s;
}

.product-card-name a:hover {
  color: var(--accent);
}

.product-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.product-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--ink);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.7rem;
}

.btn-lg {
  padding: 0.85rem 2rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== ADD TO CART ANIMATION ===== */
.btn-added {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: white !important;
}

/* ===== PRODUCT DETAIL ===== */
.product-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.product-detail-image {
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.product-detail-image.home { background: var(--home-tint); }
.product-detail-image.personal-care { background: var(--care-tint); }
.product-detail-image.kitchen { background: var(--kitchen-tint); }

.product-detail-info {}

.product-detail-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 1rem;
}

.product-detail-name {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.product-detail-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -1px;
  margin-bottom: 1.5rem;
}

.product-detail-desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.product-features {
  list-style: none;
  margin-bottom: 2rem;
}

.product-features li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.product-features li:first-child {
  border-top: 1px solid var(--border);
}

.feature-check {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.8rem;
}

.product-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.product-actions .btn {
  flex: 1;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--ink);
}

.breadcrumb .sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

/* ===== CART PAGE ===== */
.cart-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 5rem;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 3rem;
  align-items: start;
}

.cart-items {}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item:first-child {
  border-top: 1px solid var(--border);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.cart-item-image.home { background: var(--home-tint); }
.cart-item-image.personal-care { background: var(--care-tint); }
.cart-item-image.kitchen { background: var(--kitchen-tint); }

.cart-item-details h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 0.25rem;
}

.cart-item-details .cart-item-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.qty-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 2px;
}

.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink);
  transition: background 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}

.qty-btn:hover {
  background: var(--border);
}

.qty-value {
  width: 36px;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  height: 32px;
  line-height: 32px;
}

.cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.2s;
  font-family: 'Space Grotesk', sans-serif;
}

.cart-item-remove:hover {
  color: var(--accent);
}

.cart-item-total {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  min-width: 70px;
  text-align: right;
}

/* Cart summary sidebar */
.cart-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem;
  position: sticky;
  top: 2rem;
}

.cart-summary h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.cart-summary-row.total {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.cart-summary .btn {
  margin-top: 1.5rem;
}

.cart-empty {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
}

.cart-empty h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.cart-empty p {
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ===== CHECKOUT SUCCESS ===== */
.success-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 5rem 2rem;
  text-align: center;
}

.success-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.success-page h1 {
  font-size: 2rem;
  letter-spacing: -1px;
  margin-bottom: 0.75rem;
}

.success-page p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.order-number {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
}

/* ===== DIVIDER ===== */
.divider {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.divider-line {
  height: 1px;
  background: var(--border);
  width: 100%;
}

/* ===== FOOTER ===== */
.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: auto;
}

.footer-left {
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-right {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 1px;
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--ink);
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 968px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-detail {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem 4rem;
  }

  .product-detail-image {
    height: 300px;
    font-size: 6rem;
  }

  .cart-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .cart-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .site-nav {
    padding: 1.25rem 1.5rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
    padding: 0 1.5rem 3rem;
  }

  .page-header {
    padding: 2rem 1.5rem 1.5rem;
  }

  .category-tabs {
    padding: 0 1.5rem 1.5rem;
  }

  .product-detail-image {
    height: 250px;
    font-size: 5rem;
  }

  .product-actions {
    flex-direction: column;
  }

  .cart-item {
    grid-template-columns: 60px 1fr;
    gap: 1rem;
  }

  .cart-item-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .cart-item-total {
    grid-column: 1 / -1;
    text-align: left;
  }

  .site-footer {
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    padding: 2rem 1.5rem;
  }
}
