.pi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.pi-modal-content {
    background-color: #fff;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 3px 2px rgba(0, 0, 0, .1);
}

.pi-modal-close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 28px;
    font-weight: bold;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.pi-configurator-container {
    display: flex;
    height: 100%;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
}

.pi-visualization-panel {
    width: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#pi-visualization-area {
    position: relative;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: auto;
    border: 1px dashed #ccc;
}

.pi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
}

.pi-modal-content {
    background-color: #fff;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 3px 2px rgba(0, 0, 0, .1);
}

.pi-modal-close {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 28px;
    font-weight: bold;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 10;
}

.pi-configurator-container {
    display: flex;
    height: 100%;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
}

.pi-visualization-panel {
    width: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pi-visualization-area {
    position: relative;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: auto;
    border: 1px dashed #ccc;
}

.pi-options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pi-option {
    margin-bottom: 5px;
}

.pi-footer-summary {
    border-top: 2px solid #000;
    padding-top: 16px;
    margin-top: auto;
    background: #fff;
    position: sticky;
    bottom: 0;
}

.pi-price-container {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 16px;
}

.pi-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-block;
    vertical-align: middle;
    border: 1px solid #ccc;
    cursor: pointer;
}

.pi-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 1px solid #ccc;
    vertical-align: middle;
}

.pi-options-list input[type="radio"],
.pi-options-list input[type="checkbox"] {
    display: none;
}

.pi-options-list label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.pi-tabs-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 16px;
}

.pi-tab-link {
    padding: 10px 16px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.pi-tab-link.active {
    border-color: #007bff;
    font-weight: bold;
}

.pi-tab-pane {
    display: none;
}

.pi-tab-pane.active {
    display: block;
}

.pi-rules-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pi-rules-modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}
.pi-rules-text {
    overflow-y: auto;
    max-height: 60vh;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 16px;
}
.pi-rules-modal-footer {
    text-align: right;
}
.pi-options-disabled {
    opacity: 0.5;
}

.pi-inner-tabs-nav {
    margin-top: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.pi-inner-tabs-nav .pi-inner-tab-link {
    padding: 6px 12px;
    font-size: 0.9em;
    border-bottom-width: 2px;
    margin-bottom: -1px;
}

.pi-inner-tabs-nav .pi-inner-tab-link.active {
    border-color: #20a3d3;
    color: #20a3d3;
}

.pi-tooltip {
    position: relative;
    cursor: pointer;
}

.pi-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
}

.pi-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

.pi-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1200;
}
.pi-loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pi-required-indicator {
    color: red;
    font-weight: bold;
    margin-left: 5px;
}

.pi-step-price, .pi-option-price {
    color: #777;
    font-weight: normal;
}
.pi-option-label {
    margin-right: 5px;
}

.pi-tabs-nav-container {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    border-bottom: 1px solid #ddd;
    margin-bottom: 16px;
}

.pi-tabs-nav-wrapper {
    flex-grow: 1;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.pi-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    border-bottom: none;
    margin-bottom: 0;
}

.pi-tab-scroll-btn {
    flex-shrink: 0;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    padding: 8px;
    cursor: pointer;
    z-index: 1;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    line-height: 1;
    height: 100%;
}

.pi-tab-scroll-btn:hover {
    background-color: #eee;
}

.pi-tab-scroll-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pi-tab-scroll-btn.prev {
    border-right: none;
}

.pi-tab-scroll-btn.next {
    border-left: none;
}
.pi-inner-tabs-container {
    border-bottom: none;
    margin-top: 10px;
    margin-bottom: 16px;
}

.pi-inner-tabs-container .pi-tabs-nav-wrapper {
    border-bottom: 1px solid #ddd;
}

body.pi-modal-open {
    overflow: hidden;
}

.pi-add-to-cart-actions {
    display: flex;
    align-items: center;
}

.pi-step.step-type-file .pi-options-list {
    display: flex;
    flex-flow: column nowrap;
}

.pi-step.step-type-file .pi-options-list .help-block
{

    font-weight: normal;
    color: #344054;
    font-size: .825rem;
    margin: 0;
}

#pi-set-navigation {
    padding: 10px 20px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ddd;
    text-align: center;
}
#pi-set-navigation h3 {
    margin: 0;
    font-size: 1.2em;
}

#pi-summary-screen {
    padding: 10px;
    overflow-y: auto;
    flex-grow: 1;
}
.pi-summary-item {
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 16px;
}
.pi-summary-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
    padding: 10px;
    border-bottom: 1px solid #eee;
}
.pi-summary-item-header h5 {
    margin: 0;
    font-size: 1.1em;
}
.pi-summary-item-price {
    font-weight: bold;
}
.pi-summary-item-details {
    padding: 10px;
    font-size: 0.9em;
}
.pi-summary-item-details ul {
    padding-left: 20px;
    margin: 0;
}
.pi-summary-item-details li {
    color: #555;
}
.pi-summary-item-details strong {
    color: #000;
}

