/* =============================
   POPBRIZ Kilimall-Inspired Product Cards - Guaranteed Visibility
   ============================= */

/* Reset + Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #2d3748;
  overflow-x: hidden;
  line-height: 1.5;
}

/* =============================
   Category Section
   ============================= */
.category-section {
  margin: 1rem 0;
  padding: 0 1rem;
  position: relative;
}

.category-section.general-category {
  margin-top: 0;
  padding-top: 1rem;
  border-radius: 12px;
  border: 2px solid #ffa500;
}

/* Category Header with View All Button INSIDE the title box */
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  position: relative;
}

.category-title-wrapper {
  background: #ffffff;
  border-radius: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #ff6600;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  position: relative;
}

.category-section.general-category .category-title-wrapper {
  border-left: 4px solid #ff8c00;
  box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
}

.category-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.category-section.general-category .category-title {
  color: #fc9002;
}

.category-icon {
  font-size: 1rem;
  color: #ffd700;
}

.category-subtext {
  font-size: 0.95rem;
  color: #ff0000;
  margin: -0.25rem 0 0 0;
  font-style: italic;
  letter-spacing: 0.4px;
  position: absolute;
  bottom: -1.25rem;
  left: 1.75rem;
}

.category-section.general-category .category-subtext {
  color: #ff6600;
  font-weight: 500;
}

/* View All Button - INSIDE the category title box at far end */
.view-all-btn {
  background: linear-gradient(135deg, #ff6600, #ff8c00);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 0.5rem;
}

.view-all-btn:hover {
  background: linear-gradient(135deg, #ff8c00, #ff6600);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4);
}

.view-all-btn:active {
  transform: translateY(0);
}

.category-section.general-category .view-all-btn {
  background: linear-gradient(135deg, #ffa500, #ff8c00);
}

.category-section.general-category .view-all-btn:hover {
  background: linear-gradient(135deg, #ff8c00, #ffa500);
}

/* =============================
   Wrapper Container
   ============================= */
.wrapper-container {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 0.5rem;
}

.category-section.general-category .wrapper-container {
  padding: 0.5rem;
}

/* Scrollable Row */
.wrapper-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 1rem 0.25rem;
  scrollbar-width: none;
  width: 100%;
  position: relative;
}

.wrapper-scroll::-webkit-scrollbar {
  display: none;
}

.category-section.general-category .wrapper-scroll {
  padding: 0.5rem 0.25rem;
}

/* =============================
   Scroll Buttons - Always Visible
   ============================= */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: #ffffff;
  border: 2px solid #ff6600;
  color: #ff6600;
  font-size: 1.25rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
}

.scroll-btn.prev-btn {
  left: -20px;
}

.scroll-btn.next-btn {
  right: -20px;
}

.scroll-btn:hover {
  background: #ff6600;
  color: white;
  transform: translateY(-50%) scale(1.05);
}

.category-section.general-category .scroll-btn {
  border-color: #ffa500;
  color: #ffa500;
}

.category-section.general-category .scroll-btn:hover {
  background: #ffa500;
  color: white;
}

/* =============================
   Product Card - Guaranteed Content Visibility
   ============================= */
.product-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  min-width: 200px;
  height: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #ff6600;
  box-shadow: 0 6px 20px rgba(255, 102, 0, 0.15);
}

.category-section.general-category .product-card {
  border: 1px solid #ffe0b2;
  box-shadow: 0 3px 12px rgba(255, 165, 0, 0.1);
}

.category-section.general-category .product-card:hover {
  border-color: #ffa500;
  box-shadow: 0 6px 20px rgba(255, 165, 0, 0.2);
}

/* =============================
   Product Image (Strict 3/4 Height)
   ============================= */
.product-image {
  position: relative;
  width: 100%;
  height: 180px; /* 3/4 of 240px */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.category-section.general-category .product-image {
  background: #fff8e1;
}

/* =============================
   Tags - Always Visible
   ============================= */
.tag {
  position: absolute;
  top: 1px;
  left: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  color: #ffffff;
  text-transform: uppercase;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  line-height: 1;
}

.tag.free {
  background: #10b981;
}

.tag.premium {
  background: #ff6600;
}

.category-section.general-category .tag.premium {
  background: #ffa500;
}

/* =============================
   Product Info (Strict 1/4 Height) - GUARANTEED VISIBILITY
   ============================= */
.product-info {
  height: 140px; /* 1/4 of 320px */
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  flex-shrink: 0;
  min-height: 140px; /* Ensure minimum height */
}

.category-section.general-category .product-info {
  background: #fffdf6;
}

/* Product Name - Always Visible */
.product-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #000000;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3rem;
  margin-bottom: 0.4rem;
  word-wrap: break-word;
}

/* Ratings - Always Visible */
.rating {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.4rem;
  flex-shrink: 0;
}

.star {
  color: #ffc107;
  font-size: 0.8rem;
  line-height: 1;
}

.star.filled {
  color: #ffc107;
}

.rating-count {
  font-size: 0.75rem;
  color: #64748b;
  margin-left: 0.4rem;
  font-weight: 500;
  line-height: 1;
}

/* Price - Always Visible */
.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: #ff6600;
  margin-top: auto;
  line-height: 1.2;
  flex-shrink: 0;
}

