/* ============================================================
   PROJECT MANHATTAN — product-list.css
   Font: DM Sans | Primary: #1a6fdb
   ============================================================ */

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

body {
  font-family: 'DM Sans', sans-serif;
  background: #f4f6fb;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── NAV ─────────────────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #e8eaf0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.nav-project { font-size: 9px; font-weight: 700; letter-spacing: 2px; color: #9aa0b4; }
.nav-manhattan { font-size: 15px; font-weight: 800; color: #1a1a2e; }
.nav-manhattan span { color: #1a6fdb; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: #1a6fdb; background: #eef4fd; }

.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  min-width: 160px;
  overflow: hidden;
  list-style: none;
  z-index: 200;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu li a {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  color: #4a4e69;
  border-radius: 0;
}
.nav-dropdown-menu li a:hover { background: #f4f6fb; color: #1a6fdb; }

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

.nav-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a6fdb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.nav-email {
  font-size: 12px;
  color: #6b7280;
  font-weight: 500;
}

.nav-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  min-width: 120px;
  overflow: hidden;
  z-index: 200;
}
.nav-profile-dropdown button {
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #e63946;
  cursor: pointer;
  font-weight: 500;
}
.nav-profile-dropdown button:hover { background: #fff5f5; }

/* ── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px 16px;
}

.page-header-left { display: flex; align-items: baseline; gap: 12px; }

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a2e;
}

.product-count {
  font-size: 12px;
  color: #9aa0b4;
  font-weight: 500;
  background: #f0f2f8;
  padding: 3px 10px;
  border-radius: 20px;
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #e0e3ed;
  border-radius: 8px;
  padding: 7px 12px;
  width: 260px;
  transition: border-color 0.2s;
}
.search-wrapper:focus-within { border-color: #1a6fdb; }
.search-wrapper svg { color: #9aa0b4; flex-shrink: 0; }
.search-wrapper input {
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #1a1a2e;
  width: 100%;
  background: transparent;
}
.search-wrapper input::placeholder { color: #9aa0b4; }

.btn-add-product {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #1a6fdb;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.btn-add-product:hover { background: #1560c4; transform: translateY(-1px); }

/* ── PRODUCT GRID ────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 8px 32px 32px;
}

/* ── PRODUCT CARD ────────────────────────────────────────── */
.product-card {
  background: #fff;
  border: 1px solid #e8eaf0;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  box-shadow: 0 8px 28px rgba(26,111,219,0.10);
  transform: translateY(-2px);
}

.product-card-photo {
  width: 100%;
  height: 180px;
  background: #f4f6fb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card-photo .no-photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #d0d4e0;
  font-size: 12px;
}

.product-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #eef4fd;
  color: #1a6fdb;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.product-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-brand {
  font-size: 12px;
  color: #9aa0b4;
  font-weight: 500;
}

.product-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f4f6fb;
  border: 1px solid #e8eaf0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  color: #4a4e69;
  font-weight: 500;
}
.meta-chip svg { color: #9aa0b4; }

.allergen-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.allergen-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffc107;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid #f0f2f8;
  gap: 8px;
}

.btn-card-view {
  flex: 1;
  padding: 7px;
  background: #1a6fdb;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-card-view:hover { background: #1560c4; }

.btn-card-edit {
  padding: 7px 12px;
  background: #fff;
  border: 1.5px solid #e0e3ed;
  border-radius: 7px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #4a4e69;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-card-edit:hover { border-color: #1a6fdb; color: #1a6fdb; }

.btn-card-delete {
  padding: 7px 10px;
  background: #fff;
  border: 1.5px solid #e0e3ed;
  border-radius: 7px;
  cursor: pointer;
  color: #d0d4e0;
  transition: border-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
}
.btn-card-delete:hover { border-color: #e63946; color: #e63946; }

/* ── EMPTY & LOADING STATES ──────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 32px;
  text-align: center;
}
.empty-state h3 { font-size: 16px; font-weight: 700; color: #4a4e69; }
.empty-state p { font-size: 13px; color: #9aa0b4; }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 32px;
  color: #9aa0b4;
  font-size: 13px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e8eaf0;
  border-top-color: #1a6fdb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── DELETE MODAL ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,20,40,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-box {
  background: #fff;
  border-radius: 14px;
  padding: 36px 32px;
  max-width: 400px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.15);
  text-align: center;
  animation: modalPop 0.25s ease;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon {
  width: 56px;
  height: 56px;
  background: #eef4fd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-icon.danger { background: #fff0f1; }

.modal-title { font-size: 16px; font-weight: 700; color: #1a1a2e; }
.modal-body { font-size: 13px; color: #6b7280; line-height: 1.6; }
.modal-body strong { color: #1a1a2e; font-weight: 600; }

.modal-actions { display: flex; gap: 10px; width: 100%; margin-top: 6px; }

.modal-cancel-btn {
  flex: 1;
  padding: 9px;
  background: #fff;
  border: 1.5px solid #e0e3ed;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #4a4e69;
  cursor: pointer;
  transition: border-color 0.2s;
}
.modal-cancel-btn:hover { border-color: #1a6fdb; color: #1a6fdb; }

.modal-delete-btn {
  flex: 1;
  padding: 9px;
  background: #e63946;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.modal-delete-btn:hover { background: #c1121f; }

/* ── UTILITIES ───────────────────────────────────────────── */
.hidden { display: none !important; }