/* =============================================
   PRODUCT CARD — Base styles (shared home + archive)
   ============================================= */

/* --- Card container --- */
.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  height: 100%;
}

/* --- Link wrapper (image + name) --- */
.product-card__link {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1 1 auto;
  width: 100%;
  gap: 4px;
  text-decoration: none;
  color: var(--dark);
}
@media (min-width: 1024px) {
  .product-card__link { gap: 16px; }
}
.product-card--dark .product-card__link {
  color: var(--white);
}
.product-card__link:hover .product-card__name {
  text-decoration: underline;
}

/* --- Image wrapper --- */
.product-card__img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  margin-bottom: 12px;
}
@media (min-width: 1024px) {
  .product-card__img-wrap { min-height: 286px; max-height: 320px; }
}
.product-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- Category badges (top-left) --- */
.product-card__badges {
  position: absolute;
  top: 25px;
  left: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  z-index: 1;
}
.product-card__cat-badge {
  display: inline-block;
  padding: 4px 5px;
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  line-height: 12px;
  letter-spacing: -0.4px;
  text-transform: uppercase;
  color: var(--black);
}

/* --- Effect icon (top-right) --- */
.product-card__effet {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 54px;
  height: 54px;
  z-index: 1;
}
.product-card__effet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* --- Product name --- */
.product-card__name {
  font-family: var(--font-sporting);
  font-size: 15px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 12px;
  height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 1024px) {
  .product-card__name { padding-right: 30px; }
}
.product-card--dark .product-card__name {
  color: var(--white);
}

/* --- Bottom section (select + button) --- */
.product-card__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  gap: 4px;
  min-height: 100px;
  margin-top: auto;
}
@media (min-width: 1024px) {
  .product-card__bottom {
    gap: 16px;
    min-height: 112px;
  }
}

/* --- Variant picker --- */
.product-card__variant {
  width: 100%;
}

/* --- Custom Select component --- */
.custom-select {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.custom-select__trigger {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--black);
  border-radius: 6px;
  background: transparent;
  padding: 0 12px;
  cursor: pointer;
  font-family: var(--font-sporting);
  font-size: 13px;
  font-weight: 400;
  text-transform: uppercase;
  color: var(--black);
  transition: border-color 0.2s;
  overflow: hidden;
}
.custom-select__trigger:hover {
  border-color: var(--grey);
}
.custom-select--open .custom-select__trigger {
  border-color: var(--black);
}
.custom-select__value {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.custom-select__price {
  white-space: nowrap;
  color: var(--grey);
}
.custom-select__chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.custom-select--open .custom-select__chevron {
  transform: rotate(180deg);
}

/* Dropdown panel */
.custom-select__dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: auto;
  z-index: 50;
  min-width: 100%;
  width: max-content;
  max-width: min(92vw, 460px);
  background: var(--white);
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 4px 0;
  list-style: none;
  max-height: 280px;
  overflow-x: hidden;
  overflow-y: auto;
}
.custom-select--open .custom-select__dropdown {
  display: block;
}
.custom-select__option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  cursor: pointer;
  font-family: var(--font-sporting);
  font-size: 14px;
  text-transform: uppercase;
  color: var(--black);
  transition: background 0.15s;
}
.custom-select__option:hover {
  background: #f5f5f5;
}
.custom-select__check {
  flex-shrink: 0;
  color: var(--green);
  opacity: 0;
  transition: opacity 0.15s;
}
.custom-select__option--selected .custom-select__check {
  opacity: 1;
}
.custom-select__label {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  font-weight: 400;
}
.custom-select__option .custom-select__price {
  color: var(--grey);
  font-size: 13px;
}

/* Dark mode variant */
.product-card--dark .custom-select__trigger {
  color: var(--white);
  border-color: var(--white);
}
.product-card--dark .custom-select__chevron {
  color: var(--white);
}

/* --- Add to cart button --- */
.product-card .btn.btn--add-to-cart {
  width: 100%;
  height: 48px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  border-radius: 5px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.product-card .btn.btn--add-to-cart:hover {
  background: var(--green);
  color: var(--black);
  border-color: var(--green);
}
.product-card--dark .btn.btn--add-to-cart {
  background: var(--white);
  color: var(--black);
  border-color: var(--white);
}

/* --- Out of stock button --- */
.product-card .btn.btn--out-of-stock {
  width: 100%;
  height: 48px;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  border-radius: 5px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Price styles --- */
.product-card .btn__sep {
  opacity: 0.5;
}
.product-card .price-old {
  text-decoration: line-through;
  opacity: 0.6;
  font-size: 12px;
}
.product-card .price-new {
  color: var(--green);
  font-size: 16px;
}
.product-card .price-current {
  font-size: 16px;
}

/* --- Cart icon in button (hidden on desktop) --- */
.product-card .btn__cart-icon {
  display: none;
}
