/* ==========================================================================
   Modern storefront theme for django-oscar (Bootstrap 4 + Oscar markup)
   PURE DECORATION ONLY — no body/container display/flex/max-width changes,
   so the Bootstrap grid and Oscar layout flow stay intact.
   ========================================================================== */

:root {
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #eceef1;
  --bg: #f6f7f9;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(17, 24, 39, .06), 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-hover: 0 14px 34px rgba(17, 24, 39, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

/* Font + base colours only (does NOT touch layout flow) */
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
a { color: var(--brand); transition: color .15s ease; }
a:hover { color: var(--brand-dark); text-decoration: none; }

/* ---------- Header & navigation (colour only) ---------- */
.navbar-light.bg-light.accounts {
  background: #fff !important;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
  min-height: 42px;
}
.navbar-light.bg-light.accounts .navbar-nav > li > a,
.navbar-light.bg-light.accounts a { color: var(--muted); }
.navbar-light.bg-light.accounts a:hover { color: var(--brand); }

.navbar-dark.bg-dark {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-dark) 100%) !important;
  border: none;
  box-shadow: var(--shadow);
}
.navbar-dark.bg-dark .navbar-brand {
  font-weight: 800;
  letter-spacing: .3px;
  font-size: 1.4rem;
}
.navbar-dark.bg-dark .navbar-brand:hover { color: #fff; }
.navbar-dark.bg-dark .nav-link,
.navbar-dark.bg-dark .navbar-nav > li > a { color: rgba(255, 255, 255, .9); }
.navbar-dark.bg-dark .navbar-nav > li > a:hover,
.navbar-dark.bg-dark .nav-link:hover { color: #fff; }
.navbar-dark.bg-dark .dropdown-menu {
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: var(--shadow-hover);
}

/* search box */
.navbar-dark.bg-dark .input-group .form-control,
.navbar-dark.bg-dark input[type="text"],
.navbar-dark.bg-dark input[type="search"] {
  border: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important;
  padding: .5rem 1rem;
  box-shadow: none;
}
.navbar-dark.bg-dark .input-group-append .btn,
.navbar-dark.bg-dark .btn.search {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
  background: rgba(255, 255, 255, .18);
  border: none;
  color: #fff;
}
.navbar-dark.bg-dark .btn.search:hover { background: rgba(255, 255, 255, .3); }

/* ---------- Page header polish ---------- */
.page-header {
  border: none;
  margin: 0 0 28px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
}
.page-header h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.page-header .rss-header, .page-header small { color: var(--muted); }

/* ---------- Product grid (category / search) ---------- */
/* Use a normal flex column (NOT Oscar's absolute-positioned price). The key
   fix: force .product_price back into normal flow with `position: static` so
   it stops behaving as Oscar's `position:absolute` overlay that drifts on top
   of the title. margin-top:auto pins the price/button to the card bottom. */
.product_pod {
  display: flex;
  flex-direction: column;
  height: 100%;            /* equal-height cards (Bootstrap 4 .row is flex) */
  text-align: center;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.product_pod:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: #dfe3ea;
}
.product_pod .image_container {
  height: 165px;            /* mirrors Oscar $image-container-height */
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Subtle solid fill behind every product image (real or missing). The
     explicit .no-image-placeholder element below draws the icon for imageless
     products, so we keep this as a plain colour to avoid a double icon. */
  background: #f8fafc;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.product_pod .image_container img { color: transparent; }
.product_pod .image_container .img-thumbnail {
  border: none;
  padding: 0;
  background: none;
  border-radius: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  min-width: 0;             /* allow flex item to shrink inside the card */
  object-fit: contain;
  transition: transform .4s ease;
}
.product_pod:hover .image_container .img-thumbnail { transform: scale(1.06); }
/* Clean neutral placeholder for products that have no image at all. Renders
   instead of Oscar's generic "image_not_found.jpg" so the card looks
   intentional and on-brand. */
.product_pod .image_container .no-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  color: #94a3b8;
  text-decoration: none;
}
.product_pod .image_container .no-image-placeholder svg { color: #cbd5e1; }
.product_pod .image_container .no-image-placeholder span {
  font-size: .8rem;
  color: #94a3b8;
  letter-spacing: .02em;
}
.product_pod h3 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 4px 0 8px;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product_pod h3 a { color: var(--ink); }
.product_pod h3 a:hover { color: var(--brand); }
.product_pod .star-rating { color: #f5a623; font-size: .8rem; margin-bottom: 6px; }
/* KEY: undo Oscar's `position: absolute` on .product_price so it lives in the
   flex column and pins to the card bottom via margin-top:auto (no overlap). */
.product_pod .product_price {
  position: static;
  margin-top: auto;
  display: flex;
  flex-direction: column;
}
.product_pod .price_color {
  color: var(--brand);
  font-weight: 700;
  font-size: 1.15rem;
}
/* The compact add-to-basket form has no class, so target it generically and
   let it span the full card width; the inner .btn-block button then fills it. */
.product_pod .product_price form { width: 100%; margin-top: 10px; }
.product_pod .product_price .btn-block { width: 100%; white-space: nowrap; }

/* ---------- Product detail ---------- */
.single-product .product_pod,
.product_gallery {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.product_main .price_color {
  color: var(--brand);
  font-weight: 800;
  font-size: 1.8rem;
  display: inline-block;
  margin: 6px 0 14px;
}
.product_main .instock.availability { color: #16a34a; font-weight: 600; }
.product_main .instock.availability::before { content: "● "; }
.add-to-basket .btn { width: 100%; }

/* ---------- Buttons (colour only) ---------- */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  padding: .55rem 1.1rem;
  transition: all .15s ease;
}
.btn-primary,
.btn-info {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
}
.btn-primary:hover, .btn-info:hover {
  background: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
}
.btn-default, .btn-secondary {
  background: #fff !important;
  border-color: var(--line) !important;
  color: var(--ink) !important;
}
.btn-default:hover, .btn-secondary:hover {
  border-color: var(--brand) !important;
  color: var(--brand) !important;
}
.btn-lg { padding: .8rem 1.6rem; font-size: 1.05rem; }

/* ---------- Basket mini ---------- */
.basket-mini { font-size: .9rem; }
.basket-mini .btn { border-radius: 999px; }

/* ---------- Cards / panels / wells ---------- */
.panel, .card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-heading, .card-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.well {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* ---------- Footer (colour only) ---------- */
.footer {
  background: #fff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--brand); }

/* ---------- Misc polish ---------- */
.badge { border-radius: 999px; }
.table { background: #fff; }
.form-control { border-radius: var(--radius-sm); }
.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .15rem rgba(79, 70, 229, .2);
}
.pagination > li > a, .pagination > li > span {
  border-radius: var(--radius-sm);
  margin: 0 2px;
}

/* ---------- 语言切换 (EN / 中文 双按钮) ---------- */
.lang-switch .lang-btn {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .3px;
  padding: .3rem .7rem;
}
.lang-switch .lang-btn.active {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
  color: #fff !important;
  box-shadow: none;
}

/* ---------- 演示站点角标 (DEMO badge) ----------
   固定右下角，高 z-index，不拦截点击 (pointer-events:none)。 */
.demo-badge {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: linear-gradient(120deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .5px;
  padding: 7px 16px;
  border-top-left-radius: 10px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, .35);
  pointer-events: none;
  user-select: none;
}
.demo-badge::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #fff;
  vertical-align: middle;
  animation: demo-badge-pulse 1.6s ease-in-out infinite;
}
@keyframes demo-badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.7); }
}
