:root {
  --primary: #e11d48;
  --secondary: #334155;
  --light: #f1f5f9;
}

body {
  background: var(--light);
}

.categories-header {
  background: linear-gradient(135deg, var(--primary), #be123c);
  color: white;
  padding: 3rem 0;
  margin-bottom: 2rem;
}

.categories-header h1 {
  font-size: 2.8rem;
  font-weight: 700;
}

.category-card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  height: 100%;
  background: white;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  color: inherit;
  text-decoration: none;
}

.category-icon {
  background: linear-gradient(135deg, var(--primary), #be123c);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
}

.product-card {
  border: none;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  height: 100%;
  background: #ffffff;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.product-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  background: var(--light);
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary);
  min-height: 50px;
}

.price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-add-cart {
  background: var(--primary);
  border: none;
  color: white;
  transition: all 0.3s;
  width: 100%;
}

.btn-add-cart:hover {
  background: #be123c;
  color: white;
}

.pagination-custom .page-link {
  color: var(--primary);
  border: 1px solid #e5e7eb;
}

.pagination-custom .page-link:hover {
  background: var(--primary);
  color: white;
}

.pagination-custom .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
}

.category-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.category-count {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 1rem;
  flex: 1;
}

.category-link {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
}

.category-link:hover {
  color: #be123c;
}

.category-link i {
  margin-left: 0.5rem;
  transition: transform 0.3s;
}

.category-card:hover .category-link i {
  transform: translateX(4px);
}

.stats-section {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin-bottom: 3rem;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  color: var(--secondary);
  font-weight: 600;
  margin-top: 0.5rem;
}


