/* Cafepoint – NOVÉ FUNKCIE (mobil aj desktop): kvíz, recenzie, darčeky podľa rozpočtu, mini košík, gramáž na karte.
   Patrí k cafepoint-features.js */

.cp-sec {
    --f-ink: var(--cp-ink, #0f0f0f);
    --f-text: var(--cp-text, #2f2f2f);
    --f-muted: var(--cp-muted, #5f6170);
    --f-dark: var(--cp-dark, #1e2a1e);
    --f-beige: var(--cp-header-bg, #f6f6f3);
    --f-line: var(--cp-line, #e0e5ee);
    margin: 40px 0 0;
    color: var(--f-text);
}
.cp-sec__head {
    margin: 0 0 16px;
}
html body .cp-sec .cp-sec__title {
    margin: 0 !important;
}
.cp-sec__sub {
    margin: 6px 0 0;
    color: var(--f-muted);
    font-size: 15px;
    line-height: 1.45;
}

/* ================= DARČEKY PODĽA ROZPOČTU ================= */
.cp-gifts__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cp-gifts__list > li {
    margin: 0;
    padding: 0;
}
html body .cp-gifts__tile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 150px;
    padding: 16px;
    background: var(--f-beige);
    color: var(--f-ink);
    text-decoration: none;
    transition: background-color 0.15s ease-out;
}
html body .cp-gifts__tile:hover {
    background: #eeeee8;
    color: var(--f-ink);
    text-decoration: none;
}
html body .cp-gifts__tile:focus-visible {
    outline: 2px solid var(--f-dark);
    outline-offset: 2px;
}
.cp-gifts__price {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
.cp-gifts__thumbs {
    display: flex;
    min-height: 52px;
    margin-top: auto;
}
.cp-gifts__thumbs > span {
    width: 52px;
    height: 52px;
    margin-left: -10px;
    padding: 5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 2px var(--f-beige);
    overflow: hidden;
}
.cp-gifts__thumbs > span:first-child {
    margin-left: 0;
}
.cp-gifts__thumbs img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.cp-gifts__note {
    margin-top: auto;
    color: rgb(255 255 255 / 0.78);
    font-size: 14px;
    line-height: 1.4;
}
.cp-gifts__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.cp-gifts__more svg {
    transition: transform 0.15s ease-out;
}
.cp-gifts__tile:hover .cp-gifts__more svg {
    transform: translateX(3px);
}
html body .cp-gifts__tile--voucher,
html body .cp-gifts__tile--voucher:hover {
    background: var(--f-dark);
    color: #fff;
}
html body .cp-gifts__tile--voucher:hover {
    background: #15201a;
}

/* ================= KVÍZ ================= */
.cp-quiz__card {
    padding: 20px 16px;
    background: var(--f-beige);
}
.cp-quiz__top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
}
.cp-quiz__step {
    flex: none;
    color: var(--f-muted);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.cp-quiz__bar {
    flex: 1;
    height: 3px;
    background: rgb(15 15 15 / 0.1);
}
.cp-quiz__bar > span {
    display: block;
    height: 100%;
    background: var(--f-dark);
    transition: width 0.25s ease-out;
}
html body .cp-quiz__back {
    flex: none;
    min-height: 32px;
    padding: 0 4px;
    background: none;
    border: 0;
    color: var(--f-ink);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.cp-quiz__q {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}
.cp-quiz__legend {
    float: left;
    width: 100%;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    color: var(--f-ink);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}
.cp-quiz__opts {
    clear: both;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
html body .cp-quiz__opt {
    min-height: 56px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid rgb(15 15 15 / 0.14);
    border-radius: 0;
    color: var(--f-ink);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease-out, background-color 0.15s ease-out, color 0.15s ease-out;
}
html body .cp-quiz__opt:hover {
    border-color: var(--f-dark);
}
html body .cp-quiz__opt.is-on {
    background: var(--f-dark);
    border-color: var(--f-dark);
    color: #fff;
}
html body .cp-quiz__opt:focus-visible,
html body .cp-quiz__add:focus-visible,
html body .cp-quiz__again:focus-visible {
    outline: 2px solid var(--f-dark);
    outline-offset: 2px;
}
.cp-quiz__loading {
    padding: 24px 0;
    color: var(--f-muted);
    font-size: 15px;
    text-align: center;
}
.cp-quiz__res {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cp-quiz__item {
    display: flex;
    gap: 14px;
    margin: 0;
    padding: 10px;
    background: #fff;
}
html body .cp-quiz__img {
    flex: none;
    width: 88px;
    height: 88px;
    padding: 6px;
    background: var(--f-beige);
}
.cp-quiz__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.cp-quiz__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}
html body .cp-quiz__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--f-ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
}
.cp-quiz__price {
    color: var(--f-ink);
    font-size: 15px;
    font-weight: 600;
}
html body .cp-quiz__add {
    margin-top: auto;
    min-height: 34px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid var(--f-dark);
    border-radius: 0;
    color: var(--f-dark);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.15s ease-out, color 0.15s ease-out;
}
html body .cp-quiz__add:hover {
    background: var(--f-dark);
    color: #fff;
}
.cp-quiz__add.is-loading {
    opacity: 0.5;
}
.cp-quiz__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 16px 0 0;
}
html body .cp-quiz__all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    background: var(--f-dark);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}
html body .cp-quiz__all:hover {
    background: #15201a;
    color: #fff;
    text-decoration: none;
}
html body .cp-quiz__again {
    min-height: 44px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--f-ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* ================= RECENZIE ================= */
.cp-reviews__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px 16px;
}
html body .cp-reviews__sum {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--f-ink);
    text-decoration: none;
}
.cp-reviews__score {
    font-size: 20px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.cp-reviews__count {
    color: var(--f-muted);
    font-size: 13px;
    line-height: 1.35;
}
.cp-reviews__score small {
    color: var(--f-muted);
    font-size: 13px;
    font-weight: 400;
}
html body a.cp-reviews__sum:hover .cp-reviews__count {
    color: var(--f-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cp-reviews__stars {
    display: inline-flex;
    gap: 1px;
    color: rgb(15 15 15 / 0.18);
}
.cp-reviews__stars .is-on {
    color: #c98a00;
}
.cp-reviews__stars svg {
    display: block;
}
.cp-reviews__demo {
    margin: 0 0 12px;
    padding: 8px 12px;
    background: #fff4d6;
    color: #6b4a00;
    font-size: 13px;
    line-height: 1.4;
}
.cp-reviews__list {
    display: flex;
    gap: 8px;
    margin: 0 -20px;
    padding: 0 20px 4px;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 20px;
    scrollbar-width: none;
}
.cp-reviews__list::-webkit-scrollbar {
    display: none;
}
.cp-reviews__item {
    flex: 0 0 82%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 18px 16px;
    background: var(--f-beige);
    scroll-snap-align: start;
}
.cp-reviews__text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
    margin: 0;
    color: var(--f-ink);
    font-size: 15px;
    line-height: 1.5;
}
.cp-reviews__name {
    margin-top: auto;
    color: var(--f-ink);
    font-size: 13px;
    font-weight: 600;
}
.cp-reviews__name span {
    color: var(--f-muted);
    font-weight: 400;
}

/* ================= MINI KOŠÍK ================= */
.cp-drawer {
    position: fixed;
    inset: 0;
    z-index: 100000;
}
.cp-drawer[hidden] {
    display: none;
}
.cp-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgb(15 15 15 / 0.45);
    opacity: 0;
    transition: opacity 0.2s ease-out;
}
.cp-drawer.is-open .cp-drawer__overlay {
    opacity: 1;
}
.cp-drawer__panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    max-height: 88vh;
    background: #fff;
    color: var(--cp-text, #2f2f2f);
    font-size: 15px;
    transform: translateY(100%);
    transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
    padding-bottom: env(safe-area-inset-bottom);
}
.cp-drawer.is-open .cp-drawer__panel {
    transform: none;
}
.cp-drawer__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px 12px 16px;
    border-bottom: 1px solid var(--cp-line, #e0e5ee);
}
.cp-drawer__ok {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cp-stock, #0b7a1d);
    color: #fff;
}
.cp-drawer__ok svg {
    width: 16px;
    height: 16px;
}
html body .cp-drawer__title {
    flex: 1;
    margin: 0;
    color: var(--cp-ink, #0f0f0f);
    font-size: 16px !important;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}
html body .cp-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--cp-ink, #0f0f0f);
    cursor: pointer;
}
.cp-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.cp-drawer__item {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 0 0 16px;
}
.cp-drawer__img {
    flex: none;
    width: 72px;
    height: 72px;
    padding: 6px;
    background: var(--cp-header-bg, #f6f6f3);
}
.cp-drawer__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.cp-drawer__name {
    margin: 0 0 4px;
    color: var(--cp-ink, #0f0f0f);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
}
.cp-drawer__meta {
    margin: 0;
    color: var(--cp-muted, #5f6170);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.cp-drawer__ship {
    margin: 0;
}
.cp-drawer__foot {
    display: grid;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--cp-line, #e0e5ee);
}
.cp-drawer__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 0 0 4px;
    color: var(--cp-ink, #0f0f0f);
}
.cp-drawer__total strong {
    font-size: 18px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
html body .cp-drawer__go,
html body .cp-drawer__cont {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid var(--cp-dark, #1e2a1e);
    border-radius: 0;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease-out, color 0.15s ease-out;
}
html body .cp-drawer__go {
    background: var(--cp-dark, #1e2a1e);
    color: #fff;
}
html body .cp-drawer__go:hover {
    background: #15201a;
    color: #fff;
    text-decoration: none;
}
html body .cp-drawer__cont {
    background: #fff;
    color: var(--cp-dark, #1e2a1e);
}
html body .cp-drawer__cont:hover {
    background: var(--cp-header-bg, #f6f6f3);
}
html body .cp-drawer__go:focus-visible,
html body .cp-drawer__cont:focus-visible,
html body .cp-drawer__close:focus-visible {
    outline: 2px solid var(--cp-dark, #1e2a1e);
    outline-offset: 2px;
}
html.cp-drawer-open,
html.cp-drawer-open body {
    overflow: hidden !important;
}
/* pri otvorenom mini košíku netreba aj zelenú hlášku Shoptetu */
html.cp-drawer-open .messages,
html.cp-drawer-open #msgWrapper,
html.cp-drawer-open .cp-chat,
html.cp-drawer-open .cp-sticky-buy {
    display: none !important;
}

/* ================= GRAMÁŽ NA KARTE =================
   nenápadná roletka v riadku s cenou: „250g ⌄" bez rámčeka */
html body .products .product.cp-has-qs .prices {
    display: flex !important;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    column-gap: 8px;
}
.cp-qs-wrap {
    position: relative;
    flex: none;
    margin: 0 0 0 auto;
}
.cp-qs-wrap::after {
    content: "";
    position: absolute;
    right: 2px;
    top: 50%;
    width: 6px;
    height: 6px;
    margin-top: -5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    color: var(--cp-muted, #5f6170);
    transform: rotate(45deg);
    pointer-events: none;
}
html body select.cp-qs {
    display: block;
    width: auto;
    max-width: 120px;
    height: 32px;
    margin: 0;
    padding: 0 16px 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: var(--cp-muted, #5f6170);
    font-family: inherit;
    font-size: 16px; /* iPhone pri 16px nepribližuje stránku */
    font-weight: 500;
    line-height: 32px;
    text-overflow: ellipsis;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: color 0.15s ease-out;
}
html body select.cp-qs:hover {
    color: var(--cp-ink, #0f0f0f);
}
html body select.cp-qs:focus-visible {
    outline: 2px solid var(--cp-dark, #1e2a1e);
    outline-offset: 2px;
}
@media (min-width: 768px) {
    html body select.cp-qs {
        font-size: 14px;
    }
}
.product .cp-qs-loading .price-final,
.cp-qs-loading .price-final,
.product.cp-qs-loading .add-to-cart-button {
    opacity: 0.45;
    transition: opacity 0.15s ease-out;
}
html body .products .product .add-to-cart-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}


/* ================= POPIS KATEGÓRIE: 3 riadky + „Čítať viac" (aj desktop) ================= */
html body .category-perex.cp-clamp {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}
html body .category-perex.cp-clamp p {
    display: inline;
    margin: 0 !important;
}
html body .category-perex.cp-has-toggle {
    margin-bottom: 8px !important;
}
html body .cp-perex-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 0;
    background: none;
    border: 0;
    color: var(--cp-ink, #0f0f0f);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}
html body .cp-perex-toggle::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.15s ease-out;
}
html body .cp-perex-toggle[aria-expanded="true"]::after {
    transform: translateY(2px) rotate(-135deg);
}
html body .cp-perex-toggle:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}
html body .cp-perex-toggle:focus-visible {
    outline: 2px solid var(--cp-dark, #1e2a1e);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .cp-drawer__panel,
    .cp-drawer__overlay,
    .cp-quiz__bar > span {
        transition: none;
    }
}

/* ================= DESKTOP ================= */
@media (min-width: 768px) {
    .cp-sec {
        margin-top: 72px;
    }
    .cp-sec__head {
        margin-bottom: 24px;
    }
    .cp-gifts__list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }
    html body .cp-gifts__tile {
        min-height: 200px;
        padding: 24px;
        gap: 16px;
    }
    .cp-gifts__price {
        font-size: 24px;
    }
    .cp-gifts__thumbs,
    .cp-gifts__thumbs > span {
        min-height: 64px;
    }
    .cp-gifts__thumbs > span {
        width: 64px;
        height: 64px;
    }

    .cp-quiz {
        display: grid;
        grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
        gap: 48px;
        align-items: start;
    }
    .cp-quiz__card {
        padding: 32px;
    }
    .cp-quiz__legend {
        font-size: 22px;
        margin-bottom: 20px;
    }
    .cp-quiz__opts {
        gap: 12px;
    }
    html body .cp-quiz__opt {
        min-height: 64px;
        padding: 12px 16px;
    }
    .cp-quiz__res {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
    .cp-quiz__item {
        flex-direction: column;
        padding: 12px;
    }
    html body .cp-quiz__img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        padding: 12%;
    }
    .cp-quiz__info {
        flex: 1;
    }

    .cp-reviews__list {
        margin: 0;
        padding: 0 0 4px;
        scroll-padding: 0;
        gap: 12px;
    }
    .cp-reviews__item {
        flex: 0 0 calc((100% - 36px) / 4);
        padding: 24px;
    }

    .cp-drawer__panel {
        left: auto;
        top: 0;
        width: 420px;
        max-width: 100%;
        max-height: none;
        transform: translateX(100%);
    }
    .cp-drawer__head {
        padding: 16px 12px 16px 24px;
    }
    .cp-drawer__body {
        padding: 24px;
    }
    .cp-drawer__foot {
        padding: 16px 24px 24px;
    }
}
@media (min-width: 768px) and (max-width: 991px) {
    .cp-quiz {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .cp-gifts__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
