/* ===========================================
   WooCommerce Product Configurator - Frontend Styles
   =========================================== */

/* Configurator Container */
.wpc-configurator {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Sections */
.wpc-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.wpc-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.wpc-section-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #333;
}

.wpc-section-description {
    font-size: 15px;
    color: #666;
    margin: 0 0 20px 0;
}

/* Select Wrapper */
.wpc-select-wrapper {
    position: relative;
    margin-bottom: 15px;
}

.wpc-select {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    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;
    padding-right: 45px;
}

.wpc-select:hover {
    border-color: #999;
}

.wpc-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* System Details */
.wpc-system-details {
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.wpc-system-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpc-system-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #0073aa;
}

.wpc-system-image-wrapper {
    display: block;
    margin: 15px 0;
}

.wpc-system-image-link {
    display: block;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.wpc-system-image-link::after {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.wpc-system-image-link:hover::after {
    opacity: 1;
}

.wpc-system-image {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.wpc-system-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(0.9);
}

/* Simple Lightbox */
.wpc-lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    cursor: pointer;
    animation: wpc-fade-in 0.3s ease;
}

.wpc-lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpc-lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.wpc-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.wpc-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wpc-lightbox-close:hover {
    transform: scale(1.1);
}

@keyframes wpc-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wpc-system-description {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.wpc-system-price {
    font-size: 18px;
    font-weight: 700;
    color: #00a32a;
}

/* Features List */
.wpc-features-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wpc-feature-selector {
    position: relative;
}

/* Feature Preview */
.wpc-feature-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff;
    border: 2px solid #0073aa;
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.wpc-feature-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpc-feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wpc-feature-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wpc-feature-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.wpc-feature-price {
    font-size: 16px;
    font-weight: 700;
    color: #00a32a;
}

.wpc-remove-feature {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: #d63638;
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.wpc-remove-feature:hover {
    background: #b32d2e;
    transform: scale(1.1);
}

.wpc-remove-feature .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Add More */
.wpc-add-more {
    text-align: center;
    padding: 15px;
    background: #fff9e6;
    border: 2px dashed #dba617;
    border-radius: 8px;
    margin-top: 10px;
}

.wpc-add-more p {
    margin: 0;
    font-size: 15px;
    color: #946200;
    font-weight: 600;
}

/* Add Feature Button */
.wpc-add-feature-btn {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #0073aa;
    background: #fff;
    border: 2px dashed #0073aa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.wpc-add-feature-btn:hover {
    background: #f0f9ff;
    border-color: #005a87;
    color: #005a87;
}

.wpc-add-feature-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Price Summary */
.wpc-price-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    color: #fff;
}

.wpc-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.wpc-price-row:last-child {
    border-bottom: none;
}

.wpc-price-label {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

.wpc-price-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.wpc-price-value * {
    color: #fff !important;
}

.wpc-total-price-row {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
}

.wpc-total-price-row .wpc-price-label {
    font-size: 20px;
}

.wpc-total-price-row .wpc-price-value {
    font-size: 26px;
}

/* Animations */
@keyframes wpc-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpc-system-details,
.wpc-feature-preview,
.wpc-add-more {
    animation: wpc-slide-in 0.3s ease;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .wpc-configurator {
        padding: 20px;
        margin: 20px 0;
    }
    
    .wpc-section-title {
        font-size: 20px;
    }
    
    .wpc-section-description {
        font-size: 14px;
    }
    
    .wpc-select {
        font-size: 15px;
        padding: 12px 15px;
    }
    
    .wpc-system-image {
        max-height: 200px;
    }
    
    .wpc-feature-preview {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
        padding-top: 45px;
    }
    
    .wpc-feature-image {
        width: 100%;
        height: 150px;
    }
    
    .wpc-feature-info {
        width: 100%;
    }
    
    .wpc-feature-name {
        font-size: 16px;
    }
    
    .wpc-feature-price {
        font-size: 15px;
    }
    
    .wpc-price-summary {
        padding: 20px;
    }
    
    .wpc-price-label {
        font-size: 14px;
    }
    
    .wpc-price-value {
        font-size: 16px;
    }
    
    .wpc-total-price-row .wpc-price-label {
        font-size: 18px;
    }
    
    .wpc-total-price-row .wpc-price-value {
        font-size: 22px;
    }
}

@media screen and (max-width: 480px) {
    .wpc-configurator {
        padding: 15px;
        margin: 15px -15px;
        border-radius: 0;
    }
    
    .wpc-section {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    
    .wpc-section-title {
        font-size: 18px;
    }
    
    .wpc-select {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .wpc-system-name {
        font-size: 18px;
    }
    
    .wpc-price-summary {
        padding: 15px;
        margin-top: 20px;
    }
}

/* Loading State */
.wpc-configurator.loading {
    opacity: 0.6;
    pointer-events: none;
}

.wpc-configurator.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: wpc-spin 0.8s linear infinite;
}

@keyframes wpc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Touch Device Enhancements */
@media (hover: none) and (pointer: coarse) {
    .wpc-select,
    .wpc-add-feature-btn,
    .wpc-remove-feature {
        min-height: 44px;
    }
    
    .wpc-feature-preview {
        padding: 20px;
        padding-top: 50px;
    }
}

/* Print Styles */
@media print {
    .wpc-configurator {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .wpc-remove-feature,
    .wpc-add-feature-btn,
    .wpc-add-more {
        display: none !important;
    }
}

/* Accessibility */
.wpc-select:focus,
.wpc-add-feature-btn:focus,
.wpc-remove-feature:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .wpc-configurator {
        border-width: 3px;
    }
    
    .wpc-select,
    .wpc-feature-preview {
        border-width: 3px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

