/* ==========================================================================
   codePresta.com · Wishlist
   καρδιά στις κάρτες · κουμπί στη σελίδα προϊόντος · συρτάρι · σελίδα · toast
   ========================================================================== */
:root {
    --cpwl-primary: var(--cp-primary, #1c3673);
    --cpwl-heart: #e0244d;
}

.cpwl-heart-svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linejoin: round;
    transition: fill .15s, stroke .15s;
}

/* ── καρδιά στην κάρτα (πάνω δεξιά στην εικόνα) ── */
.cpwl-heart {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #eceef2;
    border-radius: 50%;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: color .15s, border-color .15s, transform .15s;
}

.cpwl-heart:hover {
    border-color: #f5c2cc;
    color: var(--cpwl-heart);
}

.cpwl-heart.is-active,
.cpwl-btn.is-active {
    color: var(--cpwl-heart);
}

.cpwl-heart.is-active .cpwl-heart-svg,
.cpwl-btn.is-active .cpwl-heart-svg {
    fill: currentColor;
}

.cpwl-heart.is-pop .cpwl-heart-svg,
.cpwl-btn.is-pop .cpwl-heart-svg {
    animation: cpwl-pop .45s ease;
}

@keyframes cpwl-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cpwl-heart.is-busy,
.cpwl-btn.is-busy {
    pointer-events: none;
}

/* το παλιό blockwishlist (αν μείνει ενεργό) να μη διπλασιάζει την καρδιά */
.pcard .wishlist-button-add {
    display: none !important;
}

/* ── κουμπί στη σελίδα προϊόντος ── */
.cpwl-btn {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-top: 10px;
    padding: 0 18px;
    border: 1px solid #dcdfe6;
    border-radius: 10px;
    background: #fff;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}

.cpwl-btn:hover {
    border-color: #f5c2cc;
    color: var(--cpwl-heart);
}

.cpwl-btn.is-active {
    border-color: #f5c2cc;
    background: #fff5f7;
}

/* ── συρτάρι (όπως το καλάθι: overlay χωρίς blur, από δεξιά) ── */
html.cpwl-lock {
    overflow: hidden;
}

.cpwl-drawer {
    position: fixed;
    inset: 0;
    z-index: 1300;
}

.cpwl-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    opacity: 0;
    transition: opacity .3s ease;
}

.cpwl-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(490px, calc(100vw - 24px));
    border-radius: 16px 0 0 16px;
    background: #fff;
    box-shadow: -14px 0 40px rgba(15, 23, 42, .2);
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.22, .8, .3, 1);
}

.cpwl-drawer.is-open .cpwl-overlay {
    opacity: 1;
}

.cpwl-drawer.is-open .cpwl-panel {
    transform: none;
}

.cpwl-head {
    display: flex;
    flex: 0 0 auto;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #ececec;
}

.cpwl-title {
    display: flex;
    gap: 6px;
    align-items: baseline;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: #1f2937;
}

/* count like in the cart: "(3)" */
.cpwl-title-count {
    font-size: 15px;
    font-weight: 500;
    color: #6b7280;
}

.cpwl-title-count::before { content: "("; }
.cpwl-title-count::after { content: ")"; }

.cpwl-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: -8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #1f2937;
    cursor: pointer;
    transition: background-color .15s ease, transform .2s ease;
}

.cpwl-close:hover {
    background: #f3f4f6;
    transform: rotate(90deg);
}

.cpwl-drawer .cpwl-close svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.cpwl-body {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.cpwl-body.is-loading:empty::after,
.cpwl-body.is-loading::before {
    content: "";
    position: absolute;
    top: 40px;
    left: 50%;
    width: 22px;
    height: 22px;
    margin-left: -11px;
    border: 2px solid #d5d9e1;
    border-top-color: var(--cpwl-primary);
    border-radius: 50%;
    animation: cpwl-spin .6s linear infinite;
}

.cpwl-body.is-loading > * {
    opacity: .45;
}

@keyframes cpwl-spin {
    to { transform: rotate(360deg); }
}

/* the footer stays at the bottom of the drawer, like the cart totals */
.cpwl-items {
    flex: 1 0 auto;
    margin: 0;
    padding: 6px 24px;
    list-style: none;
}

/* same row as a cart line: image · name + price · remove */
.cpwl-item {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 18px 0;
    border-bottom: 1px solid #eceef2;
    transition: opacity .25s, transform .25s;
}

.cpwl-item:last-child {
    border-bottom: 0;
}

.cpwl-item-img {
    display: block;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border: 1px solid #eceef2;
    border-radius: 12px;
    background: #fff;
}

.cpwl-item-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cpwl-item-info {
    min-width: 0;
}

.cpwl-item-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #1f2937;
    text-decoration: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cpwl-item-name:hover {
    color: var(--cpwl-primary);
    text-decoration: none;
}

.cpwl-item-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.cpwl-item-price {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    color: #1f2937;
}

.cpwl-item-cart {
    margin: 0;
}

.cpwl-cart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--cpwl-primary);
    border-radius: 10px;
    background: var(--cpwl-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease, background-color .15s ease;
}

.cpwl-cart-btn:hover {
    color: #fff;
    text-decoration: none;
    filter: brightness(1.12);
}

.cpwl-cart-btn.is-outline {
    background: #fff;
    color: var(--cpwl-primary);
}

