/* =========================================================
   KUBRA'S ELEGANCE
   Produits, couleurs, variations et galerie
   ========================================================= */

:root {
  --vvv-kubras-black: #080604;
  --vvv-kubras-brown: #21170f;
  --vvv-kubras-gold: #c9a45f;
  --vvv-kubras-cream: #fffaf2;
  --vvv-kubras-white: #ffffff;
}

/* =========================================================
   GRILLE DU SHORTCODE
   ========================================================= */

.vvv-kubras-products-shortcode,
.vvv-kubras-products-shortcode * {
  box-sizing: border-box;
}

.vvv-kubras-products-shortcode {
  width: 100%;
}

.vvv-kubras-products-grid {
  display: grid;
  grid-template-columns:
    repeat(
      var(--vvv-kubras-products-columns, 4),
      minmax(0, 1fr)
    );
  gap: clamp(18px, 2.2vw, 34px);
}

/* =========================================================
   CARTE PRODUIT
   ========================================================= */

.vvv-kubras-product-card {
  position: relative;
  min-width: 0;
  color: var(--vvv-kubras-brown);
}

.vvv-kubras-product-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  background: #f3eee7;
  text-decoration: none;
}

.vvv-kubras-product-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    opacity 280ms ease,
    transform 700ms cubic-bezier(.2, .7, .2, 1);
}

.vvv-kubras-product-card__image.is-changing {
  opacity: 0.25;
}

.vvv-kubras-product-card:hover
.vvv-kubras-product-card__image {
  transform: scale(1.025);
}

.vvv-kubras-product-card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 7px 11px;
  border: 1px solid rgba(201, 164, 95, 0.48);
  background: rgba(8, 6, 4, 0.84);
  color: var(--vvv-kubras-cream);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.vvv-kubras-product-card__content {
  padding-top: 14px;
}

.vvv-kubras-product-card__title {
  margin: 11px 0 5px;
  font-family: "Bodoni Moda", serif;
  font-size: clamp(18px, 1.4vw, 23px);
  font-weight: 500;
  line-height: 1.16;
}

.vvv-kubras-product-card__link {
  color: inherit;
  text-decoration: none;
}

.vvv-kubras-product-card__price {
  color: rgba(33, 23, 15, 0.72);
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.vvv-kubras-product-card__price del {
  opacity: 0.45;
}

.vvv-kubras-product-card__price ins {
  color: var(--vvv-kubras-brown);
  text-decoration: none;
}

/* =========================================================
   PASTILLES DES CARTES
   ========================================================= */

.vvv-kubras-card-colors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vvv-kubras-card-color,
.vvv-kubras-single-swatch,
.vvv-kubras-card-color:hover,
.vvv-kubras-single-swatch:hover,
.vvv-kubras-card-color:focus,
.vvv-kubras-single-swatch:focus,
.vvv-kubras-card-color:focus-visible,
.vvv-kubras-single-swatch:focus-visible,
.vvv-kubras-card-color:active,
.vvv-kubras-single-swatch:active {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  outline: 0 !important;
  box-shadow: none !important;
  background-clip: border-box;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    transform 180ms ease,
    filter 180ms ease,
    opacity 180ms ease;
}

.vvv-kubras-card-color {
  width: 25px;
  height: 25px;
}

.vvv-kubras-single-swatch {
  width: 38px;
  height: 38px;
}

.vvv-kubras-card-color:hover,
.vvv-kubras-single-swatch:hover {
  filter: saturate(1.08) brightness(1.03);
  transform: translateY(-2px) scale(1.06);
}

.vvv-kubras-card-color.is-active,
.vvv-kubras-single-swatch.is-active {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  filter: saturate(1.1) brightness(1.04);
  transform: translateY(-1px) scale(1.12);
}

.vvv-kubras-card-color.is-unavailable,
.vvv-kubras-single-swatch.is-unavailable {
  opacity: 0.3;
  cursor: not-allowed;
}

.vvv-kubras-card-color.is-unavailable::after,
.vvv-kubras-single-swatch.is-unavailable::after {
  position: absolute;
  width: 135%;
  height: 1px;
  background: rgba(8, 6, 4, 0.72);
  content: "";
  transform: rotate(-45deg);
}

/* =========================================================
   FICHE PRODUIT
   ========================================================= */

.vvv-kubras-native-color-select > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.vvv-kubras-single-colors {
  width: 100%;
  padding: 4px 0 8px;
}

.vvv-kubras-single-colors__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 13px;
  color: var(--vvv-kubras-brown);
  font-family: "Manrope", sans-serif;
  font-size: 13px;
}

.vvv-kubras-selected-color-name {
  color: rgba(33, 23, 15, 0.62);
  font-weight: 600;
}

.vvv-kubras-single-colors__list {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

/* =========================================================
   GALERIE PAR COULEUR
   ========================================================= */

.vvv-kubras-variation-thumbnails {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  margin-top: 14px;
}

.vvv-kubras-variation-thumbnail {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1.15;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 2px;
  background: #f1ece5;
  cursor: pointer;
  opacity: 0.72;
  transition:
    border-color 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.vvv-kubras-variation-thumbnail:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.vvv-kubras-variation-thumbnail.is-active {
  border-color: var(--vvv-kubras-gold);
  opacity: 1;
}

.vvv-kubras-variation-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.woocommerce-product-gallery
.woocommerce-product-gallery__image
img.is-changing {
  opacity: 0.25;
  transition: opacity 200ms ease;
}

/* =========================================================
   ADMIN : GALERIE DES VARIATIONS
   ========================================================= */

.vvv-kubras-variation-gallery {
  box-sizing: border-box;
  width: 100%;
  padding: 14px !important;
  border: 1px solid #e2d8c7;
  border-radius: 8px;
  background: #fffaf2;
}

.vvv-kubras-variation-gallery-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.vvv-kubras-variation-gallery-item {
  position: relative;
  width: 78px;
  height: 90px;
  overflow: hidden;
  margin: 0;
  border: 2px solid #ffffff;
  border-radius: 6px;
  background: #eeeeee;
  box-shadow: 0 0 0 1px rgba(33, 23, 15, 0.15);
  cursor: move;
}

.vvv-kubras-variation-gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vvv-kubras-remove-gallery-image {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0 !important;
  place-items: center;
  border-radius: 50%;
  background: rgba(8, 6, 4, 0.82) !important;
  color: #ffffff !important;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
}

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

@media (max-width: 1100px) {
  .vvv-kubras-products-grid {
    grid-template-columns: repeat(
      min(var(--vvv-kubras-products-columns, 4), 3),
      minmax(0, 1fr)
    );
  }
}

@media (max-width: 767px) {
  .vvv-kubras-products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 12px;
  }

  .vvv-kubras-product-card__content {
    padding-top: 11px;
  }

  .vvv-kubras-product-card__title {
    margin-top: 9px;
    font-size: 17px;
  }

  .vvv-kubras-card-colors {
    gap: 6px;
  }

  .vvv-kubras-card-color {
    width: 22px;
    height: 22px;
  }

  .vvv-kubras-variation-thumbnails {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  .vvv-kubras-products-grid {
    grid-template-columns: 1fr;
  }
}