.product-price.free-text {
  color: #059669;
}

.product-price.premium-text {
  color: #ff6600;
  font-style: italic;
}

.category-section.general-category .product-price {
  color: #ff8c00;
}

.category-section.general-category .product-price.premium-text {
  color: #ff8c00;
}

/* =============================
   Responsive Design - GUARANTEED VISIBILITY ON ALL SCREENS
   ============================= */

/* Large Desktop */
@media (min-width: 1400px) {
  .product-card {
    min-width: 240px;
    height: 360px;
  }
  
  .product-image {
    height: 210px; /* 3/4 of 280px */
  }
  
  .product-info {
    height: 150px; /* 1/4 of 360px */
    min-height: 150px;
    padding: 1rem;
  }
  
  .product-name {
    font-size: 1rem;
    min-height: 2.6rem;
  }
  
  .product-price {
    font-size: 1.1rem;
  }
}

/* Desktop */
@media (max-width: 1399px) and (min-width: 1200px) {
  .product-card {
    min-width: 220px;
    height: 340px;
  }
  
  .product-image {
    height: 195px; /* 3/4 of 260px */
  }
  
  .product-info {
    height: 145px; /* 1/4 of 340px */
    min-height: 145px;
  }
}

/* Tablet Landscape */
@media (max-width: 1199px) and (min-width: 992px) {
  .product-card {
    min-width: 200px;
    height: 320px;
  }
  
  .product-image {
    height: 180px; /* 3/4 of 240px */
  }
  
  .product-info {
    height: 140px; /* 1/4 of 320px */
    min-height: 140px;
  }
  
  .scroll-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  
  .scroll-btn.prev-btn {
    left: -15px;
  }
  
  .scroll-btn.next-btn {
    right: -15px;
  }
}

