/**
 * Product Configurator - Frontend Styles
 */

/* Wrapper */
.pc-configurator-wrapper {
    margin: 30px 0;
    padding: 25px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* Header */
.pc-configurator-header {
    margin-bottom: 25px;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 15px;
}

.pc-configurator-title {
    margin: 0 0 8px 0;
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

.pc-configurator-description {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Selected Colors Container */
.pc-selected-colors {
    margin-bottom: 20px;
}

.pc-color-selection {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 15px;
    position: relative;
}

.pc-color-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.pc-color-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pc-color-swatch-display {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    border: 2px solid #ddd;
    overflow: hidden;
}

.pc-color-swatch-display img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pc-color-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.pc-remove-color-btn {
    background: #dc3232;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s;
}

.pc-remove-color-btn:hover {
    background: #a00;
}

/* Black Color Banner */
.pc-black-color-banner {
    background: rgba(255, 0, 0, 0.1);
    color: #dc3232;
    border: 1px solid #dc3232;
    border-radius: 10px;
    padding: 12px 15px;
    margin: 15px 0;
    font-style: italic;
    font-size: 14px;
    line-height: 1.5;
}

/* Sizes Grid */
.pc-sizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.pc-size-option {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px;
}

.pc-size-option.pc-size-selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.pc-size-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.pc-size-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pc-size-name {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.pc-size-modifier {
    font-size: 12px;
    color: #666;
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
}

.pc-size-modifier.pc-modifier-free {
    color: #46b450;
}

.pc-quantity-input-wrapper {
    margin-top: 8px;
    display: none;
}

.pc-size-selected .pc-quantity-input-wrapper {
    display: block;
}

.pc-quantity-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.pc-quantity-input:focus {
    outline: none;
    border-color: #2271b1;
}

/* Quantity Input Error State */
.pc-quantity-input.pc-quantity-error {
    border-color: #d93025;
    background-color: #fef7f7;
}

.pc-quantity-input.pc-quantity-error:focus {
    border-color: #d93025;
    box-shadow: 0 0 0 2px rgba(217, 48, 37, 0.1);
}

.pc-quantity-error-msg {
    color: #d93025;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}

/* Add Color Button */
.pc-add-color-section {
    margin: 20px 0;
    text-align: center;
}

.pc-add-color-btn {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pc-add-color-btn:hover {
    background: #135e96;
}

.pc-plus-icon {
    font-size: 20px;
    font-weight: bold;
}

/* Color Picker Modal */
.pc-color-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pc-color-picker-content {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
}

.pc-color-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.pc-color-picker-header h4 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.pc-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 1;
}

.pc-modal-close:hover {
    color: #333;
}

.pc-color-picker-body {
    padding: 20px;
}

.pc-available-colors {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.pc-color-option {
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.2s;
}

.pc-color-option:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

.pc-color-option.pc-color-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pc-color-option.pc-color-disabled:hover {
    border-color: transparent;
    background: transparent;
}

.pc-color-swatch {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    border: 2px solid #ddd;
    margin: 0 auto 8px;
    overflow: hidden;
}

.pc-color-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pc-color-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    color: #666;
    font-size: 32px;
    font-weight: bold;
}

.pc-color-name {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Summary Section */
.pc-summary {
    background: #fff;
    border: 2px solid #2271b1;
    border-radius: 6px;
    padding: 20px;
    margin-top: 25px;
}

.pc-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.pc-summary-label {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.pc-summary-value {
    font-weight: 700;
    color: #2271b1;
    font-size: 18px;
}

.pc-estimated-price {
    border-top: 1px solid #ddd;
    margin-top: 8px;
    padding-top: 12px;
}

/* Validation Message */
.pc-validation-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 12px;
    margin-top: 15px;
}

.pc-validation-message.pc-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* Empty State */
.pc-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.pc-empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.pc-empty-state-text {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .pc-configurator-wrapper {
        padding: 15px;
    }

    .pc-sizes-grid {
        grid-template-columns: 1fr;
    }

    .pc-available-colors {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .pc-color-swatch {
        width: 60px;
        height: 60px;
    }
}

/* Loading State */
.pc-configurator-loading {
    opacity: 0.6;
    pointer-events: none;
}

.pc-loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2271b1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: pc-spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes pc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