.cpwl-cart-btn.is-outline:hover {
    background: color-mix(in srgb, var(--cpwl-primary) 6%, #fff);
    color: var(--cpwl-primary);
    filter: none;
}

.cpwl-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: -6px -6px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.cpwl-drawer .cpwl-remove svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.cpwl-remove:hover {
    background: #fdf0f3;
    color: #d0103a;
}

.cpwl-leaving {
    opacity: 0;
    transform: translateX(16px);
}

.cpwl-foot {
    position: sticky;
    bottom: 0;
    padding: 18px 24px 24px;
    border-top: 1px solid #eceef2;
    background: #fff;
}

.cpwl-all {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border: 1px solid var(--cpwl-primary);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--cpwl-primary);
    text-decoration: none;
    transition: background-color .15s ease;
}

.cpwl-all:hover {
    background: color-mix(in srgb, var(--cpwl-primary) 6%, #fff);
    color: var(--cpwl-primary);
    text-decoration: none;
}

@media (max-width: 575px) {
    .cpwl-head {
        padding: 16px 16px 14px;
    }

    .cpwl-items {
        padding: 4px 16px;
    }

    .cpwl-item {
        grid-template-columns: 68px minmax(0, 1fr) auto;
        gap: 12px;
    }

    .cpwl-item-img {
        width: 68px;
        height: 68px;
    }

    .cpwl-foot {
        padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
    }
}

/* άδεια λίστα */
.cpwl-empty {
    padding: 48px 24px;
    text-align: center;
}

.cpwl-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #fdeef1;
    color: var(--cpwl-heart);
}

.cpwl-empty-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.cpwl-empty-title {
    margin: 0 0 4px;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
}

.cpwl-empty-text {
    margin: 0 0 16px;
    font-size: 14px;
    color: #6b7280;
}

/* ── wishlist page · codePresta by Nextpointer ── */
.cpwl-page {
    padding: 8px 0 48px;
}

.cpwl-page[hidden],
.cpwl-page [hidden] {
    display: none !important;
}

.cpwl-page-head {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px 24px;
    border-radius: 20px;
    background: #fff;
}

.cpwl-page-ico {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #fdeef1;
    color: var(--cpwl-heart);
}

.cpwl-page-ico svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linejoin: round;
}

.cpwl-page-head-text {
    flex: 1 1 auto;
    min-width: 0;
}

.cpwl-page-title {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0;
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 700;
    color: #1f2937;
}

.cpwl-page-title span {
    padding: 2px 10px;
    border-radius: 999px;
    background: #fdeef1;
    font-size: 14px;
    line-height: 1.5;
    color: var(--cpwl-heart);
}

.cpwl-page-note {
    margin: 4px 0 0;
    font-size: 14px;
    color: #6b7280;
}

.cpwl-page-note a {
    font-weight: 600;
    color: var(--cpwl-primary);
}

.cpwl-page-back {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 8px;
    align-items: center;
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    background: #f5f7fb;
    font-size: 14px;
    font-weight: 600;
    color: var(--cpwl-primary);
    text-decoration: none;
    transition: background .2s;
}

.cpwl-page-back:hover {
    background: #eef1f7;
    color: var(--cpwl-primary);
    text-decoration: none;
}

.cpwl-page-back svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* product grid: 5 / 4 / 3 / 2 columns */
.cpwl-page-list .products {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.cpwl-page-list .products > .js-product {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    flex: none;
}

.cpwl-page-list .js-product {
    transition: opacity .25s, transform .25s;
}

/* empty state: white card, no border */
.cpwl-empty.is-page {
    margin: 0;
    padding: clamp(40px, 6vw, 72px) 24px;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: none;
}

.cpwl-empty.is-page .cpwl-empty-icon {
    width: 84px;
    height: 84px;
    margin-bottom: 18px;
    box-shadow: 0 0 0 10px #fff5f7;
}

.cpwl-empty.is-page .cpwl-empty-icon svg {
    width: 38px;
    height: 38px;
}

.cpwl-empty.is-page .cpwl-empty-title {
    font-size: 21px;
}

.cpwl-empty.is-page .cpwl-empty-text {
    margin-bottom: 28px;
    font-size: 15px;
}

.cpwl-empty-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 760px;
    margin: 0 auto 30px;
    padding: 0;
    list-style: none;
}

.cpwl-empty-steps li {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 20px 16px;
    border-radius: 16px;
    background: #f5f7fb;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
}

.cpwl-step-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fff;
    color: var(--cpwl-primary);
}

.cpwl-step-ico svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cpwl-empty-btn {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    height: 48px;
    padding: 0 26px;
    border-radius: 12px;
    background: var(--cpwl-primary);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    transition: background .2s;
}

.cpwl-empty-btn:hover {
    background: var(--cp-primary-hover, #15295a);
    color: #fff;
    text-decoration: none;
}

.cpwl-empty-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 1399px) {
    .cpwl-page-list .products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1199px) {
    .cpwl-page-list .products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .cpwl-page-head { flex-wrap: wrap; padding: 18px; }
    .cpwl-page-ico { width: 44px; height: 44px; border-radius: 14px; }
    .cpwl-page-head-text { flex: 1 1 0; }
    .cpwl-page-title { font-size: 20px; }
    .cpwl-page-back { width: 100%; justify-content: center; }
    .cpwl-page-list .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .cpwl-empty-steps { grid-template-columns: 1fr; }
    .cpwl-empty-steps li { flex-direction: row; text-align: left; padding: 14px 16px; }
    .cpwl-empty-btn { width: 100%; justify-content: center; }
}

/* ── toast ── */
.cpwl-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1400;
    display: flex;
    gap: 14px;
    align-items: center;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    border-radius: 12px;
    background: #1f2937;
    font-size: 14px;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity .2s, transform .2s;
}

.cpwl-toast span {
    white-space: nowrap;
}

.cpwl-toast.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.cpwl-toast a {
    font-weight: 700;
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}
