
:root {
    --epsc-accent: #ec6f9d;
    --epsc-dark: #171717;
    --epsc-muted: #6b7280;
    --epsc-border: #e7e7e7;
    --epsc-bg: #ffffff;
}

body.epsc-open {
    overflow: hidden;
}

.epsc-trigger {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999990;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    background: var(--epsc-accent);
    color: #fff;
    box-shadow: 0 12px 35px rgba(0,0,0,.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.epsc-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(0,0,0,.22);
}

.epsc-trigger-icon {
    display: inline-flex;
}

.epsc-count {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 23px;
    text-align: center;
    border: 2px solid #fff;
}

.epsc-overlay {
    position: fixed;
    inset: 0;
    z-index: 999991;
    background: rgba(0,0,0,.46);
    opacity: 0;
    transition: opacity .25s ease;
}

.epsc-overlay.is-visible {
    opacity: 1;
}

.epsc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(430px, 100vw);
    height: 100dvh;
    z-index: 999992;
    transform: translateX(100%);
    transition: transform .28s ease;
    pointer-events: none;
}

.epsc-drawer.is-open {
    transform: translateX(0);
    pointer-events: auto;
}

.epsc-panel {
    height: 100%;
    background: var(--epsc-bg);
    box-shadow: -16px 0 45px rgba(0,0,0,.18);
    display: flex;
    flex-direction: column;
}

.epsc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--epsc-border);
}

.epsc-header h2 {
    margin: 0 0 3px;
    font-size: 23px;
    line-height: 1.2;
    color: var(--epsc-dark);
}

.epsc-header-count {
    color: var(--epsc-muted);
    font-size: 13px;
}

.epsc-close,
.epsc-remove {
    border: 0;
    background: transparent;
    color: #111;
    cursor: pointer;
    line-height: 1;
}

.epsc-close {
    font-size: 34px;
}

.epsc-remove {
    font-size: 24px;
    color: #999;
}

.epsc-content {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.epsc-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 24px;
}

.epsc-item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--epsc-border);
}

.epsc-thumb img {
    width: 82px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.epsc-item-body {
    min-width: 0;
}

.epsc-item-top,
.epsc-item-bottom,
.epsc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.epsc-item-title a,
.epsc-item-title {
    color: var(--epsc-dark);
    font-weight: 700;
    font-size: 15px;
    line-height: 1.35;
    text-decoration: none;
}

.epsc-item .variation {
    margin: 7px 0 0;
    font-size: 12px;
    color: var(--epsc-muted);
}

.epsc-item-bottom {
    margin-top: 14px;
}

.epsc-qty {
    display: inline-grid;
    grid-template-columns: 32px 38px 32px;
    border: 1px solid var(--epsc-border);
    border-radius: 9px;
    overflow: hidden;
}

.epsc-qty button,
.epsc-qty input {
    width: 100%;
    height: 34px;
    border: 0;
    background: #fff;
    text-align: center;
    color: #111;
}

.epsc-qty button {
    cursor: pointer;
    font-size: 18px;
}

.epsc-qty input {
    appearance: textfield;
    -moz-appearance: textfield;
    padding: 0;
    font-weight: 700;
}

.epsc-qty input::-webkit-outer-spin-button,
.epsc-qty input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.epsc-line-price {
    font-weight: 800;
    color: var(--epsc-dark);
}

.epsc-footer {
    border-top: 1px solid var(--epsc-border);
    padding: 20px 24px 24px;
    background: #fff;
}

.epsc-row {
    margin-bottom: 8px;
    color: var(--epsc-muted);
}

.epsc-total {
    margin: 4px 0 18px;
    color: var(--epsc-dark);
    font-size: 20px;
}

.epsc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.epsc-btn {
    min-height: 46px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    font-weight: 700;
    text-decoration: none;
    transition: opacity .2s ease, transform .2s ease;
}

.epsc-btn:hover {
    opacity: .9;
    transform: translateY(-1px);
}

.epsc-btn-primary {
    background: var(--epsc-accent);
    color: #fff;
}

.epsc-btn-secondary {
    border: 1px solid var(--epsc-dark);
    color: var(--epsc-dark);
    background: #fff;
}

.epsc-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
}

