/**
 * Tenbit Addon - WooCommerce Products Grid & Cards Styles
 * Author: Team Tenbit (https://tenbitsol.com)
 * Version: 1.0.0
 */

/* Grid Wrapper */
.tenbit-products-wrapper {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.tenbit-products-grid {
  display: grid;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Columns */
.tenbit-products-grid.columns-1 { grid-template-columns: 1fr; }
.tenbit-products-grid.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tenbit-products-grid.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tenbit-products-grid.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tenbit-products-grid.columns-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tenbit-products-grid.columns-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Product Card */
.tenbit-product-card {
  position: relative;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.tenbit-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.15);
}

/* Media Wrapper */
.tenbit-product-card .product-media-wrapper {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 Aspect Ratio Square */
  background-color: #f7f6f2;
  overflow: hidden;
}

.tenbit-product-card .woocommerce-loop-product__link-media,
.tenbit-product-card .product-media-wrapper > a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tenbit-product-card .attachment-woocommerce_thumbnail,
.tenbit-product-card .product-media-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tenbit-product-card:hover .attachment-woocommerce_thumbnail,
.tenbit-product-card:hover .product-media-wrapper img {
  transform: scale(1.06);
}

/* Badges (Top-Left) */
.product-card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  pointer-events: none;
}

.product-card-badges .badge {
  display: inline-flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 2px;
  line-height: 1.2;
}

.product-card-badges .badge-blaze {
  background-color: #ff5500;
  color: #ffffff;
}

.product-card-badges .badge-dark {
  background-color: #0d0f0e;
  color: #ffffff;
}

.product-card-badges .badge-olive {
  background-color: #3b4739;
  color: #ffffff;
}

/* Wishlist Action (Top-Right) */
.product-card-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}

.btn-card-action {
  width: 36px;
  height: 36px;
  background-color: #ffffff;
  color: #191917;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 1rem;
}

.btn-card-action:hover {
  background-color: #ff5500;
  color: #ffffff;
  border-color: #ff5500;
  transform: scale(1.1);
  box-shadow: 0 4px 14px rgba(255, 85, 0, 0.35);
}

.btn-card-action.active {
  background-color: #ff5500;
  color: #ffffff;
  border-color: #ff5500;
}

/* Quick View Hover Bar (Slides up on Hover) */
.quick-view-btn-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 6;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tenbit-product-card:hover .quick-view-btn-bar {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.quick-view-btn-bar button,
.quick-view-btn-bar a {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: rgba(13, 15, 14, 0.92);
  color: #ffffff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 11px 16px;
  border: none;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background-color 0.2s ease;
}

.quick-view-btn-bar button:hover,
.quick-view-btn-bar a:hover {
  background-color: #ff5500;
  color: #ffffff;
}

/* Product Info Wrap */
.product-info-wrap {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  background-color: #ffffff;
}

/* Category & Tech Spec Tag */
.product-category-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #939185;
  margin-bottom: 6px;
}

/* Product Title */
.tenbit-product-card .woocommerce-loop-product__title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.1;
  color: #191917;
  margin: 0 0 8px 0;
  padding: 0;
}

.tenbit-product-card .woocommerce-loop-product__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tenbit-product-card .woocommerce-loop-product__title a:hover {
  color: #ff5500;
}

/* Star Rating */
.tenbit-product-card .star-rating-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.tenbit-product-card .star-rating-stars {
  color: #ff5500;
  font-size: 0.85rem;
  letter-spacing: 2px;
  line-height: 1;
}

.tenbit-product-card .star-rating-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: #939185;
  line-height: 1;
}

/* Swatches */
.product-card-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.swatch-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.swatch-dot:hover {
  transform: scale(1.2);
}

.swatch-dot.active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 3.5px #ff5500;
  transform: scale(1.15);
}

/* Product Card Footer (Price & Add to Pack) */
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin-top: auto;
  gap: 12px;
}

.tenbit-product-card .price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.45rem;
  font-weight: 800;
  color: #191917;
  line-height: 1;
}

.tenbit-product-card .price del {
  color: #939185;
  font-size: 1.05rem;
  font-weight: 600;
  text-decoration: line-through;
}

.tenbit-product-card .price ins {
  text-decoration: none;
  color: #ff5500;
}

/* Add to Pack Button */
.tenbit-product-card .button.add_to_cart_button,
.tenbit-product-card .btn-add-to-pack {
  background-color: #0d0f0e;
  color: #ffffff;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 18px;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tenbit-product-card .button.add_to_cart_button:hover,
.tenbit-product-card .btn-add-to-pack:hover {
  background-color: #ff5500;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(255, 85, 0, 0.35);
  transform: translateY(-1px);
}

/* --- Responsive Layout Adjustments --- */
@media (max-width: 1200px) {
  .tenbit-products-grid.columns-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .tenbit-products-grid.columns-3,
  .tenbit-products-grid.columns-4,
  .tenbit-products-grid.columns-5,
  .tenbit-products-grid.columns-6 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  
  .tenbit-product-card .woocommerce-loop-product__title {
    font-size: 1.15rem;
  }
  
  .tenbit-product-card .price {
    font-size: 1.25rem;
  }

  .tenbit-product-card .button.add_to_cart_button,
  .tenbit-product-card .btn-add-to-pack {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .tenbit-products-grid {
    grid-template-columns: 1fr !important;
  }
}
