/**
 * Dynamic Product Selector Styles
 * Modern, responsive styling for the product selector
 */

.dps-product-selector {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.dps-product-selector h3 {
    margin: 0 0 2rem 0;
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid #3498db;
    padding-bottom: 1rem;
}

.dps-selector-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dps-select-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dps-select-group label {
    font-weight: 600;
    color: #34495e;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.dps-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    background: #ffffff;
    color: #2c3e50;
    transition: all 0.3s ease;
    cursor: pointer;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.dps-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.dps-select:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.dps-select:not(:disabled):hover {
    border-color: #bdc3c7;
}

.dps-product-display {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.dps-product-display h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
}

#dps-product-info {
    margin-bottom: 1.5rem;
}

#dps-product-info p {
    margin: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

#dps-product-info p:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 1.1rem;
    color: #27ae60;
}

#dps-product-info strong {
    color: #34495e;
    min-width: 80px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure product name spans wrap properly */
#dps-product-info span {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    display: inline-block;
}

.dps-add-to-cart-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dps-add-to-cart-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.dps-add-to-cart-btn:active:not(:disabled) {
    transform: translateY(0);
}

.dps-add-to-cart-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading states */
.dps-select option[value=""] {
    color: #6c757d;
    font-style: italic;
}

/* Ensure proper text wrapping for select options */
.dps-select option {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    padding: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .dps-product-selector {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .dps-product-selector h3 {
        font-size: 1.5rem;
    }
    
    .dps-select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    #dps-product-info p {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    #dps-product-info strong {
        min-width: auto;
    }
    
    .dps-selector-container {
        gap: 1.2rem; /* Slightly reduce gap for mobile */
    }
}

@media (max-width: 480px) {
    .dps-product-selector {
        padding: 1rem;
    }
    
    .dps-selector-container {
        gap: 1rem;
    }
    
    .dps-product-display {
        padding: 1rem;
    }
}

/* Animation for product display */
.dps-product-display {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus styles for accessibility */
.dps-select:focus,
.dps-add-to-cart-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .dps-product-selector {
        border: 2px solid #000000;
    }
    
    .dps-select {
        border: 2px solid #000000;
    }
    
    .dps-add-to-cart-btn {
        border: 2px solid #000000;
    }
}