.epsc-empty-icon {
    color: #c7c7c7;
    margin-bottom: 12px;
}

.epsc-empty p {
    margin: 0 0 18px;
    font-weight: 700;
}

.epsc-loading {
    opacity: .55;
    pointer-events: none;
}

@media (max-width: 600px) {
    .epsc-trigger {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
    }

    .epsc-drawer {
        width: 100vw;
    }

    .epsc-header {
        padding: 18px;
    }

    .epsc-items {
        padding: 6px 18px;
    }

    .epsc-footer {
        padding: 18px;
    }

    .epsc-actions {
        grid-template-columns: 1fr;
    }
}


/* ===== EPROJEKT SIDE CART 1.0.2 — poprawki widoczności ilości ===== */

.epsc-qty {
    display: inline-grid !important;
    grid-template-columns: 34px 42px 34px !important;
    align-items: stretch !important;
    width: 110px !important;
    min-width: 110px !important;
    height: 36px !important;
    background: #ffffff !important;
    border: 1px solid #dedede !important;
    border-radius: 9px !important;
    overflow: hidden !important;
}

.epsc-qty button,
.epsc-qty input.epsc-qty-input {
    box-sizing: border-box !important;
    display: block !important;
    position: relative !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 34px !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
    text-align: center !important;
    vertical-align: middle !important;
    opacity: 1 !important;
}

.epsc-qty button {
    z-index: 2 !important;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    font-family: Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 500 !important;
    line-height: 34px !important;
    cursor: pointer !important;
}

.epsc-qty input.epsc-qty-input {
    z-index: 3 !important;
    color: #111111 !important;
    -webkit-text-fill-color: #111111 !important;
    caret-color: #111111 !important;
    font-family: Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 34px !important;
    appearance: textfield !important;
    -moz-appearance: textfield !important;
}

.epsc-qty input.epsc-qty-input:focus {
    outline: 1px solid var(--epsc-accent) !important;
    outline-offset: -1px !important;
}

.epsc-qty-minus {
    border-right: 1px solid #eeeeee !important;
}

.epsc-qty-plus {
    border-left: 1px solid #eeeeee !important;
}

/* Motywy i WooCommerce często narzucają biały tekst w polach number. */
.epsc-drawer input[type="number"].epsc-qty-input,
.epsc-drawer input[type="number"].epsc-qty-input:hover,
.epsc-drawer input[type="number"].epsc-qty-input:focus {
    color: #111111 !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #111111 !important;
    text-shadow: none !important;
}

/* Przycisk koszyka: zawsze koło, a licznik ponad nim. */
button.epsc-trigger {
    box-sizing: border-box !important;
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    padding: 0 !important;
    border: 2px solid var(--epsc-accent) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: var(--epsc-accent) !important;
    overflow: visible !important;
}

button.epsc-trigger:hover {
    background: var(--epsc-accent) !important;
    color: #ffffff !important;
}

button.epsc-trigger .epsc-trigger-icon,
button.epsc-trigger .epsc-trigger-icon svg {
    display: block !important;
    width: 25px !important;
    height: 25px !important;
    margin: 0 !important;
}

button.epsc-trigger .epsc-count {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10 !important;
    top: -7px !important;
    right: -7px !important;
    min-width: 24px !important;
    width: auto !important;
    height: 24px !important;
    padding: 0 6px !important;
    border: 2px solid #ffffff !important;
    border-radius: 999px !important;
    background: #161616 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 20px !important;
    text-align: center !important;
}

@media (max-width: 600px) {
    button.epsc-trigger {
        width: 54px !important;
        min-width: 54px !important;
        max-width: 54px !important;
        height: 54px !important;
        min-height: 54px !important;
        max-height: 54px !important;
    }
}


/* ===== EPROJEKT SIDE CART 1.0.3 — poprawa pozycji ikony ===== */
button.epsc-trigger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    line-height: 1 !important;
    text-align: center !important;
}

button.epsc-trigger .epsc-trigger-icon {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    pointer-events: none !important;
}

button.epsc-trigger .epsc-trigger-icon svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(0) !important;
}

button.epsc-trigger .epsc-count {
    top: -6px !important;
    right: -6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}
