/* Base Styles & Typography */
.cpa-product-addons {
    margin: 20px 0;
    padding: 0;
    background: transparent;
    border: none;
}

.cpa-addon-group {
    background: #fff;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    /* Default Accent Color Fallback */
    --cpa-accent-color: #0073aa;
}

.cpa-addon-group h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
    color: #333;
}

/* Field Group */
.cpa-field {
    margin-bottom: 20px;
}

.cpa-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    font-size: 15px;
}

.cpa-grid-layout .cpa-field-label {
    grid-column: 1 / -1;
    width: 100%;
}

/* Option Items (General) */
.cpa-option {
    margin-bottom: 8px;
}

.cpa-option label {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.cpa-option label:hover {
    background-color: #f9f9f9;
}

/* Selected State (JS sets .cpa-selected on label) */
.cpa-option label.cpa-selected {
    background-color: #fdfdfd;
    border-color: var(--cpa-accent-color);
    box-shadow: 0 0 0 1px var(--cpa-accent-color) inset;
    /* Soft Inner Border */
}

/* Inputs */
.cpa-option input {
    margin-right: 10px;
    accent-color: var(--cpa-accent-color);
    transform: scale(1.1);
    /* Slightly larger inputs */
}

/* Price Tag */
.cpa-price-tag {
    font-weight: 500;
    color: #666;
    margin-left: auto;
    /* Push to right in flex container */
    font-size: 0.9em;
    padding-left: 10px;
}

/* Fix for spacing issue: Remove global margin from price amount if present */
.cpa-price-tag .woocommerce-Price-amount,
.cpa-cart-price .woocommerce-Price-amount {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

/* Grid Layout Improvements */
/* Grid Layout Improvements */
.cpa-grid-layout {
    display: grid;
    gap: 15px;
    align-items: stretch;
}

/* Make the label fill the height */
.cpa-grid-layout .cpa-option {
    height: 100%;
}

.cpa-grid-layout .cpa-option label {
    flex-direction: column;
    justify-content: flex-start;
    text-align: center;
    border: 1px solid #e5e5e5;
    height: 100%;
    padding: 30px 15px 15px 15px;
    /* Top padding for radio */
    background: #fff;
    position: relative;
    border-radius: 8px;
    /* Consistent rounded corners */
}

/* Absolute Positioned Radio/Checkbox */
.cpa-grid-layout .cpa-option input {
    position: absolute;
    top: 10px;
    right: 10px;
    margin: 0;
    transform: scale(1.2);
}

.cpa-grid-layout .cpa-option label:hover {
    border-color: #ccc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    z-index: 999;
}

/* Selected State */
.cpa-grid-layout .cpa-option label.cpa-selected {
    border-color: var(--cpa-accent-color);
    box-shadow: 0 0 0 1px var(--cpa-accent-color) inset, 0 4px 12px rgba(0, 0, 0, 0.08);
    background-color: #fff;
    z-index: 10;
}

/* Image Handling */

.cpa-img-wrapper {
    position: relative;
    display: inline-block;
}

.cpa-img-wrapper .cpa-img-zoom {
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(10px) !important;
}

.cpa-img-wrapper:hover .cpa-img-zoom {
    display: block !important;
    opacity: 1;
    transform: translateX(-50%) translateY(0) !important;
}

.cpa-option img {
    position: relative;
    z-index: 1;
}

/* Tooltips */
.cpa-tooltip-icon {
    display: inline-block;
    margin-left: 6px;
    color: #888;
    cursor: help;
    position: relative;
    vertical-align: middle;
}

.cpa-tooltip-icon:hover {
    color: var(--cpa-accent-color);
}

.cpa-tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.4;
    white-space: pre-wrap;
    min-width: 150px;
    max-width: 250px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10000;
    pointer-events: none;
}

.cpa-tooltip-icon::before {
    content: '';
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    border-width: 6px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10000;
    pointer-events: none;
}

.cpa-tooltip-icon:hover::after,
.cpa-tooltip-icon:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Text Inputs */
.cpa-field-text input,
.cpa-field-textarea textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cpa-field-text input:focus,
.cpa-field-textarea textarea:focus {
    border-color: var(--cpa-accent-color);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
    /* Outline simulation */
    outline: none;
}

/* Modal styles */
.cpa-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    /* Black w/ opacity */
    backdrop-filter: blur(2px);
}

.cpa-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;
    /* Increased from 600px */
    position: relative;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cpa-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 10px;
    line-height: 1;
    z-index: 1;
}

.cpa-close:hover,
.cpa-close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* ... keep existing modal CSS ... */

/* Column Grid Definitions */
.cpa-layout-2-col {
    grid-template-columns: repeat(2, 1fr);
}

.cpa-layout-3-col {
    grid-template-columns: repeat(3, 1fr);
}

.cpa-layout-4-col {
    grid-template-columns: repeat(4, 1fr);
}

.cpa-layout-5-col {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 600px) {
    .cpa-grid-layout {
        grid-template-columns: 1fr !important;
    }

    .cpa-grid-layout {
        grid-template-columns: 1fr !important;
    }
}

/* Checkout Improvements (Grid Layout) */
.woocommerce-checkout .product-name dl.variation {
    margin-left: 10px !important;
    padding-left: 0 !important;
    border-left: none !important;
    margin-top: 8px !important;
    display: grid !important;
    grid-template-columns: auto 1fr !important;
    gap: 3px 10px !important;
    align-items: baseline !important;
}

.woocommerce-checkout .product-name dl.variation dt {
    float: none !important;
    clear: none !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

.woocommerce-checkout .product-name dl.variation dd {
    float: none !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

/* Edit Button in Cart */
button.cpa-edit-cart-item {
    margin-top: 5px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    font-weight: normal;
}

button.cpa-edit-cart-item:hover {
    background-color: #e5e5e5;
    color: #000;
}

/* Cart: Remove unwanted separators */
.woocommerce-cart dl.variation dt::before {
    content: none !important;
    display: none !important;
}

.woocommerce-cart dl.variation dd {
    border-left: none !important;
    padding-left: 0 !important;
}

/* Checkout Column Widths */
.woocommerce-checkout table.shop_table {
    width: 100% !important;
    table-layout: fixed !important;
}

.woocommerce-checkout table.shop_table th.product-total,
.woocommerce-checkout table.shop_table td.product-total {
    width: 110px !important;
    white-space: nowrap !important;
    text-align: right !important;
}

.woocommerce-checkout table.shop_table th.product-name,
.woocommerce-checkout table.shop_table td.product-name {
    width: auto !important;
}

/* Global Layout Adjustment */
@media (min-width: 1000px) {
    .woocommerce-checkout #customer_details {
        width: 40% !important;
        float: left !important;
        margin-right: 0 !important;
    }

    .woocommerce-checkout #order_review_heading,
    .woocommerce-checkout #order_review {
        width: 58% !important;
        float: right !important;
        clear: right !important;
    }
}

/* Shipping Layout Fix */
/* Shipping Layout Fix */
body .woocommerce-checkout table.shop_table tr.shipping {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    width: 100% !important;
}

body .woocommerce-checkout table.shop_table tr.shipping th {
    display: block !important;
    width: 35% !important;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

body .woocommerce-checkout table.shop_table tr.shipping td {
    display: block !important;
    width: 65% !important;
    text-align: left !important;
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}