.cpc-calculator-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.cpc-calculator-main {
    background: #F8F8F8;
    padding: 30px;
    border-radius: 10px;
    width: 100%;
}

.woocommerce-cart-form .product-name a {
    display: block !important;
    visibility: visible !important;
}

/* Accordion Styles */

.cpc-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 30px;
    cursor: pointer;
    background: #fff;
    transition: background 0.3s ease;
    user-select: none;
    border-radius: 20px;
}

.cpc-accordion-header:hover {
    background: #e7e7e7;
}

.cpc-accordion-section.active .cpc-accordion-header {
    border-bottom: 1px solid #e5e7eb;
}

.cpc-accordion-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
    line-height: 1;
}

.cpc-accordion-content {
    padding: 20px 0;
    display: none;
}

.cpc-accordion-section.active .cpc-accordion-content {
    display: block;
}

.cpc-accordion-header h3 {
    margin: 0;
    font-size: 16px !important;
    line-height: 1 !important;
}

/* Legacy section styles for non-accordion */
.cpc-section {
    margin-bottom: 20px;
}


/* Shape Options */
.cpc-shape-options {
    display: flex;
    gap: 23px;
}

.cpc-radio-button {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.cpc-radio-button input[type="radio"] {
    display: none;
}

.cpc-radio-button span {
    padding: 23px 30px;
    border: 1px solid rgb(0 0 0 / 30%);
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s;
    font-size: 14px;
    background: #ffffff;
    display: flex;
    align-items: center;
    line-height: 1;
}

.cpc-radio-button:hover span {
    border-color: #ff6b35;
    background: #fff5f3;
}

.cpc-radio-button.active span,
.cpc-radio-button input[type="radio"]:checked+span {
    border-color: #ff6b35;
    border-width:2px;
}

/* Product Options */
.cpc-product-options {
    display: flex;
    flex-wrap: wrap;
    gap: 23px;
}

.cpc-product-card {
    display: flex;
    padding: 23px 30px;
    border: 1px solid rgb(0 0 0 / 30%);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    width: calc(100% / 2 - 11.5px);
    background-color: #ffffff;
}

.cpc-product-card input[type="radio"] {
    display: none;
}

.cpc-product-card .product-icon {
    font-size: 24px;
    margin-right: 20px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 8px;
}

.cpc-product-card .product-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cpc-product-card .product-info span {
    font-size: 12px;
}

.cpc-product-card .product-info strong {
    font-size: 14px;
}

.cpc-product-card:hover {
    border-color: #ff6b35;
    background: #fff5f3;
}

.cpc-product-card.active,
.cpc-product-card input[type="radio"]:checked~* {
    border-color: #ff6b35;
    border-width:2px;
}

/* Color Options */
.cpc-color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 23px;
}

.cpc-color-button {
    display: flex;
    padding: 23px 20px;
    border: 1px solid rgb(0 0 0 / 30%);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    gap: 20px;
    align-items: center;
    background: #ffffff;
}

.cpc-color-button input[type="radio"] {
    display: none;
}

