/**
 * Sidebar cart · front (μοντέρνο συρτάρι, 100% responsive)
 *
 * @author    codePresta.com
 * @copyright codePresta.com
 */
.sbc {
    --sbc-primary: var(--cp-primary, #1c3673);
    --sbc-text: #1f2937;
    --sbc-muted: #6b7280;
    --sbc-line: #eceef2;
    --sbc-soft: #f5f6f8;
    position: fixed;
    inset: 0;
    z-index: 1300;
    font-size: 14px;
    color: var(--sbc-text);
}

.sbc[hidden],
.js-sbc-source[hidden] {
    display: none;
}

/* μόνο το html: με body { overflow:hidden } (το theme δίνει height:100%) η σελίδα γύριζε στην αρχή */
html.sbc-lock {
    overflow: hidden;
}

.sbc svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.sbc-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);
    outline: 0;
}

.sbc.is-open .sbc-overlay {
    opacity: 1;
}

.sbc.is-open .sbc-panel {
    transform: none;
}

.sbc-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* φόρτωση μετά από αλλαγή */
.sbc.is-loading .sbc-body,
.sbc.is-loading .sbc-foot {
    opacity: .55;
    pointer-events: none;
    transition: opacity .15s ease;
}

/* ── κεφαλίδα ── */
.sbc-head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid #ececec;
}

.sbc-title {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
    color: var(--sbc-text);
}

.sbc-title-count {
    font-size: 15px;
    font-weight: 500;
    color: var(--sbc-muted);
}

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

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

.sbc-close svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.6;
}

/* ── προϊόντα ── */
.sbc-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px 24px;
}

.sbc-items {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sbc-item {
    position: relative;
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    padding: 18px 0;
    border-bottom: 1px solid var(--sbc-line);
    transition: opacity .15s ease;
}

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

.sbc-item.is-loading {
    opacity: .45;
    pointer-events: none;
}

.sbc-item-img {
    display: block;
    width: 80px;
    height: 80px;
    overflow: hidden;
    border: 1px solid var(--sbc-line);
    border-radius: 12px;
    background: #fff;
}

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

.sbc-item-noimg {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--sbc-soft);
}

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

.sbc-item-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--sbc-text);
    text-decoration: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.sbc-item-attrs {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--sbc-muted);
}

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

.sbc-item-price {
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    color: var(--sbc-text);
}

/* ποσότητα − / + */
.sbc-qty {
    display: inline-flex;
    align-items: center;
    height: 36px;
    border: 1px solid #d6dae1;
    border-radius: 999px;
    background: #fff;
}

.sbc-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--sbc-text);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.sbc-qty-btn:hover:not(:disabled) {
    background: var(--sbc-soft);
    color: var(--sbc-primary);
}

.sbc-qty-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.sbc-qty-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

.sbc-qty-value {
    min-width: 24px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.sbc-qty-gift {
    font-size: 13px;
    color: var(--sbc-muted);
}

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

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

.sbc-remove svg {
    width: 19px;
    height: 19px;
}

/* ── σύνολα + κουμπιά ── */
.sbc-foot {
    flex: 0 0 auto;
    padding: 18px 24px 24px;
    border-top: 1px solid var(--sbc-line);
    background: #fff;
    box-shadow: 0 -10px 24px rgba(15, 23, 42, .04);
}

.sbc-totals {
    margin: 0 0 16px;
}

.sbc-total-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    font-size: 14px;
    color: var(--sbc-muted);
}

.sbc-total-line dt,
.sbc-total-line dd {
    margin: 0;
    font-weight: 400;
}

.sbc-total-line dd {
    color: var(--sbc-text);
}

.sbc-total-line.is-discount dd {
    color: #16a34a;
}

.sbc-total-line.is-total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed #d6dae1;
    font-size: 17px;
    color: var(--sbc-text);
}

.sbc-total-line.is-total dt,
.sbc-total-line.is-total dd {
    font-weight: 700;
}

/* totals like the checkout: groups separated by a thin line */
.sbc-totals.is-detailed .sbc-total-line {
    padding: 2px 0;
    font-size: 13.5px;
}

.sbc-total-group + .sbc-total-group:not(:empty) {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--sbc-line);
}

