/* Base Styles */
:root {
  --primary-color: #0066cc;
  --secondary-color: #f5f7fa;
  --text-color: #333;
  --light-text: #666;
  --border-color: #e0e0e0;
}

.bodya {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
  padding: 0;
  min-width: 320px;
}

/* Hero Section */
.cardhero {
  background: linear-gradient(to right, #0a84b4 0%, #0d9ec8 100%);
  color: #fff;
  padding: 1rem;
  text-align: center;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.cardhero h1 {
  margin: 0 0 0.3rem;
  font-size: 1.5rem;
  color: #fff;
}

.cardhero p {
  font-size: 0.9rem;
  margin: 0 0 0.8rem;
  color: #fdfdfd;
}

.cardstats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}

.cardstat {
  text-align: center;
  padding: 0.8rem;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 120px;
  background-color: rgba(255,255,255,0.1);
  min-height: 70px;
}

.cardstat-value {
  font-size: 1.3rem;
  font-weight: bold;
  color: #fdfdfd;
  margin-bottom: 0.3rem;
  display: block;
  min-height: 1.3rem;
}

.cardstat-label {
  font-size: 0.7rem;
  display: block;
}

/* Main Container */
.cardmain-container {
  display: flex;
  flex-wrap: wrap;
  margin: 1rem 2rem auto;
  padding: 0 1rem;
  gap: 2rem;
  max-width: 100%;
}

/* Filter Sidebar */
.cardfilter-sidebar {
  flex: 0 0 300px;
  background: #d8ecf1;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  height: fit-content;
  position: sticky;
  top: 20px;
}

.cardfilter-sidebar h3 {
  margin-top: 0;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.cardfilter-group {
  margin-bottom: 1.5rem;
}

.cardfilter-group strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.cardfilter-group label {
  display: block;
  margin: 0.5rem 0;
  cursor: pointer;
  font-size: 0.95rem;
}

.cardfilter-group input[type="radio"] {
  margin-right: 0.5rem;
}

/* Product Section */
.uniquecardproduct-section {
  flex: 1;
  min-width: 0;
}

.uniquecardsearch-bar {
  position: relative;
  margin-bottom: 1.5rem;
}

.uniquecardsearch-bar input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 42px;
  border: 1.5px solid rgba(4,142,180,0.45);
  border-radius: 22px;
  font-size: 1rem;
  box-sizing: border-box;
  background: url("/assets/icon/search.svg") no-repeat 16px center;
  background-size: 20px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.uniquecardsearch-bar input[type="text"]:focus {
  border-color: rgba(4,142,180,0.7);
  outline: none;
  box-shadow: 0 0 0 2px rgba(0,81,124,0.1);
}

/* Product Grid */
.cardproduct-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.product-card {
  background: #fff;
  border-radius: 40px;
  padding: 1.25rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  contain: layout style;
  backface-visibility: hidden;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  background-color: #dcf4ff;
}

.product-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.product-card h4 a {
  margin: 0 0 0.75rem;
  color: var(--primary-color);
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 550;
}

.product-card p {
  color: #565656;
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.product-card a {
  text-decoration: none;
}

/* Buttons */
.card-button-container {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 1rem;
  width: calc(100% - 2.5rem);
  position: absolute;
  bottom: 1.25rem;
}

.free-download,
.buy-now {
  padding: 0.55rem 0.6rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 3;
  text-align: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.free-download {
  background: #4caf50;
  color: #fff;
}

.buy-now {
  background: var(--primary-color);
  color: #fff;
  border: none;
}

.free-download:hover {
  background: #3e8e41;
  transform: scale(0.98);
}

.buy-now:hover {
  background: #0056b3;
  transform: scale(0.98);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination a {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-color);
}

.pagination a.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1200px) {
  .cardproduct-grid { gap: 1.5rem; }
}

@media (max-width: 1024px) {
  .cardproduct-grid { grid-template-columns: repeat(2, 1fr); }
  .cardhero { min-height: 180px; padding: 1rem 0.5rem; }
  .cardhero h1 { font-size: 1.4rem; }
  .cardhero p { font-size: 0.85rem; }
  .cardstat { width: 110px; padding: 0.7rem; min-height: 65px; }
  .cardstat-value { font-size: 1.2rem; }
  .cardstat-label { font-size: 0.65rem; }
  .cardmain-container { gap: 1.5rem; }
  .cardfilter-sidebar { padding: 1.2rem; }
}

@media (max-width: 768px) {
  .cardmain-container { flex-direction: column; }
  .cardfilter-sidebar {
    flex: 1; width: 100%; margin-bottom: 1.5rem; position: static;
  }
  .card-button-container {
    position: relative; bottom: auto; width: 100%;
  }
  .product-card { height: auto; min-height: 200px; }
}

@media (max-width: 640px) {
  .cardproduct-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .cardstats { justify-content: space-around; }
  .cardstat { width: calc(50% - 0.5rem); margin: 0.25rem; min-height: 60px; }
  .footer-container { flex-direction: column; gap: 1.5rem; }
  .footer-column { min-width: 100%; }
}

@media (max-width: 480px) {
  .cardhero h1 { font-size: 1.2rem; }
  .cardhero p { font-size: 0.75rem; }
  .cardstat { width: calc(50% - 0.25rem); padding: 0.5rem; min-height: 55px; }
  .product-card { padding: 1rem; }
  .product-card h4 { font-size: 1rem; }
  .product-card p { font-size: 0.85rem; }
  .free-download, .buy-now { padding: 0.5rem; font-size: 0.75rem; }
}

@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
  .cardproduct-grid { grid-template-columns: repeat(2, 1fr); }
  .card-button-container { width: calc(100% - 2.5rem); }
}

@media only screen and (min-device-width: 1024px) and (max-device-width: 1366px) {
  .cardproduct-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (orientation: landscape) and (max-width: 1024px) {
  .cardproduct-grid { grid-template-columns: repeat(2, 1fr); }
  .card-button-container { flex-direction: row; }
}
