/* ============================================
   SNE'S COLLECTION — App Styles
   Cart, Admin, Modals, Badges, Toast
   ============================================ */

/* ---- CART BADGE ---- */
.cart-btn-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.cart-badge {
  display: none;
  position: absolute;
  top: -7px;
  right: -8px;
  background: #000;
  color: #fff;
  border-radius: 9999px;
  font-size: 10px;
  font-family: 'Manrope', sans-serif;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  pointer-events: none;
  border: 2px solid #fbf9f9;
}

/* ---- CART MODAL ---- */
#cart-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
#cart-modal.open {
  pointer-events: all;
}
#cart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s ease;
  cursor: pointer;
}
#cart-modal.open #cart-backdrop {
  background: rgba(0,0,0,0.5);
}
#cart-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 100%;
  max-width: 440px;
  background: #fbf9f9;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -4px 0 32px rgba(0,0,0,0.12);
}
#cart-modal.open #cart-panel {
  transform: translateX(0);
}
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 24px;
  border-bottom: 1px solid #c4c7c7;
  flex-shrink: 0;
}
#cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
}
.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid #c4c7c7;
  flex-shrink: 0;
  background: #fbf9f9;
}

/* ---- TOAST ---- */
#cart-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #000;
  color: #fff;
  padding: 12px 24px;
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  white-space: nowrap;
}
#cart-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- LOGIN MODAL ---- */
#login-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
}
#login-modal.open {
  display: flex;
}
.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  cursor: pointer;
}
.login-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  padding: 40px;
  background: #fbf9f9;
}

/* ---- ADD PRODUCT MODAL ---- */
#add-product-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
}
#add-product-modal.open {
  display: flex;
}
.add-product-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  cursor: pointer;
}
.add-product-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin: 20px;
  padding: 40px;
  background: #fbf9f9;
  max-height: 90vh;
  overflow-y: auto;
}

/* ---- ADMIN MODE ---- */
body.admin-mode .admin-only {
  display: flex !important;
}
.admin-only {
  display: none !important;
}
.admin-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 100;
  display: none;
  width: 56px;
  height: 56px;
  background: #000;
  color: #fff;
  border-radius: 9999px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-family: 'Material Symbols Outlined';
  font-size: 24px;
}
body.admin-mode .admin-fab {
  display: flex;
}
.admin-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(0,0,0,0.35);
}
.product-admin-bar {
  display: none;
  gap: 8px;
  padding: 8px 0 0;
}
body.admin-mode .product-admin-bar {
  display: flex;
}
.sale-ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #000;
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  text-transform: uppercase;
}

/* ---- UTIL ---- */
body.overflow-hidden {
  overflow: hidden;
}

/* Admin login button in nav */
#admin-nav-btn {
  font-size: 11px;
  font-family: 'Manrope', sans-serif;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  color: #747878;
  transition: color 0.2s;
  border: none;
  background: none;
  padding: 0;
}
#admin-nav-btn:hover { color: #000; }

@media (max-width: 640px) {
  .login-panel, .add-product-panel { padding: 28px 20px; }
  #cart-panel { max-width: 100%; }
}
