:root {
  --cf-red: #cf202f;
  --cf-red-dark: #a91220;
  --cf-orange: #ff7a00;
  --cf-orange-light: #fff5eb;
  --cf-text-main: #1e293b;
  --cf-text-muted: #64748b;
  --cf-bg-light: #ffffff;
  --cf-card-bg: #ffffff;
  --cf-border: #e2e8f0;
  --cf-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --cf-shadow-hover: 0 16px 30px rgba(0, 0, 0, 0.08);
}

.cf-product-grid-container {
  width: 100%;
  box-sizing: border-box;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cf-product-grid-container *,
.cf-product-grid-container *::before,
.cf-product-grid-container *::after { box-sizing: border-box; }

/* Category Filter Tabs */
.cf-filter-wrapper {
  display: flex;
  justify-content: flex-start;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  gap: 8px;
  margin-bottom: 32px;
}

.cf-filter-wrapper::-webkit-scrollbar { display: none; }

.cf-filter-btn {
  flex: 0 0 auto;
  background: #f8fafc;
  border: 1px solid var(--cf-border);
  color: var(--cf-text-muted);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cf-filter-btn:hover,
.cf-filter-btn.cf-active {
  background: var(--cf-red);
  color: #ffffff;
  border-color: var(--cf-red);
  box-shadow: 0 4px 12px rgba(207, 32, 47, 0.2);
}

.cf-filter-btn:focus-visible,
.cf-card-btn:focus-visible,
.cf-card-title a:focus-visible,
.cf-card-image-wrap:focus-visible { outline: 3px solid rgba(255, 122, 0, .4); outline-offset: 3px; }


.cf-search-wrapper {
  max-width: 520px;
  margin: 0 auto 20px;
}

.cf-product-search {
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--cf-border);
  border-radius: 12px;
  background: #fff;
  color: var(--cf-text-main);
  font: inherit;
  font-size: 14px;
  box-shadow: var(--cf-shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.cf-product-search:focus {
  outline: none;
  border-color: var(--cf-red);
  box-shadow: 0 0 0 3px rgba(207, 32, 47, .12);
}

.cf-pagination-wrap { margin-top: 28px; }
.cf-pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 7px; }
.cf-page-btn { min-width: 38px; min-height: 38px; padding: 7px 12px; border: 1px solid var(--cf-border); border-radius: 9px; background: #fff; color: var(--cf-text-main); font-size: 13px; font-weight: 700; cursor: pointer; transition: all .2s ease; }
.cf-page-btn:hover, .cf-page-btn.cf-active { background: var(--cf-red); border-color: var(--cf-red); color: #fff; }
.cf-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.cf-page-dots { color: var(--cf-text-muted); padding: 0 2px; }

/* Product Grid Layouts */
.cf-products-grid {
  display: grid;
  gap: 24px;
  transition: opacity .22s ease;
}

.cf-products-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cf-products-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cf-products-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Product Card Style 1 (Default Clean Light) */
.cf-product-card {
  background: var(--cf-card-bg);
  border: 1px solid var(--cf-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--cf-shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: all 0.3s ease;
}

.cf-product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--cf-shadow-hover);
  border-color: #cbd5e1;
}

.cf-card-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  height: 200px;
  background: #f1f5f9;
  overflow: hidden;
}

.cf-card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cf-product-card:hover .cf-card-image-wrap img { transform: scale(1.06); }

.cf-card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background: var(--cf-red);
  text-transform: uppercase;
  z-index: 2;
}

.cf-card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.cf-card-cat {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cf-orange);
  margin-bottom: 4px;
}

.cf-card-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--cf-text-main);
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.cf-card-title a { color: inherit; text-decoration: none; }
.cf-card-title a:hover { color: var(--cf-red); }

.cf-card-desc {
  font-size: 13px;
  color: var(--cf-text-muted);
  line-height: 1.45;
  margin: 0 0 16px 0;
  flex-grow: 1;
}

.cf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--cf-border);
}

.cf-card-spec {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  background: #f8fafc;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.cf-card-spec del { opacity: .65; }
.cf-card-spec ins { color: var(--cf-red); text-decoration: none; }

.cf-card-btn {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cf-red);
  text-decoration: none;
  transition: color 0.2s ease;
  text-align: right;
}

.cf-card-btn:hover { color: var(--cf-red-dark); text-decoration: underline; }

/* Style 2: Compact Minimalist Card */
.style2 .cf-card-image-wrap { height: 160px; }
.style2 .cf-card-content { padding: 14px; }
.style2 .cf-card-title { font-size: 15px; }
.style2 .cf-card-desc { font-size: 12.5px; }

/* Style 3: Image-focused card */
.style3 .cf-product-card { border-radius: 20px; }
.style3 .cf-card-image-wrap { height: 260px; }
.style3 .cf-card-content { padding: 18px 20px 20px; }
.style3 .cf-card-title { font-size: 18px; }
.style3 .cf-card-footer { border-top-style: solid; }
.style3 .cf-card-spec { background: var(--cf-orange-light); border-color: #fed7aa; color: #9a3412; }

.cf-grid-status { min-height: 0; text-align: center; font-size: 13px; color: var(--cf-text-muted); }
.cf-is-loading .cf-grid-status { min-height: 24px; margin-bottom: 8px; }
.cf-is-loading { cursor: progress; }
.cf-no-products { grid-column: 1 / -1; padding: 32px; text-align: center; color: var(--cf-text-muted); border: 1px dashed var(--cf-border); border-radius: 14px; }
.cf-grid-admin-warning { padding: 12px 16px; border-left: 4px solid #dba617; background: #fff8e5; color: #3c434a; }

/* Responsive Adjustments */
@media (max-width: 992px) {
  .cf-products-grid.cols-3, .cf-products-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .cf-products-grid.cols-2, .cf-products-grid.cols-3, .cf-products-grid.cols-4 { grid-template-columns: 1fr; }
  .cf-card-image-wrap, .style2 .cf-card-image-wrap, .style3 .cf-card-image-wrap { height: 220px; }
  .cf-card-footer { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .cf-product-card, .cf-card-image-wrap img, .cf-filter-btn, .cf-products-grid { transition: none; }
}
