/**
 * DTF Product Manager Pro - Compact Frontend Styles
 * Version: 4.3.1 (FIXED)
 * REPLICATES EXACTLY THE APPROVED MOCKUP
 * 
 * CHANGELOG:
 * - Eliminados estilos duplicados del modal (ya están en dtf-help-modal.css)
 * - Mantenidos solo los overrides específicos para compact layout
 */

/* Container */
.dtf-product-container.dtf-compact-layout {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
}

.dtf-compact-form {
    max-width: 600px;
    margin: 0 auto;
}

/* HEADER CON BOTÓN DE AYUDA */
.dtf-compact-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.dtf-compact-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

/* Override para botón de ayuda más pequeño en compacto */
.dtf-compact-layout .dtf-help-btn {
    padding: 6px 12px;
    font-size: 11px;
    gap: 5px;
}

.dtf-compact-layout .dtf-help-btn span:first-child {
    font-size: 14px;
}

/* El resto de estilos del botón vienen de dtf-help-modal.css */

/* UPLOAD ZONE - Estructura del clásico adaptada al compacto */
.dtf-compact-layout .dtf-upload-zone {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    padding: 20px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    position: relative;
    min-height: 140px;
}

.dtf-compact-layout .dtf-upload-zone:hover {
    border-color: var(--dtf-primary, #009d45);
    background: #f0f9f4;
}

.dtf-compact-layout .dtf-upload-zone.dragover {
    background: #e8f5ed;
    border-color: var(--dtf-primary, #009d45);
    border-style: solid;
}

.dtf-compact-layout .dtf-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.dtf-compact-layout .dtf-dropzone-content h3 {
    margin: 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.dtf-compact-layout .dtf-formats {
    color: #757575;
    font-size: 11px;
    margin: 0;
}

.dtf-compact-layout .dtf-btn {
    background: var(--dtf-primary, #009d45);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.dtf-compact-layout .dtf-btn:hover {
    background: var(--dtf-btn-hover, #007d36);
}

/* UPLOAD LOADER */
.dtf-compact-layout .dtf-upload-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
}

.dtf-compact-layout .dtf-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--dtf-primary, #009d45);
    border-radius: 50%;
    animation: dtf-spin 0.8s linear infinite;
}

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

.dtf-compact-layout .dtf-progress-bar {
    width: 200px;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
}

.dtf-compact-layout .dtf-progress-fill {
    height: 100%;
    background: var(--dtf-primary, #009d45);
    width: 0%;
    transition: width 0.3s;
}

/* FILES LIST */
.dtf-compact-layout .dtf-files-compact {
    margin-bottom: 8px;
}

.dtf-compact-layout .dtf-file-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 4px;
}

.dtf-compact-layout .dtf-file-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.dtf-compact-layout .dtf-file-icon {
    width: 24px;
    height: 24px;
    background: #e8f5ed;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.dtf-compact-layout .dtf-file-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dtf-compact-layout .dtf-file-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.dtf-compact-layout .dtf-qty-controls {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
}

.dtf-compact-layout .dtf-qty-btn {
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dtf-compact-layout .dtf-qty-btn:hover {
    background: var(--dtf-primary, #009d45);
    color: white;
    border-color: var(--dtf-primary, #009d45);
}

.dtf-compact-layout .dtf-qty-input {
    width: 60px;
    height: 22px;
    min-width: 60px;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    padding: 0 4px;
    -moz-appearance: textfield; /* Firefox */
}

/* Eliminar spinners de input number */
.dtf-compact-layout .dtf-qty-input::-webkit-outer-spin-button,
.dtf-compact-layout .dtf-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dtf-compact-layout .dtf-file-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--dtf-primary, #009d45);
    min-width: 50px;
    text-align: right;
}

.dtf-compact-layout .dtf-file-remove {
    width: 22px;
    height: 22px;
    border: none;
    background: #009d45 !important;
    color: white !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.85;
}

.dtf-compact-layout .dtf-file-remove:hover {
    background: #007d36 !important;
    color: white !important;
    opacity: 1;
    transform: scale(1.15);
}

.dtf-compact-layout .dtf-add-more {
    text-align: center;
    padding: 4px;
}

.dtf-compact-layout .dtf-add-more-btn {
    background: none;
    border: 1px dashed var(--dtf-primary, #009d45);
    color: var(--dtf-primary, #009d45);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.dtf-compact-layout .dtf-add-more-btn:hover {
    background: #f0f9f4;
}

/* PRICE TABLE ACCORDION */
.dtf-compact-layout .dtf-price-accordion {
    margin-bottom: 8px;
}

.dtf-compact-layout .dtf-price-toggle {
    width: 100%;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    transition: all 0.2s;
}

.dtf-compact-layout .dtf-price-toggle:hover {
    background: #fafafa;
    border-color: var(--dtf-primary, #009d45);
}

.dtf-compact-layout .dtf-price-toggle.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background: #fafafa;
}

.dtf-compact-layout .arrow-icon {
    font-size: 10px;
    transition: transform 0.2s;
}

.dtf-compact-layout .arrow-icon.rotated {
    transform: rotate(180deg);
}

.dtf-compact-layout .dtf-price-content {
    display: none;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 8px;
    background: white;
}

.dtf-compact-layout .dtf-price-content.active {
    display: block;
}

.dtf-compact-layout .dtf-price-table {
    width: 100%;
    font-size: 11px;
}

.dtf-compact-layout .dtf-price-table th {
    text-align: left;
    padding: 4px;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.dtf-compact-layout .dtf-price-table td {
    padding: 4px;
    border-bottom: 1px solid #f0f0f0;
}

.dtf-compact-layout .dtf-price-table tr.active {
    background: #f0f9f4;
    font-weight: 600;
}

.dtf-compact-layout .dtf-minimum-badge {
    font-size: 10px;
    color: #666;
    font-weight: normal;
}

/* DELIVERY OPTIONS */
.dtf-compact-layout .dtf-delivery-compact {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.dtf-compact-layout .dtf-delivery-option {
    flex: 1;
    position: relative;
}

.dtf-compact-layout .dtf-delivery-option input {
    position: absolute;
    opacity: 0;
}

.dtf-compact-layout .dtf-delivery-option label {
    display: block;
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.dtf-compact-layout .dtf-delivery-option input:checked + label {
    border-color: var(--dtf-primary, #009d45);
    background: #f0f9f4;
}

.dtf-compact-layout .dtf-delivery-title {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 2px;
}

.dtf-compact-layout .dtf-delivery-time {
    font-size: 10px;
    color: #666;
}

/* SUMMARY ACCORDION */
.dtf-compact-layout .dtf-summary-accordion {
    margin-bottom: 8px;
}

.dtf-compact-layout .dtf-summary-toggle {
    width: 100%;
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ed 100%);
    border: 2px solid var(--dtf-primary, #009d45);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.dtf-compact-layout .dtf-summary-toggle:hover {
    box-shadow: 0 2px 8px rgba(0,157,69,0.2);
}

.dtf-compact-layout .dtf-summary-toggle.active {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.dtf-compact-layout .dtf-summary-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dtf-compact-layout .dtf-summary-left {
    flex: 1;
    min-width: 0;
}

.dtf-compact-layout .dtf-summary-label {
    font-size: 11px;
    color: #666;
    display: block;
    margin-bottom: 2px;
}

.dtf-compact-layout .dtf-summary-total {
    font-size: 26px;
    font-weight: 700;
    color: var(--dtf-primary, #009d45);
    line-height: 1;
}

.dtf-compact-layout .dtf-summary-subtitle {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
}

.dtf-compact-layout .dtf-summary-expand {
    background: var(--dtf-primary, #009d45);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dtf-compact-layout .dtf-summary-expand:hover {
    background: var(--dtf-btn-hover, #007d36);
}

/* BREAKDOWN CONTENT */
.dtf-compact-layout .dtf-breakdown-content {
    display: none;
    border: 2px solid var(--dtf-primary, #009d45);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 12px;
    background: white;
}

.dtf-compact-layout .dtf-breakdown-content.active {
    display: block;
}

.dtf-compact-layout .dtf-breakdown-section {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.dtf-compact-layout .dtf-breakdown-section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.dtf-compact-layout .dtf-breakdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dtf-compact-layout .dtf-breakdown-icon {
    width: 20px;
    height: 20px;
    background: #e8f5ed;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 12px;
}

.dtf-compact-layout .dtf-breakdown-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.dtf-compact-layout .dtf-breakdown-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 11px;
    color: #666;
}

.dtf-compact-layout .dtf-breakdown-line span:last-child {
    font-weight: 600;
    color: #333;
}

.dtf-compact-layout .dtf-breakdown-total {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    margin-top: 8px;
    border-top: 2px solid #e0e0e0;
    font-size: 12px;
    font-weight: 700;
}

.dtf-compact-layout .dtf-breakdown-total-amount {
    color: var(--dtf-primary, #009d45);
    font-size: 14px;
}

/* CART BUTTON */
.dtf-compact-layout .dtf-cart-btn {
    width: 100%;
    background: var(--dtf-button-cart, var(--dtf-primary, #009d45));
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0,157,69,0.2);
}

.dtf-compact-layout .dtf-cart-btn:hover:not(:disabled) {
    background: var(--dtf-btn-hover, #007d36);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,157,69,0.3);
}

.dtf-compact-layout .dtf-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

/* TRUST BADGES */
.dtf-compact-layout .dtf-trust-badges {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.dtf-compact-layout .dtf-trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 10px;
    color: #666;
}

.dtf-compact-layout .dtf-trust-badge .dtf-icon {
    color: var(--dtf-primary, #009d45);
    font-size: 14px;
}

/* MESSAGES */
.dtf-compact-layout .dtf-messages {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.dtf-compact-layout .dtf-messages.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.dtf-compact-layout .dtf-messages.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .dtf-compact-form {
        padding: 0 12px;
    }
    
    .dtf-compact-layout .dtf-summary-total {
        font-size: 22px;
    }
    
    .dtf-compact-layout .dtf-trust-badges {
        grid-template-columns: 1fr;
    }
}

/* MULTI-UPLOAD OVERLAY */
.dtf-multi-upload-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.dtf-multi-upload-overlay[style*="block"] {
    display: flex !important;
}

.dtf-multi-upload-modal {
    background: white;
    border-radius: 16px;
    padding: 40px 50px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: dtf-modal-appear 0.3s ease;
}

@keyframes dtf-modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dtf-multi-upload-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--dtf-primary, #009d45);
    border-radius: 50%;
    animation: dtf-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.dtf-multi-upload-text {
    margin-bottom: 20px;
}

.dtf-multi-upload-text strong {
    display: block;
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.dtf-multi-upload-count {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: var(--dtf-primary, #009d45);
}

.dtf-multi-upload-count .current {
    font-size: 28px;
}

.dtf-multi-upload-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.dtf-multi-upload-bar-fill {
    height: 100%;
    background: var(--dtf-primary, #009d45);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.dtf-multi-upload-wait {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* ============================================
   NOTA: Los estilos del modal de ayuda están
   en dtf-help-modal.css - NO DUPLICAR AQUÍ
   ============================================ */
