/* Mobile-First Premium Shopee Storefront & Admin Styles */
:root {
  --primary: #ee4d2d;
  --primary-dark: #d73211;
  --primary-light: #ff7354;
  --secondary: #ffb703;
  --bg-dark: #0f1115;
  --bg-color: #f4f5f7;
  --card-bg: #ffffff;
  --text-main: #1a1a1a;
  --text-sub: #666666;
  --border-color: #e5e7eb;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(238, 77, 45, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.4;
  padding-bottom: 90px;
  overflow-x: hidden;
}

/* Mobile Header Navbar */
.app-header {
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  padding: 10px 15px;
}

.header-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-weight: 900;
  font-size: 19px;
  text-decoration: none;
}

.admin-nav-btn {
  background: #111;
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Search Input */
.mobile-search-wrap {
  max-width: 600px;
  margin: 10px auto 0 auto;
  position: relative;
}

.mobile-search-wrap input {
  width: 100%;
  padding: 10px 38px 10px 15px;
  border: 2px solid var(--primary-light);
  border-radius: 25px;
  outline: none;
  font-size: 13px;
}

.mobile-search-wrap button {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
}

/* Category Slider */
.mobile-cats {
  max-width: 600px;
  margin: 15px auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 15px 5px 15px;
  scrollbar-width: none;
}

.cat-btn {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: #444;
  cursor: pointer;
}

.cat-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Mobile Product Grid */
.mobile-grid-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 12px;
}

.grid-two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 360px) {
  .grid-two-col {
    grid-template-columns: 1fr;
  }
}

.mobile-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  border: 1px solid #eaeaea;
  display: flex;
  flex-direction: column;
  position: relative;
}

.badge-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 2;
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fafafa;
  overflow: hidden;
  position: relative;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: #222;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 34px;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
}

.card-price {
  color: var(--primary);
  font-size: 16px;
  font-weight: 900;
}

.card-old-price {
  color: #999;
  font-size: 11px;
  text-decoration: line-through;
}

.btn-buy-now {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 10px 8px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 4px 10px rgba(238, 77, 45, 0.3);
  text-align: center;
}

.btn-buy-now:active {
  transform: scale(0.97);
}

/* MOBILE OPTIMIZED DIRECT CARD (CHUYỂN HƯỚNG TRỰC TIẾP TRÊN ĐIỆN THOẠI) */
.mobile-direct-page {
  background: #0d0f12;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
}

.mobile-direct-card {
  color: #222;
  max-width: 420px;
  width: 100%;
  border-radius: 20px;
  padding: 22px 18px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
  border: 1px solid rgba(255,255,255,0.3);
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.mobile-direct-img {
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 16px;
  margin: 0 auto 12px auto;
  border: 3px solid var(--primary);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.mobile-direct-title {
  font-size: 17px;
  font-weight: 800;
  color: #111;
  margin-bottom: 8px;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(255,255,255,0.8), 0 0 10px rgba(255,255,255,0.9);
}

.mobile-direct-price {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 12px;
  text-shadow: 0 1px 4px rgba(255,255,255,0.8), 0 0 10px rgba(255,255,255,0.9);
}

.ad-countdown-box {
  background: linear-gradient(135deg, #1a1a1a 0%, #2b2b2b 100%);
  color: white;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid #ff7354;
}

.timer-num {
  font-size: 38px;
  font-weight: 900;
  color: var(--secondary);
  margin: 5px 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.btn-buy-dynamic {
  background: linear-gradient(135deg, #ee4d2d 0%, #d73211 100%);
  color: white;
  font-size: 16px;
  font-weight: 900;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(238, 77, 45, 0.45);
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-buy-dynamic:active {
  transform: scale(0.98);
}

/* ADMIN PANEL STYLES */
.admin-container {
  max-width: 800px;
  margin: 20px auto;
  padding: 0 15px;
}

.admin-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.admin-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #111;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 5px;
  color: #333;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 5px rgba(238, 77, 45, 0.3);
}

.btn-admin-submit {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  width: 100%;
}

.admin-item-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #eee;
}

.admin-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-item-info img {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
}

.admin-actions {
  display: flex;
  gap: 6px;
}

.btn-edit {
  background: #007bff;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.btn-del {
  background: #dc3545;
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}



.mobile-direct-card::before, .ad-modal-content::before {
  content: "";
  position: absolute;
  top: -30px; left: -30px; right: -30px; bottom: -30px;
  background-image: var(--card-bg-img);
  background-size: cover;
  background-position: center;
  filter: blur(3px);
  z-index: -2;
}
.mobile-direct-card::after, .ad-modal-content::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 255, 255, 0.2);
  z-index: -1;
}

/* FOMO Fake Sales Notification Toast */
.fomo-toast {
  position: fixed;
  bottom: 20px;
  left: 15px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid #ffe0d0;
  box-shadow: 0 8px 24px rgba(238, 77, 45, 0.25);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
  max-width: 320px;
  pointer-events: none;
}
.fomo-toast.show {
  transform: translateY(0);
  opacity: 1;
}
.fomo-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff9900, #ee4d2d);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(238, 77, 45, 0.3);
}
.fomo-content {
  font-size: 12px;
  color: #333;
  line-height: 1.4;
  text-shadow: none;
}
.fomo-title {
  font-weight: 700;
  color: #111;
}
.fomo-product {
  color: #ee4d2d;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.fomo-time {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
}
