/* Container Defaults */
.category-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 0px;
  align-items: flex-start;

}

.category-header-flex h2 {
  margin-bottom: 0px;
}

/* --- GRID MODE (Default) --- */
.ucp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 4 Columns */
  gap: 20px;
}

/* --- LIST MODE (Activated by JS) --- */
.ucp-grid.view-list {
  display: block;
  /* Stack items vertically */
}

.view-list .post-item-wrapper {
  margin-bottom: 15px;
  /* border-bottom: 1px solid #eee; */
  padding-bottom: 10px;
}

/* Hide images in List View */
.view-list .Imgthumb {
  display: none !important;
}

/* Make text card full width in List View */
.view-list .blog-content_v4 {
  width: 100% !important;
}

.view-switcher {
  display: flex;
  column-gap: 10px;
  align-items: center;
}

.toggle-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #ebf5ff;
  border-radius: 6px;
  padding: 5px;
  align-items: center;
}

.toggle-buttons .view-btn {
  border-radius: 6px;
  padding: 6px;
  height: 32px;
  width: 32px;
}

.view-btn.active {
  background-color: #fff;
}

/* Layout Alignment */
.category-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
}

.category-note {
  font-size: 16px;
  color: var(--uffizio-text-secondary);
  margin: 20px 0 30px;
}

/* Grid vs List Buttons */
.view-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-buttons {
  display: flex;
  background: #eef4f9;
  border-radius: 4px;
  padding: 2px;
}

.view-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #7cb9f3;
}

.view-btn.active {
  background: #fff;
  color: #1e88e5;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* The 4-Column Grid */
.ucp-grid.view-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Card Styling from your image */
.minimal-card {
  /* border: 1px solid #e0e6ed; */
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  background: #fff;
}

.post-image-thumb {
  background-color: #f0f3fb !important;
  /* The light blue/grey in your image */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  width: 315px;
  height: 235px;
}

.post-image-thumb img {
  max-width: 100%;
  max-height: 165px !important;
  object-fit: contain;
  /* mix-blend-mode: multiply; */
  mix-blend-mode: darken;
}

.post-content-area {
  padding: 20px;
  border-top: 1px solid #e0e6ed;

}

.brand-name {
  font-weight: 600;
  color: #444;
  font-size: 15px;
  margin-bottom: 5px;
}

.post-title {
  font-size: 18px;
  color: var(--uffizio-text-secondary) !important;
  margin: 0;
  font-weight: 600;
}

.post-title a {
  color: var(--uffizio-text-secondary) !important;

}

.post-title a:hover {
  color: var(--uffizio-color-accent) !important;
}

/* --- LIST VIEW OVERRIDE --- */
.view-list .ucp-grid {
  display: block;
}

.view-list .post-item-wrapper {
  margin-bottom: 10px;
}

.view-list .minimal-card {
  border: none;
  border-bottom: 1px solid #eee;
  border-radius: 0;
}

.view-list .post-image-thumb {
  display: none !important;
}

/* Hides image */
.view-list .post-content-area {
  padding: 10px 0;
  border: none;
}

.category-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.toggle-buttons {
  display: flex;
  background: #eef4f9;
  border-radius: 6px;
  padding: 3px;
}

.view-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: #7cb9f3;
}

.view-btn.active {
  background: #fff;
  color: #1e88e5;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Switching Logic */
.view-grid .list-table-wrapper {
  display: none;
}

.view-list .ucp-grid {
  display: none;
}

/* Grid Style */
.ucp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.minimal-card {
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.list-table-wrapper {
  border-radius: 8px;
  overflow: hidden;
}

.devices-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0px !important;
  margin-bottom: 0px;
}

.devices-table tr th {
  background-color: #EBF5FF !important;
}

.devices-table th {
  background: #eef7ff;
  padding: 20px;
  text-align: left;
  border-bottom: 1px solid #d1e3f3;
  border-right: 1px solid #d1e3f3;
}

.devices-table>tbody>tr:nth-of-type(even) {
  background: #F2F9FF !important;
}

.devices-table td {
  padding: 6px 20px;
  text-align: left;
}

.td-device a,
.td-manufacturer a {
  color: var(--uffizio-text-secondary);
}

.td-device a:hover,
.td-manufacturer a:hover {
  color: var(--uffizio-color-accent);
}

.col-index {
  width: 85px;
}

.devices-table td.td-index {
  text-align: center;
}

.td-category a {
  color: #1e88e5;
  text-decoration: none;
  font-weight: 500;
}

#view-container .ucp-grid {
  grid-template-columns: repeat(4, 1fr);
}

.sort-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  vertical-align: middle;
}

.sort-icon svg {
  opacity: 0.6;
  transition: opacity 0.2s;
}

th:hover .sort-icon svg {
  opacity: 1;
}

.devices-table {
  border-collapse: collapse;
  border: none;
}