/* Tablet Portrait */
@media (max-width: 991px) and (min-width: 768px) {
  .category-section {
    padding: 0 0.75rem;
  }
  
  .category-title-wrapper {
    padding: 0.4rem 0.8rem;
  }
  
  .category-title {
    font-size: 1.3rem;
  }
  
  .view-all-btn {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
  }
  
  .category-subtext {
    font-size: 0.9rem;
    bottom: -1.1rem;
    left: 1.5rem;
  }
  
  .product-card {
    min-width: 180px;
    height: 300px;
  }
  
  .product-image {
    height: 170px; /* 3/4 of 226px */
    padding: 10px;
  }
  
  .product-info {
    height: 130px; /* 1/4 of 300px */
    min-height: 130px;
    padding: 0.625rem;
  }
  
  .product-name {
    font-size: 0.85rem;
    min-height: 2.1rem;
  }
  
  .product-price {
    font-size: 0.95rem;
  }
  
  .rating {
    margin-bottom: 0.3rem;
  }
  
  .star {
    font-size: 0.75rem;
  }
  
  .rating-count {
    font-size: 0.7rem;
  }
  
  .scroll-btn {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  
  .scroll-btn.prev-btn {
    left: -12px;
  }
  
  .scroll-btn.next-btn {
    right: -12px;
  }
}

/* Mobile Landscape */
@media (max-width: 767px) and (min-width: 576px) {
  .category-section {
    margin: 1.5rem 0;
    padding: 0 0.5rem;
  }
  
  .category-title-wrapper {
    padding: 0.35rem 0.7rem;
  }
  
  .category-title {
    font-size: 1.15rem;
  }
  
  .view-all-btn {
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
    margin-right: 0.25rem;
  }
  
  .category-subtext {
    font-size: 0.85rem;
    bottom: -1rem;
    left: 1.25rem;
  }
  
  .product-card {
    min-width: 160px;
    height: 280px;
  }
  
  .product-image {
    height: 158px; /* 3/4 of 210px */
    padding: 8px;
  }
  
  .product-info {
    height: 122px; /* 1/4 of 280px */
    min-height: 122px;
    padding: 0.5rem;
  }
  
  .product-name {
    font-size: 0.8rem;
    min-height: 1.9rem;
    margin-bottom: 0.3rem;
  }
  
  .product-price {
    font-size: 0.9rem;
  }
  
  .rating {
    margin-bottom: 0.25rem;
  }
  
  .star {
    font-size: 0.7rem;
  }
  
  .rating-count {
    font-size: 0.65rem;
    margin-left: 0.3rem;
  }
  
  .tag {
    font-size: 0.6rem;
    padding: 3px 6px;
  }
  
  .scroll-btn {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
  
  .scroll-btn.prev-btn {
    left: -10px;
  }
  
  .scroll-btn.next-btn {
    right: -10px;
  }
}

/* Mobile Portrait */
@media (max-width: 575px) and (min-width: 480px) {
  .category-section {
    margin: 1.25rem 0;
    padding: 0 0.5rem;
  }
  
  .category-title-wrapper {
    padding: 0.3rem 0.6rem;
  }
  
  .category-title {
    font-size: 1rem;
  }
  
  .view-all-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    margin-right: 0.2rem;
  }
  
  .category-subtext {
    font-size: 0.8rem;
    bottom: -0.9rem;
    left: 1rem;
  }
  
  .wrapper-scroll {
    gap: 0.75rem;
    padding: 0.75rem 0.25rem;
  }
  
  .product-card {
    min-width: 150px;
    height: 260px;
  }
  
  .product-image {
    height: 146px; /* 3/4 of 195px */
    padding: 6px;
  }
  
  .product-info {
    height: 114px; /* 1/4 of 260px */
    min-height: 114px;
    padding: 0.5rem;
  }
  
  .product-name {
    font-size: 0.78rem;
    min-height: 1.8rem;
    margin-bottom: 0.25rem;
  }
  
  .product-price {
    font-size: 0.85rem;
  }
  
  .rating {
    margin-bottom: 0.2rem;
  }
  
  .tag {
    top: 6px;
    left: 6px;
  }
  
  .scroll-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
  
  .scroll-btn.prev-btn {
    left: -8px;
  }
  
  .scroll-btn.next-btn {
    right: -8px;
  }
}

/* Small Mobile */
@media (max-width: 479px) and (min-width: 360px) {
  .category-section {
    margin: 1rem 0;
    padding: 0 0.25rem;
  }
  
  .category-title-wrapper {
    padding: 0.25rem 0.5rem;
  }
  
  .category-title {
    font-size: 0.9rem;
  }
  
  .view-all-btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.65rem;
    margin-right: 0.15rem;
  }
  
  .category-subtext {
    font-size: 0.75rem;
    bottom: -0.8rem;
    left: 0.75rem;
  }
  
  .wrapper-scroll {
    gap: 0.5rem;
    padding: 0.5rem 0.125rem;
  }
  
  .product-card {
    min-width: 140px;
    height: 240px;
  }
  
  .product-image {
    height: 135px; /* 3/4 of 180px */
    padding: 5px;
  }
  
  .product-info {
    height: 105px; /* 1/4 of 240px */
    min-height: 105px;
    padding: 0.4rem;
  }
  
  .product-name {
    font-size: 0.75rem;
    min-height: 1.6rem;
    margin-bottom: 0.2rem;
  }
  
  .product-price {
    font-size: 0.8rem;
  }
  
  .rating {
    margin-bottom: 0.15rem;
  }
  
  .star {
    font-size: 0.65rem;
  }
  
  .rating-count {
    font-size: 0.6rem;
  }
  
  .tag {
    font-size: 0.6rem;
    padding: 2px 4px;
    top: 4px;
    left: 4px;
  }
  
  .scroll-btn {
    display: none; /* Hide on very small screens to maximize space */
  }
}

