/* ========================================
   MATERIALS PAGE - FDM Materials Catalog
   ======================================== */

.intro {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 1.1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Materials Grid */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

/* Material Card */
.material-card {
  border: 2px solid var(--primary);
  border-radius: 12px;
  background: var(--bg-secondary);
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  font-size: 0.95rem;
  line-height: 1.5;
  position: relative;
}

.material-card.in-stock {
  border-color: #22c55e !important;
}

.material-card.on-way {
  border-color: #eab308 !important;
}

.material-card:hover {
  box-shadow: 0 8px 16px rgba(220, 38, 38, 0.2);
}

.material-card.in-stock:hover {
  box-shadow: 0 8px 16px rgba(34, 197, 94, 0.2);
}

.material-card.on-way:hover {
  box-shadow: 0 8px 16px rgba(234, 179, 8, 0.2);
}

/* Stock Badge */
.stock-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stock-badge.skladem {
  background: #22c55e;
  color: #000;
}

.stock-badge.na-ceste {
  background: #eab308;
  color: #000;
}

/* Material Card Content */
.material-card h3 {
  margin: 0 0 8px 0;
  color: var(--primary);
  font-size: 1.5rem;
  padding-right: 120px;
}

.material-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.4;
}

.info-line {
  margin: 8px 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
}

.info-line strong {
  color: var(--primary);
}

.info-section {
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* Temperature Section */
.temp-section {
  background: rgba(220, 38, 38, 0.1);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.temp-section .info-line {
  margin: 6px 0;
}

/* Color Swatches */
.color-swatches {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  cursor: help;
  transition: all 0.2s;
}

.color-swatch:hover {
  transform: scale(1.2);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Loading & Error */
#loader {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 1.2rem;
}

.error {
  background: rgba(239, 68, 68, 0.15);
  border-left: 4px solid #ef4444;
  color: #ff9999;
  padding: 15px 20px;
  border-radius: 6px;
  text-align: center;
  margin: 20px 0;
}

/* Responsive */
@media (max-width: 768px) {
  .materials-grid {
    grid-template-columns: 1fr;
  }
}
