/* VSL Calculator Styles */
#vsl-calculator-container {
    max-width: 450px;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header del producto */
.vsl-product-header {
    margin-bottom: 24px;
}

.vsl-product-title {
    color: #2BB5A4;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.vsl-price-display {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
}

.vsl-price-label {
    color: #666;
    font-size: 14px;
}

.vsl-price-amount {
    color: #2BB5A4;
    font-size: 28px;
    font-weight: 700;
}

.vsl-price-unit {
    color: #666;
    font-size: 14px;
}

.vsl-product-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Secciones del calculador */
.vsl-calculator-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.vsl-section-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 14px;
}

/* Selector de colores */
.vsl-color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.vsl-color-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.vsl-color-option:hover {
    background: #f0f0f0;
}

.vsl-color-option.active {
    background: #e3f2fd;
    border: 2px solid #2196F3;
}

.vsl-color-sample {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid #ddd;
}

.vsl-color-blanco { background: #f5f5f5; }
.vsl-color-beige { background: #d4c4a8; }
.vsl-color-cafe { background: #8b6914; }
.vsl-color-gris { background: #6c757d; }
.vsl-color-blackout { background: #1a1a1a; }
.vsl-color-screen { background: #4a4a4a; }

/* Imágenes de variación de color */
.vsl-color-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #ddd;
    margin-bottom: 5px;
}

.vsl-color-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vsl-color-option.active .vsl-color-image {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

.vsl-color-option span {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* Selector de apertura */
.vsl-aperture-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.vsl-aperture-option {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.vsl-aperture-option:hover {
    border-color: #2196F3;
}

.vsl-aperture-option.active {
    border-color: #2196F3;
    background: #e3f2fd;
}

.vsl-aperture-icon {
    width: 40px;
    height: 30px;
}

/* Selector de motor */
.vsl-motor-options {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.vsl-motor-option {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.vsl-motor-option:hover {
    border-color: #2196F3;
}

.vsl-motor-option.active {
    border-color: #2196F3;
    background: #e3f2fd;
}

.vsl-motor-icon {
    width: 40px;
    height: 40px;
}

/* Sección de medidas */
.vsl-measures-section {
    margin-bottom: 20px;
}

.vsl-measures-title {
    background: #2BB5A4;
    color: white;
    padding: 12px 16px;
    margin: 0 0 16px 0;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.vsl-measures-inputs {
    display: flex;
    gap: 16px;
}

.vsl-measure-input {
    flex: 1;
    position: relative;
}

.vsl-measure-input label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.vsl-measure-input input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
}

.vsl-unit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
    pointer-events: none;
    margin-top: 12px;
}

/* Tabla de precios */
.vsl-price-breakdown {
    margin-bottom: 20px;
}

.vsl-price-table {
    width: 100%;
    border-collapse: collapse;
    background: #e8f5e8;
    border-radius: 6px;
    overflow: hidden;
}

.vsl-price-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #d4e6d4;
}

.vsl-price-table tr:last-child td {
    border-bottom: none;
}

.vsl-price-table td:first-child {
    color: #333;
    font-weight: 500;
}

.vsl-price-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #2BB5A4;
}

.vsl-total-presencial td {
    background: #ff6b6b;
    color: white !important;
}

.vsl-total-online td {
    background: #2BB5A4;
    color: white !important;
}

.vsl-motor-row {
    display: none;
}

.vsl-motor-row.show {
    display: table-row;
}

.vsl-senefa-row {
    display: none;
}

.vsl-senefa-row.show {
    display: table-row;
}

.vsl-peso-row {
    display: none;
}

.vsl-peso-row.show {
    display: table-row;
}

.vsl-tax-note {
    font-size: 12px;
    color: #666;
    margin: 8px 0 0 0;
    text-align: center;
}

/* Opciones de pago */
.vsl-payment-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.vsl-payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
}

.vsl-payment-option img {
    height: 20px;
    width: auto;
}

/* Video tutorial */
.vsl-video-section {
    margin-bottom: 20px;
}

.vsl-video-thumbnail {
    background: linear-gradient(135deg, #2BB5A4, #1a8a7a);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    position: relative;
}

.vsl-play-button {
    font-size: 24px;
    margin-bottom: 8px;
}

.vsl-video-label {
    background: #ffc107;
    color: #333;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 8px;
}

.vsl-video-thumbnail p {
    margin: 0;
    font-size: 14px;
}

/* Sección de instalación */
.vsl-installation-section {
    margin-bottom: 20px;
}

.vsl-installation-title {
    background: #2BB5A4;
    color: white;
    padding: 12px 16px;
    margin: 0 0 16px 0;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.vsl-installation-options {
    background: white;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.vsl-radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
}

.vsl-radio-option:last-child {
    margin-bottom: 0;
}

.vsl-radio-option input[type="radio"] {
    display: none;
}

.vsl-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    background: white;
}

.vsl-radio-option input[type="radio"]:checked + .vsl-radio-custom {
    border-color: #2196F3;
}

.vsl-radio-option input[type="radio"]:checked + .vsl-radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #2196F3;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Sección senefa */
.vsl-senefa-section {
    margin-bottom: 20px;
}

.vsl-senefa-options {
    background: #f8f9fa;
    padding: 16px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 12px;
}

.vsl-senefa-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.vsl-senefa-option:hover {
    background-color: rgba(33, 150, 243, 0.05);
}

.vsl-senefa-option:last-child {
    margin-bottom: 0;
}

.vsl-senefa-option input[type="radio"] {
    display: none;
}

.vsl-senefa-option .vsl-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    background: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.vsl-senefa-option input[type="radio"]:checked + .vsl-radio-custom {
    border-color: #2196F3;
    background-color: white;
}

.vsl-senefa-option input[type="radio"]:checked + .vsl-radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #2196F3;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.vsl-senefa-description {
    font-size: 13px;
    color: #666;
    margin: 0;
    padding: 8px 12px;
    background: #f0f8ff;
    border-left: 3px solid #2196F3;
    border-radius: 4px;
}

.vsl-senefa-text {
    font-weight: 500;
    color: #333;
}

/* Sección peso */
.vsl-peso-section {
    margin-bottom: 20px;
}

.vsl-peso-options {
    background: #f8f9fa;
    padding: 16px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 12px;
}

.vsl-peso-option {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.vsl-peso-option:hover {
    background-color: rgba(33, 150, 243, 0.05);
}

.vsl-peso-option:last-child {
    margin-bottom: 0;
}

.vsl-peso-option input[type="radio"] {
    display: none;
}

.vsl-peso-option .vsl-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    background: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.vsl-peso-option input[type="radio"]:checked + .vsl-radio-custom {
    border-color: #2196F3;
    background-color: white;
}

.vsl-peso-option input[type="radio"]:checked + .vsl-radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #2196F3;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.vsl-peso-description {
    font-size: 13px;
    color: #666;
    margin: 0;
    padding: 8px 12px;
    background: #f0f8ff;
    border-left: 3px solid #2196F3;
    border-radius: 4px;
}

.vsl-peso-text {
    font-weight: 500;
    color: #333;
}

/* Sección posición de cadena */
.vsl-chain-position-section {
    margin-bottom: 20px;
}

.vsl-chain-position-options {
    background: #f8f9fa;
    padding: 16px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    display: flex;
    gap: 16px;
}

.vsl-chain-position-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex: 1;
    background: white;
    border: 2px solid transparent;
    justify-content: center;
}

.vsl-chain-position-option:hover {
    background-color: rgba(33, 150, 243, 0.05);
    border-color: rgba(33, 150, 243, 0.2);
}

.vsl-chain-position-option input[type="radio"]:checked + .vsl-radio-custom + .vsl-chain-position-text {
    color: #2196F3;
    font-weight: 600;
}

.vsl-chain-position-option input[type="radio"] {
    display: none;
}

.vsl-chain-position-option .vsl-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    background: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.vsl-chain-position-option input[type="radio"]:checked + .vsl-radio-custom {
    border-color: #2196F3;
    background-color: white;
}

.vsl-chain-position-option input[type="radio"]:checked + .vsl-radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #2196F3;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.vsl-chain-position-text {
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
}

/* Sección caída de cortina */
.vsl-fall-direction-section {
    margin-bottom: 20px;
}

.vsl-fall-direction-options {
    background: #f8f9fa;
    padding: 16px;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    display: flex;
    gap: 16px;
}

.vsl-fall-direction-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
    flex: 1;
    background: white;
    border: 2px solid transparent;
    justify-content: center;
}

.vsl-fall-direction-option:hover {
    background-color: rgba(33, 150, 243, 0.05);
    border-color: rgba(33, 150, 243, 0.2);
}

.vsl-fall-direction-option input[type="radio"]:checked + .vsl-radio-custom + .vsl-fall-direction-text {
    color: #2196F3;
    font-weight: 600;
}

.vsl-fall-direction-option input[type="radio"] {
    display: none;
}

.vsl-fall-direction-option .vsl-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    position: relative;
    background: white;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.vsl-fall-direction-option input[type="radio"]:checked + .vsl-radio-custom {
    border-color: #2196F3;
    background-color: white;
}

.vsl-fall-direction-option input[type="radio"]:checked + .vsl-radio-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #2196F3;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.vsl-fall-direction-text {
    font-weight: 500;
    color: #333;
    transition: all 0.2s ease;
}

/* Sección añadir al carrito */
.vsl-add-to-cart-section {
    display: flex;
    gap: 12px;
    align-items: center;
}

.vsl-quantity-input {
    flex: 0 0 80px;
}

.vsl-quantity-input input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
}

.vsl-add-to-cart-btn {
    flex: 1;
    background: #6f42c1;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.vsl-add-to-cart-btn:hover {
    background: #5a32a3;
}

.vsl-add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Estados de carga */
.vsl-loading {
    opacity: 0.6;
    pointer-events: none;
}

.vsl-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: vsl-spin 1s linear infinite;
}

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

