/**
 * Category Section Styles
 * Complex category layout with tailwind-inspired design
 */

.tp-category-section-wrapper {
  padding: 2rem 0;
  background: #f6f6f6;
}

.tp-category-section {
  width: 100%;
}

/* =================================
   TOP SECTION: PRODUCTS & SERVICES  
   ================================= */

.tp-category-section__top {
  margin-bottom: 2rem;
}

.tp-top-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (max-width: 468px) {
  .tp-top-grid {
    grid-template-columns: 1fr;
  }
}

.tp-section-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
  letter-spacing: -0.025em;
}

/* Section Header with Link */
.tp-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tp-section-header .tp-section-title {
  margin-bottom: 0;
}

.tp-section-link {
  color: #f97316;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.tp-section-link:hover {
  color: #ea580c;
}

/* Category Boxes */
.tp-category-boxes {
  display: grid;
  gap: 0.75rem;
}

/* Grid column variations */
.tp-category-boxes--cols-1 {
  grid-template-columns: 1fr;
}

.tp-category-boxes--cols-2 {
  grid-template-columns: 1fr 1fr;
}

.tp-category-boxes--cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.tp-category-boxes--cols-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.tp-products-section .tp-category-box:first-child {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  border: 1px solid #e2e8f0;
}
.tp-products-section .tp-category-box:nth-child(2) {
  background: linear-gradient(135deg, #fc466b 0%, #3f5efb 100%);
  border: 1px solid #fed7aa;
}
.tp-products-section .tp-category-box:nth-child(3) {
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  border: 1px solid #fed7aa;
}
.tp-products-section .tp-category-box:nth-child(4) {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: 1px solid #fed7aa;
}
.tp-services-section .tp-category-box:first-child {
  background: linear-gradient(135deg, #fdf2f8 0%, #f9a8d4 100%);
  border: 1px solid #f9a8d4;
}
.tp-services-section .tp-category-box:nth-child(2) {
  background: linear-gradient(135deg, #f0fdf4 0%, #a7f3d0 100%);
  border: 1px solid #a7f3d0;
}
.tp-category-box {
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tp-category-box:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tp-box-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
}

.tp-box-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  height: 100%;
  padding: 0.75rem;
  width: 100%;
  gap: 1rem;
  order: 2;
}

.tp-category-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tp-gray-200);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.tp-category-count {
  font-size: 0.9rem;
  color: var(--tp-gray-300);
  display: block;
}

.tp-view-more {
  font-size: 0.75rem;
  color: var(--tp-gray-200);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.2s ease;
}

.tp-view-more:hover {
  color: white;
}

.tp-view-more i {
  font-size: 0.625rem;
  transition: transform 0.2s ease;
}

.tp-view-more:hover i {
  transform: translateX(2px);
}

.tp-box-right {
  flex: 1;
  height: 100%;
  width: 100%;
  order: 1;
}

.tp-box-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mobile: Always use grid 2 columns */
@media (max-width: 1024px) {
  .tp-category-boxes,
  .tp-category-boxes--cols-1,
  .tp-category-boxes--cols-2,
  .tp-category-boxes--cols-3,
  .tp-category-boxes--cols-4 {
    grid-template-columns: 1fr 1fr;
  }
}
/* =================================
   BOTTOM SECTION: INDUSTRIES GRID
   ================================= */

.tp-category-section__bottom {
  margin-top: 2rem;
}

/* Desktop Grid */
.tp-industries-grid__desktop {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}

/* Mobile Industries Grid (replaces slider) */
.tp-industries-grid__mobile {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 1024px) {
  .tp-industries-grid__desktop {
    display: none;
  }

  .tp-industries-grid__mobile {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

.tp-industry-item {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 0.25rem;
  text-decoration: none;
  transition: all 0.2s ease;
  text-align: center;
  height: 100%;
  min-height: 140px;
}

.tp-industry-item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.tp-industry-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 3px;
  margin-bottom: 0.375rem;
  flex-shrink: 0;
}

.tp-industry-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: 2.4em;
  word-wrap: break-word;
  hyphens: auto;
}

/* =================================
   RESPONSIVE DESIGN
   ================================= */

/* Tablet */
@media (min-width: 640px) {
  .top-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .tp-section-title {
    font-size: 1.3rem;
  }

  .tp-category-name {
    font-size: 1.2rem;
  }

  .tp-category-count {
    font-size: 1rem;
  }

  .tp-view-more {
    font-size: 1rem;
  }

  /* Industries grid on tablet - hide desktop, show mobile grid */
  .tp-industries-grid__desktop {
    display: none;
  }

  .tp-industries-grid__mobile {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .tp-industry-item {
    padding: 0.625rem;
  }

  .tp-industry-name {
    font-size: 1rem;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .container {
    padding: 0 1.5rem;
  }

  .tp-category-section__top {
    margin-bottom: 3rem;
  }

  .tp-category-section__bottom {
    margin-top: 3rem;
  }

  .tp-section-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }

  .tp-category-name {
    font-size: 1.2rem;
  }

  /* Industries grid on desktop */
  .tp-industries-grid__desktop {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
  }

  .tp-industries-grid__mobile {
    display: none;
    gap: 0.5rem;
  }

  .tp-industry-item {
    padding: 0.75rem;
  }

  .tp-industry-name {
    font-size: 1rem;
  }
}

/* Mobile Slider for Industries */
@media (max-width: 639px) {
  .tp-industries-grid__desktop {
    display: none;
  }

  .tp-industries-slider {
    display: block;
  }

  .tp-industries-slider .tp-industry-item {
    margin: 0;
  }
}

/* =================================
   NO CATEGORIES FALLBACK
   ================================= */

.no-categories {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 5px;
}

/* =================================
   SPLIDE OVERRIDES
   ================================= */

.tp-industries-slider.splide {
  padding-bottom: 2rem;
}

.tp-industries-slider .splide__pagination {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 0.375rem;
}

.tp-industries-slider .splide__pagination__page {
  all: unset;
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  padding: 0;
  margin: 0;
  transition: all 0.2s ease;
}

.tp-industries-slider .splide__pagination__page.is-active {
  background: var(--primary-color);
  transform: scale(1.2);
}

/* =================================
   ACCESSIBILITY & INTERACTIONS
   ================================= */

.tp-category-box:focus-within,
.tp-industry-item:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tp-category-box,
  .tp-industry-item,
  .tp-view-more,
  .tp-view-more i {
    transition: none;
  }

  .tp-category-box:hover,
  .tp-industry-item:hover {
    transform: none;
  }

  .tp-view-more:hover i {
    transform: none;
  }
}

/* High contrast */
@media (prefers-contrast: high) {
  .tp-category-box,
  .tp-industry-item {
    border-width: 2px;
  }

  .tp-category-box:hover,
  .tp-industry-item:hover {
    border-color: var(--text-primary);
  }
}

/* =================================
   PRODUCTS SECTIONS
   ================================= */

.tp-category-section__products {
  margin-top: 3rem;
}

.tp-product-section {
  margin-bottom: 2.5rem;
}

.tp-product-section:last-child {
  margin-bottom: 0;
}

/* Products Grid */
.tp-products-grid {
  width: 100%;
}

/* Desktop: 6 products in 1 row */
.tp-products-grid__desktop {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.5rem;
}

/* Tablet: 6 products in 3x2 layout */
.tp-products-grid__tablet {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Mobile: 6 products in 2x3 layout */
.tp-products-grid__mobile {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .tp-products-grid__desktop,
  .tp-products-grid__tablet {
    display: none;
  }

  .tp-products-grid__mobile {
    display: grid;
  }

  .tp-product-section {
    margin-bottom: 2rem;
  }

  .tp-category-section__products {
    margin-top: 2rem;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .tp-products-grid__desktop {
    display: none;
  }

  .tp-products-grid__tablet {
    display: grid;
  }
}

/* No products message */
.tp-no-products {
  text-align: center;
  padding: 2rem;
  color: #6b7280;
  font-style: italic;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}