/* ==========================================================================
   STYLE.CSS - SHOPEE AFFILIATE WOMEN'S FASHION (BIO TIKTOK MOBILE FIRST)
   Palettes: White, Pastel Pink, Soft Rose & Warm Beige
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-main: #fff8f9;
  --bg-card: #ffffff;
  --bg-beige: #fbf7f4;
  --bg-pink-light: #fff0f3;
  --bg-pink-soft: #ffe3e8;

  --primary-pink: #ff758c;
  --primary-rose: #ff4d6d;
  --primary-dark: #c9184a;
  
  --shopee-orange: #ee4d2d;
  --shopee-grad: linear-gradient(135deg, #ff5722 0%, #ee4d2d 100%);
  --pink-grad: linear-gradient(135deg, #ff758c 0%, #ff4d6d 100%);
  --gold-star: #ffb703;

  --text-main: #2b2024;
  --text-sub: #78656d;
  --text-muted: #a3959c;

  --border-pink: #ffd6ff;
  --shadow-sm: 0 4px 12px rgba(255, 117, 140, 0.08);
  --shadow-md: 0 8px 24px rgba(255, 77, 109, 0.12);
  --shadow-float: 0 12px 32px rgba(238, 77, 45, 0.2);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
}

/* Reset & Universal Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f5f0ed;
  color: var(--text-main);
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0;
}

/* Mobile App Wrapper - Fits nicely on mobile viewports & centers on desktop */
.app-container {
  width: 100%;
  max-width: 480px; /* TikTok Bio mobile standard frame size max width */
  min-height: 100vh;
  background-color: var(--bg-main);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow-x: hidden;
  padding-bottom: 80px;
}

/* Header & Bio Section */
.bio-header {
  background: linear-gradient(180deg, #ffe3e8 0%, #fff8f9 100%);
  padding: 24px 16px 16px 16px;
  text-align: center;
  position: relative;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.avatar-wrapper {
  position: relative;
  width: 86px;
  height: 86px;
  margin: 0 auto 12px auto;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffffff;
  box-shadow: var(--shadow-md);
  background-color: #fff0f3;
}

.verified-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--primary-rose);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  border: 2px solid #ffffff;
}

.bio-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.bio-tagline {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 12px;
  line-height: 1.4;
}

.bio-tagline span {
  display: inline-block;
  background: rgba(255, 117, 140, 0.12);
  color: var(--primary-rose);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.78rem;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid rgba(255, 117, 140, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.social-btn:active {
  transform: scale(0.96);
  background: var(--bg-pink-light);
}

.social-btn.shopee-badge {
  background: var(--shopee-grad);
  color: #ffffff;
  border: none;
}

/* Sticky Navigation & Search Container */
.sticky-controls {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 248, 249, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px 8px 16px;
  border-bottom: 1px solid rgba(255, 117, 140, 0.1);
}

/* Search Bar */
.search-box {
  position: relative;
  margin-bottom: 10px;
}

.search-input {
  width: 100%;
  padding: 12px 42px 12px 40px;
  background: #ffffff;
  border: 1.5px solid #ffe0e6;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--primary-pink);
  box-shadow: 0 0 0 3px rgba(255, 117, 140, 0.2);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-pink);
  font-size: 1rem;
  pointer-events: none;
}

.clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-pink-light);
  color: var(--primary-rose);
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.clear-search.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Category Filter Tabs (Horizontal Scroll) */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE */
}

.category-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.tab-btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #ffe3e8;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tab-btn.active {
  background: var(--pink-grad);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 77, 109, 0.25);
  transform: translateY(-1px);
}

/* Main Content Area */
.main-content {
  padding: 16px;
}

/* Featured Carousel Section */
.featured-section {
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title i {
  color: var(--primary-rose);
}

.item-count {
  font-size: 0.78rem;
  color: var(--text-sub);
  font-weight: 500;
}

/* Featured Banner Card */
.featured-card {
  background: linear-gradient(135deg, #fff0f3 0%, #ffe3e8 100%);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid #ffd6ff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
}

.featured-card-img {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.featured-info {
  flex: 1;
}

.featured-badge {
  display: inline-block;
  background: var(--shopee-grad);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.featured-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-price-group {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.featured-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.featured-old-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Products Grid System - 2 COLUMNS ON MOBILE REQUIRED */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns strictly on mobile */
  gap: 12px;
}

/* Screen Size Specific Tweaks (320px, 375px, 390px, 430px) */
@media (max-width: 350px) {
  /* Extra small screens like 320px */
  .products-grid {
    gap: 8px;
  }
  .product-title {
    font-size: 0.78rem;
  }
  .btn-shopee {
    font-size: 0.72rem;
    padding: 7px 4px;
  }
  .bio-header {
    padding: 16px 12px;
  }
}

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

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

.product-card:active {
  transform: scale(0.98);
}

/* Image Container & Badges */
.card-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio square image */
  background: var(--bg-pink-light);
  overflow: hidden;
}

.card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.discount-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(238, 77, 45, 0.92);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
}

.tag-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 117, 140, 0.95);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

/* Card Body */
.card-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 6px;
  height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rating & Sales */
.meta-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.rating-box {
  display: flex;
  align-items: center;
  gap: 3px;
  color: var(--gold-star);
  font-weight: 700;
}

.sold-text {
  color: var(--text-muted);
}

/* Price Section */
.price-container {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 10px;
  margin-top: auto; /* Push price & button to bottom */
}

.current-price {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.original-price {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Shopee Affiliate Button */
.btn-shopee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px 6px;
  background: var(--shopee-grad);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none;
  box-shadow: 0 4px 10px rgba(238, 77, 45, 0.25);
  transition: all 0.2s ease;
  cursor: pointer;
}

.btn-shopee:active {
  transform: scale(0.96);
  opacity: 0.95;
}

.shopee-icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Empty State / Not Found */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  grid-column: 1 / -1;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.7;
}

.empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-sub {
  font-size: 0.82rem;
  color: var(--text-sub);
}

/* Floating Action / Bio TikTok Banner Bottom */
.floating-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-top: 1px solid #ffe3e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
  box-shadow: var(--shadow-float);
}

.footer-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-info img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

/* Contact & Bio Banner Card at Bottom */
.contact-card-section {
  margin-top: 28px;
  margin-bottom: 16px;
}

.bio-deal-banner {
  background: linear-gradient(135deg, #ffffff 0%, #fff0f3 100%);
  border: 1.5px solid #ffe3e8;
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.deal-heart-icon {
  width: 44px;
  height: 44px;
  background: var(--pink-grad);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin: 0 auto 10px auto;
  box-shadow: 0 6px 16px rgba(255, 77, 109, 0.3);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.deal-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.deal-subtext {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-bottom: 16px;
}

.contact-info-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #ffd6ff;
  border-radius: var(--radius-full);
  color: var(--primary-dark);
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.contact-item:active {
  transform: scale(0.97);
  background: var(--bg-pink-light);
}

.contact-item i {
  color: var(--primary-rose);
}

.author-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255, 117, 140, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  color: var(--text-main);
}

.author-badge i {
  color: var(--primary-rose);
}

.footer-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-sub-info {
  font-size: 0.68rem;
  color: var(--primary-rose);
  font-weight: 700;
}


.btn-share {
  background: var(--bg-pink-light);
  color: var(--primary-rose);
  border: 1px solid rgba(255, 117, 140, 0.3);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-share:active {
  transform: scale(0.94);
}

/* Toast Message */
.toast-msg {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: rgba(43, 32, 36, 0.92);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 2000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 6px;
}

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