/* Software page theme: Indigo/Blue accent (distinct from services & training) */
body.products-page{
  --primary:#4f46e5;
  --primary-dark:#3730a3;
  --primary-light:#7c73ff;
  --dark:#0f172a;
}

/* HERO */
.products-hero{
  position:relative;
  padding:130px 0 90px;
  color:#fff;
  overflow:hidden;
}
.products-hero__bg{
  position:absolute; inset:0;
  background-image:url('https://images.unsplash.com/photo-1518770660439-4636190af475?w=1920&h=1080&fit=crop');
  background-size:cover; background-position:center;
}
.products-hero__overlay{
  position:absolute; inset:0;
  background:linear-gradient(135deg, rgba(15,23,42,.93), rgba(79,70,229,.55));
}
.products-hero__content{ position:relative; z-index:2; max-width:820px; }
.products-hero__content h1{ color:#fff; font-size:2.7rem; margin:16px 0 18px; }
.products-hero__content p{ color:rgba(255,255,255,.85); font-size:1.05rem; margin-bottom:30px; max-width:650px; }
.products-hero__cta{ display:flex; gap:16px; flex-wrap:wrap; margin-bottom:34px; }

.products-hero__stats{
  display:flex; gap:40px; flex-wrap:wrap;
}
.stat h3{
  font-family:'DM Serif Display', serif;
  font-size:2rem;
  color:#fff;
}
.stat p{
  font-size:.8rem;
  font-weight:700;
  color:rgba(255,255,255,.7);
  text-transform:uppercase;
  letter-spacing:.5px;
}

/* CATALOG CONTROLS */
.catalog-controls{
  display:flex;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  margin:28px 0 10px;
}
.catalog-search{
  flex:1;
  min-width:260px;
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--bg-light);
  border:1px solid var(--border);
  border-radius:50px;
  padding:12px 16px;
}
.catalog-search i{ color:var(--muted); }
.catalog-search input{
  border:none; outline:none;
  width:100%;
  background:transparent;
  font-size:.95rem;
}
.catalog-sort{ display:flex; align-items:center; gap:10px; color:var(--muted); font-weight:700; }
.catalog-sort select{
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  background:#fff;
  font-weight:700;
}

/* FILTER TABS */
.filter-tabs{
  display:flex; justify-content:center; flex-wrap:wrap;
  gap:12px; margin:22px 0 22px;
}
.filter-tab{
  padding:11px 24px;
  border-radius:50px;
  border:1.5px solid var(--border);
  background:#fff;
  color:var(--muted);
  font-weight:700;
  font-size:.88rem;
  transition:var(--transition);
}
.filter-tab:hover{ border-color:var(--primary); color:var(--primary); }
.filter-tab.active{
  background:linear-gradient(135deg,var(--primary),var(--primary-light));
  border-color:transparent;
  color:#fff;
  box-shadow:0 8px 20px rgba(79,70,229,.25);
}

/* PRODUCT GRID */
.product-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(320px, 1fr));
  gap:28px;
}
.product-card{
  background:#fff;
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow-sm);
  transition:var(--transition);
  cursor:pointer;
  opacity:0;
  transform:translateY(16px);
  animation:cardIn .5s ease forwards;
}
@keyframes cardIn{ to{ opacity:1; transform:translateY(0);} }
.product-card:hover{ transform:translateY(-8px); box-shadow:var(--shadow-lg); }
.product-img{ height:210px; overflow:hidden; position:relative; }
.product-img img{ width:100%; height:100%; object-fit:cover; transition:transform .5s ease; }
.product-card:hover .product-img img{ transform:scale(1.08); }

.product-badge{
  position:absolute;
  top:14px; left:14px;
  background:rgba(255,255,255,.95);
  color:var(--primary-dark);
  font-size:.7rem;
  font-weight:800;
  letter-spacing:.5px;
  padding:5px 12px;
  border-radius:999px;
}
.product-body{ padding:22px; }
.product-body h3{ font-size:1.12rem; margin-bottom:10px; }
.product-body p{ color:var(--muted); font-size:.9rem; margin-bottom:14px; }

.product-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:.82rem;
}
.product-meta span i{ color:var(--primary); margin-right:6px; }

.load-more-wrap{ display:flex; justify-content:center; margin-top:34px; }

.empty-state{ text-align:center; padding:60px 20px; color:var(--muted); }
.empty-state i{ font-size:2.3rem; color:var(--border); margin-bottom:14px; display:block; }

