/* ================================================================
   Custom Product Swatches Grid — style.css
   ================================================================ */

/* ── Grille ── */
.cps-grid {
    display: grid;
    gap: 24px;
    width: 100%;
}

.cps-cols-1 { grid-template-columns: repeat(1, 1fr); }
.cps-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cps-cols-3 { grid-template-columns: repeat(3, 1fr); }
.cps-cols-4 { grid-template-columns: repeat(4, 1fr); }
.cps-cols-5 { grid-template-columns: repeat(5, 1fr); }
.cps-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1024px) {
    .cps-cols-4,
    .cps-cols-5,
    .cps-cols-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .cps-cols-3,
    .cps-cols-4,
    .cps-cols-5,
    .cps-cols-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .cps-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
}

/* ── Carte ── */
.cps-card {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.cps-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.10);
}

/* ── Image ── */
.cps-card__image-wrap {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
    aspect-ratio: 3/4;
}

.cps-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.cps-card:hover .cps-card__img {
    transform: scale(1.04);
}

/* ── Badges ── */
.cps-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    z-index: 2;
}

.cps-badge--new         { background: #2e7d32; color: #fff; }
.cps-badge--sale        { background: #e53935; color: #fff; }
.cps-badge--bestseller  { background: #f5a623; color: #fff; }
.cps-badge--toprated    { background: #7b1fa2; color: #fff; }
.cps-badge--featured    { background: #1a56db; color: #fff; }

/* ── Body ── */
.cps-card__body {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* ── Titre ── */
.cps-card__title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #111;
    text-decoration: none;
    text-align: center;
    line-height: 1.3;
    display: block;
}

.cps-card__title:hover { color: #555; }

/* ── Prix ── */
.cps-card__price {
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1a56db;
}

.cps-card__price del { color: #aaa; font-weight: 400; margin-right: 4px; }
.cps-card__price ins { text-decoration: none; color: #e53935; }

/* ── Swatches ── */
.cps-swatches {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0;
    align-items: center;
}

.cps-swatches__row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

/* ── Swatch commun ── */
.cps-swatch {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* ── Swatch IMAGE / COULEUR ── */
@media (max-width: 768px) {
	.cps-swatch--image {
    width: 25px !important;
    height: 25px !important;
    border-radius: 50%;
    border: 2px solid #ddd;
    overflow: hidden;
    background: #f5f5f5;
}
}
.cps-swatch--image {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 2px solid #ddd;
    overflow: hidden;
    background: #f5f5f5;
}

.cps-swatch--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.cps-swatch__color {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

.cps-swatch--image:hover:not(.cps-swatch--oos) {
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}

/* ── Swatch TAILLE / TEXTE ── */
.cps-swatch--label {
    min-width: 25px;
    height: 25px;
    padding: 0 10px;
    border-radius: 20px;
    border: 1.5px solid #ccc;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.02em;
}
@media (max-width: 768px) {
	.cps-swatch--label {
    min-width: 25px !important;
    height: 25px !important;
    padding: 0 10px;
    border-radius: 20px;
    border: 1.5px solid #ccc;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    color: #333;
    letter-spacing: 0.02em;
}
}
.cps-swatch--label:hover:not(.cps-swatch--oos) {
    border-color: #111;
    border-width: 2px;
    color: #111;
}

/* ── Épuisé — croix rouge ── */
.cps-swatch--oos {
    opacity: 0.7;
    cursor: default;
}

.cps-swatch--oos .cps-swatch__cross {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 900;
    color: #e53935;
    line-height: 1;
    pointer-events: none;
    z-index: 3;
}

/* Pour les labels épuisés, la croix est inline */
.cps-swatch--label.cps-swatch--oos {
    color: #bbb;
    border-color: #eee;
    text-decoration: line-through;
}

.cps-swatch--label .cps-swatch__cross {
    font-size: 16px;
}

/* ── Cercle rouge barré (style de la capture) ── */
.cps-swatch--image.cps-swatch--oos::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #e53935;
    z-index: 2;
    pointer-events: none;
}

.cps-swatch--image.cps-swatch--oos::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 4px;
    right: 4px;
    height: 2px;
    background: #e53935;
    transform: rotate(-45deg);
    z-index: 2;
    pointer-events: none;
}

/* ── Bouton ── */
.cps-card__btn {
    display: block;
    background: #111;
    color: #fff;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    margin-top: auto;
    transition: background 0.2s;
}

.cps-card__btn:hover {
    background: #444;
    color: #fff;
}

/* ── No products ── */
.cps-no-products {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* ── Swatch actif (sélectionné) ── */
.cps-swatch--image.cps-swatch--active {
    border-color: #111;
    box-shadow: 0 0 0 2px #111;
}

.cps-swatch--label.cps-swatch--active {
    border-color: #111;
    border-width: 2px;
    color: #111;
    background: #f5f5f5;
}

/* ── Bouton état désactivé (variable, rien sélectionné) ── */
.cps-card__btn--disabled {
    background: #ccc !important;
    cursor: not-allowed;
    color: #fff;
}

/* ── Bouton épuisé ── */
.cps-card__btn--oos {
    background: #eee !important;
    color: #999 !important;
    cursor: not-allowed;
    text-decoration: none;
}

/* ── Bouton état "Ajouté !" ── */
.cps-card__btn--added {
    background: #2e7d32 !important;
}

/* ── Feedback panier ── */
.cps-cart-feedback {
    display: none;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    padding: 6px 0 2px;
    border-radius: 4px;
}

.cps-feedback--success { color: #2e7d32; }
.cps-feedback--error   { color: #e53935; }
