/* ─────────────────────────────────────────────────────────────────
   RetailKit Catalog — Module Styles
   ───────────────────────────────────────────────────────────────── */

#app-loading {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream);
}

.catalog-screen { display: none; flex: 1; overflow-y: auto; }
.catalog-screen.active { display: block; }

.catalog-search {
  padding: 7px 14px; border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1); color: #fff;
  font-size: 13px; outline: none; width: 180px;
  font-family: 'DM Sans', sans-serif;
}
.catalog-search::placeholder { color: rgba(255,255,255,0.45); }
.catalog-search:focus { border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.15); }

/* ── Hero ── */
.catalog-hero {
  background: var(--navy);
  padding: 32px 24px;
  text-align: center;
}
.catalog-hero h1 { font-size: 24px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.catalog-hero p  { color: rgba(255,255,255,0.55); font-size: 14px; }

/* ── Dept Grid ── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 24px;
  max-width: 960px;
  margin: 0 auto;
}
.dept-card {
  background: var(--white); border-radius: 14px;
  border: 1.5px solid var(--border); padding: 28px 16px;
  text-align: center; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.dept-card:hover  { border-color: var(--navy); box-shadow: var(--shadow); }
.dept-card:active { transform: scale(0.97); }
.dept-icon  { font-size: 36px; }
.dept-name  { font-size: 14px; font-weight: 700; color: var(--navy); }
.dept-count { font-size: 12px; color: var(--muted); }

/* ── Category ── */
.category-header {
  background: var(--navy); padding: 16px 20px;
  display: flex; align-items: center; gap: 14px; color: #fff;
}
.back-btn {
  background: rgba(255,255,255,0.1); border: none;
  color: #fff; padding: 6px 14px; border-radius: 20px;
  font-size: 13px; cursor: pointer; font-family: 'DM Sans', sans-serif;
}
.back-btn:hover { background: rgba(255,255,255,0.2); }
.category-title { font-size: 16px; font-weight: 700; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px; padding: 20px;
  max-width: 960px; margin: 0 auto;
}
.cat-card {
  background: var(--white); border-radius: 12px;
  border: 1.5px solid var(--border); padding: 22px 14px;
  text-align: center; cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.cat-card:hover  { border-color: var(--navy); }
.cat-card:active { transform: scale(0.97); }
.cat-name  { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.cat-count { font-size: 11px; color: var(--muted); }

/* ── Products ── */
.products-toolbar {
  padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--white); flex-wrap: wrap;
}
.products-toolbar .back-btn { background: var(--cream); color: var(--navy); border: 1.5px solid var(--border); }
.toolbar-title { font-size: 14px; font-weight: 700; color: var(--navy); flex: 1; }
.toolbar-count { font-size: 12px; color: var(--muted); }
.sort-select {
  padding: 6px 10px; border-radius: 8px;
  border: 1.5px solid var(--border); font-size: 12px;
  font-family: 'DM Sans', sans-serif; outline: none; cursor: pointer;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px; padding: 20px;
  max-width: 1100px; margin: 0 auto;
}

.product-card {
  background: var(--white); border-radius: 12px;
  border: 1.5px solid var(--border); overflow: hidden;
  cursor: pointer; transition: box-shadow 0.15s, transform 0.1s;
}
.product-card:hover  { box-shadow: var(--shadow); }
.product-card:active { transform: scale(0.98); }

.product-img {
  height: 140px; background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; position: relative;
}
.product-img img {
  width: 100%; height: 100%; object-fit: cover;
}

.product-info { padding: 12px; }
.product-name { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 4px; line-height: 1.3; }
.product-brand { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.product-price { font-size: 15px; font-weight: 700; color: var(--navy); }
.product-mrp   { font-size: 11px; color: var(--muted); text-decoration: line-through; margin-left: 4px; }

.color-dots { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.color-dot  {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.1);
}

.load-more-wrap { text-align: center; padding: 20px; }

/* ── Product Detail ── */
.detail-header {
  background: var(--navy); padding: 16px 20px;
  display: flex; align-items: center; gap: 14px; color: #fff;
}
.detail-body { padding: 20px; max-width: 600px; margin: 0 auto; }

.detail-img {
  width: 100%; height: 240px; background: var(--cream);
  border-radius: 14px; display: flex; align-items: center;
  justify-content: center; font-size: 80px; margin-bottom: 20px;
  overflow: hidden;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }

.detail-name  { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.detail-brand { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.detail-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; }
.detail-price { font-size: 26px; font-weight: 700; color: var(--navy); }
.detail-mrp   { font-size: 14px; color: var(--muted); text-decoration: line-through; }
.detail-savings { font-size: 12px; color: var(--green); font-weight: 600; }

.detail-section { margin-bottom: 20px; }
.detail-section-title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px;
}

.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.color-swatch.selected { border-color: var(--navy); transform: scale(1.15); }
.color-swatch:hover    { transform: scale(1.1); }

.size-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.size-btn {
  min-width: 44px; height: 44px; border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--navy);
  font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 0 10px; transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.size-btn.selected { background: var(--navy); color: #fff; border-color: var(--navy); }
.size-btn:hover:not(.selected) { border-color: var(--navy); }
.size-btn.out-of-stock { opacity: 0.35; cursor: not-allowed; }

.stock-badge {
  display: inline-block; padding: 4px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
  margin-bottom: 16px;
}
.stock-ok  { background: var(--green2); color: var(--green); }
.stock-low { background: var(--amber2); color: var(--amber); }
.stock-out { background: var(--red2);   color: var(--red); }

/* ── Salesman Banner ── */
#salesman-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--gold); color: #fff;
  text-align: center; padding: 10px;
  font-size: 13px; font-weight: 600;
  z-index: 200;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .dept-grid    { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px; }
  .products-grid{ grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 12px; }
  .catalog-search { width: 130px; }
}

/* ── Out of stock ── */
.out-of-stock-card { opacity: 0.7; cursor: not-allowed; }
.out-of-stock-card .product-img { position: relative; }
.oos-badge {
  position: absolute; top: 8px; right: 8px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; letter-spacing: 0.3px;
}

/* ── Filter bar ── */
#filter-bar { display: none; }

/* ── Stock badge ── */
.stock-badge {
  display: inline-block; padding: 4px 12px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
  margin-bottom: 14px;
}
.stock-ok  { background: var(--green2); color: var(--green); }
.stock-low { background: var(--amber2); color: var(--amber); }
.stock-out { background: var(--red2);   color: var(--red);   }
