/**
 * Solicitar Cotización Mercadito - Accesorios CSS v4.0.0
 * Diseño minimalista tipo card expandible
 */

/* ========================================
   SECCIÓN PRINCIPAL DE ACCESORIOS
======================================== */

.scm-accessories-section {
    margin: 24px 0;
    padding: 0;
}

.scm-accessories-header {
    margin-bottom: 20px;
}

.scm-accessories-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--scm-text, #1e293b);
    margin: 0 0 8px;
    display: inline;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.scm-optional-badge {
    font-size: 16px;
    font-weight: 500;
    color: var(--scm-text, #1e293b);
    text-decoration: underline;
    text-underline-offset: 4px;
    margin-left: 0;
}

.scm-accessories-description {
    font-size: 14px;
    color: var(--scm-text-muted, #64748b);
    line-height: 1.6;
    margin: 12px 0 0;
}

.scm-accessories-description strong {
    color: var(--scm-text, #1e293b);
}

/* ========================================
   LISTA DE ACCESORIOS
======================================== */

.scm-accessories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ========================================
   CARD DE ACCESORIO
======================================== */

.scm-accessory-card {
    border: 1px solid var(--scm-border, #e2e8f0);
    border-radius: 8px;
    background: var(--scm-bg, #fff);
    overflow: hidden;
    transition: all 0.3s ease;
}

.scm-accessory-card:hover {
    border-color: var(--scm-primary, #2563eb);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.scm-accessory-card.scm-selected {
    border-color: var(--scm-primary, #2563eb);
    box-shadow: 0 0 0 1px var(--scm-primary, #2563eb);
}

/* ========================================
   VISTA COLAPSADA (por defecto)
======================================== */

.scm-accessory-collapsed {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    cursor: pointer;
}

.scm-accessory-card.scm-selected .scm-accessory-collapsed {
    display: none;
}

.scm-accessory-thumb {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--scm-bg-secondary, #f8fafc);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--scm-border, #e2e8f0);
}

.scm-accessory-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scm-no-image {
    color: var(--scm-text-muted, #64748b);
}

.scm-accessory-info {
    flex: 1;
    min-width: 0;
}

.scm-accessory-info .scm-accessory-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--scm-text, #1e293b);
    margin: 0 0 6px;
    line-height: 1.3;
}

.scm-accessory-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scm-accessory-select-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--scm-primary, #2563eb);
    cursor: pointer;
    text-align: left;
    transition: color 0.2s ease;
}

.scm-accessory-select-btn:hover {
    color: var(--scm-primary-hover, #1d4ed8);
    text-decoration: underline;
}

.scm-accessory-select-btn.scm-selected {
    color: var(--scm-primary, #2563eb);
}

.scm-accessory-link {
    font-size: 13px;
    color: var(--scm-text-muted, #64748b);
    text-decoration: none;
    transition: color 0.2s ease;
}

.scm-accessory-link:hover {
    color: var(--scm-text, #1e293b);
    text-decoration: underline;
}

/* ========================================
   VISTA EXPANDIDA (cuando está seleccionado)
======================================== */

.scm-accessory-expanded {
    display: none;
    padding: 20px;
}

.scm-accessory-card.scm-selected .scm-accessory-expanded {
    display: block;
}

/* Header con cantidad */
.scm-accessory-qty-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-bottom: 20px;
}

.scm-accessory-qty-header .scm-qty-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--scm-text, #1e293b);
}

.scm-accessory-expanded .scm-qty-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--scm-border, #e2e8f0);
    border-radius: 6px;
    overflow: hidden;
    background: var(--scm-bg, #fff);
}

.scm-accessory-expanded .scm-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--scm-bg-secondary, #f8fafc);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--scm-text, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scm-accessory-expanded .scm-qty-btn:hover {
    background: var(--scm-primary, #2563eb);
    color: #fff;
}

.scm-accessory-qty-input {
    width: 50px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--scm-border, #e2e8f0);
    border-right: 1px solid var(--scm-border, #e2e8f0);
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--scm-text, #1e293b);
    background: var(--scm-bg, #fff);
    -moz-appearance: textfield;
}

.scm-accessory-qty-input::-webkit-outer-spin-button,
.scm-accessory-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.scm-accessory-qty-input:focus {
    outline: none;
}

/* Imagen grande */
.scm-accessory-full-image {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.scm-accessory-full-image img {
    max-width: 180px;
    max-height: 180px;
    object-fit: contain;
    border-radius: 8px;
}

/* Detalles del accesorio */
.scm-accessory-details {
    text-align: left;
}

.scm-accessory-details .scm-accessory-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--scm-text, #1e293b);
    margin: 0 0 8px;
}

.scm-accessory-details .scm-accessory-select-btn {
    display: block;
    margin-bottom: 4px;
}

.scm-accessory-details .scm-accessory-link {
    display: block;
    margin-bottom: 6px;
}

.scm-accessory-sku {
    font-size: 13px;
    color: var(--scm-text-muted, #64748b);
    margin: 8px 0 0;
}

/* ========================================
   FOOTER CON BOTÓN LIMPIAR
======================================== */

.scm-accessories-footer {
    margin-top: 16px;
    padding-top: 0;
}

.scm-clear-accessories-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--scm-bg-secondary, #f1f5f9);
    border: 1px solid var(--scm-border, #e2e8f0);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--scm-text-muted, #64748b);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.scm-clear-accessories-btn:hover {
    background: var(--scm-danger, #ef4444);
    border-color: var(--scm-danger, #ef4444);
    color: #fff;
}

.scm-clear-accessories-btn svg {
    width: 12px;
    height: 12px;
}

/* ========================================
   ANIMACIONES
======================================== */

@keyframes scm-accessory-expand {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scm-accessory-card.scm-selected .scm-accessory-expanded {
    animation: scm-accessory-expand 0.3s ease;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 600px) {
    .scm-accessory-collapsed {
        padding: 12px;
        gap: 12px;
    }
    
    .scm-accessory-thumb {
        width: 48px;
        height: 48px;
    }
    
    .scm-accessory-info .scm-accessory-name {
        font-size: 14px;
    }
    
    .scm-accessory-select-btn {
        font-size: 13px;
    }
    
    .scm-accessory-link {
        font-size: 12px;
    }
    
    .scm-accessory-expanded {
        padding: 16px;
    }
    
    .scm-accessory-qty-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .scm-accessory-full-image img {
        max-width: 140px;
        max-height: 140px;
    }
}

/* ========================================
   INDICADOR EN BOTÓN PRINCIPAL
======================================== */

/* Cuando hay accesorios seleccionados, mostrar indicador verde */
.scm-has-selected-accessories .scm-add-to-quote-btn {
    position: relative;
}

.scm-has-selected-accessories .scm-add-to-quote-btn::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: var(--scm-accent, #10b981);
    border-radius: 50%;
    border: 2px solid var(--scm-bg, #fff);
    animation: scm-pulse-dot 1.5s infinite;
}

@keyframes scm-pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
}
