/* Base table styles */
body .pcc-calculator-container table.pcc-calculator-table {
    table-layout: fixed !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

/* Column styles */
body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-action {
    width: 40px !important;
    min-width: 40px !important;
}

body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-sku {
    width: 120px !important;
    min-width: 120px !important;
}

body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-product {
    width: 350px !important;
    min-width: 350px !important;
}

body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-size,
body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-usage,
body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-price-usage,
body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-quantity,
body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-price-unit,
body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-total,
body .pcc-calculator-container table.pcc-calculator-table col.pcc-col-cart {
    width: 80px !important;
    min-width: 80px !important;
}

/* Cell styles */
body .pcc-calculator-container table.pcc-calculator-table td,
body .pcc-calculator-container table.pcc-calculator-table th {
    padding: 8px !important;
    vertical-align: top !important;
}

/* Total cells alignment */
body .pcc-calculator-container table.pcc-calculator-table td.pcc-total,
body .pcc-calculator-container table.pcc-calculator-table td.pcc-price-per-usage,
body .pcc-calculator-container table.pcc-calculator-table td.pcc-price {
    text-align: center !important;
}

/* Total row alignment */
body .pcc-calculator-container .pcc-totals-row td {
    text-align: center !important;
    font-weight: bold !important;
}

/* Product cell specific */
body .pcc-calculator-container table.pcc-calculator-table td.pcc-product-cell {
    padding: 0 !important;
}

body .pcc-calculator-container table.pcc-calculator-table td.pcc-product-cell .pcc-product-container {
    min-height: 100% !important;
    padding: 8px !important;
}

body .pcc-calculator-container table.pcc-calculator-table td.pcc-product-cell .pcc-product-inner {
    position: relative !important;
    min-height: 100% !important;
}

/* Product search field */
body .pcc-calculator-container .pcc-product-search {
    width: 100% !important;
    min-height: 60px !important;
    height: auto !important;
    box-sizing: border-box !important;
    padding: 8px !important;
    resize: none !important;
    overflow: hidden !important;
    display: block !important;
    word-wrap: break-word !important;
    word-break: break-all !important;
    white-space: pre-wrap !important;
    line-height: 1.5 !important;
}

/* Hide scrollbars but keep functionality */
body .pcc-calculator-container .pcc-product-search::-webkit-scrollbar {
    display: none !important;
}

body .pcc-calculator-container .pcc-product-search {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

/* Table wrapper */
body .pcc-calculator-container .pcc-table-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    display: block !important;
    margin-bottom: 1em !important;
}

/* Buttons container */
body .pcc-calculator-container .pcc-buttons-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 20px 0 !important;
}

body .pcc-calculator-container .pcc-left-buttons {
    display: flex !important;
    gap: 10px !important;
    flex: 1 !important;
}

body .pcc-calculator-container .pcc-right-buttons {
    display: flex !important;
    justify-content: flex-end !important;
    flex: 1 !important;
}

/* Button positioning */
body .pcc-calculator-container .pcc-reset-button {
    order: 1 !important;
}

body .pcc-calculator-container .pcc-add-row-button {
    order: 2 !important;
    margin: 0 auto !important;
}

body .pcc-calculator-container .pcc-add-all-to-cart {
    order: 3 !important;
}

/* Delete row button */
body .pcc-calculator-container .pcc-delete-row {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    color: #757575 !important;
    transition: color 0.2s ease !important;
}

body .pcc-calculator-container .pcc-delete-row:hover {
    color: #dc3232 !important;
}

body .pcc-calculator-container .pcc-delete-row svg {
    width: 20px !important;
    height: 20px !important;
}

/* Hide WooCommerce cart popups */
body .pcc-calculator-container .added_to_cart,
body .pcc-calculator-container .added_to_cart.wc-forward,
body.woocommerce .pcc-calculator-container .added_to_cart,
body.woocommerce .pcc-calculator-container .added_to_cart.wc-forward {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
}

/* Export button container */
body .pcc-calculator-container .pcc-export-container {
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 20px !important;
    width: 100% !important;
}

body .pcc-calculator-container .pcc-export-container .pcc-export-pdf {
    margin-left: auto !important;
}

/* Header text wrapping */
body .pcc-calculator-container table.pcc-calculator-table th.pcc-header-cell {
    white-space: normal !important;
    word-break: normal !important;
    word-wrap: break-word !important;
    hyphens: none !important;
    overflow-wrap: break-word !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
}

body .pcc-calculator-container table.pcc-calculator-table th.pcc-header-cell .header-text {
    display: block !important;
    text-align: center !important;
}