/* Fabric Dedicated Page - front styles */
#module-sd_fabric_dedicated_page-gallery #wrapper{
  margin-top: 50px;
}
.sdfp-intro { margin-bottom: 1.5rem; }

.sdfp-messages { margin-bottom: 1rem; }
.sdfp-messages:empty { display: none; }

/* Responsive flex row of square fabric swatches (6 per row on desktop) */
.sdfp-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 30px 24px;
}

.sdfp-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 calc((100% - 5 * 24px) / 6);
  max-width: calc((100% - 5 * 24px) / 6);
  text-align: center;
}

.sdfp-card.sdfp-loading {
  opacity: 0.55;
  pointer-events: none;
}

/* Square swatch */
.sdfp-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #e6e6e6;
  border-radius: 3px;
  overflow: hidden;
  background: #f6f6f6;
}

.sdfp-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sdfp-card-img.sdfp-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
}

.sdfp-card-img.sdfp-noimg::after {
  content: "No image";
  color: #9a9a9a;
  font-size: 0.8rem;
}

/* Label - fixed min height so single/double line names keep everything aligned */
.sdfp-card-name {
  margin: 14px 0 2px;
  min-height: 2.7em;
  font-size: 14px;
  font-weight: 600;
  color: #2b2b2b;
  line-height: 1.35;
}

/* Price */
.sdfp-card-price {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #1f1f1f;
}

/* Quantity + button */
.sdfp-card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 6px;
}

.sdfp-qty-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sdfp-qty-label {
  font-size: 13px;
  color: #555;
}

.sdfp-qty {
  width: 64px;
  height: 40px;
  text-align: center;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}

.sdfp-add {
  width: 100%;
  max-width: 190px;
  padding: 10px 16px;
  background: #4a554e;
  color: #fff;
  border: 0;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sdfp-add:hover,
.sdfp-add:focus {
  background: #37403a;
  color: #fff;
}

@media (max-width: 991px) {
  .sdfp-grid { gap: 24px 18px; }
  .sdfp-card {
    flex: 0 0 calc((100% - 2 * 18px) / 3);
    max-width: calc((100% - 2 * 18px) / 3);
  }
}

@media (max-width: 575px) {
  .sdfp-grid { gap: 20px 14px; }
  .sdfp-card {
    flex: 0 0 calc((100% - 14px) / 2);
    max-width: calc((100% - 14px) / 2);
  }
  .sdfp-add { max-width: none; }
}
