/* Estilos para o sistema de tamanhos de produtos */

/* Seção de tamanhos no formulário de produto */
#secao-tamanhos {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

#secao-tamanhos.show {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

.tamanhos-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.tamanhos-container .form-check {
    margin-bottom: 0;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tamanhos-container .form-check:hover {
    border-color: #007bff;
    background-color: #f8f9ff;
}

.tamanhos-container .form-check input:checked + .form-check-label {
    color: #007bff;
    font-weight: bold;
}

.tamanhos-container .form-check input:checked {
    background-color: #007bff;
    border-color: #007bff;
}

.tamanhos-container .form-check input:checked ~ * {
    border-color: #007bff;
}

.tamanhos-container .form-check-label {
    font-weight: 500;
    font-size: 14px;
    margin-left: 8px;
    cursor: pointer;
}

/* Estilos para tamanhos na loja */
.produto-tamanhos {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.produto-tamanhos h6 {
    margin-bottom: 12px;
    color: #495057;
    font-weight: 600;
    font-size: 14px;
}

.tamanho-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    padding: 6px 10px;
    margin: 3px;
    display: inline-block;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    font-size: 13px;
    min-width: 35px;
    text-align: center;
    line-height: 1.2;
}

.tamanho-item:hover {
    border-color: #007bff;
    background-color: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.tamanho-item.selected {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
    transform: translateY(-1px);
}

.tamanho-item.disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Seção de múltiplos tamanhos para quantidade > 1 */
.multiplos-tamanhos {
    border-top: 1px solid #e9ecef;
    margin-top: 15px;
    padding-top: 15px;
}

.item-tamanho {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.item-tamanho .numero-item {
    background: #007bff;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    flex-shrink: 0;
}

.item-tamanho .tamanhos-disponiveis {
    display: flex;
    gap: 6px;
    flex: 1;
    flex-wrap: wrap;
}

/* Select customizado para tamanhos */
.select-tamanho {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 12px;
    background: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-tamanho:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Validação de tamanhos */
.tamanho-erro {
    color: #dc3545;
    font-size: 12px;
    margin-top: 8px;
    display: none;
    padding: 6px 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.has-error .tamanho-erro {
    display: block;
    animation: shake 0.5s ease-in-out;
}

.has-error .produto-tamanhos {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Histórico de compras - exibição de tamanhos */
.historico-tamanhos {
    background: #e9ecef;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    color: #495057;
    display: inline-block;
    margin-left: 8px;
}

.historico-tamanhos .tamanho {
    background: white;
    border-radius: 3px;
    padding: 2px 6px;
    margin: 0 2px;
    font-weight: 500;
}

/* Responsividade */
@media (max-width: 768px) {
    .tamanhos-container {
        justify-content: center;
    }

    .item-tamanho {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .item-tamanho .tamanhos-disponiveis {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }

    .multiplos-tamanhos .item-tamanho {
        padding: 15px 10px;
    }
}