/**
 * Estilos del Editor de Diseño
 */

/* ==================== EDITOR LAYOUT ==================== */
.editor-body {
    overflow-x: hidden;
    overflow-y: auto;
}

.editor-header {
    background: var(--bg-primary);
    box-shadow: var(--shadow);
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.back-btn:hover {
    color: var(--primary-color);
}

.product-title h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.editor-main {
    display: flex;
    min-height: calc(100vh - 60px);
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
    margin-top: 60px;
    overflow: hidden;
}

/* ==================== SIDEBARS ==================== */
.editor-sidebar {
    width: 300px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px;
    flex-shrink: 0;
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
}

.right-sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
    position: sticky;
    top: 60px;
}

.sidebar-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.sidebar-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.sidebar-section h3 i {
    color: var(--primary-color);
    font-size: 1rem;
}

/* Collapsible sections */
.sidebar-section.collapsible h3 {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
    justify-content: space-between;
}

.sidebar-section.collapsible h3:hover {
    color: var(--primary-color);
}

.sidebar-section.collapsible h3 .toggle-icon {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.sidebar-section.collapsible.collapsed h3 .toggle-icon {
    transform: rotate(-90deg);
}

.sidebar-section.collapsible .section-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.sidebar-section.collapsible.collapsed .section-content {
    max-height: 0;
    opacity: 0;
}

/* Floating Description Panel */
.description-panel-wrapper {
    width: 320px;
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px;
    flex-shrink: 0;
}

.description-panel-content {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.03), rgba(99, 102, 241, 0.03));
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.description-panel-content h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.description-panel-content h3 i {
    color: var(--primary-color);
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.8;
}

.product-description h1,
.product-description h2,
.product-description h3 {
    margin: 0.5em 0 0.3em 0;
    line-height: 1.3;
}

.product-description h1 {
    font-size: 1.5rem;
}

.product-description h2 {
    font-size: 1.25rem;
}

.product-description h3 {
    font-size: 1.1rem;
}

.product-description p {
    margin: 0.5em 0;
}

.product-description ul,
.product-description ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.product-description li {
    margin: 0.25em 0;
}

.product-description strong {
    color: var(--primary-color);
    font-weight: 600;
    display: inline;
}

.product-description h3 strong,
.product-description h2 strong,
.product-description h1 strong {
    display: block;
    margin-top: 0.5em;
}

.product-description em {
    font-style: italic;
}

.product-description u {
    text-decoration: underline;
}

.product-description a {
    color: var(--primary-color);
    text-decoration: none;
}

.product-description a:hover {
    text-decoration: underline;
}

/* Ocultar panel lateral en pantallas medianas, mostrar versión alternativa */
@media (max-width: 1400px) and (min-width: 769px) {
    .description-panel-wrapper {
        position: fixed;
        bottom: 0;
        left: 300px;
        right: 320px;
        width: auto;
        height: auto;
        max-height: 200px;
        border-left: none;
        border-right: none;
        border-top: 1px solid var(--border-color);
        z-index: 50;
        overflow-y: auto;
    }
    
    .editor-main {
        padding-bottom: 200px;
    }
}

/* Descripción en sidebar - ocultar por defecto, mostrar en pantallas pequeñas */
.sidebar-description-mobile {
    display: none;
}

/* En pantallas pequeñas (incluyendo móvil en modo escritorio), mostrar descripción en sidebar */
@media (max-width: 768px) {
    .description-panel-wrapper {
        display: none;
    }
    
    .sidebar-description-mobile {
        display: block;
    }
}

/* También mostrar en pantallas medianas donde el panel lateral no cabe bien */
@media (max-width: 1100px) and (min-width: 769px) {
    .sidebar-description-mobile {
        display: block;
    }
}

/* ==================== UPLOAD ZONE ==================== */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-secondary);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.upload-content i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.upload-content p {
    font-weight: 500;
    margin-bottom: 5px;
}

