:root {
  --bg-primary: #E9E3DF;
  --bg-secondary: #DFD7D1;
  --card-bg: #FFFFFF;
  --card-subtle: #F7F4F1;
  --text-main: #242220;
  --text-muted: #756F69;
  --text-light: #9B948E;
  --accent: #262423;
  --accent-hover: #000000;
  --pill-bg: #DCD3CC;
  --pill-active-bg: #262423;
  --pill-active-text: #FFFFFF;
  --border-color: #D6CBC4;
  --badge-bg: #EAE1D9;
  --badge-text: #5A4E46;
  --tag-bg: #E8F3EE;
  --tag-text: #2C6B52;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  line-height: 1.5;
}

.app-wrapper {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 18px 40px 18px;
}

/* Header & Profile */
.header-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.avatar-wrapper {
  position: relative;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #D4C5BB 0%, #F5ECE6 50%, #C4B2A5 100%);
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  display: block;
  background-color: var(--card-subtle);
}

.avatar-badge {
  position: absolute;
  bottom: 4px;
  right: 6px;
  background-color: #262423;
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid #E9E3DF;
}

.profile-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-main);
  margin-bottom: 4px;
}

.profile-subtitle {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.social-links {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-secondary);
  color: var(--text-main);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.social-btn:hover {
  background: #262423;
  color: #fff;
  border-color: #262423;
}

/* Search Bar */
.search-container {
  position: relative;
  width: 100%;
  margin-bottom: 18px;
}

.search-bar {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  border-radius: 30px;
  padding: 6px 8px 6px 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-bar:focus-within {
  border-color: var(--text-main);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
}

.search-bar input::placeholder {
  color: var(--text-light);
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 14px;
  padding: 6px;
  cursor: pointer;
  display: none;
}

.search-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-btn:hover {
  background: var(--accent-hover);
}

/* Categories Filter */
.categories-scroll {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 20px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.categories-list {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.category-pill {
  border: none;
  background: var(--pill-bg);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.category-pill:hover {
  background: #cfc5bd;
}

.category-pill.active {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Products Count / Info bar */
.results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 14px;
  padding: 0 4px;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
}

/* Product Card */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--card-subtle);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .card-media img {
  transform: scale(1.04);
}

.code-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(38, 36, 35, 0.88);
  backdrop-filter: blur(4px);
  color: #FFFFFF;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.tag-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.card-content {
  padding: 12px 10px 14px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-category {
  font-size: 10.5px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-weight: 600;
}

.card-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 35px;
}

.card-price {
  font-size: 14px;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 12px;
}

.card-actions {
  margin-top: auto;
  display: flex;
  gap: 6px;
}

.btn-buy {
  flex: 1;
  background: var(--accent);
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-buy:hover {
  background: #000000;
}

.btn-copy {
  background: var(--card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: var(--bg-secondary);
  color: var(--text-main);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-color);
}

.empty-state i {
  font-size: 38px;
  color: var(--text-light);
  margin-bottom: 14px;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

/* Footer */
.footer-section {
  margin-top: auto;
  padding-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.5);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.footer-admin-link {
  font-size: 11px;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.footer-admin-link:hover {
  color: var(--text-main);
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #242220;
  color: #FFFFFF;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Desktop optimization */
@media (min-width: 600px) {
  .app-wrapper {
    max-width: 620px;
  }
  .products-grid {
    gap: 16px;
  }
}
