/* ============================================================
   VetPCR – Tienda/Categorías en TABLA (paleta KP)
============================================================ */
:root{
  --kp-primary:#9b54ec;
  --kp-primary-700:#5a38b5;
  --kp-ink:#202040;
  --kp-panel:#f4f5f5;
  --kp-white:#fff;
}

/* Contexto */
body.post-type-archive-product,
body.tax-product_cat{
  background-color:var(--kp-panel);
  font-family:'Poppins', sans-serif;
}

/* Header / Footer (igual que tenías) */
body.post-type-archive-product .custom-header,
body.tax-product_cat .custom-header{ background-color:var(--kp-primary); }
body.post-type-archive-product .custom-header a,
body.tax-product_cat .custom-header a,
body.post-type-archive-product .custom-header .login-icon,
body.tax-product_cat .custom-header .login-icon{ color:var(--kp-white); }
body.post-type-archive-product .custom-header .login-icon:hover,
body.tax-product_cat .custom-header .login-icon:hover{ color:var(--kp-primary); transition:color .3s; }
body.post-type-archive-product .custom-header .nav-menu>li>a:hover,
body.tax-product_cat .custom-header .nav-menu>li>a:hover{ background:var(--kp-white); color:var(--kp-primary); }
body.post-type-archive-product .custom-header .sub-menu,
body.tax-product_cat .custom-header .sub-menu{ background:var(--kp-primary)!important; border-radius:12px; padding:.5rem 0; }
body.post-type-archive-product .custom-header .sub-menu li a:hover,
body.tax-product_cat .custom-header .sub-menu li a:hover{ background:var(--kp-white)!important; color:var(--kp-primary)!important; }
body.post-type-archive-product .site-footer,
body.tax-product_cat .site-footer{ background-color:var(--kp-primary); }

/* Contenedor general */
.category-wrapper{
  display:flex; gap:2.5rem; padding:3rem 5%;
  align-items:flex-start; margin-top:1rem;
}

/* Sidebar */
.sidebar-subcategories{ margin-top:1rem; min-width:200px; font-size:16px; font-weight:600; color:var(--kp-primary); }
.sidebar-subcategories .sidebar-search{ margin-bottom:2rem; margin-left:-3rem !important; }
.sidebar-subcategories .sidebar-search input[type="search"]{
  width:100%; padding:.5rem; border:1px solid #ccc; border-radius:12px;
}
.sidebar-subcategories .back-to-shop-btn{
  display:block; margin-top:1rem; margin-bottom:2rem;
  font-size:.95rem; font-weight:500; color:var(--kp-primary);
  text-decoration:none; background:none; border:none; transition:color .3s;
}
.sidebar-subcategories .back-to-shop-btn:hover{ color:var(--kp-primary); text-decoration:underline; }
.sidebar-subcategories .back-to-icons-btn{
  display:block;
  margin-top:0;
  margin-bottom:.5rem;
  font-size:1rem;
  font-weight:600;
  color:var(--kp-primary);
  text-decoration:none;
  background:none;
  border:none;
  transition:color .3s;
}

.sidebar-subcategories .back-to-icons-btn:hover{
  text-decoration:underline;
}


/* Título principal */
.category-main-title{
  background-color:var(--kp-primary); color:var(--kp-white);
  font-size:1.8rem; font-weight:700; padding:.8rem 2rem; margin-bottom:2.0rem;
  border-radius:40px 0 0 40px; width:1200px; text-align:left;
  margin-right:0; transform:translateX(30px);
}