.upload-content span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.upload-info {
    margin-top: 12px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.upload-info small {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.upload-info small:last-child {
    margin-bottom: 0;
}

.upload-info small i {
    color: var(--primary-color);
    width: 14px;
    text-align: center;
}

.upload-info small .fa-star {
    color: #f59e0b;
}

.upload-progress {
    margin-top: 15px;
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    width: 0;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==================== DESIGN CONTROLS ==================== */
.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-value {
    min-width: 50px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary-color);
}

/* Position buttons */
.position-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.pos-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.pos-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Size info */
.size-info {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.size-info strong {
    color: var(--primary-color);
}

.position-info {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.position-info strong {
    color: var(--primary-color);
}

.position-help {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

/* ==================== PRINT AREAS ==================== */
.print-areas-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.print-area-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.print-area-btn:hover {
    border-color: var(--primary-light);
}

.print-area-btn.active {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.print-area-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.print-area-btn small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==================== COLOR & SIZE SELECTORS ==================== */
.color-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-option {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 1px var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.active {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.color-option i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
    opacity: 0;
}

.color-option.active i {
    opacity: 1;
}

/* Ajustar icono para colores claros */
.color-option[style*="#FFFFFF"] i,
.color-option[style*="#F5F5DC"] i,
.color-option[style*="#FFD700"] i {
    color: var(--text-primary);
}

.selected-color {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.size-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.size-option {
    min-width: 45px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.size-option:hover {
    border-color: var(--primary-color);
}

.size-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==================== SIZE QUANTITY GRID ==================== */
.section-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Discount Promo Banner */
.discount-promo-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 2px solid #F59E0B;
    border-radius: 12px;
    margin-bottom: 16px;
}

/* Versión sutil para modales/sheets de tallas */
.discount-promo-subtle {
    padding: 8px 12px;
    background: linear-gradient(135deg, #FEF9E7 0%, #FCF3CF 100%);
    border: 1px solid #F9E79F;
    margin-bottom: 12px;
    font-size: 0.85rem;
}

.discount-promo-subtle .discount-promo-icon {
    font-size: 18px;
}

.discount-promo-subtle .discount-promo-text strong {
    font-size: 0.85rem;
}

.discount-promo-subtle .discount-examples {
    font-size: 0.75rem;
    gap: 5px;
}

.discount-promo-subtle .discount-example-item {
    padding: 2px 6px;
    font-size: 0.7rem;
}

.discount-promo-subtle .discount-example-item .discount-badge {
    font-size: 0.65rem;
    padding: 1px 4px;
}

.discount-promo-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.discount-promo-content {
    flex: 1;
    min-width: 0;
}

.discount-promo-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.9rem;
    color: #92400E;
}

.discount-promo-text strong {
    color: #78350F;
    font-size: 0.95rem;
}

.discount-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
}

.discount-example-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    white-space: nowrap;
}

.discount-example-item .qty {
    color: #78350F;
    font-weight: 600;
}

.discount-example-item .price {
    color: #065F46;
    font-weight: 700;
}

.discount-example-item .discount-badge {
    background: #10B981;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .discount-promo-banner {
        padding: 10px 12px;
    }
    
    .discount-promo-icon {
        font-size: 20px;
    }
    
    .discount-promo-text {
        font-size: 0.85rem;
        gap: 4px;
    }
    
    .discount-promo-text strong {
        font-size: 0.9rem;
    }
    
    .discount-examples {
        gap: 6px;
        font-size: 0.8rem;
    }
    
    .discount-example-item {
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .discount-promo-banner:not(.discount-promo-mobile-compact) {
        flex-direction: column;
        text-align: center;
        padding: 10px;
        gap: 8px;
    }
    
    .discount-promo-content {
        width: 100%;
    }
    
    .discount-examples {
        justify-content: center;
        gap: 4px;
    }
    
    .discount-example-item {
        font-size: 0.75rem;
        padding: 2px 5px;
    }
    
    .discount-example-item .discount-badge {
        font-size: 0.7rem;
        padding: 1px 4px;
    }
}

.size-quantity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.size-quantity-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    min-height: 60px;
}

.size-quantity-row:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.size-quantity-row.has-quantity {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(79, 70, 229, 0.05));
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.size-label {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.size-quantity-row.has-quantity .size-label {
    color: var(--primary-color);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

.quantity-controls .qty-btn {
    width: 22px;
    height: 22px;
    border: none;
    background: var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: var(--transition);
    padding: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.quantity-controls .qty-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.quantity-controls .qty-btn:active {
    transform: scale(0.95);
}

.size-qty-input {
    width: 32px;
    height: 24px;
    border: none;
    border-radius: 4px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    -moz-appearance: textfield;
}

.size-qty-input::-webkit-outer-spin-button,
.size-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.size-qty-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
}

.total-items-summary {
    margin-top: 12px;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    text-align: center;
    font-weight: 500;
    font-size: 0.9rem;
}

.total-items-summary #totalItemsCount {
    font-weight: 700;
    font-size: 1.1rem;
}

/* ==================== QUANTITY ==================== */
.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    width: fit-content;
}

.quantity-selector .qty-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.quantity-selector .qty-btn:hover {
    background: var(--border-color);
}

.quantity-selector input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
}

/* ==================== PRICING ==================== */
.pricing-section {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: var(--border-radius);
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.price-breakdown {
    margin-bottom: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.price-row.subtotal {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 8px;
}

.price-row.price-per-unit {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    padding: 4px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.price-row.price-per-unit span:last-child {
    color: var(--primary-color);
    font-weight: 600;
}

/* Precio unitario en móvil (barra debajo de botones flotantes) */
.mobile-unit-price-bar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-unit-price-bar {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 4px 10px;
        background: linear-gradient(135deg, rgba(79, 70, 229, 0.95) 0%, rgba(99, 102, 241, 0.95) 100%);
        border-radius: 20px;
        position: absolute;
        top: 113px;
        right: 16px;
        z-index: 1001;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
    }
    
    .mobile-unit-price-bar .unit-price-label {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.95);
        font-weight: 500;
    }
    
    .mobile-unit-price-bar .unit-price-value {
        font-size: 13px;
        font-weight: 700;
        color: #ffffff;
    }
}

.total-price {
    display: flex;
    justify-content: space-between;
    font-size: 1.25rem;
    font-weight: 700;
    padding-top: 12px;
    border-top: 2px solid var(--border-color);
}

.total-price span:last-child {
    color: var(--primary-color);
}

/* ==================== HELP TEXT ==================== */
.help-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 10px;
    text-align: center;
    justify-content: center;
}

/* ==================== CANVAS AREA ==================== */
.editor-canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.canvas-wrapper {
    position: relative;
    max-width: 100%;
    max-height: calc(100vh - 160px);
}

.product-canvas {
    position: relative;
    width: 500px;
    height: 600px;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.product-image-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-layer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: background-color 0.3s ease;
}

/* Overlay para áreas - se ajustará al tamaño real de la imagen */
#areasOverlay {
    position: absolute;
    pointer-events: none;
}

#areasOverlay > * {
    pointer-events: auto;
}

/* ==================== PRINT AREA ==================== */
.print-area {
    position: absolute;
    border: 2px dashed rgba(79, 70, 229, 0.5);
    background: rgba(79, 70, 229, 0.05);
    transition: all 0.3s ease;
}

.print-area-border {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.area-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    white-space: nowrap;
}

/* ==================== USER DESIGN ==================== */
.user-design {
    position: absolute;
    cursor: move;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-design img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.user-design.dragging {
    cursor: grabbing;
}

/* Borde de selección - estilo latostadora */
.design-selection-border {
    position: absolute;
    inset: -1px;
    border: 1px dashed rgba(100, 100, 100, 0.6);
    pointer-events: none;
}

/* Controles overlay estilo latostadora */
.design-controls-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.design-control-btn {
    position: absolute;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.design-control-btn:hover {
    transform: scale(1.15);
}

/* Botón eliminar - arriba izquierda */
.delete-btn {
    top: -14px;
    left: -14px;
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

/* Botón rotar - arriba derecha */
.rotate-btn {
    top: -14px;
    right: -14px;
    background: white;
    color: #333;
    cursor: grab;
}

.rotate-btn:hover {
    background: #f0f0f0;
}

.rotate-btn.active {
    cursor: grabbing;
    background: var(--primary-color);
    color: white;
}

/* Botón escalar - abajo derecha */
.scale-btn {
    bottom: -14px;
    right: -14px;
    background: white;
    color: #333;
    cursor: nwse-resize;
}

.scale-btn:hover {
    background: #f0f0f0;
}

.scale-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Design handles (mantener compatibilidad pero ocultar) */
.design-handles {
    display: none;
}

/* ==================== IMAGE TOOLS ==================== */
.image-tools {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.image-tools h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.image-tools h4 i {
    color: var(--primary-color);
}

.tool-badge {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
}

.removing-bg-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Formas de recorte */
.crop-shapes {
    margin-top: 15px;
}

.crop-shapes label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 8px;
}

.shape-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.shape-btn {
    width: 38px;
    height: 38px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.shape-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.shape-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

/* Clip paths para formas */
.user-design.shape-circle img {
    clip-path: circle(50% at 50% 50%);
}

.user-design.shape-square img {
    clip-path: none;
    border-radius: 0;
}

.user-design.shape-rounded img {
    clip-path: inset(0 round 20%);
}

.user-design.shape-oval img {
    clip-path: ellipse(40% 50% at 50% 50%);
}

.user-design.shape-oval-h img {
    clip-path: ellipse(50% 40% at 50% 50%);
}

.user-design.shape-hexagon img {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.user-design.shape-heart img {
    clip-path: path('M 50 15 C 35 0, 0 5, 0 30 C 0 55, 50 90, 50 90 C 50 90, 100 55, 100 30 C 100 5, 65 0, 50 15');
}

.user-design.shape-star img {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* ==================== ZOOM CONTROLS ==================== */
.canvas-zoom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    padding: 8px 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.zoom-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.zoom-btn:hover {
    background: var(--primary-color);
    color: white;
}

.zoom-level {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

/* ==================== PREVIEW MODAL ==================== */
.preview-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.preview-canvas {
    max-width: 100%;
}

#previewClone {
    transform: scale(0.8);
    transform-origin: center center;
}

/* ==================== RESPONSIVE ==================== */

/* Pantallas grandes */
@media (max-width: 1400px) {
    .description-panel-wrapper {
        display: none;
    }
}

@media (max-width: 1200px) {
    .editor-sidebar {
        width: 260px;
    }
    
    .product-canvas {
        width: 420px;
        height: 500px;
    }
    
    .sidebar-section h3 {
        font-size: 0.9rem;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .editor-main {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .editor-sidebar {
        width: 100%;
        border: none;
        border-bottom: 1px solid var(--border-color);
        max-height: none;
        overflow: visible;
    }
    
    .left-sidebar {
        order: 2;
    }
    
    .editor-canvas-container {
        order: 1;
        min-height: 50vh;
        padding: 20px 15px;
        background: var(--bg-tertiary);
        z-index: 10;
        position: relative;
    }
    
    .right-sidebar {
        order: 3;
        border-top: 1px solid var(--border-color);
        border-left: none;
    }
    
    .product-canvas {
        width: 380px;
        height: 450px;
        max-width: 100%;
    }
    
    .canvas-wrapper {
        max-height: 50vh;
    }
    
    .sidebar-section {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
}

/* ==================== MÓVIL - ESTILO LATOSTADORA ==================== */

/* ==================== BARRAS MÓVILES COMPACTAS ==================== */

/* Ocultar en desktop */
.mobile-top-bar,
.mobile-middle-bar,
.mobile-secondary-bar {
    display: none;
}

/* Estilos antiguos - mantener ocultos */
.mobile-floating-buttons {
    display: none !important;
}

.mobile-areas-btn,
.mobile-sizes-btn,
.mobile-change-product-btn {
    display: none !important;
}

.mobile-unit-price-bar {
    display: none !important;
}

@media (max-width: 768px) {
    /* Body sin scroll en móvil */
    .editor-body {
        overflow: hidden !important;
        height: 100vh !important;
        position: fixed !important;
        width: 100% !important;
    }
    
    /* BARRA SUPERIOR COMPACTA */
    .mobile-top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        height: 44px;
        background: #fff;
        border-bottom: 1px solid #e0e0e0;
        z-index: 95;
        padding: 0 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }
    
    /* BARRA SECUNDARIA (ÁREAS, TALLAS, CAMBIAR) - Justo encima de la inferior */
    .mobile-secondary-bar {
        display: flex;
        align-items: center;
        justify-content: space-around;
        position: fixed;
        bottom: 70px;
        left: 0;
        right: 0;
        height: 44px;
        background: #f8f9fa;
        border-top: 1px solid #e0e0e0;
        z-index: 999;
        padding: 0 10px;
    }
    
    .secondary-btn {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 8px 14px;
        background: white;
        border: 1px solid #e0e0e0;
        color: #555;
        font-size: 0.72rem;
        font-weight: 500;
        cursor: pointer;
        border-radius: 20px;
        transition: all 0.15s;
        position: relative;
    }
    
    .secondary-btn i {
        color: var(--primary-color);
        font-size: 0.85rem;
    }
    
    .secondary-btn:active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .secondary-btn:active i {
        color: white;
    }
    
    /* Ajustar barra inferior para dejar espacio */
    .mobile-bottom-bar {
        bottom: 0 !important;
    }
    
    /* Botones compactos */
    .compact-btn {
        display: flex;
        align-items: center;
        gap: 5px;
        padding: 8px 10px 6px 10px;
        background: transparent;
        border: none;
        color: #555;
        font-size: 0.72rem;
        font-weight: 500;
        cursor: pointer;
        border-radius: 6px;
        transition: all 0.15s;
        position: relative;
    }
    
    .compact-btn i {
        color: var(--primary-color);
        font-size: 0.85rem;
    }
    
    .compact-btn:active {
        background: rgba(79, 70, 229, 0.1);
    }
    
    .compact-btn .color-indicator {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: 2px solid white;
        box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
        flex-shrink: 0;
    }
    
    .compact-badge {
        position: absolute;
        top: -2px;
        right: -2px;
        background: var(--primary-color);
        color: white;
        font-size: 0.6rem;
        padding: 1px 4px;
        border-radius: 8px;
        min-width: 14px;
        text-align: center;
        font-weight: 600;
    }
    
    /* Precio unitario en barra superior */
    .compact-price {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 4px 10px;
        margin-top: 4px;
        background: linear-gradient(135deg, var(--primary-color), #7c3aed);
        border-radius: 16px;
        color: white;
    }
    
    .compact-price .price-label {
        font-size: 0.65rem;
        opacity: 0.9;
    }
    
    .compact-price .price-value {
        font-size: 0.8rem;
        font-weight: 700;
    }
    
    /* Ajustar el contenido principal para las barras */
    .editor-main {
        margin-top: 0 !important;
        padding-top: 94px !important; /* 50px header + 44px barra superior */
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    .editor-canvas-container {
        margin-top: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        height: calc(100vh - 208px) !important; /* 100vh - (50 header + 44 topbar + 44 secondary + 70 bottom) */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        flex: none !important;
    }
    
    .product-canvas {
        width: 92vw;
        max-width: 380px;
        height: auto;
        aspect-ratio: 1 / 1.15;
        max-height: calc(100vh - 240px);
    }
    
    /* Galería grid */
    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px 0;
    }
    
    .gallery-item {
        aspect-ratio: 1;
        border-radius: 8px;
        overflow: hidden;
        border: 2px solid transparent;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .gallery-item:active {
        border-color: var(--primary-color);
        transform: scale(0.95);
    }
    
    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .gallery-empty {
        grid-column: 1 / -1;
        text-align: center;
        padding: 40px 20px;
        color: #999;
    }
    
    .gallery-empty i {
        font-size: 3rem;
        margin-bottom: 10px;
        opacity: 0.5;
    }
    
    .gallery-empty p {
        margin: 0;
        font-size: 0.9rem;
    }
}

/* Estilos legacy - mantener para compatibilidad pero ocultos */
@media (max-width: 768px) {
    .mobile-floating-buttons {
        display: none !important;
    }
    
    .floating-btn {
        display: none !important;
    }
    
    .color-indicator {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        border: 2px solid white;
        box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
        flex-shrink: 0;
    }
    
    .floating-btn:active {
        background: var(--primary-color);
        color: white;
        border-color: var(--primary-color);
    }
    
    .floating-btn:active i {
        color: white;
    }
    
    /* Botón de guía centrado - LEGACY */
    .floating-btn-center {
        display: none !important;
    }
    
    .floating-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: var(--primary-color);
        color: white;
        font-size: 0.65rem;
        padding: 2px 5px;
        border-radius: 10px;
        min-width: 16px;
        text-align: center;
        font-weight: 600;
    }
    
    .floating-badge:empty,
    .floating-badge[data-count="0"] {
        display: none;
    }
    
    /* Botón de color a la derecha - LEGACY */
    .floating-btn-right {
        display: none !important;
    }
    
    /* Botones flotantes inferiores - OCULTADOS, ahora en barra media */
    .mobile-areas-btn,
    .mobile-sizes-btn,
    .mobile-change-product-btn {
        display: none !important;
    }
    
    /* LEGACY - Mantener ocultos 
    .mobile-areas-btn {
        left: 15px;
    }
    
    .mobile-sizes-btn {
        left: 110px;
    }
    
    .mobile-change-product-btn {
        right: 15px;
    }
    */
    
    .mobile-areas-btn i,
    .mobile-sizes-btn i,
    .mobile-change-product-btn i {
        color: var(--primary-color);
    }
    
    .mobile-areas-btn:active,
    .mobile-sizes-btn:active,
    .mobile-change-product-btn:active {
        background: var(--primary-color);
        color: white;
    }
    
    .mobile-areas-btn:active i,
    .mobile-sizes-btn:active i,
    .mobile-change-product-btn:active i {
        color: white;
    }
    
    .mobile-sizes-btn .floating-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: var(--primary-color);
        color: white;
        font-size: 0.65rem;
        padding: 2px 5px;
        border-radius: 10px;
        min-width: 16px;
        text-align: center;
        font-weight: 600;
    }
    
    /* Header móvil compacto */
    .editor-header {
        padding: 0 10px !important;
        height: 50px !important;
    }
    
    .header-left {
        flex: 1 !important;
        gap: 8px !important;
        min-width: 0 !important;
    }
    
    .back-btn {
        font-size: 1.1rem !important;
        padding: 8px !important;
        flex-shrink: 0 !important;
    }
    
    .back-btn span {
        display: none !important;
    }
    
    .product-title {
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        max-width: none !important;
    }
    
    .product-title h1 {
        font-size: 0.9rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
        max-width: none !important;
    }
    
    .header-right {
        flex-shrink: 0 !important;
        padding-right: 5px; /* Espacio para que el badge no se corte */
    }
    
    .header-right .cart-link {
        display: flex !important;
        font-size: 1.2rem !important;
        padding: 8px !important;
        position: relative;
    }
    
    /* Badge del carrito header - evitar overflow */
    .header-right .cart-link .cart-count {
        right: -8px;
        top: -4px;
        font-size: 0.65rem;
        width: 18px;
        height: 18px;
    }
    
    .header-right .btn {
        display: none; /* Ocultar botones, usar barra inferior */
    }
    
    /* Canvas del editor más grande en móvil */
    .editor-canvas {
        padding: 0 !important;
        margin-top: 0 !important;
        margin: 0 !important;
        height: auto !important;
    }
    
    .product-container {
        max-width: 100%;
        max-height: 100%;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Layout principal móvil */
    .editor-main {
        margin-top: 0 !important;
        padding-top: 94px !important; /* 50px header + 44px top bar */
        height: 100vh !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    
    /* Ocultar sidebars en móvil */
    .editor-sidebar {
        display: none !important;
    }
    
    /* Canvas del editor en móvil - refuerzo con !important */
    .editor-canvas-container {
        flex: none !important; /* NO usar flex:1, usar height fijo */
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        overflow: hidden !important;
        height: calc(100vh - 208px) !important; /* 100vh - (50 header + 44 topbar + 44 secondary + 70 bottom) */
        min-height: 0 !important;
        background: var(--bg-tertiary);
    }
    
    .canvas-wrapper {
        width: 100%;
        max-height: none !important;
        height: auto !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .product-canvas {
        width: 90vw;
        max-width: 360px;
        height: auto !important;
        aspect-ratio: 1 / 1.15;
        max-height: calc(100vh - 230px) !important;
        position: relative;
    }
    
    .product-image-layer {
        position: absolute;
        inset: 0;
    }
    
    .product-image-layer img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* Ocultar zoom en móvil - usar gestos */
    .canvas-zoom-controls {
        display: none;
    }
    
    /* Controles de diseño más grandes para touch */
    .design-control-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .delete-btn {
        top: -18px;
        left: -18px;
    }
    
    .rotate-btn {
        top: -18px;
        right: -18px;
    }
    
    .scale-btn {
        bottom: -18px;
        right: -18px;
    }
    
    .text-control-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* ==================== BARRA INFERIOR MÓVIL (LATOSTADORA STYLE) ==================== */
.mobile-bottom-bar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-bottom-bar {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }
    
    .mobile-bottom-bar .bar-actions {
        display: flex;
        flex: 1;
    }
    
    .mobile-bar-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        border: none;
        background: transparent;
        color: #666;
        font-size: 0.7rem;
        padding: 8px 4px;
        cursor: pointer;
        transition: all 0.2s;
        position: relative;
    }
    
    .mobile-bar-btn i {
        font-size: 1.3rem;
    }
    
    .mobile-bar-btn:active {
        background: rgba(79, 70, 229, 0.1);
    }
    
    .mobile-bar-btn.active {
        color: var(--primary-color);
    }
    
    .mobile-bar-btn .bar-badge {
        position: absolute;
        top: 5px;
        left: 50%;
        transform: translateX(5px);
        background: var(--primary-color);
        color: white;
        font-size: 0.65rem;
        padding: 2px 5px;
        border-radius: 10px;
        min-width: 16px;
        text-align: center;
    }
    
    .mobile-cart-btn {
        background: var(--primary-color);
        color: white;
        border-radius: 0;
        min-width: 100px;
    }
    
    .mobile-cart-btn:active {
        background: #5b4fd8;
    }
    
    .mobile-cart-btn .cart-price {
        font-size: 0.85rem;
        font-weight: 700;
    }
    
    .mobile-cart-btn i {
        font-size: 1rem;
    }
}

/* ==================== BOTTOM SHEETS MÓVIL ==================== */
.mobile-sheet-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-sheet-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    z-index: 1002;
    display: flex;
    flex-direction: column;
}

.mobile-sheet.active {
    transform: translateY(0);
}

.mobile-sheet-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px auto;
    flex-shrink: 0;
}

.mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px 15px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.mobile-sheet-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-sheet-header h3 i {
    color: var(--primary-color);
}

.mobile-sheet-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 5px;
}

.mobile-sheet-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Contenido específico de cada sheet */
.mobile-sheet .upload-zone {
    padding: 30px 20px;
    margin-bottom: 15px;
}

.mobile-sheet .color-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.mobile-sheet .color-option {
    width: 44px;
    height: 44px;
}

.mobile-sheet .print-areas-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.mobile-sheet .print-area-btn {
    padding: 16px;
}

.mobile-sheet .text-editor-form textarea {
    font-size: 16px;
    padding: 14px;
}

.mobile-sheet .form-select {
    font-size: 16px;
    padding: 14px;
}

.mobile-sheet .preset-colors {
    gap: 8px;
}

.mobile-sheet .preset-color {
    width: 36px;
    height: 36px;
}

.mobile-sheet .text-style-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.mobile-sheet .style-btn {
    padding: 14px;
}

.mobile-sheet .btn-block {
    padding: 16px;
    font-size: 1rem;
}

/* Sheet de opciones */
.mobile-options-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-option-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
}

.mobile-option-section h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-option-section h4 i {
    color: var(--primary-color);
}

/* Sheet de tallas */
.mobile-sheet .size-quantity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mobile-sheet .size-quantity-row {
    padding: 12px 8px;
    min-height: 70px;
}

.mobile-sheet .quantity-controls .qty-btn {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.mobile-sheet .size-qty-input {
    width: 40px;
    height: 32px;
    font-size: 1rem;
}

/* Pricing en sheet */
.mobile-pricing-summary {
    background: linear-gradient(135deg, #f8f9fa, #fff);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.mobile-pricing-summary .price-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9rem;
}

.mobile-pricing-summary .price-per-unit-mobile {
    color: var(--primary-color);
    font-weight: 600;
    background: rgba(79, 70, 229, 0.05);
    margin: 4px -15px;
    padding: 8px 15px;
}

.mobile-pricing-summary .total-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    border-top: 2px solid var(--primary-color);
    padding-top: 12px;
    margin-top: 8px;
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .editor-header {
        height: 45px;
        padding: 0 10px;
    }
    
    .product-title h1 {
        font-size: 0.85rem;
        max-width: 120px;
    }
    
    .mobile-top-bar {
        top: 45px;
        height: 42px;
    }
    
    .editor-main {
        padding-top: 87px !important; /* 45px header + 42px top bar */
    }
    
    .editor-canvas-container {
        height: calc(100vh - 194px) !important; /* 100vh - (45 header + 42 topbar + 42 secondary + 65 bottom) */
    }
    
    .product-canvas {
        width: 92vw;
        max-width: 360px;
        max-height: calc(100vh - 220px);
    }
    
    .mobile-bottom-bar {
        height: 65px;
    }
    
    .mobile-secondary-bar {
        bottom: 65px;
        height: 42px;
    }
    
    .mobile-bar-btn {
        font-size: 0.65rem;
    }
    
    .mobile-bar-btn i {
        font-size: 1.2rem;
    }
    
    .mobile-sheet .size-quantity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Landscape móviles - NO aplicar estilo móvil */
@media (max-width: 900px) and (orientation: landscape) {
    .editor-main {
        flex-direction: row;
        height: calc(100vh - 50px);
    }
    
    .editor-sidebar {
        display: block !important;
        width: 280px;
        height: 100%;
        overflow-y: auto;
        border-bottom: none;
        border-right: 1px solid var(--border-color);
    }
    
    .left-sidebar {
        order: 1;
    }
    
    .right-sidebar {
        order: 3;
        border-left: 1px solid var(--border-color);
        border-top: none;
    }
    
    .editor-canvas-container {
        order: 2;
        flex: 1;
        min-height: auto;
        max-height: none;
    }
    
    .product-canvas {
        width: 300px;
        height: 350px;
        max-height: calc(100vh - 100px);
    }
    
    .mobile-bottom-bar {
        display: none;
    }
    
    .canvas-zoom-controls {
        display: flex;
    }
}

/* Touch targets mínimos */
@media (pointer: coarse) {
    .color-option,
    .size-option,
    .print-area-btn,
    .preset-color,
    .style-btn,
    .pos-btn,
    .zoom-btn,
    .qty-btn {
        min-width: 44px;
        min-height: 44px;
    }
    
    .design-control-btn,
    .text-control-btn {
        width: 36px;
        height: 36px;
    }
}

/* ==================== B2B MESSAGE ==================== */
.b2b-message {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196F3;
    border-radius: 12px;
    padding: 20px !important;
    margin-bottom: 20px;
}

.b2b-content {
    text-align: center;
}

.b2b-content i {
    font-size: 2.5rem;
    color: #1976D2;
    margin-bottom: 12px;
    display: block;
}

.b2b-content p {
    font-size: 0.9rem;
    color: #1565C0;
    line-height: 1.5;
    margin-bottom: 15px;
}

.b2b-content .btn-outline {
    background: transparent;
    border: 2px solid #1976D2;
    color: #1976D2;
    font-weight: 600;
}

.b2b-content .btn-outline:hover {
    background: #1976D2;
    color: white;
}

/* ==================== DISCOUNT ROW ==================== */
.price-row#discountRow {
    color: #28a745;
    font-weight: 600;
}

.price-row#discountRow span:last-child {
    color: #28a745;
}

/* ==================== AREAS INDICATOR ==================== */
.print-area-btn.has-design::after {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    background: #28a745;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.print-area-btn {
    position: relative;
}

/* ==================== TEXT EDITOR ==================== */
.text-editor-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.text-editor-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    resize: none;
    font-family: inherit;
    background: var(--bg-secondary);
    transition: var(--transition);
}

.text-editor-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.char-counter {
    display: block;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ==================== TEXT PREVIEW ==================== */
.text-preview-container {
    margin-bottom: 15px;
}

.text-preview-container label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.text-preview-box {
    background: linear-gradient(45deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%);
    background-size: 20px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

#textPreview {
    font-size: 24px;
    word-break: break-word;
    max-width: 100%;
    line-height: 1.3;
}

.text-color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.text-color-picker input[type="color"] {
    width: 45px;
    height: 35px;
    padding: 2px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    background: transparent;
}

.text-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.text-color-picker input[type="color"]::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}

#textColorHex {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.preset-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.preset-color {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.preset-color:hover {
    transform: scale(1.1);
}

.preset-color[data-color="#FFFFFF"] {
    border-color: #ccc;
}

.preset-color.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

.text-style-buttons {
    display: flex;
    gap: 8px;
}

.style-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.style-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.style-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Text design element in canvas */
.text-design {
    position: absolute;
    cursor: move;
    user-select: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: center;
    line-height: 1.2;
    padding: 5px 10px;
}

.text-design.selected {
    outline: 2px dashed var(--primary-color);
    outline-offset: 3px;
}

.text-design .design-handles {
    display: none;
}

.text-design.selected .design-handles {
    display: block;
}

.text-design .design-handles .handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
}

.text-design .handle-nw { top: -6px; left: -6px; cursor: nw-resize; }
.text-design .handle-ne { top: -6px; right: -6px; cursor: ne-resize; }
.text-design .handle-sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.text-design .handle-se { bottom: -6px; right: -6px; cursor: se-resize; }

.text-design .handle-rotate {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

/* Font preview in select */
.form-select option {
    padding: 8px;
}

/* ==================== COPYRIGHT MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.modal-sm {
    max-width: 450px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.modal-header h3 i {
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
}

.copyright-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.copyright-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 0.9rem;
    text-decoration: none;
}

.copyright-links a:hover {
    text-decoration: underline;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* ==================== ALIGNMENT BUTTONS ==================== */
.alignment-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.align-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: var(--text-secondary);
}

.align-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.align-btn:active {
    transform: scale(0.95);
}

/* ==================== TEXT ELEMENTS ==================== */
.text-element {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: box-shadow 0.2s;
    z-index: 10;
}

.text-element:hover {
    box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.3);
}

.text-element.selected {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.text-content {
    font-size: 24px;
    line-height: 1.2;
    white-space: nowrap;
    display: block;
}

/* Borde de selección para texto - estilo latostadora */
.text-selection-border {
    position: absolute;
    inset: -1px;
    border: 1px dashed rgba(100, 100, 100, 0.6);
    pointer-events: none;
}

/* Controles overlay para texto estilo latostadora */
.text-controls-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.text-control-btn {
    position: absolute;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: all;
    transition: transform 0.2s, box-shadow 0.2s;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.text-control-btn:hover {
    transform: scale(1.15);
}

/* Botón eliminar texto - arriba izquierda */
.text-delete-btn {
    top: -12px;
    left: -12px;
    background: #dc3545;
    color: white;
}

.text-delete-btn:hover {
    background: #c82333;
}

/* Botón rotar texto - arriba derecha */
.text-rotate-btn {
    top: -12px;
    right: -12px;
    background: white;
    color: #333;
    cursor: grab;
}

.text-rotate-btn:hover {
    background: #f0f0f0;
}

.text-rotate-btn.active {
    cursor: grabbing;
    background: var(--primary-color);
    color: white;
}

/* Botón escalar texto - abajo derecha */
.text-scale-btn {
    bottom: -12px;
    right: -12px;
    background: white;
    color: #333;
    cursor: nwse-resize;
}

.text-scale-btn:hover {
    background: #f0f0f0;
}

.text-scale-btn.active {
    background: var(--primary-color);
    color: white;
}

/* Ocultar controles antiguos */
.text-controls {
    display: none;
}

/* Botones de texto */
.text-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.text-buttons .btn {
    margin: 0;
}

/* ==================== IMAGE EDIT MODAL ==================== */
.modal-lg {
    max-width: 850px;
}

.modal-lg .modal-header {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.modal-lg .modal-header h3 {
    flex: 1;
}

.modal-lg .modal-header .btn-primary {
    order: 2;
}

.modal-lg .modal-header .modal-close {
    order: 3;
}

.image-edit-body {
    display: flex;
    gap: 0;
    padding: 0 !important;
    min-height: 450px;
}

.image-edit-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.edit-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.edit-tab {
    flex: 1;
    padding: 15px 10px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.8rem;
}

.edit-tab i {
    font-size: 1.2rem;
}

.edit-tab:hover {
    background: rgba(79, 70, 229, 0.05);
}

.edit-tab.active {
    color: var(--primary-color);
    background: var(--bg-primary);
    border-bottom: 2px solid var(--primary-color);
}

.edit-panel {
    padding: 15px;
    flex: 1;
    overflow-y: auto;
}

.shapes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 5px;
    border: 2px solid transparent;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.shape-option:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.shape-option.active {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.shape-option span {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
}

.shape-preview {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.shape-none {
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    color: var(--text-secondary);
}

.shape-circle {
    border-radius: 50%;
}

.shape-square {
    border-radius: 0;
}

.shape-rounded {
    border-radius: 10px;
}

.shape-oval {
    border-radius: 50%;
    width: 35px;
    height: 50px;
}

.shape-oval-h {
    border-radius: 50%;
    width: 50px;
    height: 35px;
}

.shape-hexagon {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.shape-star i, .shape-heart i {
    font-size: 1.2rem;
}

/* Background Removal Panel */
.bg-removal-options {
    padding: 10px 0;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
}

.toggle-option input {
    display: none;
}

.toggle-slider {
    width: 48px;
    height: 26px;
    background: var(--bg-secondary);
    border-radius: 13px;
    position: relative;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-option input:checked + .toggle-slider {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.toggle-option input:checked + .toggle-slider::before {
    left: 24px;
}

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.option-desc {
    font-size: 0.85rem !important;
    color: var(--text-muted) !important;
    line-height: 1.5 !important;
}

.bg-removal-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    font-size: 0.9rem;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Image Preview Area */
.image-edit-preview {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: repeating-conic-gradient(#f0f0f0 0% 25%, white 0% 50%) 
                50% / 20px 20px;
}

.preview-container {
    max-width: 100%;
    max-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#editPreviewImage {
    max-width: 100%;
    max-height: 380px;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: clip-path 0.3s ease;
}

/* Shape clip-paths */
#editPreviewImage.shape-circle {
    clip-path: circle(50%);
}

#editPreviewImage.shape-square {
    clip-path: none;
}

#editPreviewImage.shape-rounded {
    border-radius: 15px;
}

#editPreviewImage.shape-oval {
    clip-path: ellipse(40% 50%);
}

#editPreviewImage.shape-oval-h {
    clip-path: ellipse(50% 40%);
}

#editPreviewImage.shape-hexagon {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

#editPreviewImage.shape-star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

#editPreviewImage.shape-heart {
    clip-path: path('M 50 85 C 20 55, 0 35, 25 15 C 45 0, 50 20, 50 25 C 50 20, 55 0, 75 15 C 100 35, 80 55, 50 85 Z');
}

/* Responsive */
@media (max-width: 768px) {
    .image-edit-body {
        flex-direction: column;
    }
    
    .image-edit-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .shapes-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .modal-lg {
        max-width: 95%;
    }
}

/* ==================== SIZES MODAL ==================== */
.sizes-compact {
    padding: 0 !important;
    border: none !important;
    margin-bottom: 15px !important;
}

.sizes-compact .btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--primary-color), #5b4fd8);
    color: white;
    border: 2px solid transparent;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}

.sizes-compact .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    background: linear-gradient(135deg, #5b4fd8, var(--primary-color));
    border-color: var(--primary-color);
    color: white;
}

.sizes-compact .btn i {
    font-size: 1.1rem;
}

.sizes-badge {
    background: white;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 12px;
    min-width: 32px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sizes-badge:empty,
.sizes-badge[data-count="0"] {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.modal-sizes {
    width: 500px;
    max-width: 95%;
}

.modal-sizes .modal-header {
    background: linear-gradient(135deg, var(--primary-color), #5b4fd8);
    color: white;
    padding: 24px;
}

.modal-sizes .modal-header h3 {
    color: white;
    font-size: 1.2rem;
}

.modal-sizes .modal-header h3 i {
    color: white;
    font-size: 1.3rem;
}

.modal-sizes .modal-close {
    color: white;
    opacity: 0.9;
    font-size: 1.5rem;
}

.modal-sizes .modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.modal-sizes .section-hint {
    background: rgba(79, 70, 229, 0.1);
    border-left: 3px solid var(--primary-color);
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.modal-sizes .modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-sizes .size-quantity-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.modal-sizes .size-quantity-row {
    padding: 14px 10px;
    min-height: 80px;
    background: linear-gradient(135deg, var(--bg-secondary), #f8f9fa);
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.modal-sizes .size-quantity-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.modal-sizes .size-quantity-row.has-quantity {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(79, 70, 229, 0.08));
    border-color: var(--primary-color);
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
}

.modal-sizes .size-label {
    font-size: 1rem;
    margin-bottom: 8px;
}

.modal-sizes .quantity-controls {
    gap: 6px;
}

.modal-sizes .quantity-controls .qty-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    background: linear-gradient(135deg, var(--primary-color), #5b4fd8);
    color: white;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.modal-sizes .quantity-controls .qty-btn:hover {
    background: linear-gradient(135deg, #5b4fd8, var(--primary-color));
    transform: scale(1.15);
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.4);
}

.modal-sizes .size-qty-input {
    width: 45px;
    height: 32px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color);
    background: white;
    border: 2px solid var(--border-color);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.modal-sizes .modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-top: 2px solid var(--border-color);
    background: linear-gradient(180deg, #f8f9fa, var(--bg-secondary));
}

.modal-sizes .total-items-summary {
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(79, 70, 229, 0.05));
    padding: 10px 16px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
}

.modal-sizes .total-items-summary #totalItemsCount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 800;
}

.modal-sizes .modal-footer .btn-primary {
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.modal-sizes .modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

@media (max-width: 580px) {
    .modal-sizes .size-quantity-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-sizes .modal-body {
        padding: 16px;
    }
    
    .modal-sizes .modal-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .modal-sizes .total-items-summary {
        width: 100%;
        justify-content: center;
    }
    
    .modal-sizes .modal-footer .btn-primary {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .modal-sizes {
        width: 95%;
    }
    
    .modal-sizes .size-quantity-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .modal-sizes .size-quantity-row {
        padding: 10px 6px;
        min-height: 70px;
    }
    
    .modal-sizes .size-label {
        font-size: 0.9rem;
    }
    
    .modal-sizes .quantity-controls .qty-btn {
        width: 28px;
        height: 28px;
    }
    
    .modal-sizes .size-qty-input {
        width: 40px;
        height: 28px;
    }
    
    .modal-sizes .modal-header {
        padding: 18px;
    }
    
    .modal-sizes .modal-header h3 {
        font-size: 1.1rem;
    }
}

/* ==================== PANEL DESCRIPCIÓN MÓVIL ==================== */
.mobile-description-panel {
    display: none;
    position: fixed;
    top: 95px; /* Debajo de botones flotantes */
    left: 10px;
    right: 10px;
    max-width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 200;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-description-panel.active {
    display: block;
}

.mobile-desc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

.mobile-desc-header h4 {
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.mobile-desc-header h4 i {
    color: var(--primary-color);
}

.close-desc-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.mobile-desc-content {
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.mobile-desc-content p {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.mobile-desc-content p:last-child {
    margin-bottom: 0;
}

.mobile-desc-content ul,
.mobile-desc-content ol {
    margin: 8px 0;
    padding-left: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mobile-desc-content li {
    margin-bottom: 4px;
}

.mobile-desc-content strong {
    color: var(--text-primary);
}

/* Colores móvil grid */
.mobile-color-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 10px 0;
}

.mobile-color-grid .color-option {
    width: 44px;
    height: 44px;
}

.selected-color-mobile {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.selected-color-mobile strong {
    color: var(--text-primary);
}

/* B2B mensaje móvil */
.mobile-b2b-message {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 2px solid #ff9800;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.mobile-b2b-message i {
    font-size: 1.5rem;
    color: #e65100;
    margin-bottom: 8px;
    display: block;
}

.mobile-b2b-message p {
    font-size: 0.85rem;
    color: #e65100;
    margin-bottom: 10px;
    line-height: 1.4;
}

.mobile-b2b-message a {
    display: inline-block;
    padding: 8px 16px;
    background: #ff9800;
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

/* ==================== SIZE GUIDE MODAL ==================== */
.size-guide-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.size-guide-modal.active {
    display: flex;
}

.size-guide-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: sizeGuideIn 0.3s ease;
}

@keyframes sizeGuideIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.size-guide-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.size-guide-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.size-guide-close:hover {
    transform: scale(1.1);
}

/* Enlace de guía de tallas en sidebar (discreto) */
.size-guide-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    padding: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.size-guide-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.size-guide-link i {
    margin-right: 5px;
    font-size: 0.75rem;
}

/* ==================== VISOR DE GALERÍA ==================== */
.gallery-viewer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.gallery-viewer-overlay.active {
    display: flex;
}

.gallery-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 80px 100px;
}

.gallery-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.gallery-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.gallery-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gallery-nav-btn.gallery-prev {
    left: 15px;
}

.gallery-nav-btn.gallery-next {
    right: 15px;
}

.gallery-viewer-content {
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-viewer-content img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.gallery-viewer-caption {
    color: white;
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.gallery-dots {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.gallery-dot.active {
    background: white;
    transform: scale(1.2);
}

.gallery-use-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.gallery-use-btn:hover {
    background: #5b4fd8;
    transform: translateX(-50%) scale(1.05);
}

/* Botón de galería en sidebar */
.btn-gallery {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-gallery:hover {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Responsive galería */
@media (max-width: 768px) {
    .gallery-viewer-container {
        padding: 50px 15px 120px;
    }
    
    .gallery-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .gallery-nav-btn.gallery-prev {
        left: 5px;
    }
    
    .gallery-nav-btn.gallery-next {
        right: 5px;
    }
    
    .gallery-close-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .gallery-viewer-content img {
        max-height: 60vh;
    }
    
    .gallery-dots {
        bottom: 130px;
    }
    
    .gallery-use-btn {
        bottom: 80px;
    }
    
    /* Ocultar botón de galería en sidebar móvil */
    .btn-gallery {
        display: none;
    }
}