/* Extra Small Mobile */
@media (max-width: 359px) {
  .category-section {
    margin: 0.75rem 0;
    padding: 0 0.125rem;
  }
  
  .category-title-wrapper {
    padding: 0.2rem 0.4rem;
  }
  
  .category-title {
    font-size: 0.8rem;
  }
  
  .view-all-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.6rem;
    margin-right: 0.1rem;
  }
  
  .category-subtext {
    font-size: 0.7rem;
    bottom: -0.7rem;
    left: 0.6rem;
  }
  
  .wrapper-scroll {
    gap: 0.4rem;
    padding: 0.4rem 0.1rem;
  }
  
  .product-card {
    min-width: 130px;
    height: 220px;
  }
  
  .product-image {
    height: 124px; /* 3/4 of 165px */
    padding: 4px;
  }
  
  .product-info {
    height: 96px; /* 1/4 of 220px */
    min-height: 96px;
    padding: 0.3rem;
  }
  
  .product-name {
    font-size: 0.7rem;
    min-height: 1.4rem;
    margin-bottom: 0.15rem;
  }
  
  .product-price {
    font-size: 0.75rem;
  }
  
  .rating {
    margin-bottom: 0.1rem;
  }
  
  .star {
    font-size: 0.6rem;
  }
  
  .rating-count {
    font-size: 0.55rem;
  }
  
  .scroll-btn {
    display: none;
  }
}

/* =============================
   Accessibility & Fallbacks
   ============================= */
.scroll-btn:focus,
.product-card:focus,
.view-all-btn:focus {
  outline: 2px solid #ff6600;
  outline-offset: 2px;
}

.category-section.general-category .scroll-btn:focus,
.category-section.general-category .product-card:focus,
.category-section.general-category .view-all-btn:focus {
  outline-color: #ffa500;
}

/* Ensure content is always visible even if images fail to load */
.product-image {
  background: #f8fafc;
  position: relative;
}

.product-image::before {
  content: '📷';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  opacity: 0.3;
  z-index: 1;
}

.product-image img {
  position: relative;
  z-index: 2;
}

.category-section.general-category .product-image::before {
  content: '⭐';
}

/* Print styles */
@media print {
  .product-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #000;
  }
  
  .scroll-btn,
  .view-all-btn {
    display: none;
  }
  
  .category-section.general-category {
    background: none;
    border: 1px solid #000;
  }
}
/* Add to existing client-billing.css */
.popular-badge {
  display: inline-block;
  background: #ff6b6b;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: bold;
  margin-top: 0.5rem;
}