/* CUSTOM TYPES */
.custom-types{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(240px,1fr));
  gap:20px;
  margin-top:30px;
}
.custom-type{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:26px;
  text-align:left;
  box-shadow:var(--shadow-sm);
  transition:var(--transition);
}
.custom-type:hover{ transform:translateY(-6px); box-shadow:var(--shadow-md); border-color:rgba(79,70,229,.35); }
.custom-type.active{
  border-color:transparent;
  background:linear-gradient(135deg, rgba(79,70,229,.12), rgba(124,115,255,.12));
  box-shadow:var(--shadow-md);
}
.custom-icon{
  width:52px; height:52px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--primary),var(--primary-light));
  color:#fff;
  display:flex; align-items:center; justify-content:center;
  margin-bottom:16px;
}
.custom-title{ display:block; font-weight:800; color:var(--ink); margin-bottom:6px; }
.custom-sub{ display:block; color:var(--muted); font-size:.88rem; }

.custom-form-wrap{ margin-top:26px; }
.custom-form{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:34px;
  box-shadow:var(--shadow-md);
}
.custom-form h3{ margin-bottom:6px; }
.custom-form p{ color:var(--muted); margin-bottom:18px; }
.custom-form .form-row{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:680px){ .custom-form .form-row{ grid-template-columns:1fr; } }

.custom-form .form-group{ margin-bottom:16px; }
.custom-form label{ font-weight:700; font-size:.85rem; margin-bottom:6px; display:block; color:var(--ink); }
.custom-form input, .custom-form select, .custom-form textarea{
  width:100%;
  padding:12px 14px;
  border:1.5px solid var(--border);
  border-radius:10px;
  background:#fafafa;
  transition:var(--transition);
}
.custom-form input:focus, .custom-form select:focus, .custom-form textarea:focus{
  outline:none;
  border-color:var(--primary);
  background:#fff;
  box-shadow:0 0 0 3px rgba(79,70,229,.15);
}
.custom-form textarea{ min-height:120px; resize:vertical; }

.custom-form .error-text{ display:none; color:#e53935; font-size:.78rem; margin-top:6px; }
.custom-form .invalid .error-text{ display:block; }
.custom-form .invalid input, .custom-form .invalid select, .custom-form .invalid textarea{ border-color:#e53935; }

.btn-full{ width:100%; justify-content:center; }

/* MODAL (detail-modal) */
.detail-modal{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.72);
  backdrop-filter:blur(4px);
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:60px 20px;
  overflow-y:auto;
  z-index:2000;
  opacity:0;
  visibility:hidden;
  transition:opacity .3s ease, visibility .3s ease;
}
.detail-modal[aria-hidden="false"]{ opacity:1; visibility:visible; }

.detail-modal-inner{
  background:#fff;
  width:100%;
  max-width:760px;
  border-radius:var(--radius);
  position:relative;
  box-shadow:var(--shadow-lg);
  animation:detailIn .4s ease;
}
@keyframes detailIn{ from{ opacity:0; transform:translateY(30px);} to{ opacity:1; transform:translateY(0);} }

.detail-close{
  position:absolute;
  top:20px; right:20px;
  width:38px; height:38px;
  border-radius:50%;
  background:var(--bg-light);
  color:var(--ink);
  display:flex; align-items:center; justify-content:center;
  transition:var(--transition);
  z-index:2;
}
.detail-close:hover{ background:var(--primary); color:#fff; transform:rotate(90deg); }

.detail-modal-content{ padding:50px 45px; }
.product-detail-hero{ margin:-50px -45px 18px; height:260px; overflow:hidden; border-radius:var(--radius) var(--radius) 0 0; }
.product-detail-hero img{ width:100%; height:100%; object-fit:cover; }

.product-detail-excerpt{ color:var(--muted); font-weight:600; margin:14px 0 18px; }

.detail-meta{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  margin:10px 0 14px;
  color:var(--muted);
  font-weight:600;
  font-size:.86rem;
}
.detail-meta i{ color:var(--primary); }

.detail-block{ margin-bottom:20px; }
.detail-block h3{
  font-size:.85rem;
  font-weight:800;
  letter-spacing:.5px;
  text-transform:uppercase;
  color:var(--primary-dark);
  margin-bottom:12px;
}
.detail-block ul li{
  margin-bottom:10px;
  color:var(--ink);
  display:flex;
  gap:10px;
}
.detail-block ul li::before{
  content:'\f00c';
  font-family:'Font Awesome 6 Free';
  font-weight:900;
  color:var(--primary);
  margin-top:2px;
  font-size:.78rem;
}

.product-detail-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin:18px 0 24px;
}
.btn-outline{
  background:#fff;
  border:1.5px solid var(--border);
  color:var(--ink);
}
.btn-outline:hover{ border-color:var(--primary); color:var(--primary); }

@media (max-width:768px){
  .products-hero__content h1{ font-size:2rem; }
  .product-detail-hero{ margin:-36px -24px 18px; height:200px; }
  .detail-modal-content{ padding:36px 24px; }
}