/* Smartflipp Reforma Wizard */
:root {
    --srw-primary: #4D58F0;
    --srw-secondary: #64748b;
    --srw-success: #10b981;
    --srw-danger: #ef4444;
}

.srw-wizard {
    max-width: 1400px;
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Cart Bar - Barra Superior SIN PRECIOS */
.srw-cart-bar {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: sticky;
    top: 20px;
    z-index: 100;
}

.srw-cart-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
}

.srw-cart-items-count {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #1e293b;
    font-size: 18px;
}

.cart-icon {
    font-size: 24px;
}

#cart-count {
    color: var(--srw-primary);
    font-size: 20px;
}

.srw-btn-cart {
    background: var(--srw-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.srw-btn-cart:hover {
    background: #3d48d0;
}

.toggle-icon {
    margin-left: 5px;
}

/* Cart Details */
.srw-cart-details {
    border-top: 1px solid #e2e8f0;
    padding: 20px 25px;
    max-height: 400px;
    overflow-y: auto;
}

.srw-cart-items .empty-cart {
    text-align: center;
    color: #64748b;
    padding: 20px;
}

/* Cart Items - Sin precios */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 12px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.cart-item:hover {
    background: #f8fafc;
}

.cart-item-info {
    flex: 1;
}

.cart-item-actions {
    display: flex;
    align-items: center;
}

.cart-item-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.cart-item-badge.badge-material {
    background: #dbeafe;
    color: #1e40af;
}

.cart-item-badge.badge-labor {
    background: #fef3c7;
    color: #92400e;
}

.cart-item h5 {
    margin: 5px 0;
    font-size: 14px;
    color: #334155;
}

.cart-item-qty {
    font-size: 12px;
    color: #64748b;
}

.cart-item-total {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-item-total > span {
    font-weight: 700;
    color: #1e293b;
}

.cart-item-remove {
    background: var(--srw-danger);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
}

.cart-item-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Cart Totals */
.cart-totals {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #e2e8f0;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.cart-total-row.subtotal {
    font-size: 16px;
    font-weight: 600;
    border-top: 1px solid #e2e8f0;
    padding-top: 12px;
    margin-top: 8px;
}

.cart-total-row.total {
    font-size: 20px;
    font-weight: 700;
    color: var(--srw-primary);
    border-top: 2px solid var(--srw-primary);
    padding-top: 12px;
    margin-top: 8px;
}

/* Progress */
.srw-progress-wrapper {
    margin-bottom: 30px;
}

.srw-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.srw-progress-fill {
    height: 100%;
    background: var(--srw-primary);
    transition: width 0.3s ease;
}

.srw-progress-text {
    text-align: center;
    margin-top: 10px;
    color: var(--srw-secondary);
    font-size: 14px;
}

/* Container */
.srw-wizard-container {
    display: flex;
    gap: 30px;
}

/* Sidebar */
.srw-wizard-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.srw-categories-nav {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 20px;
}

.srw-categories-nav h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #1e293b;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.srw-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.srw-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.srw-nav-item:hover {
    background: #f1f5f9;
    color: #334155;
}

.srw-nav-item.active {
    background: var(--srw-primary);
    color: white;
    font-weight: 600;
}

.srw-nav-item.completed {
    color: var(--srw-success);
}

.srw-nav-item.completed .srw-nav-icon::after {
    content: ' ✓';
}

.srw-nav-icon {
    font-size: 20px;
    margin-right: 12px;
    min-width: 24px;
}

.srw-nav-text {
    font-size: 14px;
}

/* Content */
.srw-wizard-content {
    flex: 1;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    min-height: 500px;
}

/* Step Header */
.srw-step-header {
    text-align: center;
    margin-bottom: 40px;
}

.srw-step-icon-large {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
}

.srw-step-header h2 {
    font-size: 28px;
    margin: 0 0 10px 0;
    color: #1e293b;
}

.srw-step-header p {
    color: var(--srw-secondary);
    font-size: 16px;
    margin: 0;
}

/* Forms */
.srw-form-section {
    max-width: 600px;
    margin: 0 auto;
}

.srw-form-group {
    margin-bottom: 20px;
}

.srw-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #334155;
}

.srw-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: inherit;
}

.srw-input:focus {
    outline: none;
    border-color: var(--srw-primary);
    box-shadow: 0 0 0 3px rgba(77, 88, 240, 0.1);
}

/* Buttons */
.srw-wizard-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}

.srw-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.srw-btn-primary {
    background: var(--srw-primary);
    color: white;
}

.srw-btn-primary:hover {
    background: #3d48d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(77, 88, 240, 0.3);
}

.srw-btn-secondary {
    background: #f1f5f9;
    color: #334155;
}

.srw-btn-secondary:hover {
    background: #e2e8f0;
}

.srw-btn-success {
    background: var(--srw-success);
    color: white;
}

.srw-btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Products */
.srw-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.srw-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
}

.srw-no-products p:first-child {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #64748b;
}

.srw-product-card {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
    background: white;
    display: flex;
    flex-direction: column;
}

