/* Variables CSS */
:root {
    --primary-color: #e67e22;
    --secondary-color: #95a5a6;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-color: #bdc3c7;
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Reset y base */
.jarrito-previewer * {
    box-sizing: border-box;
}

.jarrito-previewer {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 100vw;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
    min-height: 100vh;
}

/* Header integrado - más compacto */
.integrated-header {
    background: #ffffff;
    color: var(--dark-color);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 15px;
    text-align: center;
}

.integrated-header h2 {
    margin: 0 0 8px 0;
    font-size: 1.5em;
    color: var(--primary-color);
    font-weight: 700;
}

.integrated-header p {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.9em;
}

/* Layout principal - Fullwidth con tres columnas optimizadas */
.previewer-main-layout {
    display: grid;
    grid-template-columns: 350px 1fr 340px;
    gap: 15px;
    margin-bottom: 20px;
    /* Altura basada en la ventana para ocupar la mayor parte de pantalla */
    height: 80vh;
    min-height: 80vh;
    width: 100%;
}

/* Columna izquierda: Lista de productos optimizada */
.products-sidebar {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 15px;
    max-height: 80vh;
    overflow-y: auto;
}

.products-sidebar h3 {
    margin: 0 0 12px 0;
    color: var(--dark-color);
    font-size: 1em;
    font-weight: 600;
}

.products-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-card.selected {
    border-color: var(--success-color);
    background: #e8f5e8;
}

.product-card-image {
    width: 60px;
    height: 60px;
    aspect-ratio: 1 / 1;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    max-width: 60px;
    max-height: 60px;
    min-width: 60px;
    min-height: 60px;
    object-fit: cover;
    object-position: center;
    border-radius: 4px;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

.product-card-content {
    flex: 1;
    min-width: 0;
}

.product-card-title {
    margin: 0 0 4px 0;
    font-size: 0.9em;
    color: var(--dark-color);
    font-weight: 600;
    line-height: 1.2;
}

.product-card-price {
    margin: 0 0 6px 0;
    font-size: 0.85em;
    color: var(--success-color);
    font-weight: 600;
}

.product-card-techniques {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.technique-tag,
.technique-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.65em;
    font-weight: 500;
    line-height: 1.2;
}

/* Badges de técnicas con colores específicos */
.product-techniques .technique-tag.dtf,
.product-techniques .technique-badge.dtf,
.product-card-techniques .technique-tag.dtf,
.product-card-techniques .technique-badge.dtf {
    background: #ffebee !important;
    color: #c62828 !important;
    border: 1px solid #ffcdd2 !important;
}

.product-techniques .technique-tag.laser,
.product-techniques .technique-badge.laser,
.product-card-techniques .technique-tag.laser,
.product-card-techniques .technique-badge.laser {
    background: #e8f5e8 !important;
    color: #2e7d32 !important;
    border: 1px solid #c8e6c9 !important;
}

/* Área de trabajo - Columna central */
.previewer-workspace {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    /* Permitir scroll interno para que el header sticky funcione */
    overflow: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Controles debajo del canvas */
    .canvas-bottom-controls {
        padding: 0;
        border-top: 1px solid var(--border-color);
        background: white;
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        display: flex;
        width: 100%;
    }
    
    /* Bottom bar fijo para móvil */
    @media (max-width: 768px) {
        .canvas-bottom-controls {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: white;
            border-top: 1px solid var(--border-color);
            box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
            z-index: 1000;
            padding: 0;
            display: flex;
            flex-direction: row;
            gap: 0;
            align-items: stretch;
            justify-content: space-between;
            border-radius: 0;
            height: 80px;
        }
    }

.control-buttons {
    display: flex;
    width: 100%;
    gap: 0;
    align-items: stretch;
}

    .control-buttons .btn {
        flex: 1;
        min-width: 0;
        border-radius: 0;
        border-right: 1px solid rgba(255,255,255,0.2);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 15px 10px;
        gap: 8px;
    }
    
    /* Botones en bottom bar móvil */
    @media (max-width: 768px) {
        .control-buttons {
            display: flex;
            width: 100%;
            height: 100%;
            gap: 0;
            align-items: stretch;
        }
        
        .control-buttons .btn {
            flex: 1;
            margin: 0;
            padding: 15px 10px;
            font-size: 0.75em;
            height: 100%;
            min-width: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            border-radius: 0;
            border-right: 1px solid rgba(255,255,255,0.2);
        }
        
        .control-buttons .btn:last-child {
            border-right: none;
        }
        
        .control-buttons .btn i {
            font-size: 1.2em;
            margin-bottom: 4px;
        }
        
        .control-buttons .btn span {
            font-size: 0.75em;
            font-weight: 600;
            text-align: center;
            line-height: 1.1;
            display: block;
        }
    }

.control-buttons .btn:last-child {
    border-right: none;
    border-radius: 0 0 var(--border-radius) 0;
}

.control-buttons .btn:first-child {
    border-radius: 0 0 0 var(--border-radius);
}

.control-buttons .btn i {
    font-size: 1.6em;
    margin-bottom: 6px;
}

.control-buttons .btn span {
    font-size: 0.9em;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    display: block;
}

/* Botones principales */
.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    background: #d35400;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: var(--secondary-color);
}

.btn-secondary:hover {
    background: #7f8c8d;
}

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

.btn-success:hover {
    background: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Estilos específicos para botones del bottom bar */
.control-buttons .btn-primary {
    background: #e67e22;
}

.control-buttons .btn-primary:hover {
    background: #d35400;
}

.control-buttons .btn-secondary {
    background: #6c757d;
}

.control-buttons .btn-secondary:hover {
    background: #5a6268;
}

.control-buttons .btn-success {
    background: #28a745;
}

.control-buttons .btn-success:hover {
    background: #1e7e34;
}

.btn-block {
    width: 100%;
}

/* Mockup container */
.mockup-container {
    min-height: 400px;
    background: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 1;
    padding: 20px;
}

.mockup-placeholder {
    text-align: center;
    color: var(--secondary-color);
}

.mockup-wrapper {
    position: relative;
    display: inline-block;
}

.mockup-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Imagen del cliente - POSICIÓN CORREGIDA */
.customer-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.customer-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.customer-image {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 50%;
    max-height: 50%;
    object-fit: contain;
    cursor: move;
    user-select: none;
    transition: all 0.1s ease;
    transform: translate(-50%, -50%);
    transform-origin: center center;
}

/* Upload area integrada */
.integrated-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: var(--border-radius);
}

.upload-placeholder-integrated {
    text-align: center;
    color: var(--secondary-color);
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.upload-text {
    font-size: 1.1em;
    margin-bottom: 10px;
    font-weight: 600;
}

.upload-subtext {
    font-size: 0.9em;
    margin-bottom: 20px;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: #d35400;
    transform: translateY(-1px);
}

/* Controles de imagen */
.preview-controls {
    display: none;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
}

.control-group {
    margin-bottom: 15px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9em;
}

.control-group input[type="range"] {
    width: 100%;
    margin-bottom: 5px;
}

.control-value {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Sidebar de controles */
.controls-sidebar {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
}

.control-card {
    background: #f8f9fa;
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
}

.control-card:last-child {
    margin-bottom: 0;
}

.control-card h4 {
    margin: 0 0 15px 0;
    color: var(--dark-color);
    font-size: 1em;
    font-weight: 600;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 9999; /* sobre todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: var(--dark-color);
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--secondary-color);
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--light-color);
    color: var(--dark-color);
}

.modal-body {
    padding: 12px 20px;
    overflow: visible; /* Sin scroll */
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Dos columnas en pantallas anchas para reducir altura */
.modal-body form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Asegurar que el contenido del modal sea visible */
.modal-body .form-section {
    display: block !important;
    visibility: visible !important;
}

@media (min-width: 992px) {
    .modal-body form {
        grid-template-columns: 1fr; /* el nuevo diseño es una sola columna */
        align-items: start;
    }
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #f8f9fa;
}

/* Formularios */
.form-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: var(--dark-color);
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9em;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Grid de contacto */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

@media (min-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Caja de especificación del producto */
.product-spec-box {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 15px 0;
}

.product-spec-title {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 0.95em;
}

.product-spec-content {
    font-size: 0.9em;
    color: var(--secondary-color);
}

.product-spec-content div {
    margin-bottom: 5px;
}

.product-price-row {
    font-weight: 600;
    color: var(--success-color);
}

.product-note {
    color: var(--secondary-color);
    margin-top: 2px;
}

/* Técnicas y acción en una línea */
.techniques-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--border-color);
}
.techniques-area {
    flex: 1;
    min-width: 260px;
}

/* Asegurar que el botón de envío sea visible */
#quote-submit-inline {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: var(--success-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    flex-shrink: 0;
}

#quote-submit-inline:hover {
    background: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
.techniques-label {
    display: block;
    margin-bottom: 6px;
}
.techniques-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.techniques-list label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85em;
    font-weight: 500;
}

.techniques-list label:hover {
    background: #e9ecef;
    border-color: var(--primary-color);
}

.techniques-list input[type="checkbox"] {
    margin: 0;
    width: auto;
}

.techniques-list input[type="checkbox"]:checked + span {
    color: var(--primary-color);
    font-weight: 600;
}

/* WhatsApp button */
.whatsapp-section {
    margin-top: 20px;
    padding: 15px;
    background: #e8f5e8;
    border-radius: var(--border-radius);
    text-align: center;
}

.whatsapp-section p {
    margin: 0 0 10px 0;
    color: var(--dark-color);
}

.whatsapp-section p:last-child {
    margin-bottom: 15px;
}

.btn-whatsapp {
    background: #25d366;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Modal de carga */
.loading-modal {
    display: none;
    position: fixed;
    z-index: 10000; /* por encima del modal */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

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

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

/* Processing Overlay */
.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.processing-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    width: 90%;
}

.processing-spinner {
    margin-bottom: 20px;
}

.processing-spinner i {
    font-size: 2em;
    color: var(--primary-color);
}

.processing-content h4 {
    margin: 0 0 10px 0;
    color: var(--dark-color);
    font-size: 1.2em;
}

.processing-content p {
    margin: 0 0 20px 0;
    color: var(--secondary-color);
    font-size: 0.9em;
}

.processing-progress {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

/* Notificaciones */
.jarrito-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.jarrito-notification.error {
    background: var(--danger-color);
}

.jarrito-notification.warning {
    background: var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.jarrito-notification .close-notification {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

.jarrito-notification .close-notification:hover {
    background: rgba(255,255,255,0.2);
}

/* Responsive optimizado para fullwidth */
@media (max-width: 1400px) {
    .previewer-main-layout {
        grid-template-columns: 320px 1fr 320px;
        gap: 12px;
    }
}

/* Compresión del modal para móviles */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-height: 95vh;
        width: calc(100% - 20px);
    }
    
    .modal-header {
        padding: 10px 15px;
    }
    
    .modal-header h3 {
        font-size: 1.2em;
        margin: 0;
    }
    
    .modal-body {
        padding: 10px 15px;
        max-height: calc(95vh - 100px);
        overflow-y: auto;
    }
    
    /* Contacto en una línea en móviles */
    .contact-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .contact-grid .form-group:first-child {
        grid-column: 1 / -1; /* Nombre ocupa toda la fila */
    }
    
    .contact-grid .form-group:nth-child(2),
    .contact-grid .form-group:nth-child(3) {
        grid-column: auto; /* Correo y teléfono en la misma fila */
    }
    
    /* Reducir espaciado del textarea */
    .form-group {
        margin-bottom: 8px;
    }
    
    .form-group textarea {
        margin-bottom: 5px;
    }
    
    /* Reducir espaciado entre textarea y card del producto */
    .product-spec-box {
        margin-top: 8px;
        padding: 12px;
    }
    
    .product-spec-title {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    .product-spec-content {
        font-size: 0.85em;
    }
    
    .product-spec-content div {
        margin-bottom: 4px;
    }
    
    /* Comprimir sección de técnicas */
    .techniques-actions {
        margin-top: 10px;
        padding: 10px 0;
        gap: 8px;
    }
    
    .techniques-label {
        font-size: 0.9em;
        margin-bottom: 4px;
    }
    
    .techniques-list {
        gap: 6px;
    }
    
    .techniques-list label {
        padding: 6px 10px;
        font-size: 0.85em;
    }
    
    /* Botón de envío más compacto */
    #quote-submit-inline {
        padding: 10px 20px;
        font-size: 0.9em;
        min-width: 150px;
    }
    
    /* Reducir padding general del formulario */
    .form-section {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .form-section h4 {
        font-size: 1em;
        margin-bottom: 8px;
    }
    
    .form-section h4 i {
        font-size: 0.9em;
    }
}

@media (max-width: 1200px) {
    .previewer-main-layout {
        grid-template-columns: 300px 1fr 300px;
        gap: 10px;
        min-height: 500px;
    }
    
    .jarrito-previewer {
        padding: 8px;
    }
}

@media (max-width: 1024px) {
    .previewer-main-layout {
        grid-template-columns: 1fr;
        gap: 15px;
        min-height: 100vh;
    }
    
    .products-sidebar {
        order: -1;
        max-height: none;
        overflow: visible;
    }
    
    .products-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .product-card {
        flex: 0 0 auto;
    }
}

/* Slider horizontal en móvil */
@media (max-width: 768px) {
    .products-sidebar {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .products-sidebar h3 {
        font-size: 0.9em;
        margin-bottom: 8px;
    }
    
    
    .products-list {
        display: flex;
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        padding: 15px 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        height: auto;
        min-height: 80px;
        position: relative;
    }
    
    
    .products-list::-webkit-scrollbar {
        height: 4px;
    }
    
    .products-list::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 2px;
    }
    
    .products-list::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 2px;
    }
    
    .product-card {
        flex: 0 0 200px;
        min-width: 200px;
        max-width: 200px;
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .product-card-image {
        width: 50px;
        height: 50px;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
        overflow: hidden;
        position: relative;
    }
    
    .product-card-image img {
        width: 100%;
        height: 100%;
        max-width: 50px;
        max-height: 50px;
        min-width: 50px;
        min-height: 50px;
        object-fit: cover;
        object-position: center;
        display: block;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    .product-card-title {
        font-size: 0.8em;
        margin-bottom: 3px;
    }
    
    .product-card-price {
        font-size: 0.75em;
        margin-bottom: 4px;
    }
    
    .product-card-techniques {
        justify-content: flex-start;
        gap: 3px;
    }
    
    .technique-tag,
    .technique-badge {
        font-size: 0.6em;
        padding: 1px 4px;
    }
    
    /* Badges de técnicas con colores específicos en móvil */
    .product-techniques .technique-tag.dtf,
    .product-techniques .technique-badge.dtf,
    .product-card-techniques .technique-tag.dtf,
    .product-card-techniques .technique-badge.dtf {
        background: #ffebee !important;
        color: #c62828 !important;
        border: 1px solid #ffcdd2 !important;
    }

    .product-techniques .technique-tag.laser,
    .product-techniques .technique-badge.laser,
    .product-card-techniques .technique-tag.laser,
    .product-card-techniques .technique-badge.laser {
        background: #e8f5e8 !important;
        color: #2e7d32 !important;
        border: 1px solid #c8e6c9 !important;
    }
}

@media (max-width: 768px) {
    .jarrito-previewer {
        padding: 5px;
        min-height: 100vh;
    }
    
    .previewer-main-layout {
        gap: 10px;
        min-height: auto;
        height: auto;
        padding-bottom: 100px;
        padding-top: 0;
        display: flex;
        flex-direction: column;
    }
    
    .previewer-workspace {
        overflow: visible;
        padding: 0;
        margin-top: 0;
        min-height: auto;
        height: auto;
    }
    
    .integrated-header {
        padding: 12px 15px;
    }
    
    .integrated-header h2 {
        font-size: 1.3em;
    }
    
    .integrated-header p {
        font-size: 0.85em;
    }
    
    .mockup-container {
        min-height: 300px;
        height: 300px;
        padding: 10px 15px 20px 15px;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        overflow: hidden;
        padding-top: 5px;
    }
    
    .mockup-image {
        transform: scale(1);
        transform-origin: center;
    }
    
    .customer-image {
        max-width: 60%;
        max-height: 60%;
    }
}

/* Estados y utilidades */
.hidden {
    display: none !important;
}

/* Ocultar el carrusel anterior ya que ahora usamos la sidebar */
.products-carousel {
    display: none;
}

/* Ocultar el mensaje de imagen cargada debajo de los botones */
.image-status-info {
    display: none; /* Ocultar el mensaje debajo de los botones */
}

/* Mobile Controls Toggle */
.mobile-controls-toggle {
    position: fixed !important;
    bottom: 100px !important;
    right: 20px !important;
    z-index: 9000 !important; /* Debajo de modales (9999/10000) */
    display: none;
}

/* El toggle se muestra solo via JavaScript cuando hay imagen cargada */

.btn-toggle {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    height: 45px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-toggle:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.btn-toggle i {
    font-size: 16px;
}

.mobile-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 998;
    max-height: 70vh;
    overflow-y: auto;
    padding: 20px;
    display: none;
}

.mobile-controls.show {
    transform: translateY(0);
    display: block !important;
}

/* Controles Móviles Independientes */
.mobile-controls-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.mobile-controls-overlay.show {
    display: flex !important;
}

.mobile-controls-content {
    background: white;
    width: 100%;
    max-height: 70vh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.mobile-controls-overlay.show .mobile-controls-content {
    transform: translateY(0);
}

.mobile-controls-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.mobile-controls-close:hover {
    background: #d35400;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.mobile-controls-body {
    padding: 20px;
    max-height: calc(70vh - 40px);
    overflow-y: auto;
}

.mobile-controls-body .control-group {
    margin-bottom: 20px;
}

.mobile-controls-body .control-group:last-child {
    margin-bottom: 0;
}

.mobile-controls-body .control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.9em;
}

.mobile-controls-body .control-group input[type="range"] {
    width: 100%;
    margin-bottom: 8px;
}

.mobile-controls-body .control-value {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}


/* Estilos específicos para controles en móvil */
@media (max-width: 768px) {
    .mobile-controls {
        display: none;
    }
    
    .mobile-controls.show {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    .controls-sidebar {
        position: fixed !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        height: auto !important;
        max-height: 60vh !important;
        z-index: 999 !important;
        background: white !important;
        overflow-y: auto !important;
        padding: 20px !important;
        transform: translateY(100%) !important;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
        display: block !important;
    }
    
    .controls-sidebar.show {
        transform: translateY(0) !important;
        display: block !important;
    }
    
    /* Quitar bordes del toggle en móvil */
    .mobile-controls-toggle .btn-toggle {
        border: none !important;
        box-shadow: none !important;
        background: var(--primary-color);
    }
    
    .mobile-controls-toggle .btn-toggle:hover {
        background: #d35400;
        transform: translateY(-1px);
    }
    
    .controls-sidebar .image-controls-card:not(.mobile-controls) {
        display: none !important;
    }
    
    /* Eliminar sombras en móvil para un look más limpio */
    .product-card,
    .control-card,
    .previewer-workspace,
    .products-sidebar,
    .controls-sidebar {
        box-shadow: none !important;
        border: 1px solid #e0e0e0;
    }
    
    .integrated-header,
    .mockup-container {
        box-shadow: none !important;
        border: none !important;
        background: transparent;
    }
    
    .product-card {
        border: 1px solid #d0d0d0;
    }
    
    .control-card {
        border: 1px solid #d0d0d0;
        background: #f8f9fa;
    }
    
    .integrated-header {
        border: none !important;
        background: transparent;
    }
    
    .previewer-workspace {
        border: 1px solid #d0d0d0;
    }
    
    .products-sidebar {
        border: 1px solid #d0d0d0;
        height: auto;
        min-height: 100px;
        max-height: 150px;
        overflow: visible;
        margin-bottom: 0;
        padding-bottom: 5px;
    }
    
    .controls-sidebar {
        border: 1px solid #d0d0d0;
    }
    
    .mockup-container {
        border: none !important;
        background: transparent;
    }
    
    /* Eliminar contornos internos del card principal */
    .previewer-workspace .integrated-header {
        border-bottom: none !important;
    }
    
    .canvas-bottom-controls {
        border-top: none !important;
    }
    
    .control-buttons .btn {
        border-right: none !important;
    }
    
    .control-buttons .btn:last-child {
        border-right: none !important;
    }
    
    /* Eliminar más contornos internos */
    .form-section {
        border-bottom: none !important;
    }
    
    .techniques-actions {
        border-top: none !important;
    }
    
    .product-spec-box {
        border: none !important;
        background: transparent !important;
    }
    
    .modal-body .form-section {
        border-bottom: none !important;
    }
    
    /* Processing Overlay en móvil */
    .processing-overlay {
        z-index: 10000;
    }
    
    .processing-content {
        margin: 20px;
        padding: 25px;
        max-width: 280px;
    }
    
    .processing-spinner i {
        font-size: 1.8em;
    }
    
    .processing-content h4 {
        font-size: 1.1em;
    }
    
    .processing-content p {
        font-size: 0.85em;
    }
}

/* Dispositivos muy pequeños (menos de 480px) */
@media (max-width: 480px) {
    .jarrito-previewer {
        padding: 2px;
    }
    
    .previewer-main-layout {
        gap: 8px;
        padding-bottom: 90px;
    }
    
    .integrated-header {
        padding: 8px 12px;
        margin-bottom: 8px;
    }
    
    .integrated-header h2 {
        font-size: 1.1em;
    }
    
    .integrated-header p {
        font-size: 0.8em;
    }
    
    .mockup-container {
        min-height: 200px;
        padding: 10px;
        margin-bottom: 8px;
    }
    
    .products-sidebar {
        margin-bottom: 8px;
        padding: 8px;
    }
    
    .products-sidebar h3 {
        font-size: 0.8em;
        margin-bottom: 6px;
    }
    
    .product-card {
        padding: 8px;
        margin-bottom: 8px;
        flex: 0 0 160px;
        min-width: 160px;
        max-width: 160px;
    }
    
    .product-card-image {
        width: 40px;
        height: 40px;
        aspect-ratio: 1 / 1;
        overflow: hidden;
        position: relative;
    }
    
    .product-card-image img {
        width: 100%;
        height: 100%;
        max-width: 40px;
        max-height: 40px;
        min-width: 40px;
        min-height: 40px;
        object-fit: cover;
        object-position: center;
        display: block;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    .product-card-title {
        font-size: 0.75em;
        margin-bottom: 2px;
    }
    
    .product-card-price {
        font-size: 0.7em;
        margin-bottom: 4px;
    }
    
    .product-card-techniques {
        gap: 2px;
    }
    
    .technique-tag, .technique-badge {
        font-size: 0.55em;
        padding: 1px 3px;
    }
    
    .canvas-bottom-controls {
        height: 70px;
    }
    
    .control-buttons .btn {
        padding: 12px 8px;
        font-size: 0.8em;
    }
    
    .control-buttons .btn i {
        font-size: 1.3em;
        margin-bottom: 4px;
    }
    
    .control-buttons .btn span {
        font-size: 0.8em;
        line-height: 1.1;
    }
}

/* Estilos para la sección de personalización en productos WooCommerce */
.jarrito-customization-info {
    margin: 30px 0;
    margin-bottom: 30px !important;
    padding: 25px;
    background: linear-gradient(135deg, #fff5f0 0%, #ffffff 100%);
    border-radius: var(--border-radius);
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.15);
    text-align: center;
}

.customization-title {
    margin: 0 0 15px 0;
    font-size: 1.4em;
    color: var(--dark-color);
    font-weight: 700;
}

.customization-text {
    margin: 0 0 20px 0;
    color: var(--secondary-color);
    line-height: 1.6;
    font-size: 1em;
}

.customization-techniques {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.customization-techniques .technique-badge {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.customization-techniques .technique-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.customization-techniques .technique-badge.dtf {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #ffffff;
    border: 2px solid #ff5252;
}

.customization-techniques .technique-badge.laser {
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: #ffffff;
    border: 2px solid #37b24d;
}

.jarrito-cta-button {
    display: inline-block;
    padding: 15px 30px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
    text-decoration: none;
    margin-bottom: 30px !important;
}



.jarrito-cta-button:hover {
    background: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.4);
    color: #ffffff;
}

.jarrito-cta-button:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .jarrito-customization-info {
        padding: 20px 15px;
    }
    
    .customization-title {
        font-size: 1.2em;
    }
    
    .customization-techniques .technique-badge {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .jarrito-cta-button {
        padding: 12px 24px;
        font-size: 1em;
    }
}