/* ========================================
   Market/Grocery Style Layout
   Practical, organized, category-focused
   ======================================== */

body.design-market {
  --market-bg: #ffffff;
  --market-gray: #f8f9fa;
  --market-border: #e9ecef;
  --market-text: #212529;
  --market-secondary: #6c757d;
  --market-success: #28a745;
  --market-danger: #dc3545;
  --market-warning: #ffc107;
  --market-link: var(--og-500, #0d6efd);
  
  background-color: var(--market-bg);
  font-family: var(--site-font-family, 'Roboto', 'Segoe UI', sans-serif);
  color: var(--market-text);
}

body.design-market .market-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Search & Location Bar */
body.design-market .market-header {
  background: var(--og-500);
  padding: 15px 0;
  margin-bottom: 30px;
}

body.design-market .header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

body.design-market .market-search {
  flex: 1;
  display: flex;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

body.design-market .market-search input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  font-size: 15px;
}

body.design-market .market-search button {
  padding: 12px 25px;
  background: var(--og-600);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

/* Category Boxes at Top */
body.design-market .category-section {
  margin-bottom: 40px;
}

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

body.design-market .section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--market-text);
}

body.design-market .view-all {
  color: var(--market-link);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

body.design-market .category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
}

body.design-market .category-box {
  background: white;
  border: 2px solid var(--market-border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

body.design-market .category-box:hover {
  border-color: var(--og-500);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-3px);
}

body.design-market .category-icon {
  width: 60px;
  height: 60px;
  background: var(--market-gray);
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

body.design-market .category-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--market-text);
}

body.design-market .category-count {
  font-size: 12px;
  color: var(--market-secondary);
  margin-top: 5px;
}

/* 4-Column Product Grid */
body.design-market .product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Product Card */
body.design-market .product-card {
  background: white;
  border: 1px solid var(--market-border);
  border-radius: 12px;
  padding: 15px;
  position: relative;
  transition: box-shadow 0.3s;
}

body.design-market .product-card:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Stock Indicator */
body.design-market .stock-indicator {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

body.design-market .stock-indicator.in-stock {
  background: rgba(40, 167, 69, 0.1);
  color: var(--market-success);
}

body.design-market .stock-indicator.low-stock {
  background: rgba(255, 193, 7, 0.1);
  color: #856404;
}

body.design-market .stock-indicator.out-stock {
  background: rgba(220, 53, 69, 0.1);
  color: var(--market-danger);
}

/* Product Image */
body.design-market .product-image {
  width: 100%;
  height: 180px;
  object-fit: contain;
  margin-bottom: 15px;
}

/* Brand & Title */
body.design-market .product-brand {
  font-size: 11px;
  color: var(--og-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

body.design-market .product-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--market-text);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Weight/Size Info */
body.design-market .product-size {
  font-size: 12px;
  color: var(--market-secondary);
  margin-bottom: 10px;
}

/* Price Section */
body.design-market .price-section {
  margin-bottom: 12px;
}

body.design-market .current-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--market-text);
}

body.design-market .original-price {
  font-size: 13px;
  color: var(--market-secondary);
  text-decoration: line-through;
  margin-left: 8px;
}

body.design-market .discount-badge {
  display: inline-block;
  background: var(--market-danger);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

/* Price Per Unit */
body.design-market .price-per-unit {
  font-size: 12px;
  color: var(--market-secondary);
  margin-top: 3px;
}

/* Quick Add Button */
body.design-market .quick-add {
  width: 100%;
  padding: 12px;
  background: var(--og-500);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
}

body.design-market .quick-add:hover {
  background: var(--og-600);
  transform: translateY(-2px);
}

body.design-market .quick-add:disabled {
  background: var(--market-secondary);
  cursor: not-allowed;
  transform: none;
}

/* Quantity Selector (when added) */
body.design-market .qty-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px;
  border: 2px solid var(--og-500);
  border-radius: 8px;
}

body.design-market .qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--market-gray);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

body.design-market .qty-btn:hover {
  background: var(--og-500);
  color: white;
}

body.design-market .qty-value {
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}

/* Offers Banner */
body.design-market .offers-banner {
  background: linear-gradient(135deg, var(--og-500), var(--og-600));
  color: white;
  padding: 15px 25px;
  border-radius: 12px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
}

body.design-market .offer-icon {
  font-size: 32px;
}

body.design-market .offer-text {
  flex: 1;
}

body.design-market .offer-text h4 {
  font-size: 16px;
  margin-bottom: 3px;
}

body.design-market .offer-text p {
  font-size: 13px;
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 1200px) {
  body.design-market .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  body.design-market .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  body.design-market .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 576px) {
  body.design-market .header-content {
    flex-direction: column;
  }
  
  body.design-market .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  body.design-market .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  body.design-market .product-image {
    height: 140px;
  }
}