.category-header{background:linear-gradient(135deg,#0f172a,#1d4ed8);color:#fff;padding:2.2rem 0 2rem;margin-bottom:1.5rem}
.category-header .category-shell,.category-grid-shell{width:100%;max-width:none;padding-left:24px;padding-right:24px;margin:0 auto}
.category-header p{color:rgba(255,255,255,.82)}
.category-grid-shell .product-card{background:#fff;border:1px solid #e7edf5;border-radius:20px;overflow:hidden;box-shadow:0 12px 30px rgba(16,24,40,.08);height:100%;display:flex;flex-direction:column}
.category-grid-shell .product-card:hover{transform:translateY(-5px);box-shadow:0 20px 40px rgba(16,24,40,.12)}
.category-grid-shell .product-image{width:100%;aspect-ratio:4/3;height:auto;object-fit:cover;background:#eef2ff}
.category-grid-shell .card-body{padding:14px 14px 13px;display:flex;flex-direction:column;gap:8px;flex:1}
.category-grid-shell .product-title{font-size:1rem;line-height:1.35;font-weight:700;min-height:2.7em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:0;color:#0f172a;text-align:left}
.category-grid-shell .seller-row{display:flex;align-items:center;gap:10px}
.category-grid-shell .price{font-size:1rem;font-weight:800;color:#2563eb;margin-bottom:0}
.category-grid-shell .meta-small{font-size:.8rem;color:#6b7280}
.category-grid-shell .button-row{display:flex;gap:8px;margin-top:auto}
.category-grid-shell .button-row .btn{flex:1;min-height:38px;border-radius:12px;font-size:.82rem;font-weight:700;padding:.42rem .7rem}
.category-grid-shell .wishlist-btn{min-height:36px;border-radius:12px;font-size:.81rem}
@media (max-width:1199.98px){.category-header .category-shell,.category-grid-shell{padding-left:16px;padding-right:16px}}
@media (max-width:991.98px){.category-header .category-shell,.category-grid-shell{padding-left:12px;padding-right:12px}}


.category-product-thumb{position:relative;overflow:hidden}
.category-title-overlay{position:absolute;left:0;right:0;bottom:0;padding:32px 48px 9px 11px;background:linear-gradient(to top,rgba(2,6,23,.92),rgba(2,6,23,.55),transparent);color:#fff;text-decoration:none;opacity:0;transform:translateY(8px);transition:.2s ease;pointer-events:none}
.category-title-overlay span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.88rem;font-weight:800;line-height:1.3}
.category-product-thumb:hover .category-title-overlay,.product-card:focus-within .category-title-overlay{opacity:1;transform:none}
@media(hover:none){.category-title-overlay{opacity:1;transform:none}}


/* Tasks 06-10: category card mirrors homepage */
.category-grid-shell .compact-product-card{background:transparent;border:0;border-radius:18px;box-shadow:none;overflow:visible;height:auto}
.category-grid-shell .compact-product-card:hover{transform:translateY(-3px);box-shadow:none}
.category-grid-shell .compact-product-thumb{position:relative;aspect-ratio:4/3;border-radius:18px;overflow:hidden;background:#eef2ff;box-shadow:0 10px 26px rgba(15,23,42,.10);border:1px solid #e5eaf2}
.category-grid-shell .compact-product-thumb .product-image-link{display:block;width:100%;height:100%}
.category-grid-shell .compact-product-thumb .product-image{width:100%;height:100%;object-fit:cover;display:block}
.category-grid-shell .compact-product-card .card-body,.category-grid-shell .compact-product-card .seller-row{display:none!important}
.category-grid-shell .vertical-actions{position:absolute;right:9px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:6px;z-index:5}
.category-grid-shell .vertical-actions .action-form{margin:0;padding:0;line-height:1}
.category-grid-shell .vertical-actions .action-btn{width:35px;height:35px;min-width:35px;min-height:35px;border-radius:50%;padding:0;font-size:.82rem;background:rgba(255,255,255,.96);color:#0f172a;box-shadow:0 6px 16px rgba(15,23,42,.18);border:1px solid rgba(226,232,240,.95);display:flex;align-items:center;justify-content:center;transition:transform .18s ease,background .18s ease,color .18s ease;text-decoration:none}
.category-grid-shell .vertical-actions .action-btn:hover{transform:scale(1.06);background:#fff;color:#2563eb}
.category-grid-shell .vertical-actions .purchase-action{background:#2563eb;color:#fff;border-color:#2563eb}
.category-grid-shell .vertical-actions .purchase-action:hover{background:#1d4ed8;color:#fff}
.category-grid-shell .vertical-actions .details-action{background:#0f172a;color:#fff;border-color:#0f172a}
.category-grid-shell .vertical-actions .details-action:hover{background:#111827;color:#fff}
.category-grid-shell .compact-product-thumb .price-pill{position:absolute;top:10px;left:10px;max-width:calc(100% - 62px);padding:6px 9px;font-size:11px;line-height:1.15;border-radius:999px;display:flex;align-items:center;gap:5px;flex-wrap:wrap;z-index:4;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;box-shadow:0 8px 18px rgba(37,99,235,.22)}
.category-grid-shell .compact-product-thumb .price-pill .old-price{opacity:.82;font-size:.72rem;text-decoration-thickness:1.5px}
.category-grid-shell .compact-product-thumb .price-pill .sale-price{font-weight:800}
.category-grid-shell .category-title-overlay{padding-right:52px}
@media (max-width:575.98px){.category-grid-shell .vertical-actions{right:6px;gap:5px}.category-grid-shell .vertical-actions .action-btn{width:32px;height:32px;min-width:32px;min-height:32px;font-size:.75rem}.category-grid-shell .compact-product-thumb .price-pill{top:7px;left:7px;font-size:10px;padding:5px 7px}.category-grid-shell .category-title-overlay{padding-right:44px}}


/* v2.5.8 category compact spacing */
@media (max-width:767.98px){
 .category-header{padding:1rem 0 .9rem;margin-bottom:.65rem}
 .category-header h1{font-size:1.35rem}
 .category-header p{font-size:.78rem}
 .category-grid-shell{margin-bottom:.7rem!important}
}


/* v2.5.9 category cards: same hover-reveal controls as homepage */
.category-grid-shell .product-title-overlay{position:absolute;left:0;right:0;bottom:0;z-index:3;padding:34px 42px 9px 10px;background:linear-gradient(to top,rgba(2,6,23,.92),rgba(2,6,23,.56),transparent);color:#fff;text-decoration:none;opacity:0;visibility:hidden;transform:translateY(7px);transition:opacity .18s ease,transform .18s ease;pointer-events:none}
.category-grid-shell .product-title-overlay span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.86rem;font-weight:800;line-height:1.25;text-shadow:0 1px 2px rgba(0,0,0,.35)}
.category-grid-shell .compact-product-thumb:hover .product-title-overlay,.category-grid-shell .compact-product-card:focus-within .product-title-overlay{opacity:1;visibility:visible;transform:none}
.category-grid-shell .compact-product-thumb .vertical-actions{top:8px!important;right:8px!important;transform:none!important;gap:3px!important;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .18s ease,transform .18s ease}
.category-grid-shell .compact-product-thumb .vertical-actions .action-btn{width:27px!important;height:27px!important;min-width:27px!important;min-height:27px!important;font-size:.66rem!important;background:rgba(15,23,42,.88)!important;color:#fff!important;border:1px solid rgba(255,255,255,.72)!important;box-shadow:0 4px 10px rgba(15,23,42,.20)!important}
.category-grid-shell .compact-product-thumb .vertical-actions .action-btn:hover{background:#2563eb!important;color:#fff!important;transform:scale(1.05)!important}
.category-grid-shell .compact-product-thumb .price-pill{opacity:0;visibility:hidden;transform:translateY(-4px);transition:opacity .18s ease,transform .18s ease;padding:5px 8px!important;font-size:10px!important;box-shadow:0 5px 12px rgba(37,99,235,.18)!important}
.category-grid-shell .compact-product-thumb:hover .vertical-actions,.category-grid-shell .compact-product-card:focus-within .vertical-actions{opacity:1;visibility:visible;pointer-events:auto;transform:none!important}
.category-grid-shell .compact-product-thumb:hover .price-pill,.category-grid-shell .compact-product-card:focus-within .price-pill{opacity:1;visibility:visible;transform:none}
@media(hover:none){
 .category-grid-shell .product-title-overlay{opacity:1;visibility:visible;transform:none;padding:24px 35px 7px 8px}
 .category-grid-shell .product-title-overlay span{font-size:.72rem;line-height:1.2}
 .category-grid-shell .compact-product-thumb .vertical-actions{opacity:1;visibility:visible;pointer-events:auto;top:6px!important;right:5px!important;gap:2px!important}
 .category-grid-shell .compact-product-thumb .vertical-actions .action-btn{width:24px!important;height:24px!important;min-width:24px!important;min-height:24px!important;font-size:.58rem!important}
 .category-grid-shell .compact-product-thumb .price-pill{opacity:1;visibility:visible;transform:none;top:6px!important;left:6px!important;padding:4px 6px!important;font-size:9px!important}
}

/* Multi-image product card slider */
.product-image-slider{position:absolute;inset:0;display:block;overflow:hidden}
.product-image-slider .product-slide-image{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transform:translateX(8%);transition:opacity .45s ease,transform .45s ease}
.product-image-slider .product-slide-image.is-active{opacity:1;transform:translateX(0)}

/* Bilingual product labels: Bangla title first, English title below. */
.category-grid-shell .product-title-overlay span.product-title-bilingual{display:flex!important;flex-direction:column;gap:2px;line-height:1.2;-webkit-line-clamp:unset;-webkit-box-orient:initial;overflow:hidden}
.category-grid-shell .product-title-overlay .product-title-bilingual strong{font-weight:800;display:block}
.category-grid-shell .product-title-overlay .product-title-bilingual small{display:block;font-size:.76em;font-weight:500;opacity:.92;line-height:1.15}