.srw-product-card:hover {
    border-color: var(--srw-primary);
    box-shadow: 0 4px 12px rgba(77, 88, 240, 0.1);
    transform: translateY(-2px);
}

.srw-product-card.in-cart {
    border-color: var(--srw-success);
    background: #f0fdf4;
}

.srw-product-header {
    margin-bottom: 10px;
}

.srw-product-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-material {
    background: #dbeafe;
    color: #1e40af;
}

.badge-labor {
    background: #fef3c7;
    color: #92400e;
}

.badge-other {
    background: #f3e8ff;
    color: #6b21a8;
}

.srw-product-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #1e293b;
    min-height: 40px;
    line-height: 1.4;
}

.srw-product-description {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 15px 0;
    line-height: 1.5;
}

.srw-product-spacer {
    flex-grow: 1;
    min-height: 20px;
}

/* Información de añadido */
.srw-quantity-display {
    padding: 10px;
    background: #f0fdf4;
    border-radius: 6px;
    text-align: center;
    color: var(--srw-success);
    font-weight: 600;
    margin-bottom: 10px;
}

/* Botón Añadir */
.srw-btn-add {
    width: 100%;
    padding: 12px;
    background: var(--srw-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.srw-btn-add:hover {
    background: #3d48d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(77, 88, 240, 0.3);
}

/* Control de Cantidad */
.srw-product-in-cart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.srw-quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: var(--srw-primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.qty-btn:hover {
    background: #3d48d0;
}

.qty-input {
    width: 80px;
    text-align: center;
    padding: 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
}

.qty-input:focus {
    outline: none;
    border-color: var(--srw-primary);
}

.srw-btn-remove {
    padding: 10px;
    background: var(--srw-danger);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.srw-btn-remove:hover {
    background: #dc2626;
}

/* Loading */
.srw-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
}

.srw-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--srw-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.srw-loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 18px;
}

/* Responsive */
@media (max-width: 992px) {
    .srw-wizard-container {
        flex-direction: column;
    }
    
    .srw-wizard-sidebar {
        width: 100%;
    }
    
    .srw-categories-nav {
        position: static;
    }
    
    .srw-nav-list {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .srw-nav-item {
        flex: 0 0 auto;
        margin-bottom: 0;
    }
    
    .srw-nav-text {
        display: none;
    }
    
    .srw-nav-icon {
        margin-right: 0;
    }
    
    .srw-cart-summary {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .srw-wizard-content {
        padding: 20px;
    }
    
    .srw-products-grid {
        grid-template-columns: 1fr;
    }
    
    .srw-step-header h2 {
        font-size: 24px;
    }
    
    .srw-step-icon-large {
        font-size: 48px;
    }
    
    .srw-cart-bar {
        position: relative;
        top: 0;
    }
}

/* Modal WAPF */
.srw-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.srw-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.srw-modal-content {
    position: relative;
    max-width: 600px;
    margin: 50px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.srw-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
}

.srw-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #1e293b;
}

.srw-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.srw-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.srw-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-instructions {
    margin: 0 0 20px 0;
    color: #64748b;
    font-size: 14px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #334155;
}

.modal-wapf-field {
    width: 100%;
}

.srw-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.srw-modal-footer .srw-btn {
    padding: 12px 24px;
}

/* Página de Resumen */
.srw-resumen-step {
    max-width: 900px;
    margin: 0 auto;
}

.srw-resumen-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.srw-resumen-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.srw-resumen-section h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #1e293b;
    padding-bottom: 15px;
    border-bottom: 2px solid #e2e8f0;
}

/* Productos del Resumen */
.resumen-productos-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.resumen-categoria {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--srw-primary);
}

.resumen-categoria-title {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.resumen-productos-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.resumen-producto-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.resumen-producto-item:last-child {
    border-bottom: none;
}

.producto-titulo {
    font-weight: 500;
    color: #1e293b;
    flex: 1;
}

.producto-cantidad {
    color: #64748b;
    font-size: 14px;
    margin-left: 15px;
}

/* Formulario de Presupuesto */
.srw-presupuesto-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.srw-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.srw-form-actions {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.srw-btn-large {
    padding: 16px 40px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    font-size: 24px;
}

.btn-spinner {
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* Información del Proyecto */
.srw-info-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.srw-info-section h3 {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.resumen-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.info-item strong {
    display: block;
    margin-bottom: 5px;
    opacity: 0.9;
}

/* Mensaje de Éxito */
.srw-success-message {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.success-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.srw-success-message h2 {
    color: var(--srw-success);
    font-size: 32px;
    margin: 0 0 20px 0;
}

.srw-success-message p {
    font-size: 18px;
    color: #64748b;
    line-height: 1.6;
    margin: 10px 0;
}

.srw-success-message p strong {
    color: var(--srw-primary);
}

/* Responsive Resumen */
@media (max-width: 768px) {
    .srw-form-row {
        grid-template-columns: 1fr;
    }
    
    .resumen-producto-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .resumen-info-grid {
        grid-template-columns: 1fr;
    }
    
    .srw-btn-large {
        width: 100%;
        justify-content: center;
    }
}
