/* public/css/styles.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  --bg-main: #fbf9f6;
  --bg-card: #ffffff;
  --deep: #111827;
  --muted: #4b5563;
  --accent-orange: #ff3502;
  --accent-gold: #ffb204;
  --accent-grad: linear-gradient(135deg, #ff3502, #ffb204);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.08);
  --radius-lg: 16px;
  --radius-pill: 50px;
  --font-main: "Outfit", sans-serif;
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-blur: blur(12px);
}

*,
*::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: 12px 28px;
  border-radius: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-size: 0.95rem;
  white-space: nowrap;
}

.btn-primary {
  background: var(--deep);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  background: #1a2221;
}

.btn-outline {
  background: white;
  border: 1px solid #e2e8f0;
  color: var(--deep);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.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.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.top-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 80px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo-img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  border-radius: 10px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-title {
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.5px;
}

.nav-right-group {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links {
  display: flex;
  gap: 24px;
  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(--deep);
  font-weight: 600;
}

.nav-auth-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.03);
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-auth-btn {
  background: var(--deep);
  color: white;
  padding: 10px 24px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: 0.2s;
}

.nav-auth-btn:hover {
  background: #1a2221;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .top-nav-inner {
    flex-direction: column;
    padding: 15px;
    gap: 15px;
    height: auto;
  }

  .nav-right-group {
    width: 100%;
    flex-direction: column;
    gap: 15px;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
  }

  .nav-auth-area {
    width: 100%;
    justify-content: center;
  }

  .nav-user-pill {
    display: none;
  }
}

/* --- UTILS --- */
.card-shell {
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 1.2rem;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--deep);
  font-weight: 500;
}

.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  background: #f8fafc;
  transition: all 0.2s;
}

.input-group input:focus,
.input-group textarea:focus {
  background: #fff;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(255, 53, 2, 0.1);
  outline: none;
}

/* --- 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;
}

.category-banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .shop-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .shop-search,
  .shop-select {
    min-width: 100%;
    flex: 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;
  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;
}

/* --- PREMIUM CART DRAWER --- */
.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.cart-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 100%;
  max-width: 420px;
  height: 100%;
  background: var(--bg-card);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.cart-drawer.active {
  right: 0;
}

.cart-drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-drawer-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--deep);
}
.cart-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
  transition: color 0.2s;
  padding: 4px;
  line-height: 1;
}
.cart-drawer-close:hover {
  color: var(--accent-orange);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.cart-drawer-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
}
.cart-drawer-empty .icon {
  font-size: 3rem;
  opacity: 0.3;
}

.cart-drawer-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
}
.cart-drawer-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.cart-drawer-img {
  width: 70px;
  height: 70px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: #f8fafc;
}
.cart-drawer-info {
  flex: 1;
  min-width: 0;
}
.cart-drawer-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0 0 4px 0;
  color: var(--deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-drawer-price {
  font-weight: 700;
  color: var(--accent-orange);
  font-size: 0.95rem;
}
.cart-drawer-qty-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.cart-drawer-qty-ctrl {
  display: flex;
  align-items: center;
  background: #f3f4f6;
  border-radius: 20px;
  padding: 2px 4px;
}
.cart-drawer-qty-btn {
  background: none;
  border: none;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--deep);
  font-size: 0.85rem;
  border-radius: 50%;
  transition: background 0.2s;
}
.cart-drawer-qty-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}
.cart-drawer-qty-val {
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}
.cart-drawer-item-remove {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.2s;
}
.cart-drawer-item-remove:hover {
  text-decoration: underline;
}

.cart-drawer-footer {
  padding: 24px;
  border-top: 1px solid var(--glass-border);
  background: #fafafa;
}
.cart-drawer-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: var(--deep);
}
.cart-drawer-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-drawer-btn {
  width: 100%;
  padding: 14px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.cart-drawer-btn-primary {
  background: var(--accent-grad);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 53, 2, 0.25);
}
.cart-drawer-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 53, 2, 0.35);
}
.cart-drawer-btn-secondary {
  background: white;
  color: var(--deep);
  border: 1px solid #e2e8f0;
}
.cart-drawer-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* --- INTERACTIVE SEARCH SUGGESTIONS --- */
.search-container {
  position: relative;
  flex: 2;
  min-width: 200px;
}
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  margin-top: 8px;
  max-height: 350px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  flex-direction: column;
  padding: 8px;
}
.search-suggestions.active {
  display: flex;
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.suggestion-item:hover {
  background: rgba(0, 0, 0, 0.03);
}
.suggestion-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
  border: 1px solid rgba(0, 0, 0, 0.03);
}
.suggestion-details {
  flex: 1;
  min-width: 0;
}
.suggestion-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--deep);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestion-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  gap: 8px;
}
.suggestion-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-orange);
}

/* --- DETAILED PRODUCT SPECIFICATIONS GRID --- */
.product-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 15px;
  margin-bottom: 20px;
}
.spec-card {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.2s;
}
.spec-card:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: rgba(255, 53, 2, 0.15);
}
.spec-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.spec-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--deep);
}

/* --- IMAGE HOVER ZOOM EFFECT --- */
.main-media-box {
  cursor: zoom-in;
}
.main-media-box img {
  transform-origin: center center;
}
.main-media-box:hover img {
  transform: scale(1.08);
}