.sbc-total-group:empty {
    display: none;
}

.sbc-total-line.is-strong dt,
.sbc-total-line.is-strong dd {
    font-weight: 600;
    color: var(--sbc-text);
}

/* ── «Complete the set» ── */
.sbc-set {
    margin: 6px 0 14px;
    padding: 14px;
    border-radius: 16px;
    background: var(--sbc-soft);
}

.sbc-set-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--sbc-text);
}

.sbc-set-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sbc-sug {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
    background: #fff;
}

.sbc-sug-img {
    display: flex;
    flex: 0 0 56px;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}

.sbc-sug-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sbc-sug-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.sbc-sug-name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--sbc-text);
    text-decoration: none;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

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

.sbc-sug-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--sbc-text);
}

.sbc-sug-price s {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--sbc-muted);
}

.sbc-sug-add {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--sbc-primary);
    border-radius: 50%;
    background: #fff;
    color: var(--sbc-primary);
    cursor: pointer;
    transition: background .15s, color .15s, transform .15s;
}

.sbc-sug-add:hover,
.sbc-sug-add:focus-visible {
    background: var(--sbc-primary);
    color: #fff;
}

.sbc-sug-add:active {
    transform: scale(.94);
}

.sbc-sug-add svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.sbc-sug-add.is-loading {
    pointer-events: none;
    opacity: .5;
}

.sbc-sug-add.is-loading svg {
    animation: sbc-spin .8s linear infinite;
}

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

.sbc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 50px;
    margin: 0 0 10px;
    padding: 0 20px;
    border: 1px solid var(--sbc-primary);
    border-radius: 12px;
    background: var(--sbc-primary);
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease, background-color .15s ease;
}

.sbc-btn:last-child {
    margin-bottom: 0;
}

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

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

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

/* ── άδειο καλάθι ── */
.sbc-empty {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 48px 28px 32px;
    text-align: center;
}

.sbc-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--sbc-soft);
    color: var(--sbc-primary);
}

.sbc-empty-icon svg {
    width: 40px;
    height: 40px;
    stroke-width: 1.5;
}

.sbc-empty-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--sbc-text);
}

.sbc-empty-text {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--sbc-muted);
}

.sbc-empty .sbc-btn {
    max-width: 280px;
    margin: 0 auto;
}

.sbc-cats {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid var(--sbc-line);
    text-align: left;
}

.sbc-cats-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--sbc-text);
}

/* categories: two columns of cards (icon, name, number of products) */
.sbc-cats-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.sbc-cat {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--sbc-line);
    border-radius: 14px;
    background: #fff;
    color: var(--sbc-text);
    text-decoration: none;
    transition: border-color .15s, background .15s, transform .15s;
}

.sbc-cat:hover,
.sbc-cat:focus-visible {
    border-color: color-mix(in srgb, var(--sbc-primary) 35%, #fff);
    background: color-mix(in srgb, var(--sbc-primary) 4%, #fff);
    color: var(--sbc-text);
    text-decoration: none;
}

.sbc-cat-ico {
    display: inline-flex;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--sbc-soft);
    color: var(--sbc-primary);
    transition: background .15s, color .15s;
}

.sbc-cat:hover .sbc-cat-ico {
    background: var(--sbc-primary);
    color: #fff;
}

/* own icon uploaded in the back office */
.sbc-cat-ico img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.sbc-cat:hover .sbc-cat-ico.has-img {
    background: color-mix(in srgb, var(--sbc-primary) 10%, #fff);
}

.sbc-cat-ico svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sbc-cat-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.sbc-cat-name {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    hyphens: auto;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sbc-cat-count {
    margin-top: 2px;
    font-size: 11.5px;
    color: var(--sbc-muted);
}

/* the whole card is the link: no arrow (more room for the name) */
.sbc-cat-arrow {
    display: none;
}

@media (max-width: 359px) {
    .sbc-cats-list {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── κινητό ── */
@media (max-width: 575px) {
    .sbc-head {
        padding: 16px 16px 14px;
    }

    .sbc-body {
        padding: 4px 16px;
    }

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

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

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

@media (prefers-reduced-motion: reduce) {
    .sbc-overlay,
    .sbc-panel,
    .sbc-close {
        transition: none;
    }
}
