/* ========================================
   PRODUCT CARDS - Clean Mobile-First Rewrite
   Replaces scattered product card styles
   ======================================== */

/* ---- Grid Card ---- */
.shop-product-wrap .product-item {
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
  display: grid;
  grid-template-rows: auto 32px 2.6em 3em auto;
}

/* ---- Image Container ---- */
.shop-product-wrap .product-item .product-thumb {
  position: relative;
  overflow: hidden;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border-bottom: 1px solid #e8e8e8;
}

.shop-product-wrap .product-item .product-thumb img.pri-img {
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
}

/* Secondary image: centered, hidden by default */
.shop-product-wrap .product-item .product-thumb img.sec-img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

/* ---- Desktop hover: swap images ---- */
@media (hover: hover) {
  .shop-product-wrap .product-item:hover .product-thumb img.pri-img {
    opacity: 0;
    visibility: hidden;
  }
  .shop-product-wrap .product-item:hover .product-thumb img.sec-img {
    opacity: 1;
    visibility: visible;
  }
}

/* ---- Badges ---- */
.shop-product-wrap .product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.shop-product-wrap .product-label {
  position: static;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.4;
  color: #fff;
  background: var(--color-primary, #010096);
}

.shop-product-wrap .product-label.discount {
  background: #dc3545;
}

.shop-product-wrap .product-label.scratch-dent {
  position: absolute;
  top: -12px;
  left: -12px;
  width: 130px;
  height: 130px;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border-radius: 0;
  pointer-events: none;
}

.shop-product-wrap .product-label.scratch-dent span {
  display: block;
  position: absolute;
  top: 22px;
  left: -50px;
  width: 180px;
  padding: 5px 0;
  background: linear-gradient(135deg, var(--color-primary-dark, #10157C), var(--color-primary, #010096));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-transform: none;
  letter-spacing: 0.3px;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  border-top: 2px solid #f5c518;
  border-bottom: 2px solid #f5c518;
}

/* ---- Action Buttons (wishlist, compare, quickview) ---- */
.shop-product-wrap .button-group {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 4;
}

.shop-product-wrap .button-group a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  color: #555;
  font-size: 16px;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.2s ease;
}

/* ---- Add to Cart ---- */
.shop-product-wrap .box-cart {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 8px;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.2s ease;
  background: rgba(255,255,255,0.95);
}

.shop-product-wrap .box-cart .btn-cart {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary, #010096);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.shop-product-wrap .box-cart .btn-cart:hover {
  background: #000070;
}

.shop-product-wrap .box-cart .btn-cart:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

/* ---- Caption (below image) ---- */
.shop-product-wrap .product-caption {
  padding: 12px 16px 16px;
  text-align: left;
  display: contents;
}

.shop-product-wrap .product-caption .manufacturer-name {
  padding: 12px 16px 0;
  display: flex;
  align-items: center;
}

.shop-product-wrap .product-caption .manufacturer-name a {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.shop-product-wrap .product-caption .product-name,
.shop-product-wrap .product-caption .product-title-wrapper {
  padding: 0 16px;
  overflow: hidden;
}

.shop-product-wrap .product-caption .product-title-wrapper a {
  display: block;
}

.shop-product-wrap .product-caption .product-title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  color: #222;
  line-height: 1.3;
}

.shop-product-wrap .product-caption .product-name a {
  font-size: 14px;
  font-weight: 500;
  color: #222;
  line-height: 1.3;
  display: block;
}

.shop-product-wrap .product-caption .product-description-container {
  padding: 0 16px;
  overflow: hidden;
}

.shop-product-wrap .product-caption .price-box {
  padding: 12px 16px 16px;
  border-top: 1px solid #f0f0f0;
  align-self: end;
}

.shop-product-wrap .product-caption .price-regular {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary, #010096);
}

.shop-product-wrap .product-caption .price-old {
  font-size: 13px;
  color: #999;
  margin-right: 6px;
}

/* ---- Desktop hover effects ---- */
@media (hover: hover) {
  .shop-product-wrap .product-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  }

  .shop-product-wrap .product-item:hover .button-group a {
    opacity: 1;
    transform: translateX(0);
  }

  .shop-product-wrap .product-item:hover .box-cart {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Mobile: always show cart button ---- */
@media (max-width: 991px) {
  .shop-product-wrap .box-cart {
    position: static;
    opacity: 1;
    transform: none;
    background: none;
    padding: 0 16px 12px;
  }

  .shop-product-wrap .button-group a {
    opacity: 1;
    transform: none;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}

/* ---- Description ---- */
.shop-product-wrap .product-description {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-product-wrap .product-description.expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}

.shop-product-wrap .description-toggle-btn {
  background: none;
  border: none;
  color: #888;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
}

@media (max-width: 767px) {
  .shop-product-wrap .product-description {
    -webkit-line-clamp: unset;
    overflow: visible;
    font-size: 12px;
  }
  .shop-product-wrap .description-toggle-btn {
    display: none;
  }
}

/* ========================================
   LIST VIEW
   ======================================== */

.shop-product-wrap.list-view .product-item {
  display: none;
}

.shop-product-wrap.list-view .product-list-item {
  display: flex;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  margin-bottom: 16px;
  gap: 20px;
  transition: box-shadow 0.2s ease;
}

.shop-product-wrap.list-view .product-list-item .product-thumb {
  flex: 0 0 220px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fafafa;
  border-radius: 6px;
  position: relative;
}

.shop-product-wrap.list-view .product-list-item .product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.shop-product-wrap.list-view .product-content-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0;
  max-width: none;
}

.shop-product-wrap.list-view .product-content-list .product-name {
  margin-bottom: 8px;
}

.shop-product-wrap.list-view .product-content-list .product-name a {
  font-size: 16px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
}

.shop-product-wrap.list-view .product-content-list .product-description {
  -webkit-line-clamp: 3;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

.shop-product-wrap.list-view .product-content-list .price-box {
  margin-top: auto;
  padding-top: 12px;
  justify-content: flex-start;
}

/* List view column override */
.shop-product-wrap.list-view .col-md-4 {
  flex: 0 0 100%;
  max-width: 100%;
}

@media (hover: hover) {
  .shop-product-wrap.list-view .product-list-item:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  }
}

/* List view mobile */
@media (max-width: 767px) {
  .shop-product-wrap.list-view .product-list-item {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .shop-product-wrap.list-view .product-list-item .product-thumb {
    flex: none;
    max-width: 200px;
    align-self: center;
  }

  .shop-product-wrap.list-view .product-content-list .product-name a {
    font-size: 15px;
  }

  .shop-product-wrap.list-view .product-content-list .product-description {
    -webkit-line-clamp: unset;
    overflow: visible;
    font-size: 13px;
  }
}

/* ========================================
   GRID VIEW (explicit)
   ======================================== */

.shop-product-wrap.grid-view .product-item {
  display: flex;
}

.shop-product-wrap.grid-view .product-list-item {
  display: none;
}

/* Grid columns */
.shop-product-wrap [class*="col-"] {
  margin-bottom: 0;
}

/* ========================================
   SIDEBAR BRAND LOGOS
   ======================================== */

/* More spacing between sidebar items */
.sidebar-wrapper .shop-categories li a {
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Separator line between items */
.sidebar-wrapper .shop-categories li {
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-wrapper .shop-categories li:last-child {
  border-bottom: none;
}

/* Hover: only change text color, no background on the link */
.sidebar-wrapper .shop-categories li a:hover,
.sidebar-wrapper .shop-categories li:hover a,
.sidebar-wrapper .shop-categories li a:active,
.sidebar-wrapper .shop-categories li a:focus {
  color: #010096;
  background: transparent;
  background-color: transparent;
}

/* Badge hover - works for both text and logo items since badge is always a > span */
.sidebar-wrapper .shop-categories li a span {
  float: none;
  margin-left: auto;
  flex-shrink: 0;
}

.sidebar-wrapper .shop-categories li:hover a span {
  background-color: #010096;
  color: #fff;
}

/* Scratch & Dent ribbon - generic (product detail, quickview) */
.product-label.scratch-dent {
  position: absolute;
  top: 0;
  left: 0;
  width: 130px;
  height: 130px;
  overflow: hidden;
  padding: 0;
  background: transparent;
  border-radius: 0;
  pointer-events: none;
  z-index: 5;
}

.product-label.scratch-dent span {
  display: block;
  position: absolute;
  top: 22px;
  left: -45px;
  width: 180px;
  padding: 5px 0;
  background: linear-gradient(135deg, var(--color-primary-dark, #10157C), var(--color-primary, #010096));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-transform: none;
  letter-spacing: 0.3px;
  transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  border-top: 2px solid #f5c518;
  border-bottom: 2px solid #f5c518;
}

/* Ensure equal height columns in product grid */
.shop-product-wrap.grid-view {
  display: flex;
  flex-wrap: wrap;
}

.shop-product-wrap.grid-view > [class*="col-"] {
  display: flex;
  margin-bottom: 24px;
}

.shop-product-wrap.grid-view > [class*="col-"] > .product-item {
  margin-bottom: 0;
  width: 100%;
}

/* Price display layout - consistent spacing */
.price-display {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

.price-display .price-old {
  margin: 0 !important;
  padding: 0 !important;
}

.price-display .price-regular {
  margin: 0 !important;
  padding: 0 !important;
}
