.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: 15px;
    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-panel {
    width: 30%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-right: 15px;
}

#pi-steps-container {
    flex-grow: 1;
}

/* Steps Progress Indicator */
#pi-steps-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.pi-progress-step {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    border: 1px solid;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.step-completed {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.step-pending-required {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.step-pending-optional {
    background-color: #e2e3e5;
    border-color: #d6d8db;
    color: #383d41;
}

.pi-step {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.pi-accordion-header {
    cursor: pointer;
    padding: 10px;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    margin-top: 0;
}

.pi-accordion-header:hover {
    background-color: #eee;
}

.pi-step-content {
    padding: 10px;
    border: 1px solid #ddd;
    border-top: none;
}

.pi-options-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pi-option {
    margin-bottom: 5px;
}

.pi-summary {
    border-top: 2px solid #000;
    padding-top: 15px;
    margin-top: auto;
    background: #fff;
    position: sticky;
    bottom: 0;
}

.pi-price-container {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
}

.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;
}

/* Tabs */
.pi-tabs-nav {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.pi-tab-link {
    padding: 10px 15px;
    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;
}

/* Rules Modal */
.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: 15px;
}
.pi-rules-modal-footer {
    text-align: right;
}
.pi-options-disabled {
    opacity: 0.5;
}

/* --- Styles for inner tabs --- */
.pi-inner-tabs-nav {
    margin-top: 10px;
    margin-bottom: 15px;
    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; /* A different color for inner active tabs */
    color: #20a3d3;
}

/* Tooltip styles */
.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;
}

/* Loader Styles */
.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); }
}

/* Required Indicator */
.pi-required-indicator {
    color: red;
    font-weight: bold;
    margin-left: 5px;
}

/* Price spans */
.pi-step-price, .pi-option-price {
    color: #777;
    font-weight: normal;
}
.pi-option-label {
    margin-right: 5px;
}

/* --- Styles for Font Selector --- */
.pi-font-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.pi-font-option {
    display: flex;
    align-items: center;
}
.pi-font-option input[type="radio"] {
    margin-right: 5px;
}
.pi-font-option label {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.pi-font-option input[type="radio"]:checked + label {
    background-color: #3498db;
    color: #fff;
    border-color: #2980b9;
}
