/* public/css/styles.css */
:root {
  --bg-main: #fffcf5;
  --bg-card: #ffffff;
  --deep: #2c3836;
  --muted: #666666;
  --accent-orange: #ff3502;
  --accent-gold: #ffb204;
  --accent-grad: linear-gradient(135deg, #ff3502, #ffb204);
  --shadow-soft: 0 8px 24px rgba(0,0,0,0.05);
  --shadow-hover: 0 12px 32px rgba(0,0,0,0.1);
  --radius-lg: 16px;
  --radius-pill: 50px;
  --font-main: "Poppins", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg-main);
  color: var(--deep);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.2s; }
img { max-width: 100%; display: block; }

/* --- LAYOUT --- */
.page-shell { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- BUTTONS --- */
.btn {
  display: inline-flex; justify-content: center; align-items: center;
  padding: 10px 24px; border-radius: var(--radius-pill);
  font-weight: 600; border: none; cursor: pointer; transition: 0.2s;
  font-size: 0.95rem; white-space: nowrap;
}
.btn-primary { background: var(--accent-grad); color: white; box-shadow: 0 4px 15px rgba(255, 53, 2, 0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 53, 2, 0.35); }
.btn-outline { background: white; border: 1px solid #ddd; color: var(--deep); }
.btn-outline:hover { background: #f9f9f9; border-color: var(--deep); }
.btn-danger { background: #fee2e2; color: #ef4444; border: 1px solid #fecaca; }
.w-100 { width: 100%; }

/* --- NAVIGATION HEADER --- */
.top-nav {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.98); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.top-nav-inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; max-width: 1200px; margin: 0 auto; min-height: 70px;
}
.nav-brand { display: flex; align-items: center; gap: 10px; }
.nav-logo-img { width: 40px; height: 40px; object-fit: contain; }
.nav-title { font-weight: 700; font-size: 1.2rem; }

.nav-right-group { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-links a { font-weight: 500; color: var(--muted); font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--accent-orange); }

.nav-auth-area { display: flex; align-items: center; gap: 10px; }
.nav-user-pill {
  display: inline-flex; align-items: center; padding: 6px 14px;
  background: white; border-radius: var(--radius-pill);
  font-size: 0.85rem; border: 1px solid rgba(0,0,0,0.1); color: var(--muted);
  white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis;
}
.nav-auth-btn {
  background: var(--accent-grad); color: white; padding: 8px 20px;
  border-radius: var(--radius-pill); border: none; font-weight: 600; cursor: pointer; font-size: 0.9rem;
}

@media (max-width: 768px) {
  .top-nav-inner { flex-direction: column; padding: 10px; gap: 10px; height: auto; }
  .nav-right-group { width: 100%; flex-direction: column; gap: 10px; }
  .nav-links { width: 100%; justify-content: center; flex-wrap: wrap; gap: 15px; }
  .nav-auth-area { width: 100%; justify-content: center; }
  .nav-user-pill { display: none; }
}

/* --- UTILS --- */
.card-shell {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; margin-bottom: 5px; font-size: 0.9rem; color: var(--muted); }
.input-group input, .input-group textarea, .input-group select {
  width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 1rem;
}

/* --- SHOP STYLES --- */
.shop-toolbar {
  background: white; padding: 15px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft); display: flex; gap: 15px; align-items: center; margin-bottom: 2rem; flex-wrap: wrap;
}
.shop-search {
  flex: 2; min-width: 200px; background: #f9f9f9; border: 1px solid transparent;
  padding: 12px 20px; border-radius: var(--radius-pill); font-size: 0.95rem; outline: none;
}
.shop-search:focus { background: white; border-color: var(--accent-orange); }
.shop-select {
  flex: 1; min-width: 140px; padding: 12px 15px; border-radius: var(--radius-pill);
  border: 1px solid #eee; background: white; font-size: 0.9rem; cursor: pointer; outline: none;
}

.products-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 25px; padding-bottom: 3rem;
}
@media (max-width: 480px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

.product-card {
  background: white; border-radius: var(--radius-lg); padding: 12px;
  box-shadow: var(--shadow-soft); display: flex; flex-direction: column;
  transition: transform 0.3s; overflow: hidden;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.product-img-wrap {
  width: 100%; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; margin-bottom: 12px; background: #f5f5f5;
}
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-info h3 { font-size: 1rem; margin: 0 0 5px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-desc { font-size: 0.8rem; color: #888; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-size: 1.1rem; font-weight: 700; color: var(--deep); margin-bottom: 12px; }

/* --- CART STYLES (Restored) --- */
.cart-list { display: flex; flex-direction: column; gap: 1rem; }
.cart-row { display: flex; align-items: center; gap: 1rem; background: white; padding: 1rem; border-radius: 12px; box-shadow: var(--shadow-soft); }
.cart-thumb { width: 70px; height: 70px; border-radius: 8px; object-fit: cover; }
.cart-details { flex: 1; }
.cart-details h4 { margin: 0 0 5px 0; font-size: 1rem; }
.cart-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.qty-pill { display: flex; align-items: center; background: #f5f5f5; border-radius: 20px; padding: 2px 5px; }
.qty-btn { background: none; border: none; padding: 5px 10px; cursor: pointer; font-weight: bold; }
.qty-val { font-weight: 600; padding: 0 5px; }
.btn-remove { background: none; border: none; color: red; font-size: 0.8rem; cursor: pointer; text-decoration: underline; }

/* --- WHATSAPP FLOAT --- */
.whatsapp-float {
  position: fixed; bottom: 25px; right: 25px; z-index: 999;
  background: #25d366; width: 60px; height: 60px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3); transition: 0.3s;
}
.whatsapp-icon { width: 32px; height: 32px; }

/* --- FOOTER --- */
.site-footer { background: var(--deep); color: white; padding: 2rem 0; margin-top: auto; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 15px; flex-wrap: wrap; }


/* --- PRODUCT DETAIL PAGE --- */
.product-detail-container {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 768px) {
  .detail-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.detail-image-box {
  background: white;
  padding: 1rem;
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 100px; /* Sticks while scrolling */
}

.detail-img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  object-fit: cover;
  aspect-ratio: 1/1;
}

.detail-info h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.detail-price {
  font-size: 1.8rem;
  color: var(--accent-orange);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

detail-desc {
  color: var(--deep); /* Darker color for readability */
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  /* Removed white-space: pre-line because we now handle breaks in JS */
}
/* Style for the Bold Keys generated by JS */
.detail-desc strong {
  color: var(--accent-orange); /* Highlights keywords like "Material:" in orange */
  font-weight: 600;
  display: inline-block;
  margin-top: 10px; /* Adds space before new sections */
}

.detail-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 50px;
  overflow: hidden;
}

.qty-selector button {
  background: none;
  border: none;
  padding: 10px 15px;
  font-weight: bold;
  cursor: pointer;
}
.qty-selector button:hover { background: #f5f5f5; }

.qty-selector input {
  width: 40px;
  text-align: center;
  border: none;
  font-weight: 600;
  outline: none;
}