.comp-archive {
  display: grid;
  gap: 50px;
  align-items: start;
  font-family: Manrope, sans-serif;
}

.comp-topbar {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
}

.comp-searchwrap {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 10px;
}

input.comp-search {
  width: 100%;
  padding: 10px 12px;
  border-radius: 3px !important;
  border: 1px solid #ddd !important;
  outline: none;
}

button.comp-search-btn {
  border: 1px solid #000;
  background: #000;
  color: #fff !important;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 60%;
  padding: 8px !important;
}

button.comp-search-btn:hover {
  background: transparent !important;
  color: #000 !important;
}

button.comp-search-btn:hover svg path {
  fill: #000;
}

button.comp-search-btn:focus {
  background: transparent !important;
  color: #000 !important;
}

button.comp-search-btn:focus svg path {
  fill: #000;
}

.comp-sortwrap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  justify-content: end;
}

label.comp-sortlabel {
  font-size: 16px;
  color: #000;
  font-weight: 500;
}

.comp-sort {
  width: 100%;
  padding: 8px 12px;
  border-radius: 3px;
  border: 1px solid #ddd;
  background: #fff;
}

button.comp-sort-toggle {
  display: none;
}

.comp-count {
  margin: 10px 0 16px;
  color: #666;
  font-size: 14px !important;
}

.comp-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.comp-card {
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.comp-card-img {
  display: block;
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #f5f5f5;
}

.comp-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comp-card-body {
  padding: 20px;
}

.comp-card-title {
  display: block;
  font-weight: 600;
  font-size: 20px;
  color: #000;
  text-decoration: none;
  margin-bottom: 6px;
}

.comp-card-title:hover {
  text-decoration: underline;
  color: black !important;
}

.comp-loc {
  color: #666;
  font-size: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comp-loc svg {
  flex-shrink: 0;
}

.comp-contact-item {
  color: #666;
  font-size: 13px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comp-contact-item svg {
  flex-shrink: 0;
}

.comp-contact-item a {
  color: #000;
  text-decoration: none;
}

.comp-contact-item a:hover {
  text-decoration: underline;
}

.comp-desc {
  color: #666;
  font-size: 14px;
  min-height: 44px;
  margin-bottom: 14px;
  margin-top: 10px;
}

.comp-details {
  color: #000;
  text-decoration: none;
  font-weight: 500 !important;
  font-size: 14px;
  transition-property: all;
  transition-timing-function: cubic-bezier(.4, 0, .2, 1);
  transition-duration: .15s;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 3px;
  margin-top: 20px;
  justify-content: center;
  border: 1px solid black;
}

.comp-details svg {
  margin-top: 2px !important;
}

.comp-details:hover {
  color: black !important;
  gap: 8px;
  background: transparent;
}

.comp-empty {
  padding: 16px;
  border: 1px dashed #ddd;
  border-radius: 12px;
  color: #666;
}

.comp-pager {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 18px;
}

.comp-pagebtn {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.comp-pagebtn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.comp-pagetext {
  font-size: 13px;
  color: #666;
}

.comp-sort-toggle {
  position: relative;
  z-index: 9999;
  pointer-events: auto !important;
}

@media (max-width: 980px) {
  .comp-topbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  label.comp-sortlabel {
    display: none !important;
  }

  select.comp-sort {
    display: none;
  }

  button.comp-sort-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: black;
    border: 0;
    padding: 8px;
    border: 1px solid #000;
    cursor: pointer;
    border-radius: 3px;
  }

  .comp-sort-toggle:focus,
  .comp-sort-toggle:hover {
    background: transparent !important;
    color: #000 !important;
  }

  .comp-sort-toggle:hover svg path,
  .comp-sort-toggle:focus svg path,
  .comp-sort-toggle:active svg path {
    stroke: #000 !important;
  }

  .comp-sortwrap.is-open .comp-sort {
    display: block !important;
  }

  .comp-sortwrap {
    display: flex !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .comp-searchwrap {
    width: 100%;
    grid-template-columns: 1fr 80px;
  }

  input.comp-search {
    width: 100%;
  }

  .comp-topbar {
    display: flex;
    gap: 0px;
  }
}

/* Single Company Page - Products Section */
.comp-products-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #eee;
  clear: both;
}

.comp-products-title {
  font-size: 24px;
  font-weight: 800; /* Bolt */
  margin-bottom: 30px;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: Manrope, sans-serif;
}

/* Force 4 columns on company page */
.comp-products-grid-4 .prod-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

/* Carousel Specific Styles */
.comp-products-grid-4.is-carousel {
  position: relative;
  padding: 0;
}

.comp-products-grid-4.is-carousel .carousel-track {
  display: flex !important;
  grid-template-columns: none !important;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 18px !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 0;
}

.comp-products-grid-4.is-carousel .carousel-track::-webkit-scrollbar {
  display: none;
}

.comp-products-grid-4.is-carousel .prod-card {
  flex: 0 0 calc((100% - 54px) / 4) !important; /* Exactly 4 columns */
  min-width: calc((100% - 54px) / 4) !important;
  scroll-snap-align: start;
}

.comp-carousel-arrow {
  all: unset !important;
  position: absolute !important;
  top: 150px !important; /* Center on 220px image + 40px margin */
  width: 40px !important;
  height: 40px !important;
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid #eeeeee !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  z-index: 1000 !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

.comp-carousel-arrow:hover {
  background: #000000 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
}

.comp-carousel-arrow svg {
  width: 18px !important;
  height: 18px !important;
  display: block;
  stroke: currentColor;
}

.comp-carousel-arrow.prev {
  left: 10px !important; /* Overlay on the first image */
}

.comp-carousel-arrow.next {
  right: 10px !important; /* Overlay on the last image */
}

.comp-carousel-arrow svg {
  width: 20px !important;
  height: 20px !important;
  display: block;
  stroke: currentColor;
}

.comp-carousel-arrow.prev {
  left: -22px; /* Half of width to overlay neatly */
}

.comp-carousel-arrow.next {
  right: -22px; /* Half of width to overlay neatly */
}

@media (max-width: 1100px) {
  .comp-products-grid-4.is-carousel .prod-card {
    flex: 0 0 calc(33.333% - 12px);
  }
}

@media (max-width: 850px) {
  .comp-products-grid-4.is-carousel .prod-card {
    flex: 0 0 calc(50% - 9px);
  }
}

@media (max-width: 550px) {
  .comp-products-grid-4.is-carousel .prod-card {
    flex: 0 0 100%;
  }
  .comp-products-grid-4.is-carousel {
    padding: 0 30px;
  }
}

@media (max-width: 980px) {
  .comp-products-grid-4:not(.is-carousel) .prod-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  .comp-products-grid-4:not(.is-carousel) .prod-grid {
    grid-template-columns: 1fr !important;
  }
}