.devices-table th:not(.col-index),
.devices-table td:not(.col-index) {
  border-bottom: 1px solid #d1e3f3;
  border: 1px solid #d1e3f3;
  padding: 12px;
}

.category-description p {
  line-height: 140%;
  letter-spacing: .5;
}

.post-item-wrapper {
  border: 1px solid #e0e6ed;
  border-radius: 8px;
}

@media (max-width:1024px) {
  .post-image-thumb {
    height: 205px;
    width: auto;
  }

  #view-container .ucp-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }

  .category-header-flex {
    margin-top: 0px;
  }
}

@media (max-width: 768px) {
  .devices-table tr th {
    font-size: 14px;
  }

  .sort-icon {
    margin-left: 0px;
    width: 9px;
  }

  .post-image-thumb {
    padding: 10px;
    width: 100%;
    height: 100%;
  }

  .post-image-thumb img {
    height: 100px !important;
    width: auto !important;
  }

  .ucp-grid {
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 10px;
  }

  .minimal-card {
    height: auto;
  }

  .toggle-buttons .view-btn {
    width: 22px;
    height: 22px;
    padding: 3px 4px;
  }

  .toggle-buttons .view-btn svg {
    width: 14px;
    height: 14px;
    ;
  }

  .post-title a {
    font-size: 14px;
  }

  .uffizio-category-page .ucp-grid {
    column-gap: 15px;
    row-gap: 40px;
  }

  .uffizio-category-page {
    padding-bottom: 50px;
    padding-top: 50px;
  }
}

@media (max-width:430px) {

  .ucp-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px;
  }
}

/* ================================================
   GPS Device Categories Archive Page Styles
   ================================================ */

.gps-device-categories-page {
  padding: 60px 0 80px;
}

/* Section Header (Title + Subtitle above cards) */
.categories-section-header {
  text-align: center;
  margin-bottom: 50px;
}

.categories-section-header .section-title {
  font-size: 42px;
  font-weight: 700;
  color: #1a2b3c;
  margin: 0 0 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 56px;
}

.categories-section-header .section-subtitle {
  font-size: 20px;
  line-height: 30px;
  color: #5c6b7a;
  max-width: 90%;
  margin: 0 auto;
}

/* Category Grid */
.device-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 41px;
}

/* Category Card */
.device-category-card {
  background: #ffffff;
  border: 1px solid #e8edf3;
  border-radius: 8px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.device-category-card:hover {
  border-color: #d0dae5;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transform: translateY(-3px);
}

.category-card-inner {
  padding: 30px 25px;
}

/* Category Icon */
.category-icon {
  margin-bottom: 20px;
}

.category-icon svg {
  width: 26px;
  height: 26px;
}

.category-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* Category Title */
.device-category-card .category-title {
  font-family: var(--uffizio-text-secondary);
  text-transform: capitalize;
  font-size: 17px;
  font-weight: 600;
  color: #1a2b3c;
  margin: 0 0 12px;
  line-height: 26px;
}

/* Category Description */
.device-category-card .category-description {
  font-size: 16px;
  line-height: 22px;
  color: #5c6b7a;
  margin: 0 0 20px;
  min-height: 72px;
}

/* Explore More Link */
.explore-more-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--uffizio-color-accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.explore-more-link:hover {
  color: #1565c0;
  gap: 12px;
}

.explore-more-link .arrow-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.explore-more-link:hover .arrow-icon {
  transform: translateX(3px);
}

.explore-more-link .arrow-icon svg {
  width: 18px;
  height: 18px;
}

/* No Categories Found */
.no-categories-found {
  text-align: center;
  padding: 60px 20px;
  color: #5c6b7a;
}

/* Responsive Styles for Category Archive */
@media (max-width: 1024px) {
  .device-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .gps-device-categories-page {
    padding: 40px 0 60px;
  }
}

@media (max-width: 768px) {
  .device-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .category-card-inner {
    padding: 20px;
  }

  .device-category-card .category-title {
    font-size: 17px;
  }

  .device-category-card .category-description {
    font-size: 13px;
    min-height: auto;
    margin-bottom: 15px;
  }

  .category-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 15px;
  }

  .category-icon svg {
    width: 22px;
    height: 22px;
  }

  .category-icon img {
    width: 26px;
    height: 26px;
  }

  .ucp-header .header-description {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .device-categories-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .device-category-card .category-description {
    min-height: auto;
  }
}

/* Search Results Styles */
.back-to-categories {
  color: var(--uffizio-color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.back-to-categories:hover {
  opacity: 0.8;
}

.search-results-grid {
  margin-top: 30px;
}

.no-results-found {
  text-align: center;
  padding: 60px 20px;
  color: #5c6b7a;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 30px;
}

.no-results-found p {
  font-size: 16px;
  margin: 0;
}