#pi-copy-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1060;
}
.pi-copy-modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
    text-align: center;
}
#pi-copy-options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}
#pi-copy-start-new {
    margin-top: 10px;
}

.pi-step-locked {
    opacity: 0.6;
    pointer-events: none;
    background-color: #f9f9f9;
}
.pi-step-locked .pi-accordion-header {
    cursor: not-allowed;
}

.pi-viz-text-layer {
    pointer-events: none;
    padding: 5px;
    white-space: pre-wrap;
    word-break: break-word;
    box-sizing: border-box;
    overflow: hidden;
    line-height: 1.1;
}

.pi-summary-visual-container {
    position: relative;
    border: 1px dashed #ccc;
    margin-bottom: 20px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 200px;
}

.pi-summary-item-preview {
    position: absolute;
    border: 1px solid #aaa;
    background: rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
    overflow: hidden;
}

.pi-summary-item-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pi-summary-services-container {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 16px;
}
.pi-summary-services-container h5 {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.pi-service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.pi-service-item:last-child {
    border-bottom: none;
}

.pi-service-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.pi-service-price {
    font-weight: bold;
    white-space: nowrap;
    font-size: 0.9em;
}

.pi-summary-price-breakdown {
    margin-top: 20px;
    border-top: 1px solid #ccc;
    padding-top: 16px;
}

.pi-price-breakdown-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9em;
}
.pi-price-breakdown-row span:first-child {
    color: #555;
}
.pi-price-breakdown-row span:last-child {
    font-weight: 500;
}

.pi-price-breakdown-row.total {
    font-size: 1.1em;
    font-weight: bold;
    color: #000;
    border-top: 1px solid #999;
    padding-top: 8px;
    margin-top: 8px;
}

.pi-options-panel {
    width: 30%;
    min-width: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    overflow-x: hidden;
    padding-right: 16px;
}

#pi-steps-container {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.pi-show-more-btn {
    display: none;
    width: 100%;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 16px;
}

.pi-show-more-btn:focus {
    outline: none;
    border-color: #bbb;
}

/* --- NEW CART STYLES --- */

.pi-cart-set-container,
.pi-cart-product-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    margin-bottom: 20px;
    padding: 0;
}

/* -- Set Header -- */
.pi-cart-set-header {
    background-color: #f8f9fa;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pi-set-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.pi-set-delete-btn {
    color: #d9534f;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}
.pi-set-delete-btn:hover {
    color: #c9302c;
    text-decoration: none;
}

/* -- Cart Row Layout (Flex) -- */
.pi-cart-row {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap; /* Allow wrapping on mobile */
}

.pi-cart-set-items .pi-cart-row:last-child {
    border-bottom: none;
}

/* Kolumny */
.pi-col-image {
    width: 15%;
    padding-right: 16px;
}
.pi-col-image img {
    border: 1px solid #ddd; /* Ramka wg wireframe */
    padding: 2px;
    max-width: 100%;
    height: auto;
}
/* Dla pojedynczego produktu zdjęcie jest większe/z ramką */
.pi-single-product-image img {
    border: 3px solid #000; /* Gruba ramka wg wireframe */
}

.pi-col-name {
    width: 25%;
    padding-right: 16px;
}
.pi-product-name {
    font-weight: bold;
    margin-bottom: 5px;
}
.pi-customizations {
    font-size: 0.85em;
    color: #666;
    margin-top: 5px;
}
.pi-customizations-label {
    font-weight: bold;
    margin-bottom: 2px;
}

.pi-col-price,
.pi-col-qty-text,
.pi-col-total {
    width: 10%;
    text-align: center;
}

.pi-col-qty-input {
    width: 15%;
    text-align: center;
    padding: 0 10px;
}

.pi-col-delete {
    width: 10%;
    text-align: right;
}

.pi-label-mobile {
    display: none; /* Hide on desktop */
}

/* -- Set Footer -- */
.pi-cart-set-footer {
    background-color: #fafafa;
    border-top: 1px solid #e0e0e0;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pi-set-total {
    font-size: 1.2em;
    text-align: right;
}

/* -- Responsive -- */
@media (max-width: 768px) {
    .pi-cart-row {
        display: block; /* Stack on mobile */
        position: relative;
    }
    .pi-col-image {
        width: 96px;
        margin-right: 16px;
        margin-bottom: 16px;
    }
    .pi-col-name {
        width: calc(100% - 120px);
        margin-bottom: 10px;
    }
    .pi-col-price, .pi-col-qty-text, .pi-col-qty-input, .pi-col-total {
        width: 100%;
        text-align: left;
        margin-bottom: 5px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .pi-col-delete {
        width: 100%;
        text-align: right;
    }
    .pi-label-mobile {
        display: inline-block;
        font-weight: bold;
        color: #555;
    }
    .pi-col-qty-input input {
        width: 60px;
    }

}