/* =============================================
   NoDig Serbia CATALOG STYLES
   Koristi varijable iz site.css
   ============================================= */

/* Hero za katalog */
.catalog-hero {
  padding: 6rem 2rem 3rem;
  background: linear-gradient(135deg, var(--cat-color, var(--accent)) 0%, rgba(0,0,0,0.85) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.catalog-hero::before {
  content: "";
  position: absolute;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  width: 350px;
  height: 350px;
  background: url('/images/robot-pipe-2.webp') center/contain no-repeat;
  opacity: 0.15;
  pointer-events: none;
}

.catalog-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.catalog-hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.75rem;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.25);
}

.catalog-hero p {
  font-size: 1.05rem;
  opacity: 0.95;
  margin-bottom: 1.5rem;
}

.catalog-hero .btn-outline {
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
}

.catalog-hero .btn-outline:hover {
  background: #fff;
  color: var(--accent);
}

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}

.category-card {
  position: relative;
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border-color: var(--accent);
}

.category-card::after {
  content: "→";
  position: absolute;
  right: 1rem;
  top: 1rem;
  font-size: 1.1rem;
  color: #fff;
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.2s;
}

.category-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.category-card-header {
  padding: 1rem 1.2rem;
  background: linear-gradient(135deg, var(--cat-color, var(--accent)) 0%, color-mix(in srgb, var(--cat-color, var(--accent)) 70%, #000) 100%);
  color: #fff;
}

.category-card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.category-card-body {
  padding: 0.85rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.category-count {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.category-tag {
  font-size: 0.75rem;
  color: var(--muted);
}

.category-chip {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

/* Catalog Layout (products + cart) */
.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 2rem;
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

@media (max-width: 960px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.product-image {
  width: 100%;
  height: 180px;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image img {
  max-width: 90%;
  max-height: 160px;
  object-fit: contain;
}

.product-content {
  padding: 1rem 1.2rem 1.2rem;
}

.product-code {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.product-content h4 {
  font-size: 1rem;
  margin: 0 0 0.4rem;
  color: var(--fg);
}

.product-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.product-price {
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--accent);
}

.product-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.product-actions input[type="number"] {
  width: 70px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--fg);
}

.product-actions .btn {
  flex: 1;
}

/* Cart Panel */
.cart-panel {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  padding: 1.25rem;
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.cart-panel h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  color: var(--fg);
}

.cart-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cart-item {
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.cart-item-main {
  flex: 1;
  min-width: 0;
}

.cart-item-main strong {
  display: block;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-main span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.qty-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.qty-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.qty-display {
  min-width: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--fg);
}

.cart-footer {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.cart-total-line {
  font-weight: 500;
  color: var(--fg);
}

.cart-total-price {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.cart-actions .btn {
  width: 100%;
}

@media (max-width: 960px) {
  .cart-panel {
    position: static;
    max-height: none;
    margin-top: 1rem;
  }
  
  .catalog-hero::before {
    width: 200px;
    height: 200px;
    opacity: 0.08;
  }
}

/* Subcategory sections */
.subcategory-section {
  margin-bottom: 2rem;
}

.subcategory-header {
  margin-bottom: 1rem;
}

.subcategory-title {
  font-size: 1.25rem;
  color: var(--fg);
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty-state p {
  font-size: 1rem;
}

/* Product CTA */
.product-cta {
  background: linear-gradient(135deg, var(--accent) 0%, #1d4ed8 100%);
  border-radius: var(--radius, 16px);
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.product-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.product-cta h2 {
  color: #fff;
  font-size: 1.75rem;
  margin: 0 0 0.75rem;
  position: relative;
  z-index: 2;
}

.product-cta p {
  color: rgba(255,255,255,.85);
  margin: 0 0 1.5rem;
  position: relative;
  z-index: 2;
}

.product-cta .btn-white {
  display: inline-block;
  background: #fff;
  color: var(--accent);
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  position: relative;
  z-index: 2;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-cta .btn-white:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
