/* Apple Designer x ACG Style Overlay */

:root {
  /* Premium Pastel Palette */
  --acg-primary: #5c7cfa; /* Soft Royal Blue */
  --acg-primary-sub: rgba(92, 124, 250, 0.15);
  --acg-secondary: #cc5de8; /* Soft Purple */
  --acg-danger: #ff6b6b;
  --acg-success: #51cf66;

  /* Text Colors */
  --acg-text-main: #1d1d1f; /* Apple Near Black */
  --acg-text-secondary: #86868b; /* Apple Grey */

  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: 24px;
  --glass-shadow: 0 18px 48px -12px rgba(0, 0, 0, 0.06);

  /* Layout */
  --card-radius: 24px;
  --btn-radius: 999px;
}

html {
  font-size: 14px; /* Slightly larger base */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  color: var(--acg-text-main);
  background-image: url("/assets/admin/images/login/bg.jpg"); /* Keep original bg but can be overridden */
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  min-height: 100vh;
  /* Add a subtle overlay to ensure text readability better than linear-gradient */
  position: relative;
}

/* Global Image Reset */
img {
  max-width: 100%;
  height: auto;
}

/* Overlay for better contrast */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(245, 245, 247, 0.45); /* Apple light grey tint */
  backdrop-filter: blur(10px); /* Blur background image for focus on content */
  z-index: -1;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ================= Navbar ================= */
.navbar-acg {
  background: rgba(255, 255, 255, 0.85); /* Frosty */
  backdrop-filter: saturate(180%) blur(var(--glass-blur));
  -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand span {
  font-weight: 700;
  background: linear-gradient(135deg, var(--acg-primary), var(--acg-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.navbar-acg .nav-link {
  color: var(--acg-text-secondary);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--btn-radius);
  transition: all 0.2s;
}

.navbar-acg .nav-link:hover,
.navbar-acg .nav-link.active {
  color: var(--acg-text-main);
  background: rgba(0, 0, 0, 0.04);
}

.nav-icon {
  margin-right: 6px;
}

.brand-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
}

/* Search Input */
.search-input .input-group {
  background: rgba(118, 118, 128, 0.12); /* Apple Search Field Grey */
  border-radius: 12px;
  border: none;
  overflow: hidden;
  transition: background 0.2s;
}

.search-input .input-group:focus-within {
  background: #fff;
  box-shadow: 0 0 0 4px rgba(92, 124, 250, 0.2);
}

.search-input .input-group-text,
.search-input .form-control {
  background: transparent;
  border: none;
  color: var(--acg-text-main);
}

.search-input .input-group-text {
  color: var(--acg-text-secondary);
  padding-right: 0;
}

.search-input .form-control:focus {
  box-shadow: none;
  background: transparent;
}

/* User Dropdown */
.user-info-box .btn-link {
  color: var(--acg-text-main);
  text-decoration: none;
}

.user-info-box img {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-menu {
  border: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  overflow: hidden;
  padding: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
}

.dropdown-item {
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 500;
}

.dropdown-item:hover {
  background: var(--acg-primary-sub);
  color: var(--acg-primary);
}

/* ================= Panels ================= */
.panel {
  background: var(--glass-bg);
  backdrop-filter: saturate(180%) blur(var(--glass-blur));
  -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--card-radius);
  box-shadow: var(--glass-shadow);
  margin-bottom: 32px;
  padding: 32px;
  transition: transform 0.3s ease;
}

.panel-header {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.panel-header .icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #fff, #f0f0f0);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: var(--acg-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  font-size: 1.2rem;
}

.panel-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(
    135deg,
    var(--acg-text-main),
    var(--acg-text-secondary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================= Chip List ================= */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: var(--btn-radius);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.05);
  font-weight: 600;
  color: var(--acg-text-secondary);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Spring effect */
  cursor: pointer;
  font-size: 0.95rem;
}

.chip:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  background: #fff;
  color: var(--acg-text-main);
}

.chip.is-primary {
  background: var(--acg-text-main); /* Black pill for selected */
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  border-color: transparent;
}

.chip-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-right: 8px;
  background-color: #eee;
}