/* Result-count y ordering */
.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering{
  color:var(--kp-primary); font-weight:600; font-family:'Poppins', sans-serif;
}
.woocommerce .woocommerce-ordering{ position:relative; display:inline-block; margin-right:6rem; }
.woocommerce .woocommerce-ordering select{
  background-color:var(--kp-panel); color:var(--kp-primary);
  border:none; border-radius:20px; padding:.6rem; width:230px; appearance:none;
}
.woocommerce .woocommerce-ordering::after{
  content:'▼'; position:absolute; right:.9rem; top:50%; transform:translateY(-50%);
  color:var(--kp-primary); font-size:.8rem; pointer-events:none;
}
.woocommerce .woocommerce-ordering select:hover{
  background-color:var(--kp-primary)!important; color:#fff!important;
}
.woocommerce .woocommerce-ordering:hover::after{ color:#fff!important; }

/* =========================
   NUEVO: TABLA DE PRODUCTOS
   ========================= */
.kp-table-wrap{
  background:var(--kp-white);
  box-shadow:0 8px 20px rgba(0,0,0,.06);
  border-radius:16px; padding:0; overflow:hidden;
  margin:0 2rem 2.5rem 2rem;
}

.kp-product-table{
  width:100%; border-collapse:separate; border-spacing:0;
}

.kp-product-table thead th{
  background:linear-gradient(180deg, var(--kp-primary), var(--kp-primary-700));
  color:#fff; text-align:left; padding:1rem 1.25rem; font-weight:700;
  font-size:.95rem;
}
.kp-product-table thead th:first-child{ border-top-left-radius:16px; }
.kp-product-table thead th:last-child{ border-top-right-radius:16px; }

.kp-product-table tbody tr{
  background:#fff;
}
.kp-product-table tbody tr:nth-child(even){
  background:#fafafa;
}
.kp-product-table tbody td{
  padding:1rem 1.25rem; vertical-align:middle; color:var(--kp-ink);
  border-top: 1px solid rgb(10 10 25 / 87%);
}

/* Columnas (ancho sugerido) */
.kp-col-name  { width: 28%; }
.kp-col-type  { width: 10%; }
.kp-col-desc  { width: 36%; }
.kp-col-cart  { width: 13%; text-align:right; }

/* Nombre */
.kp-name-link{
  color:#1e2148; text-decoration:none; font-weight:700;
}
.kp-name-link:hover{ text-decoration:underline; }

/* Badge “Single/Panel” */
.kp-badge{
  display:inline-block; padding:.25rem .6rem; border-radius:999px;
  font-size:.8rem; font-weight:700; letter-spacing:.2px;
  background:#ecebff; color:#382a7a; border:1px solid rgba(90,56,181,.2);
}
.kp-badge.is-panel{
  background:#f3e9ff; color:#5a38b5; border-color:rgba(122,77,255,.25);
}
.kp-badge.is-single{
  background:#e9f6ff; color:#0a4670; border-color:rgba(10,70,112,.25);
}

/* Descripción corta */
.kp-cell-desc{
  line-height:1.45; opacity:.95;
   -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}
.kp-subcat-pills{
  display:flex; flex-wrap:wrap; gap:.5rem; margin: .75rem 0 1.25rem;
}
.kp-subcat-pills .kp-pill{
  display:inline-block; padding:.45rem .8rem; border-radius:999px;
  background:#f1f3f5; color:#022e47; font-weight:600; font-size:.92rem;
  border:1px solid rgba(2,46,71,.08); text-decoration:none;
}
.kp-subcat-pills .kp-pill:hover{ background:#e7ebef; }
.kp-subcat-pills .kp-pill.is-active{
  background:#7a4dff; color:#fff; border-color:transparent;
}


/* Botón “Añadir al carrito” */
.kp-cell-cart .button{
  background:var(--kp-primary); color:#fff; border-radius:999px; font-weight:700; font-size:.9rem;
  border:none; box-shadow:0 6px 16px rgba(122,77,255,.25);
}
.kp-cell-cart .button:hover{ background:var(--kp-primary-700); }

/* Ocultar por completo la grilla estándar UL de Woo en este layout */
.woocommerce ul.products,
.woocommerce-page ul.products{
  display:none !important;
}

/* Paginación */
nav.woocommerce-pagination ul.page-numbers li a,
nav.woocommerce-pagination ul.page-numbers li span{
  background:var(--kp-primary); color:#fff;
}
nav.woocommerce-pagination ul.page-numbers li .current{
  background:#105a8b;
}
.woocommerce-js a.button{
  padding-left:6px;
  padding-bottom: 3px;
  padding-top: 3px;
  padding-right: 3px;
}
/* =========================
   Responsive
   ========================= */

/* Tablets */
@media (min-width:768px) and (max-width:991px){
  .category-wrapper{ flex-direction:column; padding:2rem; margin:0 auto; }
  .category-main-title{
    font-size:1.6rem; width:100%; text-align:center; margin:0 auto 1.5rem; transform:none !important;
    border-radius:20px;
  }
  .sidebar-subcategories{ width:100% !important; text-align:center !important; margin-top:6rem !important; }

  .kp-table-wrap{ margin:0 0 2rem 0; }
  .kp-col-name  { width: 32%; }
  .kp-col-type  { width: 12%; }
  .kp-col-desc  { width: 36%; }
  .kp-col-cart  { width: 10%; }
}

/* Móviles: la tabla se convierte en “cards” apiladas */
@media (max-width:767px){
  body{ overflow-x:hidden !important; }

  .category-wrapper{
    flex-direction:column !important; padding:2rem 1rem !important; margin:2rem auto 0 !important;
    gap:1.5rem; width:100% !important; box-sizing:border-box;
  }
  .category-main-title{
    width:100% !important; margin:0 auto 1.25rem !important; padding:1rem !important;
    font-size:1.5rem; text-align:center; border-radius:20px; transform:none !important;
  }

  .kp-table-wrap{ margin:0; border-radius:12px; }
  .kp-product-table thead{ display:none; }
  .kp-product-table, .kp-product-table tbody, .kp-product-table tr, .kp-product-table td{ display:block; width:100%; }
  .kp-product-table tbody tr{
    background:#fff; margin-bottom:1rem; border-radius:12px; border:1px solid rgba(2,46,71,.06);
    box-shadow:0 8px 18px rgba(0,0,0,.05); overflow:hidden;
  }
  .kp-product-table tbody td{
    border:none; border-bottom:1px dashed rgba(32,32,64,.08);
    padding:.85rem 1rem;
  }
  .kp-product-table tbody td:last-child{ border-bottom:none; }

  .kp-cell-name{ font-size:1.05rem; }
  .kp-cell-cart{ text-align:left; }
}
@media (max-width: 767px){

  .sidebar-subcategories{
    width: 100%;
    margin-top: 1rem !important;
    text-align:left !important;
    padding: 0 1rem;
  }

  .sidebar-subcategories .sidebar-search{
    margin-left: 0 !important;
    margin-bottom: 1.25rem;
  }

  .sidebar-subcategories .back-to-shop-btn{
    font-size: 1rem;
    margin-bottom: 1.25rem;
  }

  /* Pills más compactas */
  .kp-subcat-pills{
    gap: .4rem;
    margin: .5rem 0 1.5rem;
  }
  .kp-subcat-pills .kp-pill{
    padding: .4rem .8rem;
    font-size: .9rem;
  }
}