/* Alertas */
.vsl-alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin: 12px 0;
    font-size: 14px;
}

.vsl-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.vsl-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.vsl-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Responsive */
@media (max-width: 768px) {
    #vsl-calculator-container {
        max-width: 100%;
    }
    
    .vsl-color-options {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vsl-aperture-options,
    .vsl-motor-options {
        flex-direction: column;
    }
    
    .vsl-measures-inputs {
        flex-direction: column;
    }
    
    .vsl-price-table {
        font-size: 14px;
    }
    
    .vsl-add-to-cart-section {
        flex-direction: column;
    }
    
    .vsl-quantity-input {
        flex: none;
        width: 100%;
    }
    
    /* Responsivo para nuevas secciones */
    .vsl-chain-position-options,
    .vsl-fall-direction-options {
        flex-direction: column;
        gap: 12px;
    }
    
    .vsl-chain-position-option,
    .vsl-fall-direction-option {
        justify-content: flex-start;
    }
    
    .vsl-senefa-options,
    .vsl-peso-options {
        padding: 12px;
    }
    
    .vsl-senefa-option,
    .vsl-peso-option {
        padding: 6px;
    }
}

/* Estilos para generación de PDF */
.vsl-pdf-button-container {
    margin: 20px 0;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.vsl-pdf-button-container h3 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

#vsl-generate-pdf-btn {
    background: linear-gradient(135deg, #2c5aa0 0%, #1a3f73 100%);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.3);
    position: relative;
    overflow: hidden;
}

#vsl-generate-pdf-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

#vsl-generate-pdf-btn:hover:before {
    left: 100%;
}

#vsl-generate-pdf-btn:hover {
    background: linear-gradient(135deg, #1a3f73 0%, #0f2a4f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 90, 160, 0.4);
}

#vsl-generate-pdf-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(44, 90, 160, 0.3);
}

#vsl-generate-pdf-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.pdf-icon {
    font-size: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

.loading-spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
    font-size: 16px;
}

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

.vsl-pdf-help-text {
    font-size: 13px;
    color: #6c757d;
    margin-top: 12px;
    font-style: italic;
    line-height: 1.4;
}

.vsl-pdf-features {
    margin-top: 15px;
    text-align: left;
    display: inline-block;
}

.vsl-pdf-features ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12px;
    color: #6c757d;
}

.vsl-pdf-features li {
    margin: 5px 0;
    padding-left: 20px;
    position: relative;
}

.vsl-pdf-features li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

/* Responsivo para PDF button */
@media (max-width: 768px) {
    .vsl-pdf-button-container {
        margin: 15px 0;
        padding: 15px;
    }
    
    #vsl-generate-pdf-btn {
        font-size: 14px;
        padding: 12px 24px;
    }
    
    .vsl-pdf-features {
        text-align: center;
    }
}