.cpc-color-button .color-swatch {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.cpc-color-button .color-name {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 600;
}

.cpc-color-button:hover {
    border-color: #ff6b35;
}

.cpc-color-button:hover .color-swatch {
    transform: scale(1.1);
}

.cpc-color-button.active {
    border-color: #ff6b35;
    background: #fff5f3;
}

.cpc-color-button.active .color-swatch {
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

/* Dimensions */
.cpc-dimensions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dimension-input {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-direction: column;
}

.dimension-input label {
    font-size: 14px;
    flex-shrink: 0;
}

.dimension-input input[type="number"],
.cpc-select,
.cpc-addon-details input[type=text],
.cpc-accordion-content textarea {
    padding: 14px 30px;
    border: 1px solid rgb(0 0 0 / 30%);
    border-radius: 100px;
    font-size: 14px;
    transition: border-color 0.3s;
    background-color: #ffffff;
    outline: none;
}

.cpc-accordion-content textarea {
    border-radius: 20px;
    margin-bottom: 20px;
}

.dimension-input input[type="number"]:focus,
.cpc-select:focus,
.cpc-addon-details input[type=text]:focus,
.cpc-accordion-content textarea:focus {
    outline: none;
    border-color: #ff6b35;
}

/* Add-ons */
.cpc-addons {
    display: flex;
    gap: 23px;
    margin-bottom: 20px;
}

.cpc-addon-button {
    cursor: pointer;
    padding: 23px 30px;
    border: 1px solid rgb(0 0 0 / 30%);
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s;
    font-size: 14px;
    background: #ffffff;
    line-height: 1;
    width: 100%;
}

.cpc-addon-button span {
    font-size: 13px;
    font-weight: 500;
}

.cpc-addon-button input[type="checkbox"] {
    display: none;
}

.cpc-addon-button:hover {
    border-color: #ff6b35;
}

.cpc-addon-button.active {
    border-color: #ff6b35;
}

.cpc-addon-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpc-addon-details label {
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
}

/* Additional Info */
.cpc-file-upload button.file-upload-btn {
    background-color: transparent;
    border-color: rgb(0 0 0 / 30%);
    color: #3e3e3e;
    display: flex;
    align-items: center;
    gap: 15px;
}
.cpc-file-upload button.file-upload-btn::before {
    content: "";
    background-image: url(/wp-content/uploads/2025/10/Download.png);
    background-size: contain;
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
}
.cpc-file-upload button.file-upload-btn:hover,
.cpc-file-upload button.file-upload-btn:focus {
    color: #ffffff;
}
.cpc-file-upload button.file-upload-btn:hover::before,
.cpc-file-upload button.file-upload-btn:focus::before {
    filter: brightness(0) invert(1);
}
.cpc-file-upload button.file-upload-btn img {
    display: none !important;
}
.cpc-file-upload {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 10px;
}
.cpc-file-upload input[type="file"]::file-selector-button {
  padding: 0;
  border: 0;
  font-size: 0;
}
.cpc-file-upload input {
    display: block !important;
}
/* Preview Section */
.cpc-preview-section {
    position: sticky;
    top: 20px;
    background: #F8F8F8;
    border-radius: 10px;
    padding: 30px;
    max-width: 487px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.cpc-preview-box {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.cpc-preview-box h3,
.price-breakdown h4 {
    font-size: 22px !important;
    margin: 0;
}

.preview-canvas {
    width: 100%;
    height: 259px;
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(0 0 0 / 30%);
}

.preview-shape {
    background: #ff6b35;
    position: relative;
}

.preview-dimensions {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    align-items: center;
}

/* Price Section */
.cpc-price-section {
    width: 100%;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.price-breakdown {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    line-height: 1.3;
}
.price-breakdown>div:empty {
    display: none;
}
.breakdown-addons {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.breakdown-addon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    line-height: 1.3;
}

.breakdown-separator {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.price-display {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 15px;
}

.loading-colors {
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
    padding: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgb(0 0 0 / 30%);
    border-radius: 40px;
    max-height: 60px;
    width: calc(100% / 2 - 10px);
}

.qty-btn {
    border: none !important;
    background-color: transparent !important;
    padding: 24px !important;
    color: #1A1A1A !important;
}

.qty-btn:hover {
    background: #e5e7eb;
}

.quantity-selector input {
    border: none !important;
    font-size: 14px;
    font-weight: 600;
    background-color: transparent;
    padding: 0 !important;
    outline: 0;
    text-align: center;
    padding-left: 20px !important;
}
.add-to-cart-btn {
    width: calc(100% / 2 - 10px) !important;
    max-height: 60px;
}
span#totalPriceDisplay {
    font-size: 32px;
}
/* Loading Overlay */
.cpc-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.cpc-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: #ff6b35;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
.loading-colors {
    transition: opacity 0.2s ease;
    opacity: 0.7;
    font-style: italic;
}

/* Loading state feedback */
input:disabled, select:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Calculating indicator animation */
#basePriceDisplay small {
    display: inline-block;
    animation: cpc-pulse 1.5s ease-in-out infinite;
}

@keyframes cpc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error & Success Messages */
.cpc-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

.cpc-success-box {
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

.cpc-success-box p {
    color: #065f46;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

.cpc-success-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.cpc-success-actions button {
    background: #ff6b35;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
}

.cpc-success-actions button:hover {
    background: #e55a2b;
}

.cpc-success-actions .continue-btn {
    background: #f3f4f6;
    color: #374151;
}

.cpc-success-actions .continue-btn:hover {
    background: #e5e7eb;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#widthLabel.hidden,
.dimension-input.hidden {
    display: none !important;
}

.cpc-specs-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    margin: 0;
    border: 1px solid #ffffff;
}

.cpc-specs-table thead th {
    padding: 20px 30px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.cpc-specs-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.cpc-specs-table tbody tr:last-child {
    border-bottom: none;
}

.cpc-specs-table tbody tr:hover {
    background: #f9fafb;
}

.cpc-specs-table tbody td {
    padding: 15px 30px;
}

.cpc-shape-options label.cpc-radio-button span img {
    max-width: 20px;
}

div#materialSpecsTable {
    overflow: auto;
    border: 1px solid rgb(0 0 0 / 30%);
    border-radius: 20px;
}
/* Responsive */
@media (max-width: 1024px) {
    .cpc-calculator-wrapper {
        flex-direction: column;
        gap: 0;
    }
    .cpc-preview-section {
        width: 100%;
        position: static;
        max-width: 100%;
    }
    .cpc-color-options {
        grid-template-columns: repeat(3, 1fr);
    }
    .cpc-radio-button span {
        padding: 30px 20px;
        gap: 10px;
    }
    .cpc-shape-options label.cpc-radio-button span img {
        margin-right: 0 !important;
    }
}

@media (max-width: 768px) {
    .cpc-calculator-main {
        padding: 50px 20px;
        border-radius: 0;
    }
    .cpc-shape-options,
    .cpc-product-options,
    .cpc-addons {
        gap: 10px;
    }
    .cpc-radio-button,
    .cpc-product-card {
        flex: 100%;
        width: 100%;
    }
    .cpc-color-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .cpc-dimensions {
        grid-template-columns: 1fr;
    }

    .breakdown-item,
    .breakdown-addon-item {
        font-size: 13px;
    }

    .breakdown-grand-total span:last-child {
        font-size: 20px;
    }
    .cpc-shape-options,
    .cpc-addons {
        flex-wrap: wrap;
    }
    .cpc-color-button {
        padding: 29px 20px;
        gap: 10px;
    }
    .quantity-selector {
        width: 100%;
        max-width: 142px;
    }
    .quantity-selector input {
        padding-left: 0px !important;
    }
    .add-to-cart-btn {
        width: calc(100% - 162px) !important;
    }
    .cpc-preview-section {
        padding: 0 20px 50px;
    }
    .cpc-shape-options label.cpc-radio-button span img {
        max-width: 40px;
    }
}
@media (max-width: 360px) {
    .cpc-color-options {
        grid-template-columns: repeat(1, 1fr);
    }
    .add-to-cart-btn {
        width: 100% !important;
    }
    .quantity-selector {
        max-width: 100%;
    }
}