/**
 * Frontend Calculator Styles
 *
 * @package CPPC
 */

.cppc-calculator-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.cppc-product-image{
    max-width: 50% !important;
}

.cppc-dimensions-input input {
    padding-left: 15px !important;
}

.cppc-calculator-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.cppc-calculator-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.cppc-calculator-description {
    margin: 0;
    color: #666;
    font-size: 15px;
    line-height: 1.6;
}

/* Fields */
.cppc-fields-container {
    margin-bottom: 30px;
}

.cppc-field-wrapper {
    margin-bottom: 25px;
}

.cppc-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.cppc-required {
    color: #d63638;
    font-weight: bold;
}

.cppc-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.cppc-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.cppc-input.cppc-error {
    border-color: #d63638;
}

.cppc-input.cppc-error:focus {
    box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1);
}

/* Select */
.cppc-select-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
}

/* Radio & Checkbox */
.cppc-radio-group,
.cppc-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cppc-radio-label,
.cppc-checkbox-label {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.cppc-radio-label:hover,
.cppc-checkbox-label:hover {
    background: #f9f9f9;
    border-color: #2271b1;
}

.cppc-radio-label input,
.cppc-checkbox-label input {
    margin-right: 10px;
}

.cppc-option-price {
    margin-left: auto;
    color: #2271b1;
    font-weight: 600;
}

/* Dimensions */
.cppc-dimensions-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cppc-dimension-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cppc-dimension-input {
    flex: 1;
}

.cppc-dimension-separator {
    font-size: 20px;
    font-weight: bold;
    color: #666;
}

.cppc-dimension-label {
    font-size: 14px;
    color: #666;
}

/* Price Summary */
.cppc-price-summary {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.cppc-price-breakdown {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.cppc-breakdown-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cppc-breakdown-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.cppc-breakdown-label {
    font-weight: 600;
    color: #333;
}

.cppc-breakdown-value {
    color: #666;
}

.cppc-breakdown-price {
    color: #2271b1;
    font-weight: 600;
    margin-left: auto;
    padding-left: 15px;
}

.cppc-total-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
}

.cppc-total-label {
    font-weight: 700;
    color: #333;
}

.cppc-total-amount {
    font-size: 24px;
    font-weight: 700;
    color: #2271b1;
}

/* Footer */
.cppc-calculator-footer {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Quantity Selector */
.cppc-quantity-wrapper {
    width: 100%;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cppc-quantity-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.cppc-quantity-selector {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.cppc-qty-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.cppc-qty-btn:hover {
    background: #e0e0e0;
}

.cppc-qty-btn:active {
    background: #d0d0d0;
}

.cppc-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cppc-qty-minus {
    border-right: 1px solid #ddd;
}

.cppc-qty-plus {
    border-left: 1px solid #ddd;
}

.cppc-quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: none;
    font-size: 16px;
    font-weight: 600;
    padding: 0;
    -moz-appearance: textfield;
    background: #fff;
}

.cppc-quantity-input::-webkit-outer-spin-button,
.cppc-quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cppc-quantity-input:focus {
    outline: none;
    box-shadow: none;
}

.cppc-add-to-cart-btn {
    flex: 1;
    padding: 15px 30px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.cppc-add-to-cart-btn:hover {
    background: #135e96;
}

.cppc-add-to-cart-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.cppc-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
}

.cppc-loading .spinner {
    float: none;
    margin: 0;
}

.cppc-success-message {
    position: fixed;
    top: 50px;
    right: 50px;
    background: #00a32a;
    color: #fff;
    padding: 15px 25px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 99999;
    animation: slideIn 0.3s ease-out;
}

.cppc-success-message a {
    color: #fff;
    text-decoration: underline;
    margin-left: 10px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cppc-notice {
    padding: 12px 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .cppc-calculator-container {
        padding: 20px;
    }
    .cppc-product-image{
    max-width: 80% !important;
}
    
    .cppc-calculator-title {
        font-size: 24px;
    }
    
    .cppc-dimensions-group {
        flex-direction: column;
    }
    
    .cppc-dimension-separator {
        display: none;
    }
    
    .cppc-total-amount {
        font-size: 20px;
    }
    
    .cppc-breakdown-list li {
        flex-wrap: wrap;
    }
    
    .cppc-breakdown-price {
        flex-basis: 100%;
        margin-left: 0;
        padding-left: 0;
        text-align: right;
    }
}