/* ================= Goods Card ================= */
.acg-card {
  background: #fff;
  border-radius: var(--card-radius);
  border: none;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.acg-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.12);
}

.acg-thumb {
  height: 180px;
  width: 100%;
  object-fit: cover;
  background-color: #f5f5f7;
  transition: transform 0.6s ease;
}

.acg-card:hover .acg-thumb {
  transform: scale(1.05);
}

.item-cover {
  width: 100%;
  object-fit: cover;
  border-radius: var(--card-radius);
}

.acg-card .p-3 {
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.goods-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--acg-text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  font-size: 0.85rem;
  color: var(--acg-text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--acg-primary);
  margin-top: auto;
  display: flex;
  align-items: baseline;
}

.price .unit {
  font-size: 1rem;
  margin-right: 2px;
}

.stat-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge-soft {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-soft-primary {
  background: var(--acg-primary-sub);
  color: var(--acg-primary);
}
.badge-soft-success {
  background: rgba(81, 207, 102, 0.15);
  color: var(--acg-success);
}
.badge-soft-danger {
  background: rgba(255, 107, 107, 0.15);
  color: var(--acg-danger);
}
.badge-soft-muted {
  background: rgba(0, 0, 0, 0.05);
  color: var(--acg-text-secondary);
}

/* Soldout */
.acg-card.soldout {
  opacity: 0.7;
  filter: grayscale(1);
}
.acg-card.soldout:hover {
  transform: none;
  box-shadow: none;
}
.soldout-ribbon {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

/* ================= Detail/Checkout (Overlay Style) ================= */
.item-detail {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: var(--glass-shadow);
}

/* SKU & Inputs */
.sku {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  color: var(--acg-text-secondary);
  transition: all 0.2s;
  position: relative;
  font-size: 0.95rem;
}

.sku:hover,
.sku.is-primary {
  border-color: var(--acg-primary);
  color: var(--acg-primary);
  background: var(--acg-primary-sub);
}

.sku .badge-money {
  background: var(--acg-danger);
  color: white;
  border-radius: 99px;
  padding: 2px 6px;
  font-size: 10px;
  position: absolute;
  top: -8px;
  right: -8px;
  box-shadow: 0 2px 6px rgba(255, 107, 107, 0.4);
}

.qty-group {
  background: #f5f5f7;
  border-radius: 12px;
  padding: 4px;
  border: none;
  box-shadow: none;
}

.qty-group button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #fff;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  color: var(--acg-text-main);
  font-weight: bold;
}

.price-display {
  text-align: right;
}

/* Payment Methods */
.cash-pay {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.pay-list .pay {
  border: 1px solid rgba(0, 0, 0, 0.08); /* Minimal border */
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.pay-list .pay img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.pay-list .pay:hover {
  border-color: var(--acg-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(92, 124, 250, 0.15);
}

.pay-list .pay.selected,
.pay-list .pay.active {
  border-color: var(--acg-primary);
  background: var(--acg-primary-sub);
  color: var(--acg-primary);
}

.pay-list .pay span {
  font-weight: 600;
}

/* Captcha */
.captcha-input {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
  border-right: none;
}

.captcha-img {
  border-bottom-left-radius: 0;
  border-top-left-radius: 0;
  border-left: none;
  padding: 0;
  height: 100%;
  cursor: pointer;
  margin-left: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .panel {
    padding: 20px;
    margin-bottom: 20px;
  }
  .panel-title {
    font-size: 1.25rem;
  }
  .hero-acg {
    padding: 20px;
  }
  .acg-thumb {
    height: 140px;
  }
  .chip {
    padding: 6px 14px;
    font-size: 0.9rem;
  }
}
