/* =========================================================
 *  Cue Creator – WooCommerce Variation Cards
 *  ========================================================= */

.ccvc {
    width: 100%;
    margin: 22px 0 18px;
    box-sizing: border-box;
}

.ccvc__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 13px;
}

.ccvc__title {
    margin: 0;
    color: #222;
    font-size: 21px;
    line-height: 1.3;
}

.ccvc__clear {
    padding: 6px 9px;

    color: #555;
    background: transparent;
    border: 0;

    font: inherit;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.ccvc__clear:hover,
.ccvc__clear:focus-visible {
    color: #111;
}

.ccvc__clear:disabled {
    opacity: 0.45;
    cursor: default;
}


/* ---------- Grid ---------- */

.ccvc__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
}


/* ---------- Card ---------- */

.ccvc-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
    min-height: 100%;
    padding: 0;

    color: #222;
    background: #fff;

    border: 1px solid #d7d7d1;
    border-radius: 8px;

    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;

    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);

    transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.ccvc-card:hover,
.ccvc-card:focus-visible {
    color: #111;
    background: #fffdf5;
    border-color: #d5aa00;

    transform: translateY(-2px);

    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.12);
}

.ccvc-card:focus-visible {
    outline: 3px solid rgba(218, 177, 0, 0.32);
    outline-offset: 3px;
}

.ccvc-card--selected {
    background: #fffdf2;
    border-color: #d7ad00;

    box-shadow:
    0 0 0 2px rgba(218, 177, 0, 0.18),
    0 7px 18px rgba(0, 0, 0, 0.11);
}

.ccvc-card--unavailable {
    opacity: 0.58;
    cursor: not-allowed;
}

.ccvc-card--unavailable:hover {
    transform: none;
    border-color: #d7d7d1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}


/* ---------- Image ---------- */

.ccvc-card__image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;

    background: #f4f4f1;
    overflow: hidden;
}

.ccvc-card__image {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;

    object-fit: cover;
}


/* ---------- Content ---------- */

.ccvc-card__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;

    padding: 14px 14px 12px;
}

.ccvc-card__title {
    display: block;

    margin-bottom: 4px;

    color: #171717;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.32;
}

.ccvc-card__reference {
    display: block;

    margin-bottom: 11px;

    color: #777;
    font-size: 12px;
    line-height: 1.35;
}

.ccvc-card__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 10px;

    margin-top: 5px;
}

.ccvc-card__detail {
    display: block;
    min-width: 0;
}

.ccvc-card__detail-label,
.ccvc-card__detail-value {
    display: block;
}

.ccvc-card__detail-label {
    margin-bottom: 1px;

    color: #777;
    font-size: 11px;
    line-height: 1.25;
}

.ccvc-card__detail-value {
    color: #222;
    font-size: 13px;
    line-height: 1.3;
}

.ccvc-card__fallback {
    display: block;

    color: #555;
    font-size: 13px;
    line-height: 1.45;
}


/* ---------- Footer ---------- */

.ccvc-card__footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;

    margin-top: auto;
    padding: 0 14px 14px;
}

.ccvc-card__price {
    display: block;
    width: 100%;

    color: #222;
    font-size: 14px;
    line-height: 1.35;
}

.ccvc-card__price .price {
    margin: 0;
}

.ccvc-card__price del {
    opacity: 0.62;
}

.ccvc-card__price ins {
    color: #111;
    font-weight: 700;
    text-decoration: none;
}

.ccvc-card__stock {
    display: block;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.ccvc-card__stock--available {
    color: #07894f;
}

.ccvc-card__stock--unavailable {
    color: #9d3333;
}

.ccvc-card__select-label {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    box-sizing: border-box;

    color: #111;
    background: #e3b900;
    border-radius: 20px;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.ccvc-card--selected .ccvc-card__select-label {
    color: #fff;
    background: #188c59;
}

.ccvc-card--unavailable .ccvc-card__select-label {
    color: #666;
    background: #e5e5e1;
}


/* =========================================================
 *  Progressive enhancement:
 *  pôvodný WooCommerce select skryjeme až po úspešnej
 *  inicializácii JavaScriptu.
 *  ========================================================= */

.variations_form.ccvc-ready table.variations {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;

    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;

    border: 0 !important;
    white-space: nowrap !important;
}

/*
 * Pôvodný reset zostane technicky dostupný,
 * ale návštevník používa naše Clear selection.
 */
.variations_form.ccvc-ready .reset_variations {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;

    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
}


/* ---------- Tablet ---------- */

@media (max-width: 900px) {
    .ccvc__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ---------- Mobile ---------- */

@media (max-width: 560px) {
    .ccvc {
        margin-top: 19px;
    }

    .ccvc__header {
        align-items: flex-start;
    }

    .ccvc__title {
        font-size: 20px;
    }

    .ccvc__grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .ccvc-card {
        display: grid;
        grid-template-columns: 105px minmax(0, 1fr);
        grid-template-areas:
        "image content"
        "image footer";
    }

    .ccvc-card__image-wrap {
        grid-area: image;

        height: 100%;
        min-height: 205px;
        aspect-ratio: auto;
    }

    .ccvc-card__content {
        grid-area: content;
        padding: 13px 12px 7px;
    }

    .ccvc-card__footer {
        grid-area: footer;
        padding: 3px 12px 13px;
    }

    .ccvc-card__details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 8px;
    }

    .ccvc-card__select-label {
        min-height: 35px;
    }
}


/* ---------- Veľmi malý mobil ---------- */

@media (max-width: 390px) {
    .ccvc-card {
        grid-template-columns: 90px minmax(0, 1fr);
    }

    .ccvc-card__image-wrap {
        min-height: 220px;
    }

    .ccvc-card__details {
        grid-template-columns: 1fr;
    }
}

/*
 * Ak je zo zvolenej variácie dostupný iba jeden kus,
 * skryjeme nepotrebný výber množstva.
 */
.variations_form.ccvc-single-item-variation
.single_variation_wrap
.quantity {
    display: none !important;
}
